
import unittest
import functools
from manticore.core.cpu.x86 import *
from manticore.core.smtlib import Operators
from manticore.core.memory import *


def skipIfNotImplemented(f):
    # XXX(yan) the inner function name must start with test_
    @functools.wraps(f)
    def test_inner(*args, **kwargs):
        try:
            return f(*args, **kwargs)
        except NotImplementedError, e:
            raise unittest.SkipTest(e.message)

    return test_inner

def forAllTests(decorator):
    def decorate(cls):
        for attr in cls.__dict__:
            if not attr.startswith('test_'):
                continue
            method = getattr(cls, attr)
            if callable(method):
                setattr(cls, attr, decorator(method))
        return cls

    return decorate

@forAllTests(skipIfNotImplemented)
class CPUTest(unittest.TestCase):
    _multiprocess_can_split_ = True

    class ROOperand(object):
        ''' Mocking class for operand ronly '''
        def __init__(self, size, value):
            self.size = size
            self.value = value
        def read(self):
            return self.value & ((1<<self.size)-1)

    class RWOperand(ROOperand):
        ''' Mocking class for operand rw '''
        def write(self, value):
            self.value = value & ((1<<self.size)-1)
            return self.value


    def test_PCMPESTRI_1(self):
        ''' Instruction PCMPESTRI_1
            Groups: sse42
            0x400bec:	pcmpestri	xmm1, xmm2, 0x64
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400bec] = 'f'
        mem[0x00400bed] = '\x0f'
        mem[0x00400bee] = ':'
        mem[0x00400bef] = 'a'
        mem[0x00400bf0] = '\xca'
        mem[0x00400bf1] = 'd'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400bec
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400bec], 'f')
        self.assertEqual(mem[0x400bed], '\x0f')
        self.assertEqual(mem[0x400bee], ':')
        self.assertEqual(mem[0x400bef], 'a')
        self.assertEqual(mem[0x400bf0], '\xca')
        self.assertEqual(mem[0x400bf1], 'd')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197362L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 16L)

    def test_PCMPESTRI_10(self):
        ''' Instruction PCMPESTRI_10
            Groups: sse42
            0x400b20:	pcmpestri	xmm1, xmm2, 0x20
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b20] = 'f'
        mem[0x00400b21] = '\x0f'
        mem[0x00400b22] = ':'
        mem[0x00400b23] = 'a'
        mem[0x00400b24] = '\xca'
        mem[0x00400b25] = ' '
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b20
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b20], 'f')
        self.assertEqual(mem[0x400b21], '\x0f')
        self.assertEqual(mem[0x400b22], ':')
        self.assertEqual(mem[0x400b23], 'a')
        self.assertEqual(mem[0x400b24], '\xca')
        self.assertEqual(mem[0x400b25], ' ')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197158L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 16L)

    def test_PCMPESTRI_11(self):
        ''' Instruction PCMPESTRI_11
            Groups: sse42
            0x400b38:	pcmpestri	xmm1, xmm2, 0x28
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b38] = 'f'
        mem[0x00400b39] = '\x0f'
        mem[0x00400b3a] = ':'
        mem[0x00400b3b] = 'a'
        mem[0x00400b3c] = '\xca'
        mem[0x00400b3d] = '('
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400b38
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400b38], 'f')
        self.assertEqual(mem[0x400b39], '\x0f')
        self.assertEqual(mem[0x400b3a], ':')
        self.assertEqual(mem[0x400b3b], 'a')
        self.assertEqual(mem[0x400b3c], '\xca')
        self.assertEqual(mem[0x400b3d], '(')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197182L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 7L)

    def test_PCMPESTRI_12(self):
        ''' Instruction PCMPESTRI_12
            Groups: sse42
            0x400bfe:	pcmpestri	xmm1, xmm2, 0x69
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400c00] = ':'
        mem[0x00400c01] = 'a'
        mem[0x00400c02] = '\xca'
        mem[0x00400c03] = 'i'
        mem[0x00400bfe] = 'f'
        mem[0x00400bff] = '\x0f'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400bfe
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0xf
        cpu.execute()
    
        self.assertEqual(mem[0x400c00], ':')
        self.assertEqual(mem[0x400c01], 'a')
        self.assertEqual(mem[0x400c02], '\xca')
        self.assertEqual(mem[0x400c03], 'i')
        self.assertEqual(mem[0x400bfe], 'f')
        self.assertEqual(mem[0x400bff], '\x0f')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197380L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 7L)

    def test_PCMPESTRI_13(self):
        ''' Instruction PCMPESTRI_13
            Groups: sse42
            0x400b86:	pcmpestri	xmm1, xmm2, 0x41
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b86] = 'f'
        mem[0x00400b87] = '\x0f'
        mem[0x00400b88] = ':'
        mem[0x00400b89] = 'a'
        mem[0x00400b8a] = '\xca'
        mem[0x00400b8b] = 'A'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400b86
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x10
        cpu.execute()
    
        self.assertEqual(mem[0x400b86], 'f')
        self.assertEqual(mem[0x400b87], '\x0f')
        self.assertEqual(mem[0x400b88], ':')
        self.assertEqual(mem[0x400b89], 'a')
        self.assertEqual(mem[0x400b8a], '\xca')
        self.assertEqual(mem[0x400b8b], 'A')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197260L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 8L)

    def test_PCMPESTRI_14(self):
        ''' Instruction PCMPESTRI_14
            Groups: sse42
            0x400ae4:	pcmpestri	xmm1, xmm2, 0xc
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400ae4] = 'f'
        mem[0x00400ae5] = '\x0f'
        mem[0x00400ae6] = ':'
        mem[0x00400ae7] = 'a'
        mem[0x00400ae8] = '\xca'
        mem[0x00400ae9] = '\x0c'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400ae4
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x7
        cpu.execute()
    
        self.assertEqual(mem[0x400ae4], 'f')
        self.assertEqual(mem[0x400ae5], '\x0f')
        self.assertEqual(mem[0x400ae6], ':')
        self.assertEqual(mem[0x400ae7], 'a')
        self.assertEqual(mem[0x400ae8], '\xca')
        self.assertEqual(mem[0x400ae9], '\x0c')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197098L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 16L)

    def test_PCMPESTRI_15(self):
        ''' Instruction PCMPESTRI_15
            Groups: sse42
            0x400c04:	pcmpestri	xmm1, xmm2, 0x6c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400c04] = 'f'
        mem[0x00400c05] = '\x0f'
        mem[0x00400c06] = ':'
        mem[0x00400c07] = 'a'
        mem[0x00400c08] = '\xca'
        mem[0x00400c09] = 'l'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400c04
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x7
        cpu.execute()
    
        self.assertEqual(mem[0x400c04], 'f')
        self.assertEqual(mem[0x400c05], '\x0f')
        self.assertEqual(mem[0x400c06], ':')
        self.assertEqual(mem[0x400c07], 'a')
        self.assertEqual(mem[0x400c08], '\xca')
        self.assertEqual(mem[0x400c09], 'l')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197386L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 16L)

    def test_PCMPESTRI_16(self):
        ''' Instruction PCMPESTRI_16
            Groups: sse42
            0x400b6e:	pcmpestri	xmm1, xmm2, 0x39
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b6e] = 'f'
        mem[0x00400b6f] = '\x0f'
        mem[0x00400b70] = ':'
        mem[0x00400b71] = 'a'
        mem[0x00400b72] = '\xca'
        mem[0x00400b73] = '9'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b6e
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b6e], 'f')
        self.assertEqual(mem[0x400b6f], '\x0f')
        self.assertEqual(mem[0x400b70], ':')
        self.assertEqual(mem[0x400b71], 'a')
        self.assertEqual(mem[0x400b72], '\xca')
        self.assertEqual(mem[0x400b73], '9')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197236L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_17(self):
        ''' Instruction PCMPESTRI_17
            Groups: sse42
            0x400b2c:	pcmpestri	xmm1, xmm2, 0x24
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b2c] = 'f'
        mem[0x00400b2d] = '\x0f'
        mem[0x00400b2e] = ':'
        mem[0x00400b2f] = 'a'
        mem[0x00400b30] = '\xca'
        mem[0x00400b31] = '$'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400b2c
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400b2c], 'f')
        self.assertEqual(mem[0x400b2d], '\x0f')
        self.assertEqual(mem[0x400b2e], ':')
        self.assertEqual(mem[0x400b2f], 'a')
        self.assertEqual(mem[0x400b30], '\xca')
        self.assertEqual(mem[0x400b31], '$')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197170L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 16L)

    def test_PCMPESTRI_18(self):
        ''' Instruction PCMPESTRI_18
            Groups: sse42
            0x400af0:	pcmpestri	xmm1, xmm2, 0x10
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400af0] = 'f'
        mem[0x00400af1] = '\x0f'
        mem[0x00400af2] = ':'
        mem[0x00400af3] = 'a'
        mem[0x00400af4] = '\xca'
        mem[0x00400af5] = '\x10'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400af0
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400af0], 'f')
        self.assertEqual(mem[0x400af1], '\x0f')
        self.assertEqual(mem[0x400af2], ':')
        self.assertEqual(mem[0x400af3], 'a')
        self.assertEqual(mem[0x400af4], '\xca')
        self.assertEqual(mem[0x400af5], '\x10')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197110L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_19(self):
        ''' Instruction PCMPESTRI_19
            Groups: sse42
            0x400be0:	pcmpestri	xmm1, xmm2, 0x60
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400be0] = 'f'
        mem[0x00400be1] = '\x0f'
        mem[0x00400be2] = ':'
        mem[0x00400be3] = 'a'
        mem[0x00400be4] = '\xca'
        mem[0x00400be5] = '`'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400be0
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x7
        cpu.execute()
    
        self.assertEqual(mem[0x400be0], 'f')
        self.assertEqual(mem[0x400be1], '\x0f')
        self.assertEqual(mem[0x400be2], ':')
        self.assertEqual(mem[0x400be3], 'a')
        self.assertEqual(mem[0x400be4], '\xca')
        self.assertEqual(mem[0x400be5], '`')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197350L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 16L)

    def test_PCMPESTRI_2(self):
        ''' Instruction PCMPESTRI_2
            Groups: sse42
            0x400b4a:	pcmpestri	xmm1, xmm2, 0x2d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b4a] = 'f'
        mem[0x00400b4b] = '\x0f'
        mem[0x00400b4c] = ':'
        mem[0x00400b4d] = 'a'
        mem[0x00400b4e] = '\xca'
        mem[0x00400b4f] = '-'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400b4a
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x10
        cpu.execute()
    
        self.assertEqual(mem[0x400b4a], 'f')
        self.assertEqual(mem[0x400b4b], '\x0f')
        self.assertEqual(mem[0x400b4c], ':')
        self.assertEqual(mem[0x400b4d], 'a')
        self.assertEqual(mem[0x400b4e], '\xca')
        self.assertEqual(mem[0x400b4f], '-')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197200L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 8L)

    def test_PCMPESTRI_20(self):
        ''' Instruction PCMPESTRI_20
            Groups: sse42
            0x400c0a:	pcmpestri	xmm1, xmm2, 0x6d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400c0a] = 'f'
        mem[0x00400c0b] = '\x0f'
        mem[0x00400c0c] = ':'
        mem[0x00400c0d] = 'a'
        mem[0x00400c0e] = '\xca'
        mem[0x00400c0f] = 'm'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400c0a
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x10
        cpu.execute()
    
        self.assertEqual(mem[0x400c0a], 'f')
        self.assertEqual(mem[0x400c0b], '\x0f')
        self.assertEqual(mem[0x400c0c], ':')
        self.assertEqual(mem[0x400c0d], 'a')
        self.assertEqual(mem[0x400c0e], '\xca')
        self.assertEqual(mem[0x400c0f], 'm')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197392L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 8L)

    def test_PCMPESTRI_21(self):
        ''' Instruction PCMPESTRI_21
            Groups: sse42
            0x400b14:	pcmpestri	xmm1, xmm2, 0x1c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b14] = 'f'
        mem[0x00400b15] = '\x0f'
        mem[0x00400b16] = ':'
        mem[0x00400b17] = 'a'
        mem[0x00400b18] = '\xca'
        mem[0x00400b19] = '\x1c'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b14
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b14], 'f')
        self.assertEqual(mem[0x400b15], '\x0f')
        self.assertEqual(mem[0x400b16], ':')
        self.assertEqual(mem[0x400b17], 'a')
        self.assertEqual(mem[0x400b18], '\xca')
        self.assertEqual(mem[0x400b19], '\x1c')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197146L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_22(self):
        ''' Instruction PCMPESTRI_22
            Groups: sse42
            0x400bb6:	pcmpestri	xmm1, xmm2, 0x51
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400bb6] = 'f'
        mem[0x00400bb7] = '\x0f'
        mem[0x00400bb8] = ':'
        mem[0x00400bb9] = 'a'
        mem[0x00400bba] = '\xca'
        mem[0x00400bbb] = 'Q'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400bb6
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0xf
        cpu.execute()
    
        self.assertEqual(mem[0x400bb6], 'f')
        self.assertEqual(mem[0x400bb7], '\x0f')
        self.assertEqual(mem[0x400bb8], ':')
        self.assertEqual(mem[0x400bb9], 'a')
        self.assertEqual(mem[0x400bba], '\xca')
        self.assertEqual(mem[0x400bbb], 'Q')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197308L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 7L)

    def test_PCMPESTRI_23(self):
        ''' Instruction PCMPESTRI_23
            Groups: sse42
            0x400b08:	pcmpestri	xmm1, xmm2, 0x18
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b08] = 'f'
        mem[0x00400b09] = '\x0f'
        mem[0x00400b0a] = ':'
        mem[0x00400b0b] = 'a'
        mem[0x00400b0c] = '\xca'
        mem[0x00400b0d] = '\x18'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b08
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b08], 'f')
        self.assertEqual(mem[0x400b09], '\x0f')
        self.assertEqual(mem[0x400b0a], ':')
        self.assertEqual(mem[0x400b0b], 'a')
        self.assertEqual(mem[0x400b0c], '\xca')
        self.assertEqual(mem[0x400b0d], '\x18')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197134L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_24(self):
        ''' Instruction PCMPESTRI_24
            Groups: sse42
            0x400c1c:	pcmpestri	xmm1, xmm2, 0x74
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400c20] = '\xca'
        mem[0x00400c21] = 't'
        mem[0x00400c1c] = 'f'
        mem[0x00400c1d] = '\x0f'
        mem[0x00400c1e] = ':'
        mem[0x00400c1f] = 'a'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400c1c
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x6
        cpu.execute()
    
        self.assertEqual(mem[0x400c20], '\xca')
        self.assertEqual(mem[0x400c21], 't')
        self.assertEqual(mem[0x400c1c], 'f')
        self.assertEqual(mem[0x400c1d], '\x0f')
        self.assertEqual(mem[0x400c1e], ':')
        self.assertEqual(mem[0x400c1f], 'a')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197410L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 6L)

    def test_PCMPESTRI_25(self):
        ''' Instruction PCMPESTRI_25
            Groups: sse42
            0x400bda:	pcmpestri	xmm1, xmm2, 0x5d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400bda] = 'f'
        mem[0x00400bdb] = '\x0f'
        mem[0x00400bdc] = ':'
        mem[0x00400bdd] = 'a'
        mem[0x00400bde] = '\xca'
        mem[0x00400bdf] = ']'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400bda
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0xf
        cpu.execute()
    
        self.assertEqual(mem[0x400bda], 'f')
        self.assertEqual(mem[0x400bdb], '\x0f')
        self.assertEqual(mem[0x400bdc], ':')
        self.assertEqual(mem[0x400bdd], 'a')
        self.assertEqual(mem[0x400bde], '\xca')
        self.assertEqual(mem[0x400bdf], ']')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197344L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 7L)

    def test_PCMPESTRI_26(self):
        ''' Instruction PCMPESTRI_26
            Groups: sse42
            0x400c10:	pcmpestri	xmm1, xmm2, 0x70
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400c10] = 'f'
        mem[0x00400c11] = '\x0f'
        mem[0x00400c12] = ':'
        mem[0x00400c13] = 'a'
        mem[0x00400c14] = '\xca'
        mem[0x00400c15] = 'p'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400c10
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400c10], 'f')
        self.assertEqual(mem[0x400c11], '\x0f')
        self.assertEqual(mem[0x400c12], ':')
        self.assertEqual(mem[0x400c13], 'a')
        self.assertEqual(mem[0x400c14], '\xca')
        self.assertEqual(mem[0x400c15], 'p')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197398L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 6L)

    def test_PCMPESTRI_27(self):
        ''' Instruction PCMPESTRI_27
            Groups: sse42
            0x400c34:	pcmpestri	xmm1, xmm2, 0x7c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400c34] = 'f'
        mem[0x00400c35] = '\x0f'
        mem[0x00400c36] = ':'
        mem[0x00400c37] = 'a'
        mem[0x00400c38] = '\xca'
        mem[0x00400c39] = '|'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400c34
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x7
        cpu.execute()
    
        self.assertEqual(mem[0x400c34], 'f')
        self.assertEqual(mem[0x400c35], '\x0f')
        self.assertEqual(mem[0x400c36], ':')
        self.assertEqual(mem[0x400c37], 'a')
        self.assertEqual(mem[0x400c38], '\xca')
        self.assertEqual(mem[0x400c39], '|')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197434L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 6L)

    def test_PCMPESTRI_28(self):
        ''' Instruction PCMPESTRI_28
            Groups: sse42
            0x400c2e:	pcmpestri	xmm1, xmm2, 0x79
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400c2e] = 'f'
        mem[0x00400c2f] = '\x0f'
        mem[0x00400c30] = ':'
        mem[0x00400c31] = 'a'
        mem[0x00400c32] = '\xca'
        mem[0x00400c33] = 'y'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400c2e
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0xf
        cpu.execute()
    
        self.assertEqual(mem[0x400c2e], 'f')
        self.assertEqual(mem[0x400c2f], '\x0f')
        self.assertEqual(mem[0x400c30], ':')
        self.assertEqual(mem[0x400c31], 'a')
        self.assertEqual(mem[0x400c32], '\xca')
        self.assertEqual(mem[0x400c33], 'y')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197428L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 7L)

    def test_PCMPESTRI_29(self):
        ''' Instruction PCMPESTRI_29
            Groups: sse42
            0x400b80:	pcmpestri	xmm1, xmm2, 0x40
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b80] = 'f'
        mem[0x00400b81] = '\x0f'
        mem[0x00400b82] = ':'
        mem[0x00400b83] = 'a'
        mem[0x00400b84] = '\xca'
        mem[0x00400b85] = '@'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b80
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b80], 'f')
        self.assertEqual(mem[0x400b81], '\x0f')
        self.assertEqual(mem[0x400b82], ':')
        self.assertEqual(mem[0x400b83], 'a')
        self.assertEqual(mem[0x400b84], '\xca')
        self.assertEqual(mem[0x400b85], '@')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197254L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 16L)

    def test_PCMPESTRI_3(self):
        ''' Instruction PCMPESTRI_3
            Groups: sse42
            0x400ac6:	pcmpestri	xmm1, xmm2, 1
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400ac6] = 'f'
        mem[0x00400ac7] = '\x0f'
        mem[0x00400ac8] = ':'
        mem[0x00400ac9] = 'a'
        mem[0x00400aca] = '\xca'
        mem[0x00400acb] = '\x01'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400ac6
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x10
        cpu.execute()
    
        self.assertEqual(mem[0x400ac6], 'f')
        self.assertEqual(mem[0x400ac7], '\x0f')
        self.assertEqual(mem[0x400ac8], ':')
        self.assertEqual(mem[0x400ac9], 'a')
        self.assertEqual(mem[0x400aca], '\xca')
        self.assertEqual(mem[0x400acb], '\x01')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197068L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 8L)

    def test_PCMPESTRI_30(self):
        ''' Instruction PCMPESTRI_30
            Groups: sse42
            0x400ba4:	pcmpestri	xmm1, xmm2, 0x4c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400ba4] = 'f'
        mem[0x00400ba5] = '\x0f'
        mem[0x00400ba6] = ':'
        mem[0x00400ba7] = 'a'
        mem[0x00400ba8] = '\xca'
        mem[0x00400ba9] = 'L'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400ba4
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x7
        cpu.execute()
    
        self.assertEqual(mem[0x400ba4], 'f')
        self.assertEqual(mem[0x400ba5], '\x0f')
        self.assertEqual(mem[0x400ba6], ':')
        self.assertEqual(mem[0x400ba7], 'a')
        self.assertEqual(mem[0x400ba8], '\xca')
        self.assertEqual(mem[0x400ba9], 'L')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197290L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 16L)

    def test_PCMPESTRI_31(self):
        ''' Instruction PCMPESTRI_31
            Groups: sse42
            0x400ad8:	pcmpestri	xmm1, xmm2, 8
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400ad8] = 'f'
        mem[0x00400ad9] = '\x0f'
        mem[0x00400ada] = ':'
        mem[0x00400adb] = 'a'
        mem[0x00400adc] = '\xca'
        mem[0x00400add] = '\x08'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400ad8
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400ad8], 'f')
        self.assertEqual(mem[0x400ad9], '\x0f')
        self.assertEqual(mem[0x400ada], ':')
        self.assertEqual(mem[0x400adb], 'a')
        self.assertEqual(mem[0x400adc], '\xca')
        self.assertEqual(mem[0x400add], '\x08')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197086L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 7L)

    def test_PCMPESTRI_32(self):
        ''' Instruction PCMPESTRI_32
            Groups: sse42
            0x400b50:	pcmpestri	xmm1, xmm2, 0x30
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b50] = 'f'
        mem[0x00400b51] = '\x0f'
        mem[0x00400b52] = ':'
        mem[0x00400b53] = 'a'
        mem[0x00400b54] = '\xca'
        mem[0x00400b55] = '0'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400b50
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400b50], 'f')
        self.assertEqual(mem[0x400b51], '\x0f')
        self.assertEqual(mem[0x400b52], ':')
        self.assertEqual(mem[0x400b53], 'a')
        self.assertEqual(mem[0x400b54], '\xca')
        self.assertEqual(mem[0x400b55], '0')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197206L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_33(self):
        ''' Instruction PCMPESTRI_33
            Groups: sse42
            0x400b44:	pcmpestri	xmm1, xmm2, 0x2c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b44] = 'f'
        mem[0x00400b45] = '\x0f'
        mem[0x00400b46] = ':'
        mem[0x00400b47] = 'a'
        mem[0x00400b48] = '\xca'
        mem[0x00400b49] = ','
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400b44
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x7
        cpu.execute()
    
        self.assertEqual(mem[0x400b44], 'f')
        self.assertEqual(mem[0x400b45], '\x0f')
        self.assertEqual(mem[0x400b46], ':')
        self.assertEqual(mem[0x400b47], 'a')
        self.assertEqual(mem[0x400b48], '\xca')
        self.assertEqual(mem[0x400b49], ',')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197194L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 16L)

    def test_PCMPESTRI_34(self):
        ''' Instruction PCMPESTRI_34
            Groups: sse42
            0x400bbc:	pcmpestri	xmm1, xmm2, 0x54
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400bc0] = '\xca'
        mem[0x00400bc1] = 'T'
        mem[0x00400bbc] = 'f'
        mem[0x00400bbd] = '\x0f'
        mem[0x00400bbe] = ':'
        mem[0x00400bbf] = 'a'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400bbc
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x7
        cpu.execute()
    
        self.assertEqual(mem[0x400bc0], '\xca')
        self.assertEqual(mem[0x400bc1], 'T')
        self.assertEqual(mem[0x400bbc], 'f')
        self.assertEqual(mem[0x400bbd], '\x0f')
        self.assertEqual(mem[0x400bbe], ':')
        self.assertEqual(mem[0x400bbf], 'a')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197314L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 15L)

    def test_PCMPESTRI_35(self):
        ''' Instruction PCMPESTRI_35
            Groups: sse42
            0x400ad2:	pcmpestri	xmm1, xmm2, 5
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400ad2] = 'f'
        mem[0x00400ad3] = '\x0f'
        mem[0x00400ad4] = ':'
        mem[0x00400ad5] = 'a'
        mem[0x00400ad6] = '\xca'
        mem[0x00400ad7] = '\x05'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400ad2
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x10
        cpu.execute()
    
        self.assertEqual(mem[0x400ad2], 'f')
        self.assertEqual(mem[0x400ad3], '\x0f')
        self.assertEqual(mem[0x400ad4], ':')
        self.assertEqual(mem[0x400ad5], 'a')
        self.assertEqual(mem[0x400ad6], '\xca')
        self.assertEqual(mem[0x400ad7], '\x05')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197080L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 8L)

    def test_PCMPESTRI_36(self):
        ''' Instruction PCMPESTRI_36
            Groups: sse42
            0x400b26:	pcmpestri	xmm1, xmm2, 0x21
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b26] = 'f'
        mem[0x00400b27] = '\x0f'
        mem[0x00400b28] = ':'
        mem[0x00400b29] = 'a'
        mem[0x00400b2a] = '\xca'
        mem[0x00400b2b] = '!'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400b26
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x10
        cpu.execute()
    
        self.assertEqual(mem[0x400b26], 'f')
        self.assertEqual(mem[0x400b27], '\x0f')
        self.assertEqual(mem[0x400b28], ':')
        self.assertEqual(mem[0x400b29], 'a')
        self.assertEqual(mem[0x400b2a], '\xca')
        self.assertEqual(mem[0x400b2b], '!')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197164L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 8L)

    def test_PCMPESTRI_37(self):
        ''' Instruction PCMPESTRI_37
            Groups: sse42
            0x400bc8:	pcmpestri	xmm1, xmm2, 0x58
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400bc8] = 'f'
        mem[0x00400bc9] = '\x0f'
        mem[0x00400bca] = ':'
        mem[0x00400bcb] = 'a'
        mem[0x00400bcc] = '\xca'
        mem[0x00400bcd] = 'X'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400bc8
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x7
        cpu.execute()
    
        self.assertEqual(mem[0x400bc8], 'f')
        self.assertEqual(mem[0x400bc9], '\x0f')
        self.assertEqual(mem[0x400bca], ':')
        self.assertEqual(mem[0x400bcb], 'a')
        self.assertEqual(mem[0x400bcc], '\xca')
        self.assertEqual(mem[0x400bcd], 'X')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197326L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 6L)

    def test_PCMPESTRI_38(self):
        ''' Instruction PCMPESTRI_38
            Groups: sse42
            0x400b98:	pcmpestri	xmm1, xmm2, 0x48
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b98] = 'f'
        mem[0x00400b99] = '\x0f'
        mem[0x00400b9a] = ':'
        mem[0x00400b9b] = 'a'
        mem[0x00400b9c] = '\xca'
        mem[0x00400b9d] = 'H'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400b98
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400b98], 'f')
        self.assertEqual(mem[0x400b99], '\x0f')
        self.assertEqual(mem[0x400b9a], ':')
        self.assertEqual(mem[0x400b9b], 'a')
        self.assertEqual(mem[0x400b9c], '\xca')
        self.assertEqual(mem[0x400b9d], 'H')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197278L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 15L)

    def test_PCMPESTRI_39(self):
        ''' Instruction PCMPESTRI_39
            Groups: sse42
            0x400b02:	pcmpestri	xmm1, xmm2, 0x15
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b02] = 'f'
        mem[0x00400b03] = '\x0f'
        mem[0x00400b04] = ':'
        mem[0x00400b05] = 'a'
        mem[0x00400b06] = '\xca'
        mem[0x00400b07] = '\x15'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b02
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b02], 'f')
        self.assertEqual(mem[0x400b03], '\x0f')
        self.assertEqual(mem[0x400b04], ':')
        self.assertEqual(mem[0x400b05], 'a')
        self.assertEqual(mem[0x400b06], '\xca')
        self.assertEqual(mem[0x400b07], '\x15')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197128L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_4(self):
        ''' Instruction PCMPESTRI_4
            Groups: sse42
            0x400c22:	pcmpestri	xmm1, xmm2, 0x75
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400c22] = 'f'
        mem[0x00400c23] = '\x0f'
        mem[0x00400c24] = ':'
        mem[0x00400c25] = 'a'
        mem[0x00400c26] = '\xca'
        mem[0x00400c27] = 'u'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400c22
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x6
        cpu.execute()
    
        self.assertEqual(mem[0x400c22], 'f')
        self.assertEqual(mem[0x400c23], '\x0f')
        self.assertEqual(mem[0x400c24], ':')
        self.assertEqual(mem[0x400c25], 'a')
        self.assertEqual(mem[0x400c26], '\xca')
        self.assertEqual(mem[0x400c27], 'u')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197416L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 6L)

    def test_PCMPESTRI_40(self):
        ''' Instruction PCMPESTRI_40
            Groups: sse42
            0x400c3a:	pcmpestri	xmm1, xmm2, 0x7d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400c3a] = 'f'
        mem[0x00400c3b] = '\x0f'
        mem[0x00400c3c] = ':'
        mem[0x00400c3d] = 'a'
        mem[0x00400c3e] = '\xca'
        mem[0x00400c3f] = '}'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400c3a
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x6
        cpu.execute()
    
        self.assertEqual(mem[0x400c3a], 'f')
        self.assertEqual(mem[0x400c3b], '\x0f')
        self.assertEqual(mem[0x400c3c], ':')
        self.assertEqual(mem[0x400c3d], 'a')
        self.assertEqual(mem[0x400c3e], '\xca')
        self.assertEqual(mem[0x400c3f], '}')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197440L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 6L)

    def test_PCMPESTRI_41(self):
        ''' Instruction PCMPESTRI_41
            Groups: sse42
            0x400af6:	pcmpestri	xmm1, xmm2, 0x11
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400af6] = 'f'
        mem[0x00400af7] = '\x0f'
        mem[0x00400af8] = ':'
        mem[0x00400af9] = 'a'
        mem[0x00400afa] = '\xca'
        mem[0x00400afb] = '\x11'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400af6
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400af6], 'f')
        self.assertEqual(mem[0x400af7], '\x0f')
        self.assertEqual(mem[0x400af8], ':')
        self.assertEqual(mem[0x400af9], 'a')
        self.assertEqual(mem[0x400afa], '\xca')
        self.assertEqual(mem[0x400afb], '\x11')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197116L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_42(self):
        ''' Instruction PCMPESTRI_42
            Groups: sse42
            0x400c28:	pcmpestri	xmm1, xmm2, 0x78
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400c28] = 'f'
        mem[0x00400c29] = '\x0f'
        mem[0x00400c2a] = ':'
        mem[0x00400c2b] = 'a'
        mem[0x00400c2c] = '\xca'
        mem[0x00400c2d] = 'x'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400c28
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x6
        cpu.execute()
    
        self.assertEqual(mem[0x400c28], 'f')
        self.assertEqual(mem[0x400c29], '\x0f')
        self.assertEqual(mem[0x400c2a], ':')
        self.assertEqual(mem[0x400c2b], 'a')
        self.assertEqual(mem[0x400c2c], '\xca')
        self.assertEqual(mem[0x400c2d], 'x')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197422L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 15L)

    def test_PCMPESTRI_43(self):
        ''' Instruction PCMPESTRI_43
            Groups: sse42
            0x400b62:	pcmpestri	xmm1, xmm2, 0x35
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b62] = 'f'
        mem[0x00400b63] = '\x0f'
        mem[0x00400b64] = ':'
        mem[0x00400b65] = 'a'
        mem[0x00400b66] = '\xca'
        mem[0x00400b67] = '5'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b62
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b62], 'f')
        self.assertEqual(mem[0x400b63], '\x0f')
        self.assertEqual(mem[0x400b64], ':')
        self.assertEqual(mem[0x400b65], 'a')
        self.assertEqual(mem[0x400b66], '\xca')
        self.assertEqual(mem[0x400b67], '5')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197224L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_44(self):
        ''' Instruction PCMPESTRI_44
            Groups: sse42
            0x400baa:	pcmpestri	xmm1, xmm2, 0x4d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400baa] = 'f'
        mem[0x00400bab] = '\x0f'
        mem[0x00400bac] = ':'
        mem[0x00400bad] = 'a'
        mem[0x00400bae] = '\xca'
        mem[0x00400baf] = 'M'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400baa
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x10
        cpu.execute()
    
        self.assertEqual(mem[0x400baa], 'f')
        self.assertEqual(mem[0x400bab], '\x0f')
        self.assertEqual(mem[0x400bac], ':')
        self.assertEqual(mem[0x400bad], 'a')
        self.assertEqual(mem[0x400bae], '\xca')
        self.assertEqual(mem[0x400baf], 'M')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197296L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 8L)

    def test_PCMPESTRI_45(self):
        ''' Instruction PCMPESTRI_45
            Groups: sse42
            0x400b68:	pcmpestri	xmm1, xmm2, 0x38
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b68] = 'f'
        mem[0x00400b69] = '\x0f'
        mem[0x00400b6a] = ':'
        mem[0x00400b6b] = 'a'
        mem[0x00400b6c] = '\xca'
        mem[0x00400b6d] = '8'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b68
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b68], 'f')
        self.assertEqual(mem[0x400b69], '\x0f')
        self.assertEqual(mem[0x400b6a], ':')
        self.assertEqual(mem[0x400b6b], 'a')
        self.assertEqual(mem[0x400b6c], '\xca')
        self.assertEqual(mem[0x400b6d], '8')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197230L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_46(self):
        ''' Instruction PCMPESTRI_46
            Groups: sse42
            0x400c16:	pcmpestri	xmm1, xmm2, 0x71
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400c16] = 'f'
        mem[0x00400c17] = '\x0f'
        mem[0x00400c18] = ':'
        mem[0x00400c19] = 'a'
        mem[0x00400c1a] = '\xca'
        mem[0x00400c1b] = 'q'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400c16
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x6
        cpu.execute()
    
        self.assertEqual(mem[0x400c16], 'f')
        self.assertEqual(mem[0x400c17], '\x0f')
        self.assertEqual(mem[0x400c18], ':')
        self.assertEqual(mem[0x400c19], 'a')
        self.assertEqual(mem[0x400c1a], '\xca')
        self.assertEqual(mem[0x400c1b], 'q')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197404L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 6L)

    def test_PCMPESTRI_47(self):
        ''' Instruction PCMPESTRI_47
            Groups: sse42
            0x400acc:	pcmpestri	xmm1, xmm2, 4
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400acc] = 'f'
        mem[0x00400acd] = '\x0f'
        mem[0x00400ace] = ':'
        mem[0x00400acf] = 'a'
        mem[0x00400ad0] = '\xca'
        mem[0x00400ad1] = '\x04'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400acc
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400acc], 'f')
        self.assertEqual(mem[0x400acd], '\x0f')
        self.assertEqual(mem[0x400ace], ':')
        self.assertEqual(mem[0x400acf], 'a')
        self.assertEqual(mem[0x400ad0], '\xca')
        self.assertEqual(mem[0x400ad1], '\x04')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197074L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 16L)

    def test_PCMPESTRI_48(self):
        ''' Instruction PCMPESTRI_48
            Groups: sse42
            0x400b92:	pcmpestri	xmm1, xmm2, 0x45
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b92] = 'f'
        mem[0x00400b93] = '\x0f'
        mem[0x00400b94] = ':'
        mem[0x00400b95] = 'a'
        mem[0x00400b96] = '\xca'
        mem[0x00400b97] = 'E'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400b92
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x10
        cpu.execute()
    
        self.assertEqual(mem[0x400b92], 'f')
        self.assertEqual(mem[0x400b93], '\x0f')
        self.assertEqual(mem[0x400b94], ':')
        self.assertEqual(mem[0x400b95], 'a')
        self.assertEqual(mem[0x400b96], '\xca')
        self.assertEqual(mem[0x400b97], 'E')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197272L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 8L)

    def test_PCMPESTRI_49(self):
        ''' Instruction PCMPESTRI_49
            Groups: sse42
            0x400afc:	pcmpestri	xmm1, xmm2, 0x14
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b00] = '\xca'
        mem[0x00400b01] = '\x14'
        mem[0x00400afc] = 'f'
        mem[0x00400afd] = '\x0f'
        mem[0x00400afe] = ':'
        mem[0x00400aff] = 'a'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400afc
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b00], '\xca')
        self.assertEqual(mem[0x400b01], '\x14')
        self.assertEqual(mem[0x400afc], 'f')
        self.assertEqual(mem[0x400afd], '\x0f')
        self.assertEqual(mem[0x400afe], ':')
        self.assertEqual(mem[0x400aff], 'a')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197122L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_5(self):
        ''' Instruction PCMPESTRI_5
            Groups: sse42
            0x400be6:	pcmpestri	xmm1, xmm2, 0x61
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400be6] = 'f'
        mem[0x00400be7] = '\x0f'
        mem[0x00400be8] = ':'
        mem[0x00400be9] = 'a'
        mem[0x00400bea] = '\xca'
        mem[0x00400beb] = 'a'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400be6
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x10
        cpu.execute()
    
        self.assertEqual(mem[0x400be6], 'f')
        self.assertEqual(mem[0x400be7], '\x0f')
        self.assertEqual(mem[0x400be8], ':')
        self.assertEqual(mem[0x400be9], 'a')
        self.assertEqual(mem[0x400bea], '\xca')
        self.assertEqual(mem[0x400beb], 'a')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197356L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 8L)

    def test_PCMPESTRI_50(self):
        ''' Instruction PCMPESTRI_50
            Groups: sse42
            0x400b9e:	pcmpestri	xmm1, xmm2, 0x49
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400ba0] = ':'
        mem[0x00400ba1] = 'a'
        mem[0x00400ba2] = '\xca'
        mem[0x00400ba3] = 'I'
        mem[0x00400b9e] = 'f'
        mem[0x00400b9f] = '\x0f'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400b9e
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0xf
        cpu.execute()
    
        self.assertEqual(mem[0x400ba0], ':')
        self.assertEqual(mem[0x400ba1], 'a')
        self.assertEqual(mem[0x400ba2], '\xca')
        self.assertEqual(mem[0x400ba3], 'I')
        self.assertEqual(mem[0x400b9e], 'f')
        self.assertEqual(mem[0x400b9f], '\x0f')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197284L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 7L)

    def test_PCMPESTRI_51(self):
        ''' Instruction PCMPESTRI_51
            Groups: sse42
            0x400ac0:	pcmpestri	xmm1, xmm2, 0
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400ac0] = 'f'
        mem[0x00400ac1] = '\x0f'
        mem[0x00400ac2] = ':'
        mem[0x00400ac3] = 'a'
        mem[0x00400ac4] = '\xca'
        mem[0x00400ac5] = '\x00'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400ac0
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400ac0], 'f')
        self.assertEqual(mem[0x400ac1], '\x0f')
        self.assertEqual(mem[0x400ac2], ':')
        self.assertEqual(mem[0x400ac3], 'a')
        self.assertEqual(mem[0x400ac4], '\xca')
        self.assertEqual(mem[0x400ac5], '\x00')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197062L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 16L)

    def test_PCMPESTRI_52(self):
        ''' Instruction PCMPESTRI_52
            Groups: sse42
            0x400b74:	pcmpestri	xmm1, xmm2, 0x3c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b74] = 'f'
        mem[0x00400b75] = '\x0f'
        mem[0x00400b76] = ':'
        mem[0x00400b77] = 'a'
        mem[0x00400b78] = '\xca'
        mem[0x00400b79] = '<'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b74
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b74], 'f')
        self.assertEqual(mem[0x400b75], '\x0f')
        self.assertEqual(mem[0x400b76], ':')
        self.assertEqual(mem[0x400b77], 'a')
        self.assertEqual(mem[0x400b78], '\xca')
        self.assertEqual(mem[0x400b79], '<')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197242L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_53(self):
        ''' Instruction PCMPESTRI_53
            Groups: sse42
            0x400bce:	pcmpestri	xmm1, xmm2, 0x59
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400bce] = 'f'
        mem[0x00400bcf] = '\x0f'
        mem[0x00400bd0] = ':'
        mem[0x00400bd1] = 'a'
        mem[0x00400bd2] = '\xca'
        mem[0x00400bd3] = 'Y'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400bce
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x6
        cpu.execute()
    
        self.assertEqual(mem[0x400bce], 'f')
        self.assertEqual(mem[0x400bcf], '\x0f')
        self.assertEqual(mem[0x400bd0], ':')
        self.assertEqual(mem[0x400bd1], 'a')
        self.assertEqual(mem[0x400bd2], '\xca')
        self.assertEqual(mem[0x400bd3], 'Y')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197332L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 6L)

    def test_PCMPESTRI_54(self):
        ''' Instruction PCMPESTRI_54
            Groups: sse42
            0x400b56:	pcmpestri	xmm1, xmm2, 0x31
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b56] = 'f'
        mem[0x00400b57] = '\x0f'
        mem[0x00400b58] = ':'
        mem[0x00400b59] = 'a'
        mem[0x00400b5a] = '\xca'
        mem[0x00400b5b] = '1'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b56
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b56], 'f')
        self.assertEqual(mem[0x400b57], '\x0f')
        self.assertEqual(mem[0x400b58], ':')
        self.assertEqual(mem[0x400b59], 'a')
        self.assertEqual(mem[0x400b5a], '\xca')
        self.assertEqual(mem[0x400b5b], '1')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197212L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_55(self):
        ''' Instruction PCMPESTRI_55
            Groups: sse42
            0x400b7a:	pcmpestri	xmm1, xmm2, 0x3d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b7a] = 'f'
        mem[0x00400b7b] = '\x0f'
        mem[0x00400b7c] = ':'
        mem[0x00400b7d] = 'a'
        mem[0x00400b7e] = '\xca'
        mem[0x00400b7f] = '='
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b7a
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b7a], 'f')
        self.assertEqual(mem[0x400b7b], '\x0f')
        self.assertEqual(mem[0x400b7c], ':')
        self.assertEqual(mem[0x400b7d], 'a')
        self.assertEqual(mem[0x400b7e], '\xca')
        self.assertEqual(mem[0x400b7f], '=')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197248L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_56(self):
        ''' Instruction PCMPESTRI_56
            Groups: sse42
            0x400b5c:	pcmpestri	xmm1, xmm2, 0x34
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b60] = '\xca'
        mem[0x00400b61] = '4'
        mem[0x00400b5c] = 'f'
        mem[0x00400b5d] = '\x0f'
        mem[0x00400b5e] = ':'
        mem[0x00400b5f] = 'a'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b5c
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b60], '\xca')
        self.assertEqual(mem[0x400b61], '4')
        self.assertEqual(mem[0x400b5c], 'f')
        self.assertEqual(mem[0x400b5d], '\x0f')
        self.assertEqual(mem[0x400b5e], ':')
        self.assertEqual(mem[0x400b5f], 'a')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197218L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_57(self):
        ''' Instruction PCMPESTRI_57
            Groups: sse42
            0x400ade:	pcmpestri	xmm1, xmm2, 9
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400ae0] = ':'
        mem[0x00400ae1] = 'a'
        mem[0x00400ae2] = '\xca'
        mem[0x00400ae3] = '\t'
        mem[0x00400ade] = 'f'
        mem[0x00400adf] = '\x0f'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400ade
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x7
        cpu.execute()
    
        self.assertEqual(mem[0x400ae0], ':')
        self.assertEqual(mem[0x400ae1], 'a')
        self.assertEqual(mem[0x400ae2], '\xca')
        self.assertEqual(mem[0x400ae3], '\t')
        self.assertEqual(mem[0x400ade], 'f')
        self.assertEqual(mem[0x400adf], '\x0f')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197092L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 7L)

    def test_PCMPESTRI_58(self):
        ''' Instruction PCMPESTRI_58
            Groups: sse42
            0x400b3e:	pcmpestri	xmm1, xmm2, 0x29
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b40] = ':'
        mem[0x00400b41] = 'a'
        mem[0x00400b42] = '\xca'
        mem[0x00400b43] = ')'
        mem[0x00400b3e] = 'f'
        mem[0x00400b3f] = '\x0f'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400b3e
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x7
        cpu.execute()
    
        self.assertEqual(mem[0x400b40], ':')
        self.assertEqual(mem[0x400b41], 'a')
        self.assertEqual(mem[0x400b42], '\xca')
        self.assertEqual(mem[0x400b43], ')')
        self.assertEqual(mem[0x400b3e], 'f')
        self.assertEqual(mem[0x400b3f], '\x0f')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197188L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 7L)

    def test_PCMPESTRI_59(self):
        ''' Instruction PCMPESTRI_59
            Groups: sse42
            0x400bb0:	pcmpestri	xmm1, xmm2, 0x50
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400bb0] = 'f'
        mem[0x00400bb1] = '\x0f'
        mem[0x00400bb2] = ':'
        mem[0x00400bb3] = 'a'
        mem[0x00400bb4] = '\xca'
        mem[0x00400bb5] = 'P'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400bb0
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400bb0], 'f')
        self.assertEqual(mem[0x400bb1], '\x0f')
        self.assertEqual(mem[0x400bb2], ':')
        self.assertEqual(mem[0x400bb3], 'a')
        self.assertEqual(mem[0x400bb4], '\xca')
        self.assertEqual(mem[0x400bb5], 'P')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197302L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 15L)

    def test_PCMPESTRI_6(self):
        ''' Instruction PCMPESTRI_6
            Groups: sse42
            0x400b0e:	pcmpestri	xmm1, xmm2, 0x19
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b0e] = 'f'
        mem[0x00400b0f] = '\x0f'
        mem[0x00400b10] = ':'
        mem[0x00400b11] = 'a'
        mem[0x00400b12] = '\xca'
        mem[0x00400b13] = '\x19'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b0e
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b0e], 'f')
        self.assertEqual(mem[0x400b0f], '\x0f')
        self.assertEqual(mem[0x400b10], ':')
        self.assertEqual(mem[0x400b11], 'a')
        self.assertEqual(mem[0x400b12], '\xca')
        self.assertEqual(mem[0x400b13], '\x19')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197140L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_60(self):
        ''' Instruction PCMPESTRI_60
            Groups: sse42
            0x400b1a:	pcmpestri	xmm1, xmm2, 0x1d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b1a] = 'f'
        mem[0x00400b1b] = '\x0f'
        mem[0x00400b1c] = ':'
        mem[0x00400b1d] = 'a'
        mem[0x00400b1e] = '\xca'
        mem[0x00400b1f] = '\x1d'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400b1a
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x0
        cpu.execute()
    
        self.assertEqual(mem[0x400b1a], 'f')
        self.assertEqual(mem[0x400b1b], '\x0f')
        self.assertEqual(mem[0x400b1c], ':')
        self.assertEqual(mem[0x400b1d], 'a')
        self.assertEqual(mem[0x400b1e], '\xca')
        self.assertEqual(mem[0x400b1f], '\x1d')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197152L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 0L)

    def test_PCMPESTRI_61(self):
        ''' Instruction PCMPESTRI_61
            Groups: sse42
            0x400bf2:	pcmpestri	xmm1, xmm2, 0x65
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400bf2] = 'f'
        mem[0x00400bf3] = '\x0f'
        mem[0x00400bf4] = ':'
        mem[0x00400bf5] = 'a'
        mem[0x00400bf6] = '\xca'
        mem[0x00400bf7] = 'e'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400bf2
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x10
        cpu.execute()
    
        self.assertEqual(mem[0x400bf2], 'f')
        self.assertEqual(mem[0x400bf3], '\x0f')
        self.assertEqual(mem[0x400bf4], ':')
        self.assertEqual(mem[0x400bf5], 'a')
        self.assertEqual(mem[0x400bf6], '\xca')
        self.assertEqual(mem[0x400bf7], 'e')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197368L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 8L)

    def test_PCMPESTRI_62(self):
        ''' Instruction PCMPESTRI_62
            Groups: sse42
            0x400bd4:	pcmpestri	xmm1, xmm2, 0x5c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400bd4] = 'f'
        mem[0x00400bd5] = '\x0f'
        mem[0x00400bd6] = ':'
        mem[0x00400bd7] = 'a'
        mem[0x00400bd8] = '\xca'
        mem[0x00400bd9] = '\\'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400bd4
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x6
        cpu.execute()
    
        self.assertEqual(mem[0x400bd4], 'f')
        self.assertEqual(mem[0x400bd5], '\x0f')
        self.assertEqual(mem[0x400bd6], ':')
        self.assertEqual(mem[0x400bd7], 'a')
        self.assertEqual(mem[0x400bd8], '\xca')
        self.assertEqual(mem[0x400bd9], '\\')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197338L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 15L)

    def test_PCMPESTRI_63(self):
        ''' Instruction PCMPESTRI_63
            Groups: sse42
            0x400bf8:	pcmpestri	xmm1, xmm2, 0x68
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400bf8] = 'f'
        mem[0x00400bf9] = '\x0f'
        mem[0x00400bfa] = ':'
        mem[0x00400bfb] = 'a'
        mem[0x00400bfc] = '\xca'
        mem[0x00400bfd] = 'h'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400bf8
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400bf8], 'f')
        self.assertEqual(mem[0x400bf9], '\x0f')
        self.assertEqual(mem[0x400bfa], ':')
        self.assertEqual(mem[0x400bfb], 'a')
        self.assertEqual(mem[0x400bfc], '\xca')
        self.assertEqual(mem[0x400bfd], 'h')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197374L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 15L)

    def test_PCMPESTRI_64(self):
        ''' Instruction PCMPESTRI_64
            Groups: sse42
            0x400bc2:	pcmpestri	xmm1, xmm2, 0x55
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400bc2] = 'f'
        mem[0x00400bc3] = '\x0f'
        mem[0x00400bc4] = ':'
        mem[0x00400bc5] = 'a'
        mem[0x00400bc6] = '\xca'
        mem[0x00400bc7] = 'U'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400bc2
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0xf
        cpu.execute()
    
        self.assertEqual(mem[0x400bc2], 'f')
        self.assertEqual(mem[0x400bc3], '\x0f')
        self.assertEqual(mem[0x400bc4], ':')
        self.assertEqual(mem[0x400bc5], 'a')
        self.assertEqual(mem[0x400bc6], '\xca')
        self.assertEqual(mem[0x400bc7], 'U')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197320L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 7L)

    def test_PCMPESTRI_7(self):
        ''' Instruction PCMPESTRI_7
            Groups: sse42
            0x400b8c:	pcmpestri	xmm1, xmm2, 0x44
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b8c] = 'f'
        mem[0x00400b8d] = '\x0f'
        mem[0x00400b8e] = ':'
        mem[0x00400b8f] = 'a'
        mem[0x00400b90] = '\xca'
        mem[0x00400b91] = 'D'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400b8c
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x8
        cpu.execute()
    
        self.assertEqual(mem[0x400b8c], 'f')
        self.assertEqual(mem[0x400b8d], '\x0f')
        self.assertEqual(mem[0x400b8e], ':')
        self.assertEqual(mem[0x400b8f], 'a')
        self.assertEqual(mem[0x400b90], '\xca')
        self.assertEqual(mem[0x400b91], 'D')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197266L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 16L)

    def test_PCMPESTRI_8(self):
        ''' Instruction PCMPESTRI_8
            Groups: sse42
            0x400aea:	pcmpestri	xmm1, xmm2, 0xd
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400aea] = 'f'
        mem[0x00400aeb] = '\x0f'
        mem[0x00400aec] = ':'
        mem[0x00400aed] = 'a'
        mem[0x00400aee] = '\xca'
        mem[0x00400aef] = '\r'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400aea
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x10
        cpu.execute()
    
        self.assertEqual(mem[0x400aea], 'f')
        self.assertEqual(mem[0x400aeb], '\x0f')
        self.assertEqual(mem[0x400aec], ':')
        self.assertEqual(mem[0x400aed], 'a')
        self.assertEqual(mem[0x400aee], '\xca')
        self.assertEqual(mem[0x400aef], '\r')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197104L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 8L)

    def test_PCMPESTRI_9(self):
        ''' Instruction PCMPESTRI_9
            Groups: sse42
            0x400b32:	pcmpestri	xmm1, xmm2, 0x25
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400b32] = 'f'
        mem[0x00400b33] = '\x0f'
        mem[0x00400b34] = ':'
        mem[0x00400b35] = 'a'
        mem[0x00400b36] = '\xca'
        mem[0x00400b37] = '%'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400b32
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.ECX = 0x10
        cpu.execute()
    
        self.assertEqual(mem[0x400b32], 'f')
        self.assertEqual(mem[0x400b33], '\x0f')
        self.assertEqual(mem[0x400b34], ':')
        self.assertEqual(mem[0x400b35], 'a')
        self.assertEqual(mem[0x400b36], '\xca')
        self.assertEqual(mem[0x400b37], '%')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4197176L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)
        self.assertEqual(cpu.ECX, 8L)

    def test_PCMPESTRM_1(self):
        ''' Instruction PCMPESTRM_1
            Groups: sse42
            0x4009d0:	pcmpestrm	xmm1, xmm2, 0x38
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009d0] = 'f'
        mem[0x004009d1] = '\x0f'
        mem[0x004009d2] = ':'
        mem[0x004009d3] = '`'
        mem[0x004009d4] = '\xca'
        mem[0x004009d5] = '8'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x4009d0
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009d0], 'f')
        self.assertEqual(mem[0x4009d1], '\x0f')
        self.assertEqual(mem[0x4009d2], ':')
        self.assertEqual(mem[0x4009d3], '`')
        self.assertEqual(mem[0x4009d4], '\xca')
        self.assertEqual(mem[0x4009d5], '8')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196822L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_10(self):
        ''' Instruction PCMPESTRM_10
            Groups: sse42
            0x4009ac:	pcmpestrm	xmm1, xmm2, 0x2c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009ac] = 'f'
        mem[0x004009ad] = '\x0f'
        mem[0x004009ae] = ':'
        mem[0x004009af] = '`'
        mem[0x004009b0] = '\xca'
        mem[0x004009b1] = ','
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x4009ac
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009ac], 'f')
        self.assertEqual(mem[0x4009ad], '\x0f')
        self.assertEqual(mem[0x4009ae], ':')
        self.assertEqual(mem[0x4009af], '`')
        self.assertEqual(mem[0x4009b0], '\xca')
        self.assertEqual(mem[0x4009b1], ',')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196786L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_11(self):
        ''' Instruction PCMPESTRM_11
            Groups: sse42
            0x400a24:	pcmpestrm	xmm1, xmm2, 0x54
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a24] = 'f'
        mem[0x00400a25] = '\x0f'
        mem[0x00400a26] = ':'
        mem[0x00400a27] = '`'
        mem[0x00400a28] = '\xca'
        mem[0x00400a29] = 'T'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a24
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a24], 'f')
        self.assertEqual(mem[0x400a25], '\x0f')
        self.assertEqual(mem[0x400a26], ':')
        self.assertEqual(mem[0x400a27], '`')
        self.assertEqual(mem[0x400a28], '\xca')
        self.assertEqual(mem[0x400a29], 'T')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196906L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_12(self):
        ''' Instruction PCMPESTRM_12
            Groups: sse42
            0x4009f4:	pcmpestrm	xmm1, xmm2, 0x44
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009f4] = 'f'
        mem[0x004009f5] = '\x0f'
        mem[0x004009f6] = ':'
        mem[0x004009f7] = '`'
        mem[0x004009f8] = '\xca'
        mem[0x004009f9] = 'D'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x4009f4
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009f4], 'f')
        self.assertEqual(mem[0x4009f5], '\x0f')
        self.assertEqual(mem[0x4009f6], ':')
        self.assertEqual(mem[0x4009f7], '`')
        self.assertEqual(mem[0x4009f8], '\xca')
        self.assertEqual(mem[0x4009f9], 'D')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196858L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_13(self):
        ''' Instruction PCMPESTRM_13
            Groups: sse42
            0x400a1e:	pcmpestrm	xmm1, xmm2, 0x51
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a20] = ':'
        mem[0x00400a21] = '`'
        mem[0x00400a22] = '\xca'
        mem[0x00400a23] = 'Q'
        mem[0x00400a1e] = 'f'
        mem[0x00400a1f] = '\x0f'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a1e
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a20], ':')
        self.assertEqual(mem[0x400a21], '`')
        self.assertEqual(mem[0x400a22], '\xca')
        self.assertEqual(mem[0x400a23], 'Q')
        self.assertEqual(mem[0x400a1e], 'f')
        self.assertEqual(mem[0x400a1f], '\x0f')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196900L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_14(self):
        ''' Instruction PCMPESTRM_14
            Groups: sse42
            0x400a7e:	pcmpestrm	xmm1, xmm2, 0x71
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a80] = ':'
        mem[0x00400a81] = '`'
        mem[0x00400a82] = '\xca'
        mem[0x00400a83] = 'q'
        mem[0x00400a7e] = 'f'
        mem[0x00400a7f] = '\x0f'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a7e
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a80], ':')
        self.assertEqual(mem[0x400a81], '`')
        self.assertEqual(mem[0x400a82], '\xca')
        self.assertEqual(mem[0x400a83], 'q')
        self.assertEqual(mem[0x400a7e], 'f')
        self.assertEqual(mem[0x400a7f], '\x0f')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196996L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_15(self):
        ''' Instruction PCMPESTRM_15
            Groups: sse42
            0x400994:	pcmpestrm	xmm1, xmm2, 0x24
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400994] = 'f'
        mem[0x00400995] = '\x0f'
        mem[0x00400996] = ':'
        mem[0x00400997] = '`'
        mem[0x00400998] = '\xca'
        mem[0x00400999] = '$'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400994
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400994], 'f')
        self.assertEqual(mem[0x400995], '\x0f')
        self.assertEqual(mem[0x400996], ':')
        self.assertEqual(mem[0x400997], '`')
        self.assertEqual(mem[0x400998], '\xca')
        self.assertEqual(mem[0x400999], '$')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196762L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_16(self):
        ''' Instruction PCMPESTRM_16
            Groups: sse42
            0x400934:	pcmpestrm	xmm1, xmm2, 4
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400934] = 'f'
        mem[0x00400935] = '\x0f'
        mem[0x00400936] = ':'
        mem[0x00400937] = '`'
        mem[0x00400938] = '\xca'
        mem[0x00400939] = '\x04'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400934
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400934], 'f')
        self.assertEqual(mem[0x400935], '\x0f')
        self.assertEqual(mem[0x400936], ':')
        self.assertEqual(mem[0x400937], '`')
        self.assertEqual(mem[0x400938], '\xca')
        self.assertEqual(mem[0x400939], '\x04')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196666L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_17(self):
        ''' Instruction PCMPESTRM_17
            Groups: sse42
            0x400a9c:	pcmpestrm	xmm1, xmm2, 0x7c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400aa0] = '\xca'
        mem[0x00400aa1] = '|'
        mem[0x00400a9c] = 'f'
        mem[0x00400a9d] = '\x0f'
        mem[0x00400a9e] = ':'
        mem[0x00400a9f] = '`'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a9c
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400aa0], '\xca')
        self.assertEqual(mem[0x400aa1], '|')
        self.assertEqual(mem[0x400a9c], 'f')
        self.assertEqual(mem[0x400a9d], '\x0f')
        self.assertEqual(mem[0x400a9e], ':')
        self.assertEqual(mem[0x400a9f], '`')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197026L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_18(self):
        ''' Instruction PCMPESTRM_18
            Groups: sse42
            0x40092e:	pcmpestrm	xmm1, xmm2, 1
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040092e] = 'f'
        mem[0x0040092f] = '\x0f'
        mem[0x00400930] = ':'
        mem[0x00400931] = '`'
        mem[0x00400932] = '\xca'
        mem[0x00400933] = '\x01'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x40092e
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x40092e], 'f')
        self.assertEqual(mem[0x40092f], '\x0f')
        self.assertEqual(mem[0x400930], ':')
        self.assertEqual(mem[0x400931], '`')
        self.assertEqual(mem[0x400932], '\xca')
        self.assertEqual(mem[0x400933], '\x01')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196660L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_19(self):
        ''' Instruction PCMPESTRM_19
            Groups: sse42
            0x4009a6:	pcmpestrm	xmm1, xmm2, 0x29
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009a6] = 'f'
        mem[0x004009a7] = '\x0f'
        mem[0x004009a8] = ':'
        mem[0x004009a9] = '`'
        mem[0x004009aa] = '\xca'
        mem[0x004009ab] = ')'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x4009a6
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009a6], 'f')
        self.assertEqual(mem[0x4009a7], '\x0f')
        self.assertEqual(mem[0x4009a8], ':')
        self.assertEqual(mem[0x4009a9], '`')
        self.assertEqual(mem[0x4009aa], '\xca')
        self.assertEqual(mem[0x4009ab], ')')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196780L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_2(self):
        ''' Instruction PCMPESTRM_2
            Groups: sse42
            0x400a54:	pcmpestrm	xmm1, xmm2, 0x64
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a54] = 'f'
        mem[0x00400a55] = '\x0f'
        mem[0x00400a56] = ':'
        mem[0x00400a57] = '`'
        mem[0x00400a58] = '\xca'
        mem[0x00400a59] = 'd'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400a54
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a54], 'f')
        self.assertEqual(mem[0x400a55], '\x0f')
        self.assertEqual(mem[0x400a56], ':')
        self.assertEqual(mem[0x400a57], '`')
        self.assertEqual(mem[0x400a58], '\xca')
        self.assertEqual(mem[0x400a59], 'd')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196954L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_20(self):
        ''' Instruction PCMPESTRM_20
            Groups: sse42
            0x400a66:	pcmpestrm	xmm1, xmm2, 0x69
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a66] = 'f'
        mem[0x00400a67] = '\x0f'
        mem[0x00400a68] = ':'
        mem[0x00400a69] = '`'
        mem[0x00400a6a] = '\xca'
        mem[0x00400a6b] = 'i'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400a66
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a66], 'f')
        self.assertEqual(mem[0x400a67], '\x0f')
        self.assertEqual(mem[0x400a68], ':')
        self.assertEqual(mem[0x400a69], '`')
        self.assertEqual(mem[0x400a6a], '\xca')
        self.assertEqual(mem[0x400a6b], 'i')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196972L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_21(self):
        ''' Instruction PCMPESTRM_21
            Groups: sse42
            0x400958:	pcmpestrm	xmm1, xmm2, 0x10
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400958] = 'f'
        mem[0x00400959] = '\x0f'
        mem[0x0040095a] = ':'
        mem[0x0040095b] = '`'
        mem[0x0040095c] = '\xca'
        mem[0x0040095d] = '\x10'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400958
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400958], 'f')
        self.assertEqual(mem[0x400959], '\x0f')
        self.assertEqual(mem[0x40095a], ':')
        self.assertEqual(mem[0x40095b], '`')
        self.assertEqual(mem[0x40095c], '\xca')
        self.assertEqual(mem[0x40095d], '\x10')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196702L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_22(self):
        ''' Instruction PCMPESTRM_22
            Groups: sse42
            0x40095e:	pcmpestrm	xmm1, xmm2, 0x11
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400960] = ':'
        mem[0x00400961] = '`'
        mem[0x00400962] = '\xca'
        mem[0x00400963] = '\x11'
        mem[0x0040095e] = 'f'
        mem[0x0040095f] = '\x0f'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x40095e
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400960], ':')
        self.assertEqual(mem[0x400961], '`')
        self.assertEqual(mem[0x400962], '\xca')
        self.assertEqual(mem[0x400963], '\x11')
        self.assertEqual(mem[0x40095e], 'f')
        self.assertEqual(mem[0x40095f], '\x0f')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196708L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_23(self):
        ''' Instruction PCMPESTRM_23
            Groups: sse42
            0x400976:	pcmpestrm	xmm1, xmm2, 0x19
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400976] = 'f'
        mem[0x00400977] = '\x0f'
        mem[0x00400978] = ':'
        mem[0x00400979] = '`'
        mem[0x0040097a] = '\xca'
        mem[0x0040097b] = '\x19'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400976
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400976], 'f')
        self.assertEqual(mem[0x400977], '\x0f')
        self.assertEqual(mem[0x400978], ':')
        self.assertEqual(mem[0x400979], '`')
        self.assertEqual(mem[0x40097a], '\xca')
        self.assertEqual(mem[0x40097b], '\x19')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196732L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_24(self):
        ''' Instruction PCMPESTRM_24
            Groups: sse42
            0x400a8a:	pcmpestrm	xmm1, xmm2, 0x75
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a8a] = 'f'
        mem[0x00400a8b] = '\x0f'
        mem[0x00400a8c] = ':'
        mem[0x00400a8d] = '`'
        mem[0x00400a8e] = '\xca'
        mem[0x00400a8f] = 'u'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a8a
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a8a], 'f')
        self.assertEqual(mem[0x400a8b], '\x0f')
        self.assertEqual(mem[0x400a8c], ':')
        self.assertEqual(mem[0x400a8d], '`')
        self.assertEqual(mem[0x400a8e], '\xca')
        self.assertEqual(mem[0x400a8f], 'u')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197008L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_25(self):
        ''' Instruction PCMPESTRM_25
            Groups: sse42
            0x400a12:	pcmpestrm	xmm1, xmm2, 0x4d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a12] = 'f'
        mem[0x00400a13] = '\x0f'
        mem[0x00400a14] = ':'
        mem[0x00400a15] = '`'
        mem[0x00400a16] = '\xca'
        mem[0x00400a17] = 'M'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400a12
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a12], 'f')
        self.assertEqual(mem[0x400a13], '\x0f')
        self.assertEqual(mem[0x400a14], ':')
        self.assertEqual(mem[0x400a15], '`')
        self.assertEqual(mem[0x400a16], '\xca')
        self.assertEqual(mem[0x400a17], 'M')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196888L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_26(self):
        ''' Instruction PCMPESTRM_26
            Groups: sse42
            0x40093a:	pcmpestrm	xmm1, xmm2, 5
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040093a] = 'f'
        mem[0x0040093b] = '\x0f'
        mem[0x0040093c] = ':'
        mem[0x0040093d] = '`'
        mem[0x0040093e] = '\xca'
        mem[0x0040093f] = '\x05'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x40093a
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x40093a], 'f')
        self.assertEqual(mem[0x40093b], '\x0f')
        self.assertEqual(mem[0x40093c], ':')
        self.assertEqual(mem[0x40093d], '`')
        self.assertEqual(mem[0x40093e], '\xca')
        self.assertEqual(mem[0x40093f], '\x05')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196672L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_27(self):
        ''' Instruction PCMPESTRM_27
            Groups: sse42
            0x400a30:	pcmpestrm	xmm1, xmm2, 0x58
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a30] = 'f'
        mem[0x00400a31] = '\x0f'
        mem[0x00400a32] = ':'
        mem[0x00400a33] = '`'
        mem[0x00400a34] = '\xca'
        mem[0x00400a35] = 'X'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a30
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a30], 'f')
        self.assertEqual(mem[0x400a31], '\x0f')
        self.assertEqual(mem[0x400a32], ':')
        self.assertEqual(mem[0x400a33], '`')
        self.assertEqual(mem[0x400a34], '\xca')
        self.assertEqual(mem[0x400a35], 'X')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196918L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_28(self):
        ''' Instruction PCMPESTRM_28
            Groups: sse42
            0x4009ca:	pcmpestrm	xmm1, xmm2, 0x35
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009ca] = 'f'
        mem[0x004009cb] = '\x0f'
        mem[0x004009cc] = ':'
        mem[0x004009cd] = '`'
        mem[0x004009ce] = '\xca'
        mem[0x004009cf] = '5'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x4009ca
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009ca], 'f')
        self.assertEqual(mem[0x4009cb], '\x0f')
        self.assertEqual(mem[0x4009cc], ':')
        self.assertEqual(mem[0x4009cd], '`')
        self.assertEqual(mem[0x4009ce], '\xca')
        self.assertEqual(mem[0x4009cf], '5')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196816L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_29(self):
        ''' Instruction PCMPESTRM_29
            Groups: sse42
            0x400a3c:	pcmpestrm	xmm1, xmm2, 0x5c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a40] = '\xca'
        mem[0x00400a41] = '\\'
        mem[0x00400a3c] = 'f'
        mem[0x00400a3d] = '\x0f'
        mem[0x00400a3e] = ':'
        mem[0x00400a3f] = '`'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a3c
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a40], '\xca')
        self.assertEqual(mem[0x400a41], '\\')
        self.assertEqual(mem[0x400a3c], 'f')
        self.assertEqual(mem[0x400a3d], '\x0f')
        self.assertEqual(mem[0x400a3e], ':')
        self.assertEqual(mem[0x400a3f], '`')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196930L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_3(self):
        ''' Instruction PCMPESTRM_3
            Groups: sse42
            0x400a18:	pcmpestrm	xmm1, xmm2, 0x50
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a18] = 'f'
        mem[0x00400a19] = '\x0f'
        mem[0x00400a1a] = ':'
        mem[0x00400a1b] = '`'
        mem[0x00400a1c] = '\xca'
        mem[0x00400a1d] = 'P'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400a18
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a18], 'f')
        self.assertEqual(mem[0x400a19], '\x0f')
        self.assertEqual(mem[0x400a1a], ':')
        self.assertEqual(mem[0x400a1b], '`')
        self.assertEqual(mem[0x400a1c], '\xca')
        self.assertEqual(mem[0x400a1d], 'P')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196894L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_30(self):
        ''' Instruction PCMPESTRM_30
            Groups: sse42
            0x40098e:	pcmpestrm	xmm1, xmm2, 0x21
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040098e] = 'f'
        mem[0x0040098f] = '\x0f'
        mem[0x00400990] = ':'
        mem[0x00400991] = '`'
        mem[0x00400992] = '\xca'
        mem[0x00400993] = '!'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x40098e
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x40098e], 'f')
        self.assertEqual(mem[0x40098f], '\x0f')
        self.assertEqual(mem[0x400990], ':')
        self.assertEqual(mem[0x400991], '`')
        self.assertEqual(mem[0x400992], '\xca')
        self.assertEqual(mem[0x400993], '!')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196756L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_31(self):
        ''' Instruction PCMPESTRM_31
            Groups: sse42
            0x400a96:	pcmpestrm	xmm1, xmm2, 0x79
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a96] = 'f'
        mem[0x00400a97] = '\x0f'
        mem[0x00400a98] = ':'
        mem[0x00400a99] = '`'
        mem[0x00400a9a] = '\xca'
        mem[0x00400a9b] = 'y'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a96
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a96], 'f')
        self.assertEqual(mem[0x400a97], '\x0f')
        self.assertEqual(mem[0x400a98], ':')
        self.assertEqual(mem[0x400a99], '`')
        self.assertEqual(mem[0x400a9a], '\xca')
        self.assertEqual(mem[0x400a9b], 'y')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197020L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_32(self):
        ''' Instruction PCMPESTRM_32
            Groups: sse42
            0x400a90:	pcmpestrm	xmm1, xmm2, 0x78
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a90] = 'f'
        mem[0x00400a91] = '\x0f'
        mem[0x00400a92] = ':'
        mem[0x00400a93] = '`'
        mem[0x00400a94] = '\xca'
        mem[0x00400a95] = 'x'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a90
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a90], 'f')
        self.assertEqual(mem[0x400a91], '\x0f')
        self.assertEqual(mem[0x400a92], ':')
        self.assertEqual(mem[0x400a93], '`')
        self.assertEqual(mem[0x400a94], '\xca')
        self.assertEqual(mem[0x400a95], 'x')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197014L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_33(self):
        ''' Instruction PCMPESTRM_33
            Groups: sse42
            0x400a06:	pcmpestrm	xmm1, xmm2, 0x49
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a06] = 'f'
        mem[0x00400a07] = '\x0f'
        mem[0x00400a08] = ':'
        mem[0x00400a09] = '`'
        mem[0x00400a0a] = '\xca'
        mem[0x00400a0b] = 'I'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400a06
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a06], 'f')
        self.assertEqual(mem[0x400a07], '\x0f')
        self.assertEqual(mem[0x400a08], ':')
        self.assertEqual(mem[0x400a09], '`')
        self.assertEqual(mem[0x400a0a], '\xca')
        self.assertEqual(mem[0x400a0b], 'I')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196876L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_34(self):
        ''' Instruction PCMPESTRM_34
            Groups: sse42
            0x400928:	pcmpestrm	xmm1, xmm2, 0
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400928] = 'f'
        mem[0x00400929] = '\x0f'
        mem[0x0040092a] = ':'
        mem[0x0040092b] = '`'
        mem[0x0040092c] = '\xca'
        mem[0x0040092d] = '\x00'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400928
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400928], 'f')
        self.assertEqual(mem[0x400929], '\x0f')
        self.assertEqual(mem[0x40092a], ':')
        self.assertEqual(mem[0x40092b], '`')
        self.assertEqual(mem[0x40092c], '\xca')
        self.assertEqual(mem[0x40092d], '\x00')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196654L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_35(self):
        ''' Instruction PCMPESTRM_35
            Groups: sse42
            0x400a84:	pcmpestrm	xmm1, xmm2, 0x74
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a84] = 'f'
        mem[0x00400a85] = '\x0f'
        mem[0x00400a86] = ':'
        mem[0x00400a87] = '`'
        mem[0x00400a88] = '\xca'
        mem[0x00400a89] = 't'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a84
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a84], 'f')
        self.assertEqual(mem[0x400a85], '\x0f')
        self.assertEqual(mem[0x400a86], ':')
        self.assertEqual(mem[0x400a87], '`')
        self.assertEqual(mem[0x400a88], '\xca')
        self.assertEqual(mem[0x400a89], 't')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197002L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_36(self):
        ''' Instruction PCMPESTRM_36
            Groups: sse42
            0x400a72:	pcmpestrm	xmm1, xmm2, 0x6d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a72] = 'f'
        mem[0x00400a73] = '\x0f'
        mem[0x00400a74] = ':'
        mem[0x00400a75] = '`'
        mem[0x00400a76] = '\xca'
        mem[0x00400a77] = 'm'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400a72
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a72], 'f')
        self.assertEqual(mem[0x400a73], '\x0f')
        self.assertEqual(mem[0x400a74], ':')
        self.assertEqual(mem[0x400a75], '`')
        self.assertEqual(mem[0x400a76], '\xca')
        self.assertEqual(mem[0x400a77], 'm')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196984L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_37(self):
        ''' Instruction PCMPESTRM_37
            Groups: sse42
            0x400946:	pcmpestrm	xmm1, xmm2, 9
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400946] = 'f'
        mem[0x00400947] = '\x0f'
        mem[0x00400948] = ':'
        mem[0x00400949] = '`'
        mem[0x0040094a] = '\xca'
        mem[0x0040094b] = '\t'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400946
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400946], 'f')
        self.assertEqual(mem[0x400947], '\x0f')
        self.assertEqual(mem[0x400948], ':')
        self.assertEqual(mem[0x400949], '`')
        self.assertEqual(mem[0x40094a], '\xca')
        self.assertEqual(mem[0x40094b], '\t')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196684L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_38(self):
        ''' Instruction PCMPESTRM_38
            Groups: sse42
            0x400940:	pcmpestrm	xmm1, xmm2, 8
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400940] = 'f'
        mem[0x00400941] = '\x0f'
        mem[0x00400942] = ':'
        mem[0x00400943] = '`'
        mem[0x00400944] = '\xca'
        mem[0x00400945] = '\x08'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400940
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400940], 'f')
        self.assertEqual(mem[0x400941], '\x0f')
        self.assertEqual(mem[0x400942], ':')
        self.assertEqual(mem[0x400943], '`')
        self.assertEqual(mem[0x400944], '\xca')
        self.assertEqual(mem[0x400945], '\x08')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196678L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_39(self):
        ''' Instruction PCMPESTRM_39
            Groups: sse42
            0x400aa2:	pcmpestrm	xmm1, xmm2, 0x7d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400aa2] = 'f'
        mem[0x00400aa3] = '\x0f'
        mem[0x00400aa4] = ':'
        mem[0x00400aa5] = '`'
        mem[0x00400aa6] = '\xca'
        mem[0x00400aa7] = '}'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400aa2
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400aa2], 'f')
        self.assertEqual(mem[0x400aa3], '\x0f')
        self.assertEqual(mem[0x400aa4], ':')
        self.assertEqual(mem[0x400aa5], '`')
        self.assertEqual(mem[0x400aa6], '\xca')
        self.assertEqual(mem[0x400aa7], '}')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4197032L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_4(self):
        ''' Instruction PCMPESTRM_4
            Groups: sse42
            0x40097c:	pcmpestrm	xmm1, xmm2, 0x1c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400980] = '\xca'
        mem[0x00400981] = '\x1c'
        mem[0x0040097c] = 'f'
        mem[0x0040097d] = '\x0f'
        mem[0x0040097e] = ':'
        mem[0x0040097f] = '`'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x40097c
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400980], '\xca')
        self.assertEqual(mem[0x400981], '\x1c')
        self.assertEqual(mem[0x40097c], 'f')
        self.assertEqual(mem[0x40097d], '\x0f')
        self.assertEqual(mem[0x40097e], ':')
        self.assertEqual(mem[0x40097f], '`')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196738L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_40(self):
        ''' Instruction PCMPESTRM_40
            Groups: sse42
            0x400a48:	pcmpestrm	xmm1, xmm2, 0x60
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a48] = 'f'
        mem[0x00400a49] = '\x0f'
        mem[0x00400a4a] = ':'
        mem[0x00400a4b] = '`'
        mem[0x00400a4c] = '\xca'
        mem[0x00400a4d] = '`'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a48
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a48], 'f')
        self.assertEqual(mem[0x400a49], '\x0f')
        self.assertEqual(mem[0x400a4a], ':')
        self.assertEqual(mem[0x400a4b], '`')
        self.assertEqual(mem[0x400a4c], '\xca')
        self.assertEqual(mem[0x400a4d], '`')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196942L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_41(self):
        ''' Instruction PCMPESTRM_41
            Groups: sse42
            0x400952:	pcmpestrm	xmm1, xmm2, 0xd
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400952] = 'f'
        mem[0x00400953] = '\x0f'
        mem[0x00400954] = ':'
        mem[0x00400955] = '`'
        mem[0x00400956] = '\xca'
        mem[0x00400957] = '\r'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400952
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400952], 'f')
        self.assertEqual(mem[0x400953], '\x0f')
        self.assertEqual(mem[0x400954], ':')
        self.assertEqual(mem[0x400955], '`')
        self.assertEqual(mem[0x400956], '\xca')
        self.assertEqual(mem[0x400957], '\r')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196696L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_42(self):
        ''' Instruction PCMPESTRM_42
            Groups: sse42
            0x40094c:	pcmpestrm	xmm1, xmm2, 0xc
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040094c] = 'f'
        mem[0x0040094d] = '\x0f'
        mem[0x0040094e] = ':'
        mem[0x0040094f] = '`'
        mem[0x00400950] = '\xca'
        mem[0x00400951] = '\x0c'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x40094c
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x40094c], 'f')
        self.assertEqual(mem[0x40094d], '\x0f')
        self.assertEqual(mem[0x40094e], ':')
        self.assertEqual(mem[0x40094f], '`')
        self.assertEqual(mem[0x400950], '\xca')
        self.assertEqual(mem[0x400951], '\x0c')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196690L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_43(self):
        ''' Instruction PCMPESTRM_43
            Groups: sse42
            0x400a0c:	pcmpestrm	xmm1, xmm2, 0x4c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a0c] = 'f'
        mem[0x00400a0d] = '\x0f'
        mem[0x00400a0e] = ':'
        mem[0x00400a0f] = '`'
        mem[0x00400a10] = '\xca'
        mem[0x00400a11] = 'L'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400a0c
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a0c], 'f')
        self.assertEqual(mem[0x400a0d], '\x0f')
        self.assertEqual(mem[0x400a0e], ':')
        self.assertEqual(mem[0x400a0f], '`')
        self.assertEqual(mem[0x400a10], '\xca')
        self.assertEqual(mem[0x400a11], 'L')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196882L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_44(self):
        ''' Instruction PCMPESTRM_44
            Groups: sse42
            0x400964:	pcmpestrm	xmm1, xmm2, 0x14
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400964] = 'f'
        mem[0x00400965] = '\x0f'
        mem[0x00400966] = ':'
        mem[0x00400967] = '`'
        mem[0x00400968] = '\xca'
        mem[0x00400969] = '\x14'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400964
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400964], 'f')
        self.assertEqual(mem[0x400965], '\x0f')
        self.assertEqual(mem[0x400966], ':')
        self.assertEqual(mem[0x400967], '`')
        self.assertEqual(mem[0x400968], '\xca')
        self.assertEqual(mem[0x400969], '\x14')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196714L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_45(self):
        ''' Instruction PCMPESTRM_45
            Groups: sse42
            0x400a36:	pcmpestrm	xmm1, xmm2, 0x59
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a36] = 'f'
        mem[0x00400a37] = '\x0f'
        mem[0x00400a38] = ':'
        mem[0x00400a39] = '`'
        mem[0x00400a3a] = '\xca'
        mem[0x00400a3b] = 'Y'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a36
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a36], 'f')
        self.assertEqual(mem[0x400a37], '\x0f')
        self.assertEqual(mem[0x400a38], ':')
        self.assertEqual(mem[0x400a39], '`')
        self.assertEqual(mem[0x400a3a], '\xca')
        self.assertEqual(mem[0x400a3b], 'Y')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196924L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_46(self):
        ''' Instruction PCMPESTRM_46
            Groups: sse42
            0x40099a:	pcmpestrm	xmm1, xmm2, 0x25
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040099a] = 'f'
        mem[0x0040099b] = '\x0f'
        mem[0x0040099c] = ':'
        mem[0x0040099d] = '`'
        mem[0x0040099e] = '\xca'
        mem[0x0040099f] = '%'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x40099a
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x40099a], 'f')
        self.assertEqual(mem[0x40099b], '\x0f')
        self.assertEqual(mem[0x40099c], ':')
        self.assertEqual(mem[0x40099d], '`')
        self.assertEqual(mem[0x40099e], '\xca')
        self.assertEqual(mem[0x40099f], '%')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196768L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_47(self):
        ''' Instruction PCMPESTRM_47
            Groups: sse42
            0x400988:	pcmpestrm	xmm1, xmm2, 0x20
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400988] = 'f'
        mem[0x00400989] = '\x0f'
        mem[0x0040098a] = ':'
        mem[0x0040098b] = '`'
        mem[0x0040098c] = '\xca'
        mem[0x0040098d] = ' '
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400988
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400988], 'f')
        self.assertEqual(mem[0x400989], '\x0f')
        self.assertEqual(mem[0x40098a], ':')
        self.assertEqual(mem[0x40098b], '`')
        self.assertEqual(mem[0x40098c], '\xca')
        self.assertEqual(mem[0x40098d], ' ')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196750L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_48(self):
        ''' Instruction PCMPESTRM_48
            Groups: sse42
            0x400a5a:	pcmpestrm	xmm1, xmm2, 0x65
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a5a] = 'f'
        mem[0x00400a5b] = '\x0f'
        mem[0x00400a5c] = ':'
        mem[0x00400a5d] = '`'
        mem[0x00400a5e] = '\xca'
        mem[0x00400a5f] = 'e'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400a5a
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a5a], 'f')
        self.assertEqual(mem[0x400a5b], '\x0f')
        self.assertEqual(mem[0x400a5c], ':')
        self.assertEqual(mem[0x400a5d], '`')
        self.assertEqual(mem[0x400a5e], '\xca')
        self.assertEqual(mem[0x400a5f], 'e')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196960L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_49(self):
        ''' Instruction PCMPESTRM_49
            Groups: sse42
            0x40096a:	pcmpestrm	xmm1, xmm2, 0x15
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040096a] = 'f'
        mem[0x0040096b] = '\x0f'
        mem[0x0040096c] = ':'
        mem[0x0040096d] = '`'
        mem[0x0040096e] = '\xca'
        mem[0x0040096f] = '\x15'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x40096a
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x40096a], 'f')
        self.assertEqual(mem[0x40096b], '\x0f')
        self.assertEqual(mem[0x40096c], ':')
        self.assertEqual(mem[0x40096d], '`')
        self.assertEqual(mem[0x40096e], '\xca')
        self.assertEqual(mem[0x40096f], '\x15')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196720L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_5(self):
        ''' Instruction PCMPESTRM_5
            Groups: sse42
            0x4009b2:	pcmpestrm	xmm1, xmm2, 0x2d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009b2] = 'f'
        mem[0x004009b3] = '\x0f'
        mem[0x004009b4] = ':'
        mem[0x004009b5] = '`'
        mem[0x004009b6] = '\xca'
        mem[0x004009b7] = '-'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x4009b2
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009b2], 'f')
        self.assertEqual(mem[0x4009b3], '\x0f')
        self.assertEqual(mem[0x4009b4], ':')
        self.assertEqual(mem[0x4009b5], '`')
        self.assertEqual(mem[0x4009b6], '\xca')
        self.assertEqual(mem[0x4009b7], '-')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196792L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_50(self):
        ''' Instruction PCMPESTRM_50
            Groups: sse42
            0x400a60:	pcmpestrm	xmm1, xmm2, 0x68
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a60] = 'f'
        mem[0x00400a61] = '\x0f'
        mem[0x00400a62] = ':'
        mem[0x00400a63] = '`'
        mem[0x00400a64] = '\xca'
        mem[0x00400a65] = 'h'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400a60
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a60], 'f')
        self.assertEqual(mem[0x400a61], '\x0f')
        self.assertEqual(mem[0x400a62], ':')
        self.assertEqual(mem[0x400a63], '`')
        self.assertEqual(mem[0x400a64], '\xca')
        self.assertEqual(mem[0x400a65], 'h')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196966L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_51(self):
        ''' Instruction PCMPESTRM_51
            Groups: sse42
            0x4009be:	pcmpestrm	xmm1, xmm2, 0x31
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009c0] = ':'
        mem[0x004009c1] = '`'
        mem[0x004009c2] = '\xca'
        mem[0x004009c3] = '1'
        mem[0x004009be] = 'f'
        mem[0x004009bf] = '\x0f'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x4009be
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009c0], ':')
        self.assertEqual(mem[0x4009c1], '`')
        self.assertEqual(mem[0x4009c2], '\xca')
        self.assertEqual(mem[0x4009c3], '1')
        self.assertEqual(mem[0x4009be], 'f')
        self.assertEqual(mem[0x4009bf], '\x0f')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196804L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_52(self):
        ''' Instruction PCMPESTRM_52
            Groups: sse42
            0x4009e2:	pcmpestrm	xmm1, xmm2, 0x3d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009e2] = 'f'
        mem[0x004009e3] = '\x0f'
        mem[0x004009e4] = ':'
        mem[0x004009e5] = '`'
        mem[0x004009e6] = '\xca'
        mem[0x004009e7] = '='
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x4009e2
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009e2], 'f')
        self.assertEqual(mem[0x4009e3], '\x0f')
        self.assertEqual(mem[0x4009e4], ':')
        self.assertEqual(mem[0x4009e5], '`')
        self.assertEqual(mem[0x4009e6], '\xca')
        self.assertEqual(mem[0x4009e7], '=')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196840L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_53(self):
        ''' Instruction PCMPESTRM_53
            Groups: sse42
            0x4009d6:	pcmpestrm	xmm1, xmm2, 0x39
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009d6] = 'f'
        mem[0x004009d7] = '\x0f'
        mem[0x004009d8] = ':'
        mem[0x004009d9] = '`'
        mem[0x004009da] = '\xca'
        mem[0x004009db] = '9'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x4009d6
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009d6], 'f')
        self.assertEqual(mem[0x4009d7], '\x0f')
        self.assertEqual(mem[0x4009d8], ':')
        self.assertEqual(mem[0x4009d9], '`')
        self.assertEqual(mem[0x4009da], '\xca')
        self.assertEqual(mem[0x4009db], '9')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196828L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_54(self):
        ''' Instruction PCMPESTRM_54
            Groups: sse42
            0x400a6c:	pcmpestrm	xmm1, xmm2, 0x6c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a6c] = 'f'
        mem[0x00400a6d] = '\x0f'
        mem[0x00400a6e] = ':'
        mem[0x00400a6f] = '`'
        mem[0x00400a70] = '\xca'
        mem[0x00400a71] = 'l'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = False
        cpu.RIP = 0x400a6c
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a6c], 'f')
        self.assertEqual(mem[0x400a6d], '\x0f')
        self.assertEqual(mem[0x400a6e], ':')
        self.assertEqual(mem[0x400a6f], '`')
        self.assertEqual(mem[0x400a70], '\xca')
        self.assertEqual(mem[0x400a71], 'l')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196978L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_55(self):
        ''' Instruction PCMPESTRM_55
            Groups: sse42
            0x4009c4:	pcmpestrm	xmm1, xmm2, 0x34
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009c4] = 'f'
        mem[0x004009c5] = '\x0f'
        mem[0x004009c6] = ':'
        mem[0x004009c7] = '`'
        mem[0x004009c8] = '\xca'
        mem[0x004009c9] = '4'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x4009c4
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009c4], 'f')
        self.assertEqual(mem[0x4009c5], '\x0f')
        self.assertEqual(mem[0x4009c6], ':')
        self.assertEqual(mem[0x4009c7], '`')
        self.assertEqual(mem[0x4009c8], '\xca')
        self.assertEqual(mem[0x4009c9], '4')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196810L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_56(self):
        ''' Instruction PCMPESTRM_56
            Groups: sse42
            0x400a00:	pcmpestrm	xmm1, xmm2, 0x48
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a00] = 'f'
        mem[0x00400a01] = '\x0f'
        mem[0x00400a02] = ':'
        mem[0x00400a03] = '`'
        mem[0x00400a04] = '\xca'
        mem[0x00400a05] = 'H'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400a00
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a00], 'f')
        self.assertEqual(mem[0x400a01], '\x0f')
        self.assertEqual(mem[0x400a02], ':')
        self.assertEqual(mem[0x400a03], '`')
        self.assertEqual(mem[0x400a04], '\xca')
        self.assertEqual(mem[0x400a05], 'H')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196870L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_57(self):
        ''' Instruction PCMPESTRM_57
            Groups: sse42
            0x4009e8:	pcmpestrm	xmm1, xmm2, 0x40
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009e8] = 'f'
        mem[0x004009e9] = '\x0f'
        mem[0x004009ea] = ':'
        mem[0x004009eb] = '`'
        mem[0x004009ec] = '\xca'
        mem[0x004009ed] = '@'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x4009e8
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009e8], 'f')
        self.assertEqual(mem[0x4009e9], '\x0f')
        self.assertEqual(mem[0x4009ea], ':')
        self.assertEqual(mem[0x4009eb], '`')
        self.assertEqual(mem[0x4009ec], '\xca')
        self.assertEqual(mem[0x4009ed], '@')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196846L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_58(self):
        ''' Instruction PCMPESTRM_58
            Groups: sse42
            0x4009b8:	pcmpestrm	xmm1, xmm2, 0x30
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009b8] = 'f'
        mem[0x004009b9] = '\x0f'
        mem[0x004009ba] = ':'
        mem[0x004009bb] = '`'
        mem[0x004009bc] = '\xca'
        mem[0x004009bd] = '0'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x4009b8
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009b8], 'f')
        self.assertEqual(mem[0x4009b9], '\x0f')
        self.assertEqual(mem[0x4009ba], ':')
        self.assertEqual(mem[0x4009bb], '`')
        self.assertEqual(mem[0x4009bc], '\xca')
        self.assertEqual(mem[0x4009bd], '0')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196798L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_59(self):
        ''' Instruction PCMPESTRM_59
            Groups: sse42
            0x4009ee:	pcmpestrm	xmm1, xmm2, 0x41
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009ee] = 'f'
        mem[0x004009ef] = '\x0f'
        mem[0x004009f0] = ':'
        mem[0x004009f1] = '`'
        mem[0x004009f2] = '\xca'
        mem[0x004009f3] = 'A'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x4009ee
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009ee], 'f')
        self.assertEqual(mem[0x4009ef], '\x0f')
        self.assertEqual(mem[0x4009f0], ':')
        self.assertEqual(mem[0x4009f1], '`')
        self.assertEqual(mem[0x4009f2], '\xca')
        self.assertEqual(mem[0x4009f3], 'A')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196852L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_6(self):
        ''' Instruction PCMPESTRM_6
            Groups: sse42
            0x4009a0:	pcmpestrm	xmm1, xmm2, 0x28
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009a0] = 'f'
        mem[0x004009a1] = '\x0f'
        mem[0x004009a2] = ':'
        mem[0x004009a3] = '`'
        mem[0x004009a4] = '\xca'
        mem[0x004009a5] = '('
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x4009a0
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009a0], 'f')
        self.assertEqual(mem[0x4009a1], '\x0f')
        self.assertEqual(mem[0x4009a2], ':')
        self.assertEqual(mem[0x4009a3], '`')
        self.assertEqual(mem[0x4009a4], '\xca')
        self.assertEqual(mem[0x4009a5], '(')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196774L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_60(self):
        ''' Instruction PCMPESTRM_60
            Groups: sse42
            0x400970:	pcmpestrm	xmm1, xmm2, 0x18
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400970] = 'f'
        mem[0x00400971] = '\x0f'
        mem[0x00400972] = ':'
        mem[0x00400973] = '`'
        mem[0x00400974] = '\xca'
        mem[0x00400975] = '\x18'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400970
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400970], 'f')
        self.assertEqual(mem[0x400971], '\x0f')
        self.assertEqual(mem[0x400972], ':')
        self.assertEqual(mem[0x400973], '`')
        self.assertEqual(mem[0x400974], '\xca')
        self.assertEqual(mem[0x400975], '\x18')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196726L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_61(self):
        ''' Instruction PCMPESTRM_61
            Groups: sse42
            0x400a78:	pcmpestrm	xmm1, xmm2, 0x70
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a78] = 'f'
        mem[0x00400a79] = '\x0f'
        mem[0x00400a7a] = ':'
        mem[0x00400a7b] = '`'
        mem[0x00400a7c] = '\xca'
        mem[0x00400a7d] = 'p'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400a78
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a78], 'f')
        self.assertEqual(mem[0x400a79], '\x0f')
        self.assertEqual(mem[0x400a7a], ':')
        self.assertEqual(mem[0x400a7b], '`')
        self.assertEqual(mem[0x400a7c], '\xca')
        self.assertEqual(mem[0x400a7d], 'p')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196990L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_62(self):
        ''' Instruction PCMPESTRM_62
            Groups: sse42
            0x400a2a:	pcmpestrm	xmm1, xmm2, 0x55
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a2a] = 'f'
        mem[0x00400a2b] = '\x0f'
        mem[0x00400a2c] = ':'
        mem[0x00400a2d] = '`'
        mem[0x00400a2e] = '\xca'
        mem[0x00400a2f] = 'U'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a2a
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a2a], 'f')
        self.assertEqual(mem[0x400a2b], '\x0f')
        self.assertEqual(mem[0x400a2c], ':')
        self.assertEqual(mem[0x400a2d], '`')
        self.assertEqual(mem[0x400a2e], '\xca')
        self.assertEqual(mem[0x400a2f], 'U')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196912L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_63(self):
        ''' Instruction PCMPESTRM_63
            Groups: sse42
            0x400a42:	pcmpestrm	xmm1, xmm2, 0x5d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a42] = 'f'
        mem[0x00400a43] = '\x0f'
        mem[0x00400a44] = ':'
        mem[0x00400a45] = '`'
        mem[0x00400a46] = '\xca'
        mem[0x00400a47] = ']'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400a42
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a42], 'f')
        self.assertEqual(mem[0x400a43], '\x0f')
        self.assertEqual(mem[0x400a44], ':')
        self.assertEqual(mem[0x400a45], '`')
        self.assertEqual(mem[0x400a46], '\xca')
        self.assertEqual(mem[0x400a47], ']')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196936L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_64(self):
        ''' Instruction PCMPESTRM_64
            Groups: sse42
            0x400a4e:	pcmpestrm	xmm1, xmm2, 0x61
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400a4e] = 'f'
        mem[0x00400a4f] = '\x0f'
        mem[0x00400a50] = ':'
        mem[0x00400a51] = '`'
        mem[0x00400a52] = '\xca'
        mem[0x00400a53] = 'a'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x400a4e
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400a4e], 'f')
        self.assertEqual(mem[0x400a4f], '\x0f')
        self.assertEqual(mem[0x400a50], ':')
        self.assertEqual(mem[0x400a51], '`')
        self.assertEqual(mem[0x400a52], '\xca')
        self.assertEqual(mem[0x400a53], 'a')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196948L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_7(self):
        ''' Instruction PCMPESTRM_7
            Groups: sse42
            0x4009dc:	pcmpestrm	xmm1, xmm2, 0x3c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009e0] = '\xca'
        mem[0x004009e1] = '<'
        mem[0x004009dc] = 'f'
        mem[0x004009dd] = '\x0f'
        mem[0x004009de] = ':'
        mem[0x004009df] = '`'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x4009dc
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009e0], '\xca')
        self.assertEqual(mem[0x4009e1], '<')
        self.assertEqual(mem[0x4009dc], 'f')
        self.assertEqual(mem[0x4009dd], '\x0f')
        self.assertEqual(mem[0x4009de], ':')
        self.assertEqual(mem[0x4009df], '`')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196834L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_8(self):
        ''' Instruction PCMPESTRM_8
            Groups: sse42
            0x4009fa:	pcmpestrm	xmm1, xmm2, 0x45
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004009fa] = 'f'
        mem[0x004009fb] = '\x0f'
        mem[0x004009fc] = ':'
        mem[0x004009fd] = '`'
        mem[0x004009fe] = '\xca'
        mem[0x004009ff] = 'E'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.OF = False
        cpu.RIP = 0x4009fa
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x4009fa], 'f')
        self.assertEqual(mem[0x4009fb], '\x0f')
        self.assertEqual(mem[0x4009fc], ':')
        self.assertEqual(mem[0x4009fd], '`')
        self.assertEqual(mem[0x4009fe], '\xca')
        self.assertEqual(mem[0x4009ff], 'E')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.RIP, 4196864L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPESTRM_9(self):
        ''' Instruction PCMPESTRM_9
            Groups: sse42
            0x400982:	pcmpestrm	xmm1, xmm2, 0x1d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400982] = 'f'
        mem[0x00400983] = '\x0f'
        mem[0x00400984] = ':'
        mem[0x00400985] = '`'
        mem[0x00400986] = '\xca'
        mem[0x00400987] = '\x1d'
        cpu.AF = False
        cpu.ZF = True
        cpu.CF = True
        cpu.OF = True
        cpu.RIP = 0x400982
        cpu.XMM2 = 0x363534333231
        cpu.EAX = 0x6
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.EDX = 0x7
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400982], 'f')
        self.assertEqual(mem[0x400983], '\x0f')
        self.assertEqual(mem[0x400984], ':')
        self.assertEqual(mem[0x400985], '`')
        self.assertEqual(mem[0x400986], '\xca')
        self.assertEqual(mem[0x400987], '\x1d')
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.RIP, 4196744L)
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.EAX, 6L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.EDX, 7L)
        self.assertEqual(cpu.SF, True)

    def test_PCMPISTRI_1(self):
        ''' Instruction PCMPISTRI_1
            Groups: sse42
            0x400746:	pcmpistri	xmm1, xmm2, 0x6d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400746] = 'f'
        mem[0x00400747] = '\x0f'
        mem[0x00400748] = ':'
        mem[0x00400749] = 'c'
        mem[0x0040074a] = '\xca'
        mem[0x0040074b] = 'm'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = True
        cpu.RIP = 0x400746
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400746], 'f')
        self.assertEqual(mem[0x400747], '\x0f')
        self.assertEqual(mem[0x400748], ':')
        self.assertEqual(mem[0x400749], 'c')
        self.assertEqual(mem[0x40074a], '\xca')
        self.assertEqual(mem[0x40074b], 'm')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 4L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196172L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_10(self):
        ''' Instruction PCMPISTRI_10
            Groups: sse42
            0x400650:	pcmpistri	xmm1, xmm2, 0x1c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400650] = 'f'
        mem[0x00400651] = '\x0f'
        mem[0x00400652] = ':'
        mem[0x00400653] = 'c'
        mem[0x00400654] = '\xca'
        mem[0x00400655] = '\x1c'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = False
        cpu.RIP = 0x400650
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400650], 'f')
        self.assertEqual(mem[0x400651], '\x0f')
        self.assertEqual(mem[0x400652], ':')
        self.assertEqual(mem[0x400653], 'c')
        self.assertEqual(mem[0x400654], '\xca')
        self.assertEqual(mem[0x400655], '\x1c')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 1L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195926L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_11(self):
        ''' Instruction PCMPISTRI_11
            Groups: sse42
            0x400668:	pcmpistri	xmm1, xmm2, 0x24
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400668] = 'f'
        mem[0x00400669] = '\x0f'
        mem[0x0040066a] = ':'
        mem[0x0040066b] = 'c'
        mem[0x0040066c] = '\xca'
        mem[0x0040066d] = '$'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x400668
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400668], 'f')
        self.assertEqual(mem[0x400669], '\x0f')
        self.assertEqual(mem[0x40066a], ':')
        self.assertEqual(mem[0x40066b], 'c')
        self.assertEqual(mem[0x40066c], '\xca')
        self.assertEqual(mem[0x40066d], '$')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195950L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_12(self):
        ''' Instruction PCMPISTRI_12
            Groups: sse42
            0x400698:	pcmpistri	xmm1, xmm2, 0x34
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400698] = 'f'
        mem[0x00400699] = '\x0f'
        mem[0x0040069a] = ':'
        mem[0x0040069b] = 'c'
        mem[0x0040069c] = '\xca'
        mem[0x0040069d] = '4'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = False
        cpu.RIP = 0x400698
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400698], 'f')
        self.assertEqual(mem[0x400699], '\x0f')
        self.assertEqual(mem[0x40069a], ':')
        self.assertEqual(mem[0x40069b], 'c')
        self.assertEqual(mem[0x40069c], '\xca')
        self.assertEqual(mem[0x40069d], '4')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 16L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4195998L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_13(self):
        ''' Instruction PCMPISTRI_13
            Groups: sse42
            0x4006c8:	pcmpistri	xmm1, xmm2, 0x44
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006c8] = 'f'
        mem[0x004006c9] = '\x0f'
        mem[0x004006ca] = ':'
        mem[0x004006cb] = 'c'
        mem[0x004006cc] = '\xca'
        mem[0x004006cd] = 'D'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x7
        cpu.CF = True
        cpu.RIP = 0x4006c8
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006c8], 'f')
        self.assertEqual(mem[0x4006c9], '\x0f')
        self.assertEqual(mem[0x4006ca], ':')
        self.assertEqual(mem[0x4006cb], 'c')
        self.assertEqual(mem[0x4006cc], '\xca')
        self.assertEqual(mem[0x4006cd], 'D')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 15L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196046L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_14(self):
        ''' Instruction PCMPISTRI_14
            Groups: sse42
            0x4006bc:	pcmpistri	xmm1, xmm2, 0x40
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006c0] = '\xca'
        mem[0x004006c1] = '@'
        mem[0x004006bc] = 'f'
        mem[0x004006bd] = '\x0f'
        mem[0x004006be] = ':'
        mem[0x004006bf] = 'c'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x1
        cpu.CF = True
        cpu.RIP = 0x4006bc
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006c0], '\xca')
        self.assertEqual(mem[0x4006c1], '@')
        self.assertEqual(mem[0x4006bc], 'f')
        self.assertEqual(mem[0x4006bd], '\x0f')
        self.assertEqual(mem[0x4006be], ':')
        self.assertEqual(mem[0x4006bf], 'c')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 15L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196034L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_15(self):
        ''' Instruction PCMPISTRI_15
            Groups: sse42
            0x40068c:	pcmpistri	xmm1, xmm2, 0x30
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040068c] = 'f'
        mem[0x0040068d] = '\x0f'
        mem[0x0040068e] = ':'
        mem[0x0040068f] = 'c'
        mem[0x00400690] = '\xca'
        mem[0x00400691] = '0'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x40068c
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40068c], 'f')
        self.assertEqual(mem[0x40068d], '\x0f')
        self.assertEqual(mem[0x40068e], ':')
        self.assertEqual(mem[0x40068f], 'c')
        self.assertEqual(mem[0x400690], '\xca')
        self.assertEqual(mem[0x400691], '0')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 16L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4195986L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_16(self):
        ''' Instruction PCMPISTRI_16
            Groups: sse42
            0x40062c:	pcmpistri	xmm1, xmm2, 0x10
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040062c] = 'f'
        mem[0x0040062d] = '\x0f'
        mem[0x0040062e] = ':'
        mem[0x0040062f] = 'c'
        mem[0x00400630] = '\xca'
        mem[0x00400631] = '\x10'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x40062c
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40062c], 'f')
        self.assertEqual(mem[0x40062d], '\x0f')
        self.assertEqual(mem[0x40062e], ':')
        self.assertEqual(mem[0x40062f], 'c')
        self.assertEqual(mem[0x400630], '\xca')
        self.assertEqual(mem[0x400631], '\x10')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 16L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4195890L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_17(self):
        ''' Instruction PCMPISTRI_17
            Groups: sse42
            0x400764:	pcmpistri	xmm1, xmm2, 0x78
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400764] = 'f'
        mem[0x00400765] = '\x0f'
        mem[0x00400766] = ':'
        mem[0x00400767] = 'c'
        mem[0x00400768] = '\xca'
        mem[0x00400769] = 'x'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = False
        cpu.RIP = 0x400764
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400764], 'f')
        self.assertEqual(mem[0x400765], '\x0f')
        self.assertEqual(mem[0x400766], ':')
        self.assertEqual(mem[0x400767], 'c')
        self.assertEqual(mem[0x400768], '\xca')
        self.assertEqual(mem[0x400769], 'x')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 16L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196202L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_18(self):
        ''' Instruction PCMPISTRI_18
            Groups: sse42
            0x4005fc:	pcmpistri	xmm1, xmm2, 0
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400600] = '\xca'
        mem[0x00400601] = '\x00'
        mem[0x004005fc] = 'f'
        mem[0x004005fd] = '\x0f'
        mem[0x004005fe] = ':'
        mem[0x004005ff] = 'c'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x82
        cpu.CF = True
        cpu.RIP = 0x4005fc
        cpu.SF = True
        cpu.execute()
    
        self.assertEqual(mem[0x400600], '\xca')
        self.assertEqual(mem[0x400601], '\x00')
        self.assertEqual(mem[0x4005fc], 'f')
        self.assertEqual(mem[0x4005fd], '\x0f')
        self.assertEqual(mem[0x4005fe], ':')
        self.assertEqual(mem[0x4005ff], 'c')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195842L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_19(self):
        ''' Instruction PCMPISTRI_19
            Groups: sse42
            0x4006ce:	pcmpistri	xmm1, xmm2, 0x45
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006ce] = 'f'
        mem[0x004006cf] = '\x0f'
        mem[0x004006d0] = ':'
        mem[0x004006d1] = 'c'
        mem[0x004006d2] = '\xca'
        mem[0x004006d3] = 'E'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0xf
        cpu.CF = True
        cpu.RIP = 0x4006ce
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006ce], 'f')
        self.assertEqual(mem[0x4006cf], '\x0f')
        self.assertEqual(mem[0x4006d0], ':')
        self.assertEqual(mem[0x4006d1], 'c')
        self.assertEqual(mem[0x4006d2], '\xca')
        self.assertEqual(mem[0x4006d3], 'E')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 7L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196052L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_2(self):
        ''' Instruction PCMPISTRI_2
            Groups: sse42
            0x400704:	pcmpistri	xmm1, xmm2, 0x58
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400704] = 'f'
        mem[0x00400705] = '\x0f'
        mem[0x00400706] = ':'
        mem[0x00400707] = 'c'
        mem[0x00400708] = '\xca'
        mem[0x00400709] = 'X'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = False
        cpu.RIP = 0x400704
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400704], 'f')
        self.assertEqual(mem[0x400705], '\x0f')
        self.assertEqual(mem[0x400706], ':')
        self.assertEqual(mem[0x400707], 'c')
        self.assertEqual(mem[0x400708], '\xca')
        self.assertEqual(mem[0x400709], 'X')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 16L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196106L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_20(self):
        ''' Instruction PCMPISTRI_20
            Groups: sse42
            0x4006f8:	pcmpistri	xmm1, xmm2, 0x54
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006f8] = 'f'
        mem[0x004006f9] = '\x0f'
        mem[0x004006fa] = ':'
        mem[0x004006fb] = 'c'
        mem[0x004006fc] = '\xca'
        mem[0x004006fd] = 'T'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = False
        cpu.RIP = 0x4006f8
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006f8], 'f')
        self.assertEqual(mem[0x4006f9], '\x0f')
        self.assertEqual(mem[0x4006fa], ':')
        self.assertEqual(mem[0x4006fb], 'c')
        self.assertEqual(mem[0x4006fc], '\xca')
        self.assertEqual(mem[0x4006fd], 'T')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 16L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196094L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_21(self):
        ''' Instruction PCMPISTRI_21
            Groups: sse42
            0x4006c2:	pcmpistri	xmm1, xmm2, 0x41
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006c2] = 'f'
        mem[0x004006c3] = '\x0f'
        mem[0x004006c4] = ':'
        mem[0x004006c5] = 'c'
        mem[0x004006c6] = '\xca'
        mem[0x004006c7] = 'A'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0xf
        cpu.CF = True
        cpu.RIP = 0x4006c2
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006c2], 'f')
        self.assertEqual(mem[0x4006c3], '\x0f')
        self.assertEqual(mem[0x4006c4], ':')
        self.assertEqual(mem[0x4006c5], 'c')
        self.assertEqual(mem[0x4006c6], '\xca')
        self.assertEqual(mem[0x4006c7], 'A')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 7L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196040L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_22(self):
        ''' Instruction PCMPISTRI_22
            Groups: sse42
            0x40069e:	pcmpistri	xmm1, xmm2, 0x35
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006a0] = ':'
        mem[0x004006a1] = 'c'
        mem[0x004006a2] = '\xca'
        mem[0x004006a3] = '5'
        mem[0x0040069e] = 'f'
        mem[0x0040069f] = '\x0f'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x10
        cpu.CF = False
        cpu.RIP = 0x40069e
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006a0], ':')
        self.assertEqual(mem[0x4006a1], 'c')
        self.assertEqual(mem[0x4006a2], '\xca')
        self.assertEqual(mem[0x4006a3], '5')
        self.assertEqual(mem[0x40069e], 'f')
        self.assertEqual(mem[0x40069f], '\x0f')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196004L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_23(self):
        ''' Instruction PCMPISTRI_23
            Groups: sse42
            0x4006b6:	pcmpistri	xmm1, xmm2, 0x3d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006b6] = 'f'
        mem[0x004006b7] = '\x0f'
        mem[0x004006b8] = ':'
        mem[0x004006b9] = 'c'
        mem[0x004006ba] = '\xca'
        mem[0x004006bb] = '='
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x1
        cpu.CF = True
        cpu.RIP = 0x4006b6
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006b6], 'f')
        self.assertEqual(mem[0x4006b7], '\x0f')
        self.assertEqual(mem[0x4006b8], ':')
        self.assertEqual(mem[0x4006b9], 'c')
        self.assertEqual(mem[0x4006ba], '\xca')
        self.assertEqual(mem[0x4006bb], '=')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 1L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196028L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_24(self):
        ''' Instruction PCMPISTRI_24
            Groups: sse42
            0x400620:	pcmpistri	xmm1, xmm2, 0xc
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400620] = 'f'
        mem[0x00400621] = '\x0f'
        mem[0x00400622] = ':'
        mem[0x00400623] = 'c'
        mem[0x00400624] = '\xca'
        mem[0x00400625] = '\x0c'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x400620
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400620], 'f')
        self.assertEqual(mem[0x400621], '\x0f')
        self.assertEqual(mem[0x400622], ':')
        self.assertEqual(mem[0x400623], 'c')
        self.assertEqual(mem[0x400624], '\xca')
        self.assertEqual(mem[0x400625], '\x0c')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195878L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_25(self):
        ''' Instruction PCMPISTRI_25
            Groups: sse42
            0x400710:	pcmpistri	xmm1, xmm2, 0x5c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400710] = 'f'
        mem[0x00400711] = '\x0f'
        mem[0x00400712] = ':'
        mem[0x00400713] = 'c'
        mem[0x00400714] = '\xca'
        mem[0x00400715] = '\\'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = False
        cpu.RIP = 0x400710
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400710], 'f')
        self.assertEqual(mem[0x400711], '\x0f')
        self.assertEqual(mem[0x400712], ':')
        self.assertEqual(mem[0x400713], 'c')
        self.assertEqual(mem[0x400714], '\xca')
        self.assertEqual(mem[0x400715], '\\')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 15L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196118L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_26(self):
        ''' Instruction PCMPISTRI_26
            Groups: sse42
            0x4006b0:	pcmpistri	xmm1, xmm2, 0x3c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006b0] = 'f'
        mem[0x004006b1] = '\x0f'
        mem[0x004006b2] = ':'
        mem[0x004006b3] = 'c'
        mem[0x004006b4] = '\xca'
        mem[0x004006b5] = '<'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = False
        cpu.RIP = 0x4006b0
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006b0], 'f')
        self.assertEqual(mem[0x4006b1], '\x0f')
        self.assertEqual(mem[0x4006b2], ':')
        self.assertEqual(mem[0x4006b3], 'c')
        self.assertEqual(mem[0x4006b4], '\xca')
        self.assertEqual(mem[0x4006b5], '<')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 1L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196022L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_27(self):
        ''' Instruction PCMPISTRI_27
            Groups: sse42
            0x400740:	pcmpistri	xmm1, xmm2, 0x6c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400740] = 'f'
        mem[0x00400741] = '\x0f'
        mem[0x00400742] = ':'
        mem[0x00400743] = 'c'
        mem[0x00400744] = '\xca'
        mem[0x00400745] = 'l'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x7
        cpu.CF = True
        cpu.RIP = 0x400740
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400740], 'f')
        self.assertEqual(mem[0x400741], '\x0f')
        self.assertEqual(mem[0x400742], ':')
        self.assertEqual(mem[0x400743], 'c')
        self.assertEqual(mem[0x400744], '\xca')
        self.assertEqual(mem[0x400745], 'l')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196166L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_28(self):
        ''' Instruction PCMPISTRI_28
            Groups: sse42
            0x400692:	pcmpistri	xmm1, xmm2, 0x31
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400692] = 'f'
        mem[0x00400693] = '\x0f'
        mem[0x00400694] = ':'
        mem[0x00400695] = 'c'
        mem[0x00400696] = '\xca'
        mem[0x00400697] = '1'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x10
        cpu.CF = False
        cpu.RIP = 0x400692
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400692], 'f')
        self.assertEqual(mem[0x400693], '\x0f')
        self.assertEqual(mem[0x400694], ':')
        self.assertEqual(mem[0x400695], 'c')
        self.assertEqual(mem[0x400696], '\xca')
        self.assertEqual(mem[0x400697], '1')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4195992L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_29(self):
        ''' Instruction PCMPISTRI_29
            Groups: sse42
            0x40064a:	pcmpistri	xmm1, xmm2, 0x19
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040064a] = 'f'
        mem[0x0040064b] = '\x0f'
        mem[0x0040064c] = ':'
        mem[0x0040064d] = 'c'
        mem[0x0040064e] = '\xca'
        mem[0x0040064f] = '\x19'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x10
        cpu.CF = False
        cpu.RIP = 0x40064a
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40064a], 'f')
        self.assertEqual(mem[0x40064b], '\x0f')
        self.assertEqual(mem[0x40064c], ':')
        self.assertEqual(mem[0x40064d], 'c')
        self.assertEqual(mem[0x40064e], '\xca')
        self.assertEqual(mem[0x40064f], '\x19')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4195920L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_3(self):
        ''' Instruction PCMPISTRI_3
            Groups: sse42
            0x400728:	pcmpistri	xmm1, xmm2, 0x64
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400728] = 'f'
        mem[0x00400729] = '\x0f'
        mem[0x0040072a] = ':'
        mem[0x0040072b] = 'c'
        mem[0x0040072c] = '\xca'
        mem[0x0040072d] = 'd'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x7
        cpu.CF = True
        cpu.RIP = 0x400728
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400728], 'f')
        self.assertEqual(mem[0x400729], '\x0f')
        self.assertEqual(mem[0x40072a], ':')
        self.assertEqual(mem[0x40072b], 'c')
        self.assertEqual(mem[0x40072c], '\xca')
        self.assertEqual(mem[0x40072d], 'd')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 15L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196142L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_30(self):
        ''' Instruction PCMPISTRI_30
            Groups: sse42
            0x40077c:	pcmpistri	xmm1, xmmword ptr [rbp - 0xa0], 0x1b
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem.mmap(0x7fffffffe000, 0x1000, 'rwx')
        mem[0x00400780] = '\x8d'
        mem[0x00400781] = '`'
        mem[0x00400782] = '\xff'
        mem[0x00400783] = '\xff'
        mem[0x00400784] = '\xff'
        mem[0x00400785] = '\x1b'
        mem[0x7fffffffe190] = 'A'
        mem[0x7fffffffe191] = 'B'
        mem[0x7fffffffe192] = 'C'
        mem[0x7fffffffe193] = 'D'
        mem[0x7fffffffe194] = 'E'
        mem[0x7fffffffe195] = 'F'
        mem[0x7fffffffe196] = 'G'
        mem[0x7fffffffe197] = 'H'
        mem[0x7fffffffe198] = 'A'
        mem[0x7fffffffe199] = 'B'
        mem[0x7fffffffe19a] = 'C'
        mem[0x7fffffffe19b] = 'D'
        mem[0x7fffffffe19c] = 'E'
        mem[0x7fffffffe19d] = 'F'
        mem[0x7fffffffe19e] = 'G'
        mem[0x7fffffffe19f] = 'H'
        mem[0x0040077c] = 'f'
        mem[0x0040077d] = '\x0f'
        mem[0x0040077e] = ':'
        mem[0x0040077f] = 'c'
        cpu.SF = False
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x7
        cpu.CF = True
        cpu.RIP = 0x40077c
        cpu.RBP = 0x7fffffffe230
        cpu.execute()
    
        self.assertEqual(mem[0x400780], '\x8d')
        self.assertEqual(mem[0x400781], '`')
        self.assertEqual(mem[0x400782], '\xff')
        self.assertEqual(mem[0x400783], '\xff')
        self.assertEqual(mem[0x400784], '\xff')
        self.assertEqual(mem[0x400785], '\x1b')
        self.assertEqual(mem[0x7fffffffe190], 'A')
        self.assertEqual(mem[0x7fffffffe191], 'B')
        self.assertEqual(mem[0x7fffffffe192], 'C')
        self.assertEqual(mem[0x7fffffffe193], 'D')
        self.assertEqual(mem[0x7fffffffe194], 'E')
        self.assertEqual(mem[0x7fffffffe195], 'F')
        self.assertEqual(mem[0x7fffffffe196], 'G')
        self.assertEqual(mem[0x7fffffffe197], 'H')
        self.assertEqual(mem[0x7fffffffe198], 'A')
        self.assertEqual(mem[0x7fffffffe199], 'B')
        self.assertEqual(mem[0x7fffffffe19a], 'C')
        self.assertEqual(mem[0x7fffffffe19b], 'D')
        self.assertEqual(mem[0x7fffffffe19c], 'E')
        self.assertEqual(mem[0x7fffffffe19d], 'F')
        self.assertEqual(mem[0x7fffffffe19e], 'G')
        self.assertEqual(mem[0x7fffffffe19f], 'H')
        self.assertEqual(mem[0x40077c], 'f')
        self.assertEqual(mem[0x40077d], '\x0f')
        self.assertEqual(mem[0x40077e], ':')
        self.assertEqual(mem[0x40077f], 'c')
        self.assertEqual(cpu.SF, False)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196230L)
        self.assertEqual(cpu.RBP, 140737488347696L)

    def test_PCMPISTRI_31(self):
        ''' Instruction PCMPISTRI_31
            Groups: sse42
            0x400626:	pcmpistri	xmm1, xmm2, 0xd
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400626] = 'f'
        mem[0x00400627] = '\x0f'
        mem[0x00400628] = ':'
        mem[0x00400629] = 'c'
        mem[0x0040062a] = '\xca'
        mem[0x0040062b] = '\r'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x400626
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400626], 'f')
        self.assertEqual(mem[0x400627], '\x0f')
        self.assertEqual(mem[0x400628], ':')
        self.assertEqual(mem[0x400629], 'c')
        self.assertEqual(mem[0x40062a], '\xca')
        self.assertEqual(mem[0x40062b], '\r')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195884L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_32(self):
        ''' Instruction PCMPISTRI_32
            Groups: sse42
            0x4006d4:	pcmpistri	xmm1, xmm2, 0x48
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006d4] = 'f'
        mem[0x004006d5] = '\x0f'
        mem[0x004006d6] = ':'
        mem[0x004006d7] = 'c'
        mem[0x004006d8] = '\xca'
        mem[0x004006d9] = 'H'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x7
        cpu.CF = True
        cpu.RIP = 0x4006d4
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006d4], 'f')
        self.assertEqual(mem[0x4006d5], '\x0f')
        self.assertEqual(mem[0x4006d6], ':')
        self.assertEqual(mem[0x4006d7], 'c')
        self.assertEqual(mem[0x4006d8], '\xca')
        self.assertEqual(mem[0x4006d9], 'H')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 15L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196058L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_33(self):
        ''' Instruction PCMPISTRI_33
            Groups: sse42
            0x400686:	pcmpistri	xmm1, xmm2, 0x2d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400686] = 'f'
        mem[0x00400687] = '\x0f'
        mem[0x00400688] = ':'
        mem[0x00400689] = 'c'
        mem[0x0040068a] = '\xca'
        mem[0x0040068b] = '-'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x400686
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400686], 'f')
        self.assertEqual(mem[0x400687], '\x0f')
        self.assertEqual(mem[0x400688], ':')
        self.assertEqual(mem[0x400689], 'c')
        self.assertEqual(mem[0x40068a], '\xca')
        self.assertEqual(mem[0x40068b], '-')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195980L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_34(self):
        ''' Instruction PCMPISTRI_34
            Groups: sse42
            0x400770:	pcmpistri	xmm1, xmm2, 0x7c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400770] = 'f'
        mem[0x00400771] = '\x0f'
        mem[0x00400772] = ':'
        mem[0x00400773] = 'c'
        mem[0x00400774] = '\xca'
        mem[0x00400775] = '|'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = False
        cpu.RIP = 0x400770
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400770], 'f')
        self.assertEqual(mem[0x400771], '\x0f')
        self.assertEqual(mem[0x400772], ':')
        self.assertEqual(mem[0x400773], 'c')
        self.assertEqual(mem[0x400774], '\xca')
        self.assertEqual(mem[0x400775], '|')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 15L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196214L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_35(self):
        ''' Instruction PCMPISTRI_35
            Groups: sse42
            0x40071c:	pcmpistri	xmm1, xmm2, 0x60
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400720] = '\xca'
        mem[0x00400721] = '`'
        mem[0x0040071c] = 'f'
        mem[0x0040071d] = '\x0f'
        mem[0x0040071e] = ':'
        mem[0x0040071f] = 'c'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x7
        cpu.CF = True
        cpu.RIP = 0x40071c
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400720], '\xca')
        self.assertEqual(mem[0x400721], '`')
        self.assertEqual(mem[0x40071c], 'f')
        self.assertEqual(mem[0x40071d], '\x0f')
        self.assertEqual(mem[0x40071e], ':')
        self.assertEqual(mem[0x40071f], 'c')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 15L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196130L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_36(self):
        ''' Instruction PCMPISTRI_36
            Groups: sse42
            0x400776:	pcmpistri	xmm1, xmm2, 0x7d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400776] = 'f'
        mem[0x00400777] = '\x0f'
        mem[0x00400778] = ':'
        mem[0x00400779] = 'c'
        mem[0x0040077a] = '\xca'
        mem[0x0040077b] = '}'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0xf
        cpu.CF = True
        cpu.RIP = 0x400776
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400776], 'f')
        self.assertEqual(mem[0x400777], '\x0f')
        self.assertEqual(mem[0x400778], ':')
        self.assertEqual(mem[0x400779], 'c')
        self.assertEqual(mem[0x40077a], '\xca')
        self.assertEqual(mem[0x40077b], '}')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 7L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196220L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_37(self):
        ''' Instruction PCMPISTRI_37
            Groups: sse42
            0x400758:	pcmpistri	xmm1, xmm2, 0x74
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400758] = 'f'
        mem[0x00400759] = '\x0f'
        mem[0x0040075a] = ':'
        mem[0x0040075b] = 'c'
        mem[0x0040075c] = '\xca'
        mem[0x0040075d] = 't'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = False
        cpu.RIP = 0x400758
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400758], 'f')
        self.assertEqual(mem[0x400759], '\x0f')
        self.assertEqual(mem[0x40075a], ':')
        self.assertEqual(mem[0x40075b], 'c')
        self.assertEqual(mem[0x40075c], '\xca')
        self.assertEqual(mem[0x40075d], 't')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 16L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196190L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_38(self):
        ''' Instruction PCMPISTRI_38
            Groups: sse42
            0x400602:	pcmpistri	xmm1, xmm2, 1
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400602] = 'f'
        mem[0x00400603] = '\x0f'
        mem[0x00400604] = ':'
        mem[0x00400605] = 'c'
        mem[0x00400606] = '\xca'
        mem[0x00400607] = '\x01'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x400602
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400602], 'f')
        self.assertEqual(mem[0x400603], '\x0f')
        self.assertEqual(mem[0x400604], ':')
        self.assertEqual(mem[0x400605], 'c')
        self.assertEqual(mem[0x400606], '\xca')
        self.assertEqual(mem[0x400607], '\x01')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195848L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_39(self):
        ''' Instruction PCMPISTRI_39
            Groups: sse42
            0x400608:	pcmpistri	xmm1, xmm2, 4
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400608] = 'f'
        mem[0x00400609] = '\x0f'
        mem[0x0040060a] = ':'
        mem[0x0040060b] = 'c'
        mem[0x0040060c] = '\xca'
        mem[0x0040060d] = '\x04'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x400608
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400608], 'f')
        self.assertEqual(mem[0x400609], '\x0f')
        self.assertEqual(mem[0x40060a], ':')
        self.assertEqual(mem[0x40060b], 'c')
        self.assertEqual(mem[0x40060c], '\xca')
        self.assertEqual(mem[0x40060d], '\x04')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195854L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_4(self):
        ''' Instruction PCMPISTRI_4
            Groups: sse42
            0x400752:	pcmpistri	xmm1, xmm2, 0x71
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400752] = 'f'
        mem[0x00400753] = '\x0f'
        mem[0x00400754] = ':'
        mem[0x00400755] = 'c'
        mem[0x00400756] = '\xca'
        mem[0x00400757] = 'q'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x10
        cpu.CF = False
        cpu.RIP = 0x400752
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400752], 'f')
        self.assertEqual(mem[0x400753], '\x0f')
        self.assertEqual(mem[0x400754], ':')
        self.assertEqual(mem[0x400755], 'c')
        self.assertEqual(mem[0x400756], '\xca')
        self.assertEqual(mem[0x400757], 'q')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196184L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_40(self):
        ''' Instruction PCMPISTRI_40
            Groups: sse42
            0x400638:	pcmpistri	xmm1, xmm2, 0x14
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400638] = 'f'
        mem[0x00400639] = '\x0f'
        mem[0x0040063a] = ':'
        mem[0x0040063b] = 'c'
        mem[0x0040063c] = '\xca'
        mem[0x0040063d] = '\x14'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = False
        cpu.RIP = 0x400638
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400638], 'f')
        self.assertEqual(mem[0x400639], '\x0f')
        self.assertEqual(mem[0x40063a], ':')
        self.assertEqual(mem[0x40063b], 'c')
        self.assertEqual(mem[0x40063c], '\xca')
        self.assertEqual(mem[0x40063d], '\x14')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 16L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4195902L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_41(self):
        ''' Instruction PCMPISTRI_41
            Groups: sse42
            0x40074c:	pcmpistri	xmm1, xmm2, 0x70
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040074c] = 'f'
        mem[0x0040074d] = '\x0f'
        mem[0x0040074e] = ':'
        mem[0x0040074f] = 'c'
        mem[0x00400750] = '\xca'
        mem[0x00400751] = 'p'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x4
        cpu.CF = True
        cpu.RIP = 0x40074c
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40074c], 'f')
        self.assertEqual(mem[0x40074d], '\x0f')
        self.assertEqual(mem[0x40074e], ':')
        self.assertEqual(mem[0x40074f], 'c')
        self.assertEqual(mem[0x400750], '\xca')
        self.assertEqual(mem[0x400751], 'p')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 16L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196178L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_42(self):
        ''' Instruction PCMPISTRI_42
            Groups: sse42
            0x400734:	pcmpistri	xmm1, xmm2, 0x68
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400734] = 'f'
        mem[0x00400735] = '\x0f'
        mem[0x00400736] = ':'
        mem[0x00400737] = 'c'
        mem[0x00400738] = '\xca'
        mem[0x00400739] = 'h'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x7
        cpu.CF = True
        cpu.RIP = 0x400734
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400734], 'f')
        self.assertEqual(mem[0x400735], '\x0f')
        self.assertEqual(mem[0x400736], ':')
        self.assertEqual(mem[0x400737], 'c')
        self.assertEqual(mem[0x400738], '\xca')
        self.assertEqual(mem[0x400739], 'h')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 15L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196154L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_43(self):
        ''' Instruction PCMPISTRI_43
            Groups: sse42
            0x400644:	pcmpistri	xmm1, xmm2, 0x18
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400644] = 'f'
        mem[0x00400645] = '\x0f'
        mem[0x00400646] = ':'
        mem[0x00400647] = 'c'
        mem[0x00400648] = '\xca'
        mem[0x00400649] = '\x18'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = False
        cpu.RIP = 0x400644
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400644], 'f')
        self.assertEqual(mem[0x400645], '\x0f')
        self.assertEqual(mem[0x400646], ':')
        self.assertEqual(mem[0x400647], 'c')
        self.assertEqual(mem[0x400648], '\xca')
        self.assertEqual(mem[0x400649], '\x18')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 16L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4195914L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_44(self):
        ''' Instruction PCMPISTRI_44
            Groups: sse42
            0x40065c:	pcmpistri	xmm1, xmm2, 0x20
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400660] = '\xca'
        mem[0x00400661] = ' '
        mem[0x0040065c] = 'f'
        mem[0x0040065d] = '\x0f'
        mem[0x0040065e] = ':'
        mem[0x0040065f] = 'c'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x1
        cpu.CF = True
        cpu.RIP = 0x40065c
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400660], '\xca')
        self.assertEqual(mem[0x400661], ' ')
        self.assertEqual(mem[0x40065c], 'f')
        self.assertEqual(mem[0x40065d], '\x0f')
        self.assertEqual(mem[0x40065e], ':')
        self.assertEqual(mem[0x40065f], 'c')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195938L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_45(self):
        ''' Instruction PCMPISTRI_45
            Groups: sse42
            0x40061a:	pcmpistri	xmm1, xmm2, 9
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040061a] = 'f'
        mem[0x0040061b] = '\x0f'
        mem[0x0040061c] = ':'
        mem[0x0040061d] = 'c'
        mem[0x0040061e] = '\xca'
        mem[0x0040061f] = '\t'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x40061a
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40061a], 'f')
        self.assertEqual(mem[0x40061b], '\x0f')
        self.assertEqual(mem[0x40061c], ':')
        self.assertEqual(mem[0x40061d], 'c')
        self.assertEqual(mem[0x40061e], '\xca')
        self.assertEqual(mem[0x40061f], '\t')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195872L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_46(self):
        ''' Instruction PCMPISTRI_46
            Groups: sse42
            0x40073a:	pcmpistri	xmm1, xmm2, 0x69
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040073a] = 'f'
        mem[0x0040073b] = '\x0f'
        mem[0x0040073c] = ':'
        mem[0x0040073d] = 'c'
        mem[0x0040073e] = '\xca'
        mem[0x0040073f] = 'i'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0xf
        cpu.CF = True
        cpu.RIP = 0x40073a
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40073a], 'f')
        self.assertEqual(mem[0x40073b], '\x0f')
        self.assertEqual(mem[0x40073c], ':')
        self.assertEqual(mem[0x40073d], 'c')
        self.assertEqual(mem[0x40073e], '\xca')
        self.assertEqual(mem[0x40073f], 'i')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 7L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196160L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_47(self):
        ''' Instruction PCMPISTRI_47
            Groups: sse42
            0x40070a:	pcmpistri	xmm1, xmm2, 0x59
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040070a] = 'f'
        mem[0x0040070b] = '\x0f'
        mem[0x0040070c] = ':'
        mem[0x0040070d] = 'c'
        mem[0x0040070e] = '\xca'
        mem[0x0040070f] = 'Y'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x10
        cpu.CF = False
        cpu.RIP = 0x40070a
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40070a], 'f')
        self.assertEqual(mem[0x40070b], '\x0f')
        self.assertEqual(mem[0x40070c], ':')
        self.assertEqual(mem[0x40070d], 'c')
        self.assertEqual(mem[0x40070e], '\xca')
        self.assertEqual(mem[0x40070f], 'Y')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196112L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_48(self):
        ''' Instruction PCMPISTRI_48
            Groups: sse42
            0x4006aa:	pcmpistri	xmm1, xmm2, 0x39
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006aa] = 'f'
        mem[0x004006ab] = '\x0f'
        mem[0x004006ac] = ':'
        mem[0x004006ad] = 'c'
        mem[0x004006ae] = '\xca'
        mem[0x004006af] = '9'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x10
        cpu.CF = False
        cpu.RIP = 0x4006aa
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006aa], 'f')
        self.assertEqual(mem[0x4006ab], '\x0f')
        self.assertEqual(mem[0x4006ac], ':')
        self.assertEqual(mem[0x4006ad], 'c')
        self.assertEqual(mem[0x4006ae], '\xca')
        self.assertEqual(mem[0x4006af], '9')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196016L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_49(self):
        ''' Instruction PCMPISTRI_49
            Groups: sse42
            0x400716:	pcmpistri	xmm1, xmm2, 0x5d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400716] = 'f'
        mem[0x00400717] = '\x0f'
        mem[0x00400718] = ':'
        mem[0x00400719] = 'c'
        mem[0x0040071a] = '\xca'
        mem[0x0040071b] = ']'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0xf
        cpu.CF = True
        cpu.RIP = 0x400716
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400716], 'f')
        self.assertEqual(mem[0x400717], '\x0f')
        self.assertEqual(mem[0x400718], ':')
        self.assertEqual(mem[0x400719], 'c')
        self.assertEqual(mem[0x40071a], '\xca')
        self.assertEqual(mem[0x40071b], ']')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 7L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196124L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_5(self):
        ''' Instruction PCMPISTRI_5
            Groups: sse42
            0x40063e:	pcmpistri	xmm1, xmm2, 0x15
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400640] = ':'
        mem[0x00400641] = 'c'
        mem[0x00400642] = '\xca'
        mem[0x00400643] = '\x15'
        mem[0x0040063e] = 'f'
        mem[0x0040063f] = '\x0f'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x10
        cpu.CF = False
        cpu.RIP = 0x40063e
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400640], ':')
        self.assertEqual(mem[0x400641], 'c')
        self.assertEqual(mem[0x400642], '\xca')
        self.assertEqual(mem[0x400643], '\x15')
        self.assertEqual(mem[0x40063e], 'f')
        self.assertEqual(mem[0x40063f], '\x0f')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4195908L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_50(self):
        ''' Instruction PCMPISTRI_50
            Groups: sse42
            0x400656:	pcmpistri	xmm1, xmm2, 0x1d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400656] = 'f'
        mem[0x00400657] = '\x0f'
        mem[0x00400658] = ':'
        mem[0x00400659] = 'c'
        mem[0x0040065a] = '\xca'
        mem[0x0040065b] = '\x1d'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x1
        cpu.CF = True
        cpu.RIP = 0x400656
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400656], 'f')
        self.assertEqual(mem[0x400657], '\x0f')
        self.assertEqual(mem[0x400658], ':')
        self.assertEqual(mem[0x400659], 'c')
        self.assertEqual(mem[0x40065a], '\xca')
        self.assertEqual(mem[0x40065b], '\x1d')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 1L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195932L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_51(self):
        ''' Instruction PCMPISTRI_51
            Groups: sse42
            0x40072e:	pcmpistri	xmm1, xmm2, 0x65
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040072e] = 'f'
        mem[0x0040072f] = '\x0f'
        mem[0x00400730] = ':'
        mem[0x00400731] = 'c'
        mem[0x00400732] = '\xca'
        mem[0x00400733] = 'e'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0xf
        cpu.CF = True
        cpu.RIP = 0x40072e
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40072e], 'f')
        self.assertEqual(mem[0x40072f], '\x0f')
        self.assertEqual(mem[0x400730], ':')
        self.assertEqual(mem[0x400731], 'c')
        self.assertEqual(mem[0x400732], '\xca')
        self.assertEqual(mem[0x400733], 'e')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 7L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196148L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_52(self):
        ''' Instruction PCMPISTRI_52
            Groups: sse42
            0x400680:	pcmpistri	xmm1, xmm2, 0x2c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400680] = 'f'
        mem[0x00400681] = '\x0f'
        mem[0x00400682] = ':'
        mem[0x00400683] = 'c'
        mem[0x00400684] = '\xca'
        mem[0x00400685] = ','
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x400680
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400680], 'f')
        self.assertEqual(mem[0x400681], '\x0f')
        self.assertEqual(mem[0x400682], ':')
        self.assertEqual(mem[0x400683], 'c')
        self.assertEqual(mem[0x400684], '\xca')
        self.assertEqual(mem[0x400685], ',')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195974L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_53(self):
        ''' Instruction PCMPISTRI_53
            Groups: sse42
            0x400674:	pcmpistri	xmm1, xmm2, 0x28
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400674] = 'f'
        mem[0x00400675] = '\x0f'
        mem[0x00400676] = ':'
        mem[0x00400677] = 'c'
        mem[0x00400678] = '\xca'
        mem[0x00400679] = '('
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x400674
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400674], 'f')
        self.assertEqual(mem[0x400675], '\x0f')
        self.assertEqual(mem[0x400676], ':')
        self.assertEqual(mem[0x400677], 'c')
        self.assertEqual(mem[0x400678], '\xca')
        self.assertEqual(mem[0x400679], '(')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195962L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_54(self):
        ''' Instruction PCMPISTRI_54
            Groups: sse42
            0x40067a:	pcmpistri	xmm1, xmm2, 0x29
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040067a] = 'f'
        mem[0x0040067b] = '\x0f'
        mem[0x0040067c] = ':'
        mem[0x0040067d] = 'c'
        mem[0x0040067e] = '\xca'
        mem[0x0040067f] = ')'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x40067a
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40067a], 'f')
        self.assertEqual(mem[0x40067b], '\x0f')
        self.assertEqual(mem[0x40067c], ':')
        self.assertEqual(mem[0x40067d], 'c')
        self.assertEqual(mem[0x40067e], '\xca')
        self.assertEqual(mem[0x40067f], ')')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195968L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_55(self):
        ''' Instruction PCMPISTRI_55
            Groups: sse42
            0x400722:	pcmpistri	xmm1, xmm2, 0x61
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400722] = 'f'
        mem[0x00400723] = '\x0f'
        mem[0x00400724] = ':'
        mem[0x00400725] = 'c'
        mem[0x00400726] = '\xca'
        mem[0x00400727] = 'a'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0xf
        cpu.CF = True
        cpu.RIP = 0x400722
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400722], 'f')
        self.assertEqual(mem[0x400723], '\x0f')
        self.assertEqual(mem[0x400724], ':')
        self.assertEqual(mem[0x400725], 'c')
        self.assertEqual(mem[0x400726], '\xca')
        self.assertEqual(mem[0x400727], 'a')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 7L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196136L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_56(self):
        ''' Instruction PCMPISTRI_56
            Groups: sse42
            0x4006e6:	pcmpistri	xmm1, xmm2, 0x4d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006e6] = 'f'
        mem[0x004006e7] = '\x0f'
        mem[0x004006e8] = ':'
        mem[0x004006e9] = 'c'
        mem[0x004006ea] = '\xca'
        mem[0x004006eb] = 'M'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = True
        cpu.RIP = 0x4006e6
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006e6], 'f')
        self.assertEqual(mem[0x4006e7], '\x0f')
        self.assertEqual(mem[0x4006e8], ':')
        self.assertEqual(mem[0x4006e9], 'c')
        self.assertEqual(mem[0x4006ea], '\xca')
        self.assertEqual(mem[0x4006eb], 'M')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 4L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196076L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_57(self):
        ''' Instruction PCMPISTRI_57
            Groups: sse42
            0x40076a:	pcmpistri	xmm1, xmm2, 0x79
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040076a] = 'f'
        mem[0x0040076b] = '\x0f'
        mem[0x0040076c] = ':'
        mem[0x0040076d] = 'c'
        mem[0x0040076e] = '\xca'
        mem[0x0040076f] = 'y'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x10
        cpu.CF = False
        cpu.RIP = 0x40076a
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40076a], 'f')
        self.assertEqual(mem[0x40076b], '\x0f')
        self.assertEqual(mem[0x40076c], ':')
        self.assertEqual(mem[0x40076d], 'c')
        self.assertEqual(mem[0x40076e], '\xca')
        self.assertEqual(mem[0x40076f], 'y')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196208L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_58(self):
        ''' Instruction PCMPISTRI_58
            Groups: sse42
            0x4006ec:	pcmpistri	xmm1, xmm2, 0x50
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006ec] = 'f'
        mem[0x004006ed] = '\x0f'
        mem[0x004006ee] = ':'
        mem[0x004006ef] = 'c'
        mem[0x004006f0] = '\xca'
        mem[0x004006f1] = 'P'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x4
        cpu.CF = True
        cpu.RIP = 0x4006ec
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006ec], 'f')
        self.assertEqual(mem[0x4006ed], '\x0f')
        self.assertEqual(mem[0x4006ee], ':')
        self.assertEqual(mem[0x4006ef], 'c')
        self.assertEqual(mem[0x4006f0], '\xca')
        self.assertEqual(mem[0x4006f1], 'P')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 16L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196082L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_59(self):
        ''' Instruction PCMPISTRI_59
            Groups: sse42
            0x400632:	pcmpistri	xmm1, xmm2, 0x11
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400632] = 'f'
        mem[0x00400633] = '\x0f'
        mem[0x00400634] = ':'
        mem[0x00400635] = 'c'
        mem[0x00400636] = '\xca'
        mem[0x00400637] = '\x11'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x10
        cpu.CF = False
        cpu.RIP = 0x400632
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400632], 'f')
        self.assertEqual(mem[0x400633], '\x0f')
        self.assertEqual(mem[0x400634], ':')
        self.assertEqual(mem[0x400635], 'c')
        self.assertEqual(mem[0x400636], '\xca')
        self.assertEqual(mem[0x400637], '\x11')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4195896L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_6(self):
        ''' Instruction PCMPISTRI_6
            Groups: sse42
            0x40066e:	pcmpistri	xmm1, xmm2, 0x25
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040066e] = 'f'
        mem[0x0040066f] = '\x0f'
        mem[0x00400670] = ':'
        mem[0x00400671] = 'c'
        mem[0x00400672] = '\xca'
        mem[0x00400673] = '%'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x40066e
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40066e], 'f')
        self.assertEqual(mem[0x40066f], '\x0f')
        self.assertEqual(mem[0x400670], ':')
        self.assertEqual(mem[0x400671], 'c')
        self.assertEqual(mem[0x400672], '\xca')
        self.assertEqual(mem[0x400673], '%')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195956L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_60(self):
        ''' Instruction PCMPISTRI_60
            Groups: sse42
            0x4006f2:	pcmpistri	xmm1, xmm2, 0x51
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006f2] = 'f'
        mem[0x004006f3] = '\x0f'
        mem[0x004006f4] = ':'
        mem[0x004006f5] = 'c'
        mem[0x004006f6] = '\xca'
        mem[0x004006f7] = 'Q'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x10
        cpu.CF = False
        cpu.RIP = 0x4006f2
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006f2], 'f')
        self.assertEqual(mem[0x4006f3], '\x0f')
        self.assertEqual(mem[0x4006f4], ':')
        self.assertEqual(mem[0x4006f5], 'c')
        self.assertEqual(mem[0x4006f6], '\xca')
        self.assertEqual(mem[0x4006f7], 'Q')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196088L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_61(self):
        ''' Instruction PCMPISTRI_61
            Groups: sse42
            0x400614:	pcmpistri	xmm1, xmm2, 8
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400614] = 'f'
        mem[0x00400615] = '\x0f'
        mem[0x00400616] = ':'
        mem[0x00400617] = 'c'
        mem[0x00400618] = '\xca'
        mem[0x00400619] = '\x08'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x400614
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400614], 'f')
        self.assertEqual(mem[0x400615], '\x0f')
        self.assertEqual(mem[0x400616], ':')
        self.assertEqual(mem[0x400617], 'c')
        self.assertEqual(mem[0x400618], '\xca')
        self.assertEqual(mem[0x400619], '\x08')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195866L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_62(self):
        ''' Instruction PCMPISTRI_62
            Groups: sse42
            0x4006da:	pcmpistri	xmm1, xmm2, 0x49
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006da] = 'f'
        mem[0x004006db] = '\x0f'
        mem[0x004006dc] = ':'
        mem[0x004006dd] = 'c'
        mem[0x004006de] = '\xca'
        mem[0x004006df] = 'I'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0xf
        cpu.CF = True
        cpu.RIP = 0x4006da
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006da], 'f')
        self.assertEqual(mem[0x4006db], '\x0f')
        self.assertEqual(mem[0x4006dc], ':')
        self.assertEqual(mem[0x4006dd], 'c')
        self.assertEqual(mem[0x4006de], '\xca')
        self.assertEqual(mem[0x4006df], 'I')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 7L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196064L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_63(self):
        ''' Instruction PCMPISTRI_63
            Groups: sse42
            0x4006a4:	pcmpistri	xmm1, xmm2, 0x38
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006a4] = 'f'
        mem[0x004006a5] = '\x0f'
        mem[0x004006a6] = ':'
        mem[0x004006a7] = 'c'
        mem[0x004006a8] = '\xca'
        mem[0x004006a9] = '8'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x8
        cpu.CF = False
        cpu.RIP = 0x4006a4
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006a4], 'f')
        self.assertEqual(mem[0x4006a5], '\x0f')
        self.assertEqual(mem[0x4006a6], ':')
        self.assertEqual(mem[0x4006a7], 'c')
        self.assertEqual(mem[0x4006a8], '\xca')
        self.assertEqual(mem[0x4006a9], '8')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 16L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196010L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_64(self):
        ''' Instruction PCMPISTRI_64
            Groups: sse42
            0x4006fe:	pcmpistri	xmm1, xmm2, 0x55
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400700] = ':'
        mem[0x00400701] = 'c'
        mem[0x00400702] = '\xca'
        mem[0x00400703] = 'U'
        mem[0x004006fe] = 'f'
        mem[0x004006ff] = '\x0f'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x10
        cpu.CF = False
        cpu.RIP = 0x4006fe
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400700], ':')
        self.assertEqual(mem[0x400701], 'c')
        self.assertEqual(mem[0x400702], '\xca')
        self.assertEqual(mem[0x400703], 'U')
        self.assertEqual(mem[0x4006fe], 'f')
        self.assertEqual(mem[0x4006ff], '\x0f')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196100L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_65(self):
        ''' Instruction PCMPISTRI_65
            Groups: sse42
            0x400662:	pcmpistri	xmm1, xmm2, 0x21
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400662] = 'f'
        mem[0x00400663] = '\x0f'
        mem[0x00400664] = ':'
        mem[0x00400665] = 'c'
        mem[0x00400666] = '\xca'
        mem[0x00400667] = '!'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x400662
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400662], 'f')
        self.assertEqual(mem[0x400663], '\x0f')
        self.assertEqual(mem[0x400664], ':')
        self.assertEqual(mem[0x400665], 'c')
        self.assertEqual(mem[0x400666], '\xca')
        self.assertEqual(mem[0x400667], '!')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195944L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_7(self):
        ''' Instruction PCMPISTRI_7
            Groups: sse42
            0x4006e0:	pcmpistri	xmm1, xmm2, 0x4c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004006e0] = 'f'
        mem[0x004006e1] = '\x0f'
        mem[0x004006e2] = ':'
        mem[0x004006e3] = 'c'
        mem[0x004006e4] = '\xca'
        mem[0x004006e5] = 'L'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x7
        cpu.CF = True
        cpu.RIP = 0x4006e0
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4006e0], 'f')
        self.assertEqual(mem[0x4006e1], '\x0f')
        self.assertEqual(mem[0x4006e2], ':')
        self.assertEqual(mem[0x4006e3], 'c')
        self.assertEqual(mem[0x4006e4], '\xca')
        self.assertEqual(mem[0x4006e5], 'L')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196070L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_8(self):
        ''' Instruction PCMPISTRI_8
            Groups: sse42
            0x40060e:	pcmpistri	xmm1, xmm2, 5
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040060e] = 'f'
        mem[0x0040060f] = '\x0f'
        mem[0x00400610] = ':'
        mem[0x00400611] = 'c'
        mem[0x00400612] = '\xca'
        mem[0x00400613] = '\x05'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = False
        cpu.ECX = 0x0
        cpu.CF = True
        cpu.RIP = 0x40060e
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40060e], 'f')
        self.assertEqual(mem[0x40060f], '\x0f')
        self.assertEqual(mem[0x400610], ':')
        self.assertEqual(mem[0x400611], 'c')
        self.assertEqual(mem[0x400612], '\xca')
        self.assertEqual(mem[0x400613], '\x05')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 0L)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4195860L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRI_9(self):
        ''' Instruction PCMPISTRI_9
            Groups: sse42
            0x40075e:	pcmpistri	xmm1, xmm2, 0x75
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400760] = ':'
        mem[0x00400761] = 'c'
        mem[0x00400762] = '\xca'
        mem[0x00400763] = 'u'
        mem[0x0040075e] = 'f'
        mem[0x0040075f] = '\x0f'
        cpu.XMM2 = 0x48474645444342414847464544434241
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.ECX = 0x10
        cpu.CF = False
        cpu.RIP = 0x40075e
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400760], ':')
        self.assertEqual(mem[0x400761], 'c')
        self.assertEqual(mem[0x400762], '\xca')
        self.assertEqual(mem[0x400763], 'u')
        self.assertEqual(mem[0x40075e], 'f')
        self.assertEqual(mem[0x40075f], '\x0f')
        self.assertEqual(cpu.XMM2, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, False)
        self.assertEqual(cpu.ECX, 8L)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196196L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_1(self):
        ''' Instruction PCMPISTRM_1
            Groups: sse42
            0x400856:	pcmpistrm	xmm1, xmm2, 0x41
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400856] = 'f'
        mem[0x00400857] = '\x0f'
        mem[0x00400858] = ':'
        mem[0x00400859] = 'b'
        mem[0x0040085a] = '\xca'
        mem[0x0040085b] = 'A'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x400856
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400856], 'f')
        self.assertEqual(mem[0x400857], '\x0f')
        self.assertEqual(mem[0x400858], ':')
        self.assertEqual(mem[0x400859], 'b')
        self.assertEqual(mem[0x40085a], '\xca')
        self.assertEqual(mem[0x40085b], 'A')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196444L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_10(self):
        ''' Instruction PCMPISTRM_10
            Groups: sse42
            0x4007cc:	pcmpistrm	xmm1, xmm2, 0x14
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007cc] = 'f'
        mem[0x004007cd] = '\x0f'
        mem[0x004007ce] = ':'
        mem[0x004007cf] = 'b'
        mem[0x004007d0] = '\xca'
        mem[0x004007d1] = '\x14'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4007cc
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007cc], 'f')
        self.assertEqual(mem[0x4007cd], '\x0f')
        self.assertEqual(mem[0x4007ce], ':')
        self.assertEqual(mem[0x4007cf], 'b')
        self.assertEqual(mem[0x4007d0], '\xca')
        self.assertEqual(mem[0x4007d1], '\x14')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196306L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_11(self):
        ''' Instruction PCMPISTRM_11
            Groups: sse42
            0x40087a:	pcmpistrm	xmm1, xmm2, 0x4d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040087a] = 'f'
        mem[0x0040087b] = '\x0f'
        mem[0x0040087c] = ':'
        mem[0x0040087d] = 'b'
        mem[0x0040087e] = '\xca'
        mem[0x0040087f] = 'M'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x40087a
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40087a], 'f')
        self.assertEqual(mem[0x40087b], '\x0f')
        self.assertEqual(mem[0x40087c], ':')
        self.assertEqual(mem[0x40087d], 'b')
        self.assertEqual(mem[0x40087e], '\xca')
        self.assertEqual(mem[0x40087f], 'M')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196480L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_12(self):
        ''' Instruction PCMPISTRM_12
            Groups: sse42
            0x400802:	pcmpistrm	xmm1, xmm2, 0x25
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400802] = 'f'
        mem[0x00400803] = '\x0f'
        mem[0x00400804] = ':'
        mem[0x00400805] = 'b'
        mem[0x00400806] = '\xca'
        mem[0x00400807] = '%'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x400802
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400802], 'f')
        self.assertEqual(mem[0x400803], '\x0f')
        self.assertEqual(mem[0x400804], ':')
        self.assertEqual(mem[0x400805], 'b')
        self.assertEqual(mem[0x400806], '\xca')
        self.assertEqual(mem[0x400807], '%')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196360L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_13(self):
        ''' Instruction PCMPISTRM_13
            Groups: sse42
            0x4007fc:	pcmpistrm	xmm1, xmm2, 0x24
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400800] = '\xca'
        mem[0x00400801] = '$'
        mem[0x004007fc] = 'f'
        mem[0x004007fd] = '\x0f'
        mem[0x004007fe] = ':'
        mem[0x004007ff] = 'b'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4007fc
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400800], '\xca')
        self.assertEqual(mem[0x400801], '$')
        self.assertEqual(mem[0x4007fc], 'f')
        self.assertEqual(mem[0x4007fd], '\x0f')
        self.assertEqual(mem[0x4007fe], ':')
        self.assertEqual(mem[0x4007ff], 'b')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196354L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_14(self):
        ''' Instruction PCMPISTRM_14
            Groups: sse42
            0x4008c8:	pcmpistrm	xmm1, xmm2, 0x68
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008c8] = 'f'
        mem[0x004008c9] = '\x0f'
        mem[0x004008ca] = ':'
        mem[0x004008cb] = 'b'
        mem[0x004008cc] = '\xca'
        mem[0x004008cd] = 'h'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4008c8
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008c8], 'f')
        self.assertEqual(mem[0x4008c9], '\x0f')
        self.assertEqual(mem[0x4008ca], ':')
        self.assertEqual(mem[0x4008cb], 'b')
        self.assertEqual(mem[0x4008cc], '\xca')
        self.assertEqual(mem[0x4008cd], 'h')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196558L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_15(self):
        ''' Instruction PCMPISTRM_15
            Groups: sse42
            0x4008f8:	pcmpistrm	xmm1, xmm2, 0x78
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008f8] = 'f'
        mem[0x004008f9] = '\x0f'
        mem[0x004008fa] = ':'
        mem[0x004008fb] = 'b'
        mem[0x004008fc] = '\xca'
        mem[0x004008fd] = 'x'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4008f8
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008f8], 'f')
        self.assertEqual(mem[0x4008f9], '\x0f')
        self.assertEqual(mem[0x4008fa], ':')
        self.assertEqual(mem[0x4008fb], 'b')
        self.assertEqual(mem[0x4008fc], '\xca')
        self.assertEqual(mem[0x4008fd], 'x')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196606L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_16(self):
        ''' Instruction PCMPISTRM_16
            Groups: sse42
            0x40080e:	pcmpistrm	xmm1, xmm2, 0x29
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040080e] = 'f'
        mem[0x0040080f] = '\x0f'
        mem[0x00400810] = ':'
        mem[0x00400811] = 'b'
        mem[0x00400812] = '\xca'
        mem[0x00400813] = ')'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x40080e
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40080e], 'f')
        self.assertEqual(mem[0x40080f], '\x0f')
        self.assertEqual(mem[0x400810], ':')
        self.assertEqual(mem[0x400811], 'b')
        self.assertEqual(mem[0x400812], '\xca')
        self.assertEqual(mem[0x400813], ')')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196372L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_17(self):
        ''' Instruction PCMPISTRM_17
            Groups: sse42
            0x40089e:	pcmpistrm	xmm1, xmm2, 0x59
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008a0] = ':'
        mem[0x004008a1] = 'b'
        mem[0x004008a2] = '\xca'
        mem[0x004008a3] = 'Y'
        mem[0x0040089e] = 'f'
        mem[0x0040089f] = '\x0f'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x40089e
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008a0], ':')
        self.assertEqual(mem[0x4008a1], 'b')
        self.assertEqual(mem[0x4008a2], '\xca')
        self.assertEqual(mem[0x4008a3], 'Y')
        self.assertEqual(mem[0x40089e], 'f')
        self.assertEqual(mem[0x40089f], '\x0f')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196516L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_18(self):
        ''' Instruction PCMPISTRM_18
            Groups: sse42
            0x4008f2:	pcmpistrm	xmm1, xmm2, 0x75
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008f2] = 'f'
        mem[0x004008f3] = '\x0f'
        mem[0x004008f4] = ':'
        mem[0x004008f5] = 'b'
        mem[0x004008f6] = '\xca'
        mem[0x004008f7] = 'u'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4008f2
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008f2], 'f')
        self.assertEqual(mem[0x4008f3], '\x0f')
        self.assertEqual(mem[0x4008f4], ':')
        self.assertEqual(mem[0x4008f5], 'b')
        self.assertEqual(mem[0x4008f6], '\xca')
        self.assertEqual(mem[0x4008f7], 'u')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196600L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_19(self):
        ''' Instruction PCMPISTRM_19
            Groups: sse42
            0x4007b4:	pcmpistrm	xmm1, xmm2, 0xc
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007b4] = 'f'
        mem[0x004007b5] = '\x0f'
        mem[0x004007b6] = ':'
        mem[0x004007b7] = 'b'
        mem[0x004007b8] = '\xca'
        mem[0x004007b9] = '\x0c'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4007b4
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007b4], 'f')
        self.assertEqual(mem[0x4007b5], '\x0f')
        self.assertEqual(mem[0x4007b6], ':')
        self.assertEqual(mem[0x4007b7], 'b')
        self.assertEqual(mem[0x4007b8], '\xca')
        self.assertEqual(mem[0x4007b9], '\x0c')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196282L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_2(self):
        ''' Instruction PCMPISTRM_2
            Groups: sse42
            0x4008ec:	pcmpistrm	xmm1, xmm2, 0x74
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008ec] = 'f'
        mem[0x004008ed] = '\x0f'
        mem[0x004008ee] = ':'
        mem[0x004008ef] = 'b'
        mem[0x004008f0] = '\xca'
        mem[0x004008f1] = 't'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4008ec
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008ec], 'f')
        self.assertEqual(mem[0x4008ed], '\x0f')
        self.assertEqual(mem[0x4008ee], ':')
        self.assertEqual(mem[0x4008ef], 'b')
        self.assertEqual(mem[0x4008f0], '\xca')
        self.assertEqual(mem[0x4008f1], 't')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196594L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_20(self):
        ''' Instruction PCMPISTRM_20
            Groups: sse42
            0x4007d8:	pcmpistrm	xmm1, xmm2, 0x18
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007d8] = 'f'
        mem[0x004007d9] = '\x0f'
        mem[0x004007da] = ':'
        mem[0x004007db] = 'b'
        mem[0x004007dc] = '\xca'
        mem[0x004007dd] = '\x18'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4007d8
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007d8], 'f')
        self.assertEqual(mem[0x4007d9], '\x0f')
        self.assertEqual(mem[0x4007da], ':')
        self.assertEqual(mem[0x4007db], 'b')
        self.assertEqual(mem[0x4007dc], '\xca')
        self.assertEqual(mem[0x4007dd], '\x18')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196318L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_21(self):
        ''' Instruction PCMPISTRM_21
            Groups: sse42
            0x400892:	pcmpistrm	xmm1, xmm2, 0x55
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400892] = 'f'
        mem[0x00400893] = '\x0f'
        mem[0x00400894] = ':'
        mem[0x00400895] = 'b'
        mem[0x00400896] = '\xca'
        mem[0x00400897] = 'U'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x400892
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400892], 'f')
        self.assertEqual(mem[0x400893], '\x0f')
        self.assertEqual(mem[0x400894], ':')
        self.assertEqual(mem[0x400895], 'b')
        self.assertEqual(mem[0x400896], '\xca')
        self.assertEqual(mem[0x400897], 'U')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196504L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_22(self):
        ''' Instruction PCMPISTRM_22
            Groups: sse42
            0x40084a:	pcmpistrm	xmm1, xmm2, 0x3d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040084a] = 'f'
        mem[0x0040084b] = '\x0f'
        mem[0x0040084c] = ':'
        mem[0x0040084d] = 'b'
        mem[0x0040084e] = '\xca'
        mem[0x0040084f] = '='
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x40084a
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40084a], 'f')
        self.assertEqual(mem[0x40084b], '\x0f')
        self.assertEqual(mem[0x40084c], ':')
        self.assertEqual(mem[0x40084d], 'b')
        self.assertEqual(mem[0x40084e], '\xca')
        self.assertEqual(mem[0x40084f], '=')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196432L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_23(self):
        ''' Instruction PCMPISTRM_23
            Groups: sse42
            0x40088c:	pcmpistrm	xmm1, xmm2, 0x54
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040088c] = 'f'
        mem[0x0040088d] = '\x0f'
        mem[0x0040088e] = ':'
        mem[0x0040088f] = 'b'
        mem[0x00400890] = '\xca'
        mem[0x00400891] = 'T'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x40088c
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40088c], 'f')
        self.assertEqual(mem[0x40088d], '\x0f')
        self.assertEqual(mem[0x40088e], ':')
        self.assertEqual(mem[0x40088f], 'b')
        self.assertEqual(mem[0x400890], '\xca')
        self.assertEqual(mem[0x400891], 'T')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196498L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_24(self):
        ''' Instruction PCMPISTRM_24
            Groups: sse42
            0x4008fe:	pcmpistrm	xmm1, xmm2, 0x79
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400900] = ':'
        mem[0x00400901] = 'b'
        mem[0x00400902] = '\xca'
        mem[0x00400903] = 'y'
        mem[0x004008fe] = 'f'
        mem[0x004008ff] = '\x0f'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4008fe
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400900], ':')
        self.assertEqual(mem[0x400901], 'b')
        self.assertEqual(mem[0x400902], '\xca')
        self.assertEqual(mem[0x400903], 'y')
        self.assertEqual(mem[0x4008fe], 'f')
        self.assertEqual(mem[0x4008ff], '\x0f')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196612L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_25(self):
        ''' Instruction PCMPISTRM_25
            Groups: sse42
            0x400838:	pcmpistrm	xmm1, xmm2, 0x38
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400838] = 'f'
        mem[0x00400839] = '\x0f'
        mem[0x0040083a] = ':'
        mem[0x0040083b] = 'b'
        mem[0x0040083c] = '\xca'
        mem[0x0040083d] = '8'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x400838
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400838], 'f')
        self.assertEqual(mem[0x400839], '\x0f')
        self.assertEqual(mem[0x40083a], ':')
        self.assertEqual(mem[0x40083b], 'b')
        self.assertEqual(mem[0x40083c], '\xca')
        self.assertEqual(mem[0x40083d], '8')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196414L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_26(self):
        ''' Instruction PCMPISTRM_26
            Groups: sse42
            0x400832:	pcmpistrm	xmm1, xmm2, 0x35
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400832] = 'f'
        mem[0x00400833] = '\x0f'
        mem[0x00400834] = ':'
        mem[0x00400835] = 'b'
        mem[0x00400836] = '\xca'
        mem[0x00400837] = '5'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x400832
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400832], 'f')
        self.assertEqual(mem[0x400833], '\x0f')
        self.assertEqual(mem[0x400834], ':')
        self.assertEqual(mem[0x400835], 'b')
        self.assertEqual(mem[0x400836], '\xca')
        self.assertEqual(mem[0x400837], '5')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196408L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_27(self):
        ''' Instruction PCMPISTRM_27
            Groups: sse42
            0x400820:	pcmpistrm	xmm1, xmm2, 0x30
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400820] = 'f'
        mem[0x00400821] = '\x0f'
        mem[0x00400822] = ':'
        mem[0x00400823] = 'b'
        mem[0x00400824] = '\xca'
        mem[0x00400825] = '0'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x400820
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400820], 'f')
        self.assertEqual(mem[0x400821], '\x0f')
        self.assertEqual(mem[0x400822], ':')
        self.assertEqual(mem[0x400823], 'b')
        self.assertEqual(mem[0x400824], '\xca')
        self.assertEqual(mem[0x400825], '0')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196390L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_28(self):
        ''' Instruction PCMPISTRM_28
            Groups: sse42
            0x400850:	pcmpistrm	xmm1, xmm2, 0x40
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400850] = 'f'
        mem[0x00400851] = '\x0f'
        mem[0x00400852] = ':'
        mem[0x00400853] = 'b'
        mem[0x00400854] = '\xca'
        mem[0x00400855] = '@'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x400850
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400850], 'f')
        self.assertEqual(mem[0x400851], '\x0f')
        self.assertEqual(mem[0x400852], ':')
        self.assertEqual(mem[0x400853], 'b')
        self.assertEqual(mem[0x400854], '\xca')
        self.assertEqual(mem[0x400855], '@')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196438L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_29(self):
        ''' Instruction PCMPISTRM_29
            Groups: sse42
            0x4007d2:	pcmpistrm	xmm1, xmm2, 0x15
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007d2] = 'f'
        mem[0x004007d3] = '\x0f'
        mem[0x004007d4] = ':'
        mem[0x004007d5] = 'b'
        mem[0x004007d6] = '\xca'
        mem[0x004007d7] = '\x15'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4007d2
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007d2], 'f')
        self.assertEqual(mem[0x4007d3], '\x0f')
        self.assertEqual(mem[0x4007d4], ':')
        self.assertEqual(mem[0x4007d5], 'b')
        self.assertEqual(mem[0x4007d6], '\xca')
        self.assertEqual(mem[0x4007d7], '\x15')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196312L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_3(self):
        ''' Instruction PCMPISTRM_3
            Groups: sse42
            0x400826:	pcmpistrm	xmm1, xmm2, 0x31
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400826] = 'f'
        mem[0x00400827] = '\x0f'
        mem[0x00400828] = ':'
        mem[0x00400829] = 'b'
        mem[0x0040082a] = '\xca'
        mem[0x0040082b] = '1'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x400826
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400826], 'f')
        self.assertEqual(mem[0x400827], '\x0f')
        self.assertEqual(mem[0x400828], ':')
        self.assertEqual(mem[0x400829], 'b')
        self.assertEqual(mem[0x40082a], '\xca')
        self.assertEqual(mem[0x40082b], '1')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196396L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_30(self):
        ''' Instruction PCMPISTRM_30
            Groups: sse42
            0x400898:	pcmpistrm	xmm1, xmm2, 0x58
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400898] = 'f'
        mem[0x00400899] = '\x0f'
        mem[0x0040089a] = ':'
        mem[0x0040089b] = 'b'
        mem[0x0040089c] = '\xca'
        mem[0x0040089d] = 'X'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x400898
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400898], 'f')
        self.assertEqual(mem[0x400899], '\x0f')
        self.assertEqual(mem[0x40089a], ':')
        self.assertEqual(mem[0x40089b], 'b')
        self.assertEqual(mem[0x40089c], '\xca')
        self.assertEqual(mem[0x40089d], 'X')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196510L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_31(self):
        ''' Instruction PCMPISTRM_31
            Groups: sse42
            0x4008aa:	pcmpistrm	xmm1, xmm2, 0x5d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008aa] = 'f'
        mem[0x004008ab] = '\x0f'
        mem[0x004008ac] = ':'
        mem[0x004008ad] = 'b'
        mem[0x004008ae] = '\xca'
        mem[0x004008af] = ']'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4008aa
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008aa], 'f')
        self.assertEqual(mem[0x4008ab], '\x0f')
        self.assertEqual(mem[0x4008ac], ':')
        self.assertEqual(mem[0x4008ad], 'b')
        self.assertEqual(mem[0x4008ae], '\xca')
        self.assertEqual(mem[0x4008af], ']')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196528L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_32(self):
        ''' Instruction PCMPISTRM_32
            Groups: sse42
            0x4007ea:	pcmpistrm	xmm1, xmm2, 0x1d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007ea] = 'f'
        mem[0x004007eb] = '\x0f'
        mem[0x004007ec] = ':'
        mem[0x004007ed] = 'b'
        mem[0x004007ee] = '\xca'
        mem[0x004007ef] = '\x1d'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4007ea
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007ea], 'f')
        self.assertEqual(mem[0x4007eb], '\x0f')
        self.assertEqual(mem[0x4007ec], ':')
        self.assertEqual(mem[0x4007ed], 'b')
        self.assertEqual(mem[0x4007ee], '\xca')
        self.assertEqual(mem[0x4007ef], '\x1d')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196336L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_33(self):
        ''' Instruction PCMPISTRM_33
            Groups: sse42
            0x4007f6:	pcmpistrm	xmm1, xmm2, 0x21
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007f6] = 'f'
        mem[0x004007f7] = '\x0f'
        mem[0x004007f8] = ':'
        mem[0x004007f9] = 'b'
        mem[0x004007fa] = '\xca'
        mem[0x004007fb] = '!'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4007f6
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007f6], 'f')
        self.assertEqual(mem[0x4007f7], '\x0f')
        self.assertEqual(mem[0x4007f8], ':')
        self.assertEqual(mem[0x4007f9], 'b')
        self.assertEqual(mem[0x4007fa], '\xca')
        self.assertEqual(mem[0x4007fb], '!')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196348L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_34(self):
        ''' Instruction PCMPISTRM_34
            Groups: sse42
            0x4008b0:	pcmpistrm	xmm1, xmm2, 0x60
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008b0] = 'f'
        mem[0x004008b1] = '\x0f'
        mem[0x004008b2] = ':'
        mem[0x004008b3] = 'b'
        mem[0x004008b4] = '\xca'
        mem[0x004008b5] = '`'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4008b0
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008b0], 'f')
        self.assertEqual(mem[0x4008b1], '\x0f')
        self.assertEqual(mem[0x4008b2], ':')
        self.assertEqual(mem[0x4008b3], 'b')
        self.assertEqual(mem[0x4008b4], '\xca')
        self.assertEqual(mem[0x4008b5], '`')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196534L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_35(self):
        ''' Instruction PCMPISTRM_35
            Groups: sse42
            0x4008a4:	pcmpistrm	xmm1, xmm2, 0x5c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008a4] = 'f'
        mem[0x004008a5] = '\x0f'
        mem[0x004008a6] = ':'
        mem[0x004008a7] = 'b'
        mem[0x004008a8] = '\xca'
        mem[0x004008a9] = '\\'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4008a4
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008a4], 'f')
        self.assertEqual(mem[0x4008a5], '\x0f')
        self.assertEqual(mem[0x4008a6], ':')
        self.assertEqual(mem[0x4008a7], 'b')
        self.assertEqual(mem[0x4008a8], '\xca')
        self.assertEqual(mem[0x4008a9], '\\')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196522L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_36(self):
        ''' Instruction PCMPISTRM_36
            Groups: sse42
            0x4008e0:	pcmpistrm	xmm1, xmm2, 0x70
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008e0] = 'f'
        mem[0x004008e1] = '\x0f'
        mem[0x004008e2] = ':'
        mem[0x004008e3] = 'b'
        mem[0x004008e4] = '\xca'
        mem[0x004008e5] = 'p'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4008e0
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008e0], 'f')
        self.assertEqual(mem[0x4008e1], '\x0f')
        self.assertEqual(mem[0x4008e2], ':')
        self.assertEqual(mem[0x4008e3], 'b')
        self.assertEqual(mem[0x4008e4], '\xca')
        self.assertEqual(mem[0x4008e5], 'p')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196582L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_37(self):
        ''' Instruction PCMPISTRM_37
            Groups: sse42
            0x400904:	pcmpistrm	xmm1, xmm2, 0x7c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400904] = 'f'
        mem[0x00400905] = '\x0f'
        mem[0x00400906] = ':'
        mem[0x00400907] = 'b'
        mem[0x00400908] = '\xca'
        mem[0x00400909] = '|'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x400904
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400904], 'f')
        self.assertEqual(mem[0x400905], '\x0f')
        self.assertEqual(mem[0x400906], ':')
        self.assertEqual(mem[0x400907], 'b')
        self.assertEqual(mem[0x400908], '\xca')
        self.assertEqual(mem[0x400909], '|')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196618L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_38(self):
        ''' Instruction PCMPISTRM_38
            Groups: sse42
            0x4008c2:	pcmpistrm	xmm1, xmm2, 0x65
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008c2] = 'f'
        mem[0x004008c3] = '\x0f'
        mem[0x004008c4] = ':'
        mem[0x004008c5] = 'b'
        mem[0x004008c6] = '\xca'
        mem[0x004008c7] = 'e'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4008c2
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008c2], 'f')
        self.assertEqual(mem[0x4008c3], '\x0f')
        self.assertEqual(mem[0x4008c4], ':')
        self.assertEqual(mem[0x4008c5], 'b')
        self.assertEqual(mem[0x4008c6], '\xca')
        self.assertEqual(mem[0x4008c7], 'e')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196552L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_39(self):
        ''' Instruction PCMPISTRM_39
            Groups: sse42
            0x40081a:	pcmpistrm	xmm1, xmm2, 0x2d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040081a] = 'f'
        mem[0x0040081b] = '\x0f'
        mem[0x0040081c] = ':'
        mem[0x0040081d] = 'b'
        mem[0x0040081e] = '\xca'
        mem[0x0040081f] = '-'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x40081a
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40081a], 'f')
        self.assertEqual(mem[0x40081b], '\x0f')
        self.assertEqual(mem[0x40081c], ':')
        self.assertEqual(mem[0x40081d], 'b')
        self.assertEqual(mem[0x40081e], '\xca')
        self.assertEqual(mem[0x40081f], '-')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196384L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_4(self):
        ''' Instruction PCMPISTRM_4
            Groups: sse42
            0x4008bc:	pcmpistrm	xmm1, xmm2, 0x64
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008c0] = '\xca'
        mem[0x004008c1] = 'd'
        mem[0x004008bc] = 'f'
        mem[0x004008bd] = '\x0f'
        mem[0x004008be] = ':'
        mem[0x004008bf] = 'b'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4008bc
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008c0], '\xca')
        self.assertEqual(mem[0x4008c1], 'd')
        self.assertEqual(mem[0x4008bc], 'f')
        self.assertEqual(mem[0x4008bd], '\x0f')
        self.assertEqual(mem[0x4008be], ':')
        self.assertEqual(mem[0x4008bf], 'b')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196546L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_40(self):
        ''' Instruction PCMPISTRM_40
            Groups: sse42
            0x4007de:	pcmpistrm	xmm1, xmm2, 0x19
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007e0] = ':'
        mem[0x004007e1] = 'b'
        mem[0x004007e2] = '\xca'
        mem[0x004007e3] = '\x19'
        mem[0x004007de] = 'f'
        mem[0x004007df] = '\x0f'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4007de
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007e0], ':')
        self.assertEqual(mem[0x4007e1], 'b')
        self.assertEqual(mem[0x4007e2], '\xca')
        self.assertEqual(mem[0x4007e3], '\x19')
        self.assertEqual(mem[0x4007de], 'f')
        self.assertEqual(mem[0x4007df], '\x0f')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196324L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_41(self):
        ''' Instruction PCMPISTRM_41
            Groups: sse42
            0x400814:	pcmpistrm	xmm1, xmm2, 0x2c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400814] = 'f'
        mem[0x00400815] = '\x0f'
        mem[0x00400816] = ':'
        mem[0x00400817] = 'b'
        mem[0x00400818] = '\xca'
        mem[0x00400819] = ','
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x400814
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400814], 'f')
        self.assertEqual(mem[0x400815], '\x0f')
        self.assertEqual(mem[0x400816], ':')
        self.assertEqual(mem[0x400817], 'b')
        self.assertEqual(mem[0x400818], '\xca')
        self.assertEqual(mem[0x400819], ',')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196378L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_42(self):
        ''' Instruction PCMPISTRM_42
            Groups: sse42
            0x4007c6:	pcmpistrm	xmm1, xmm2, 0x11
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007c6] = 'f'
        mem[0x004007c7] = '\x0f'
        mem[0x004007c8] = ':'
        mem[0x004007c9] = 'b'
        mem[0x004007ca] = '\xca'
        mem[0x004007cb] = '\x11'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4007c6
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007c6], 'f')
        self.assertEqual(mem[0x4007c7], '\x0f')
        self.assertEqual(mem[0x4007c8], ':')
        self.assertEqual(mem[0x4007c9], 'b')
        self.assertEqual(mem[0x4007ca], '\xca')
        self.assertEqual(mem[0x4007cb], '\x11')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196300L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_43(self):
        ''' Instruction PCMPISTRM_43
            Groups: sse42
            0x400868:	pcmpistrm	xmm1, xmm2, 0x48
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400868] = 'f'
        mem[0x00400869] = '\x0f'
        mem[0x0040086a] = ':'
        mem[0x0040086b] = 'b'
        mem[0x0040086c] = '\xca'
        mem[0x0040086d] = 'H'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x400868
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400868], 'f')
        self.assertEqual(mem[0x400869], '\x0f')
        self.assertEqual(mem[0x40086a], ':')
        self.assertEqual(mem[0x40086b], 'b')
        self.assertEqual(mem[0x40086c], '\xca')
        self.assertEqual(mem[0x40086d], 'H')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196462L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_44(self):
        ''' Instruction PCMPISTRM_44
            Groups: sse42
            0x4008ce:	pcmpistrm	xmm1, xmm2, 0x69
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008ce] = 'f'
        mem[0x004008cf] = '\x0f'
        mem[0x004008d0] = ':'
        mem[0x004008d1] = 'b'
        mem[0x004008d2] = '\xca'
        mem[0x004008d3] = 'i'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4008ce
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008ce], 'f')
        self.assertEqual(mem[0x4008cf], '\x0f')
        self.assertEqual(mem[0x4008d0], ':')
        self.assertEqual(mem[0x4008d1], 'b')
        self.assertEqual(mem[0x4008d2], '\xca')
        self.assertEqual(mem[0x4008d3], 'i')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196564L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_45(self):
        ''' Instruction PCMPISTRM_45
            Groups: sse42
            0x400874:	pcmpistrm	xmm1, xmm2, 0x4c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400874] = 'f'
        mem[0x00400875] = '\x0f'
        mem[0x00400876] = ':'
        mem[0x00400877] = 'b'
        mem[0x00400878] = '\xca'
        mem[0x00400879] = 'L'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x400874
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400874], 'f')
        self.assertEqual(mem[0x400875], '\x0f')
        self.assertEqual(mem[0x400876], ':')
        self.assertEqual(mem[0x400877], 'b')
        self.assertEqual(mem[0x400878], '\xca')
        self.assertEqual(mem[0x400879], 'L')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196474L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_46(self):
        ''' Instruction PCMPISTRM_46
            Groups: sse42
            0x40085c:	pcmpistrm	xmm1, xmm2, 0x44
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400860] = '\xca'
        mem[0x00400861] = 'D'
        mem[0x0040085c] = 'f'
        mem[0x0040085d] = '\x0f'
        mem[0x0040085e] = ':'
        mem[0x0040085f] = 'b'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x40085c
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400860], '\xca')
        self.assertEqual(mem[0x400861], 'D')
        self.assertEqual(mem[0x40085c], 'f')
        self.assertEqual(mem[0x40085d], '\x0f')
        self.assertEqual(mem[0x40085e], ':')
        self.assertEqual(mem[0x40085f], 'b')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196450L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_47(self):
        ''' Instruction PCMPISTRM_47
            Groups: sse42
            0x4007a8:	pcmpistrm	xmm1, xmm2, 8
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007a8] = 'f'
        mem[0x004007a9] = '\x0f'
        mem[0x004007aa] = ':'
        mem[0x004007ab] = 'b'
        mem[0x004007ac] = '\xca'
        mem[0x004007ad] = '\x08'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4007a8
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007a8], 'f')
        self.assertEqual(mem[0x4007a9], '\x0f')
        self.assertEqual(mem[0x4007aa], ':')
        self.assertEqual(mem[0x4007ab], 'b')
        self.assertEqual(mem[0x4007ac], '\xca')
        self.assertEqual(mem[0x4007ad], '\x08')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196270L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_48(self):
        ''' Instruction PCMPISTRM_48
            Groups: sse42
            0x40082c:	pcmpistrm	xmm1, xmm2, 0x34
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040082c] = 'f'
        mem[0x0040082d] = '\x0f'
        mem[0x0040082e] = ':'
        mem[0x0040082f] = 'b'
        mem[0x00400830] = '\xca'
        mem[0x00400831] = '4'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x40082c
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40082c], 'f')
        self.assertEqual(mem[0x40082d], '\x0f')
        self.assertEqual(mem[0x40082e], ':')
        self.assertEqual(mem[0x40082f], 'b')
        self.assertEqual(mem[0x400830], '\xca')
        self.assertEqual(mem[0x400831], '4')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196402L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_49(self):
        ''' Instruction PCMPISTRM_49
            Groups: sse42
            0x4008da:	pcmpistrm	xmm1, xmm2, 0x6d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008da] = 'f'
        mem[0x004008db] = '\x0f'
        mem[0x004008dc] = ':'
        mem[0x004008dd] = 'b'
        mem[0x004008de] = '\xca'
        mem[0x004008df] = 'm'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4008da
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008da], 'f')
        self.assertEqual(mem[0x4008db], '\x0f')
        self.assertEqual(mem[0x4008dc], ':')
        self.assertEqual(mem[0x4008dd], 'b')
        self.assertEqual(mem[0x4008de], '\xca')
        self.assertEqual(mem[0x4008df], 'm')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196576L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_5(self):
        ''' Instruction PCMPISTRM_5
            Groups: sse42
            0x4007a2:	pcmpistrm	xmm1, xmm2, 5
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007a2] = 'f'
        mem[0x004007a3] = '\x0f'
        mem[0x004007a4] = ':'
        mem[0x004007a5] = 'b'
        mem[0x004007a6] = '\xca'
        mem[0x004007a7] = '\x05'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4007a2
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007a2], 'f')
        self.assertEqual(mem[0x4007a3], '\x0f')
        self.assertEqual(mem[0x4007a4], ':')
        self.assertEqual(mem[0x4007a5], 'b')
        self.assertEqual(mem[0x4007a6], '\xca')
        self.assertEqual(mem[0x4007a7], '\x05')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196264L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_50(self):
        ''' Instruction PCMPISTRM_50
            Groups: sse42
            0x4007e4:	pcmpistrm	xmm1, xmm2, 0x1c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007e4] = 'f'
        mem[0x004007e5] = '\x0f'
        mem[0x004007e6] = ':'
        mem[0x004007e7] = 'b'
        mem[0x004007e8] = '\xca'
        mem[0x004007e9] = '\x1c'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4007e4
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007e4], 'f')
        self.assertEqual(mem[0x4007e5], '\x0f')
        self.assertEqual(mem[0x4007e6], ':')
        self.assertEqual(mem[0x4007e7], 'b')
        self.assertEqual(mem[0x4007e8], '\xca')
        self.assertEqual(mem[0x4007e9], '\x1c')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196330L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_51(self):
        ''' Instruction PCMPISTRM_51
            Groups: sse42
            0x400880:	pcmpistrm	xmm1, xmm2, 0x50
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400880] = 'f'
        mem[0x00400881] = '\x0f'
        mem[0x00400882] = ':'
        mem[0x00400883] = 'b'
        mem[0x00400884] = '\xca'
        mem[0x00400885] = 'P'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x400880
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400880], 'f')
        self.assertEqual(mem[0x400881], '\x0f')
        self.assertEqual(mem[0x400882], ':')
        self.assertEqual(mem[0x400883], 'b')
        self.assertEqual(mem[0x400884], '\xca')
        self.assertEqual(mem[0x400885], 'P')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196486L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_52(self):
        ''' Instruction PCMPISTRM_52
            Groups: sse42
            0x400886:	pcmpistrm	xmm1, xmm2, 0x51
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400886] = 'f'
        mem[0x00400887] = '\x0f'
        mem[0x00400888] = ':'
        mem[0x00400889] = 'b'
        mem[0x0040088a] = '\xca'
        mem[0x0040088b] = 'Q'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x400886
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400886], 'f')
        self.assertEqual(mem[0x400887], '\x0f')
        self.assertEqual(mem[0x400888], ':')
        self.assertEqual(mem[0x400889], 'b')
        self.assertEqual(mem[0x40088a], '\xca')
        self.assertEqual(mem[0x40088b], 'Q')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196492L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_53(self):
        ''' Instruction PCMPISTRM_53
            Groups: sse42
            0x4008b6:	pcmpistrm	xmm1, xmm2, 0x61
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008b6] = 'f'
        mem[0x004008b7] = '\x0f'
        mem[0x004008b8] = ':'
        mem[0x004008b9] = 'b'
        mem[0x004008ba] = '\xca'
        mem[0x004008bb] = 'a'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4008b6
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008b6], 'f')
        self.assertEqual(mem[0x4008b7], '\x0f')
        self.assertEqual(mem[0x4008b8], ':')
        self.assertEqual(mem[0x4008b9], 'b')
        self.assertEqual(mem[0x4008ba], '\xca')
        self.assertEqual(mem[0x4008bb], 'a')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196540L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_54(self):
        ''' Instruction PCMPISTRM_54
            Groups: sse42
            0x4007ba:	pcmpistrm	xmm1, xmm2, 0xd
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007ba] = 'f'
        mem[0x004007bb] = '\x0f'
        mem[0x004007bc] = ':'
        mem[0x004007bd] = 'b'
        mem[0x004007be] = '\xca'
        mem[0x004007bf] = '\r'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4007ba
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007ba], 'f')
        self.assertEqual(mem[0x4007bb], '\x0f')
        self.assertEqual(mem[0x4007bc], ':')
        self.assertEqual(mem[0x4007bd], 'b')
        self.assertEqual(mem[0x4007be], '\xca')
        self.assertEqual(mem[0x4007bf], '\r')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196288L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_55(self):
        ''' Instruction PCMPISTRM_55
            Groups: sse42
            0x40090a:	pcmpistrm	xmm1, xmm2, 0x7d
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040090a] = 'f'
        mem[0x0040090b] = '\x0f'
        mem[0x0040090c] = ':'
        mem[0x0040090d] = 'b'
        mem[0x0040090e] = '\xca'
        mem[0x0040090f] = '}'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x40090a
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40090a], 'f')
        self.assertEqual(mem[0x40090b], '\x0f')
        self.assertEqual(mem[0x40090c], ':')
        self.assertEqual(mem[0x40090d], 'b')
        self.assertEqual(mem[0x40090e], '\xca')
        self.assertEqual(mem[0x40090f], '}')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196624L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_56(self):
        ''' Instruction PCMPISTRM_56
            Groups: sse42
            0x40079c:	pcmpistrm	xmm1, xmm2, 4
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007a0] = '\xca'
        mem[0x004007a1] = '\x04'
        mem[0x0040079c] = 'f'
        mem[0x0040079d] = '\x0f'
        mem[0x0040079e] = ':'
        mem[0x0040079f] = 'b'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x40079c
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007a0], '\xca')
        self.assertEqual(mem[0x4007a1], '\x04')
        self.assertEqual(mem[0x40079c], 'f')
        self.assertEqual(mem[0x40079d], '\x0f')
        self.assertEqual(mem[0x40079e], ':')
        self.assertEqual(mem[0x40079f], 'b')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196258L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_57(self):
        ''' Instruction PCMPISTRM_57
            Groups: sse42
            0x4007ae:	pcmpistrm	xmm1, xmm2, 9
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007ae] = 'f'
        mem[0x004007af] = '\x0f'
        mem[0x004007b0] = ':'
        mem[0x004007b1] = 'b'
        mem[0x004007b2] = '\xca'
        mem[0x004007b3] = '\t'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4007ae
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007ae], 'f')
        self.assertEqual(mem[0x4007af], '\x0f')
        self.assertEqual(mem[0x4007b0], ':')
        self.assertEqual(mem[0x4007b1], 'b')
        self.assertEqual(mem[0x4007b2], '\xca')
        self.assertEqual(mem[0x4007b3], '\t')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196276L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_58(self):
        ''' Instruction PCMPISTRM_58
            Groups: sse42
            0x400844:	pcmpistrm	xmm1, xmm2, 0x3c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400844] = 'f'
        mem[0x00400845] = '\x0f'
        mem[0x00400846] = ':'
        mem[0x00400847] = 'b'
        mem[0x00400848] = '\xca'
        mem[0x00400849] = '<'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x400844
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400844], 'f')
        self.assertEqual(mem[0x400845], '\x0f')
        self.assertEqual(mem[0x400846], ':')
        self.assertEqual(mem[0x400847], 'b')
        self.assertEqual(mem[0x400848], '\xca')
        self.assertEqual(mem[0x400849], '<')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196426L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_59(self):
        ''' Instruction PCMPISTRM_59
            Groups: sse42
            0x4008e6:	pcmpistrm	xmm1, xmm2, 0x71
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008e6] = 'f'
        mem[0x004008e7] = '\x0f'
        mem[0x004008e8] = ':'
        mem[0x004008e9] = 'b'
        mem[0x004008ea] = '\xca'
        mem[0x004008eb] = 'q'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4008e6
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008e6], 'f')
        self.assertEqual(mem[0x4008e7], '\x0f')
        self.assertEqual(mem[0x4008e8], ':')
        self.assertEqual(mem[0x4008e9], 'b')
        self.assertEqual(mem[0x4008ea], '\xca')
        self.assertEqual(mem[0x4008eb], 'q')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196588L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_6(self):
        ''' Instruction PCMPISTRM_6
            Groups: sse42
            0x400808:	pcmpistrm	xmm1, xmm2, 0x28
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400808] = 'f'
        mem[0x00400809] = '\x0f'
        mem[0x0040080a] = ':'
        mem[0x0040080b] = 'b'
        mem[0x0040080c] = '\xca'
        mem[0x0040080d] = '('
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x400808
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400808], 'f')
        self.assertEqual(mem[0x400809], '\x0f')
        self.assertEqual(mem[0x40080a], ':')
        self.assertEqual(mem[0x40080b], 'b')
        self.assertEqual(mem[0x40080c], '\xca')
        self.assertEqual(mem[0x40080d], '(')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196366L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_60(self):
        ''' Instruction PCMPISTRM_60
            Groups: sse42
            0x4008d4:	pcmpistrm	xmm1, xmm2, 0x6c
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004008d4] = 'f'
        mem[0x004008d5] = '\x0f'
        mem[0x004008d6] = ':'
        mem[0x004008d7] = 'b'
        mem[0x004008d8] = '\xca'
        mem[0x004008d9] = 'l'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4008d4
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4008d4], 'f')
        self.assertEqual(mem[0x4008d5], '\x0f')
        self.assertEqual(mem[0x4008d6], ':')
        self.assertEqual(mem[0x4008d7], 'b')
        self.assertEqual(mem[0x4008d8], '\xca')
        self.assertEqual(mem[0x4008d9], 'l')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196570L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_61(self):
        ''' Instruction PCMPISTRM_61
            Groups: sse42
            0x400796:	pcmpistrm	xmm1, xmm2, 1
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400796] = 'f'
        mem[0x00400797] = '\x0f'
        mem[0x00400798] = ':'
        mem[0x00400799] = 'b'
        mem[0x0040079a] = '\xca'
        mem[0x0040079b] = '\x01'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x400796
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400796], 'f')
        self.assertEqual(mem[0x400797], '\x0f')
        self.assertEqual(mem[0x400798], ':')
        self.assertEqual(mem[0x400799], 'b')
        self.assertEqual(mem[0x40079a], '\xca')
        self.assertEqual(mem[0x40079b], '\x01')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196252L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_62(self):
        ''' Instruction PCMPISTRM_62
            Groups: sse42
            0x40083e:	pcmpistrm	xmm1, xmm2, 0x39
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400840] = ':'
        mem[0x00400841] = 'b'
        mem[0x00400842] = '\xca'
        mem[0x00400843] = '9'
        mem[0x0040083e] = 'f'
        mem[0x0040083f] = '\x0f'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x40083e
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400840], ':')
        self.assertEqual(mem[0x400841], 'b')
        self.assertEqual(mem[0x400842], '\xca')
        self.assertEqual(mem[0x400843], '9')
        self.assertEqual(mem[0x40083e], 'f')
        self.assertEqual(mem[0x40083f], '\x0f')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196420L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_63(self):
        ''' Instruction PCMPISTRM_63
            Groups: sse42
            0x400790:	pcmpistrm	xmm1, xmm2, 0
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400790] = 'f'
        mem[0x00400791] = '\x0f'
        mem[0x00400792] = ':'
        mem[0x00400793] = 'b'
        mem[0x00400794] = '\xca'
        mem[0x00400795] = '\x00'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = False
        cpu.CF = False
        cpu.RIP = 0x400790
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400790], 'f')
        self.assertEqual(mem[0x400791], '\x0f')
        self.assertEqual(mem[0x400792], ':')
        self.assertEqual(mem[0x400793], 'b')
        self.assertEqual(mem[0x400794], '\xca')
        self.assertEqual(mem[0x400795], '\x00')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196246L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_64(self):
        ''' Instruction PCMPISTRM_64
            Groups: sse42
            0x4007c0:	pcmpistrm	xmm1, xmm2, 0x10
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007c0] = 'f'
        mem[0x004007c1] = '\x0f'
        mem[0x004007c2] = ':'
        mem[0x004007c3] = 'b'
        mem[0x004007c4] = '\xca'
        mem[0x004007c5] = '\x10'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x4007c0
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007c0], 'f')
        self.assertEqual(mem[0x4007c1], '\x0f')
        self.assertEqual(mem[0x4007c2], ':')
        self.assertEqual(mem[0x4007c3], 'b')
        self.assertEqual(mem[0x4007c4], '\xca')
        self.assertEqual(mem[0x4007c5], '\x10')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, True)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, True)
        self.assertEqual(cpu.RIP, 4196294L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_7(self):
        ''' Instruction PCMPISTRM_7
            Groups: sse42
            0x4007f0:	pcmpistrm	xmm1, xmm2, 0x20
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x004007f0] = 'f'
        mem[0x004007f1] = '\x0f'
        mem[0x004007f2] = ':'
        mem[0x004007f3] = 'b'
        mem[0x004007f4] = '\xca'
        mem[0x004007f5] = ' '
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = True
        cpu.ZF = True
        cpu.CF = True
        cpu.RIP = 0x4007f0
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x4007f0], 'f')
        self.assertEqual(mem[0x4007f1], '\x0f')
        self.assertEqual(mem[0x4007f2], ':')
        self.assertEqual(mem[0x4007f3], 'b')
        self.assertEqual(mem[0x4007f4], '\xca')
        self.assertEqual(mem[0x4007f5], ' ')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196342L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_8(self):
        ''' Instruction PCMPISTRM_8
            Groups: sse42
            0x40086e:	pcmpistrm	xmm1, xmm2, 0x49
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x0040086e] = 'f'
        mem[0x0040086f] = '\x0f'
        mem[0x00400870] = ':'
        mem[0x00400871] = 'b'
        mem[0x00400872] = '\xca'
        mem[0x00400873] = 'I'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x40086e
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x40086e], 'f')
        self.assertEqual(mem[0x40086f], '\x0f')
        self.assertEqual(mem[0x400870], ':')
        self.assertEqual(mem[0x400871], 'b')
        self.assertEqual(mem[0x400872], '\xca')
        self.assertEqual(mem[0x400873], 'I')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196468L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPISTRM_9(self):
        ''' Instruction PCMPISTRM_9
            Groups: sse42
            0x400862:	pcmpistrm	xmm1, xmm2, 0x45
        '''
        mem = Memory64()
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x00400862] = 'f'
        mem[0x00400863] = '\x0f'
        mem[0x00400864] = ':'
        mem[0x00400865] = 'b'
        mem[0x00400866] = '\xca'
        mem[0x00400867] = 'E'
        cpu.XMM2 = 0x363534333231
        cpu.XMM1 = 0x48474645444342414847464544434241
        cpu.PF = False
        cpu.AF = False
        cpu.OF = False
        cpu.ZF = True
        cpu.CF = False
        cpu.RIP = 0x400862
        cpu.SF = False
        cpu.execute()
    
        self.assertEqual(mem[0x400862], 'f')
        self.assertEqual(mem[0x400863], '\x0f')
        self.assertEqual(mem[0x400864], ':')
        self.assertEqual(mem[0x400865], 'b')
        self.assertEqual(mem[0x400866], '\xca')
        self.assertEqual(mem[0x400867], 'E')
        self.assertEqual(cpu.XMM2, 59602136937009)
        self.assertEqual(cpu.XMM1, 96074494030011676290068831614766629441L)
        self.assertEqual(cpu.PF, False)
        self.assertEqual(cpu.AF, False)
        self.assertEqual(cpu.OF, False)
        self.assertEqual(cpu.ZF, True)
        self.assertEqual(cpu.CF, False)
        self.assertEqual(cpu.RIP, 4196456L)
        self.assertEqual(cpu.SF, False)

    def test_PCMPESTRI_1_symbolic(self):
        ''' Instruction PCMPESTRI_1
            Groups: sse42
            0x400bec:	pcmpestri	xmm1, xmm2, 0x64
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400bec] = 'f'
        mem[0x400bed] = '\x0f'
        mem[0x400bee] = ':'
        mem[0x400bef] = 'a'
        mem[0x400bf0] = '\xca'
        mem[0x400bf1] = 'd'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400bec
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400becL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400becL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400bec, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bed, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bee, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400bef, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400bf0, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400bf1, 8)== ord('d'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400bf2)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x10)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_10_symbolic(self):
        ''' Instruction PCMPESTRI_10
            Groups: sse42
            0x400b20:	pcmpestri	xmm1, xmm2, 0x20
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b20] = 'f'
        mem[0x400b21] = '\x0f'
        mem[0x400b22] = ':'
        mem[0x400b23] = 'a'
        mem[0x400b24] = '\xca'
        mem[0x400b25] = ' '
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b20
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b20L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b20L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b20, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b21, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b22, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b23, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b24, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b25, 8)== ord(' '))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b26)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x10)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_11_symbolic(self):
        ''' Instruction PCMPESTRI_11
            Groups: sse42
            0x400b38:	pcmpestri	xmm1, xmm2, 0x28
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b38] = 'f'
        mem[0x400b39] = '\x0f'
        mem[0x400b3a] = ':'
        mem[0x400b3b] = 'a'
        mem[0x400b3c] = '\xca'
        mem[0x400b3d] = '('
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b38
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b38L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b38L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b38, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b39, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b3a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b3b, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b3c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b3d, 8)== ord('('))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b3e)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x7)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_12_symbolic(self):
        ''' Instruction PCMPESTRI_12
            Groups: sse42
            0x400bfe:	pcmpestri	xmm1, xmm2, 0x69
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400c00] = ':'
        mem[0x400c01] = 'a'
        mem[0x400c02] = '\xca'
        mem[0x400c03] = 'i'
        mem[0x400bfe] = 'f'
        mem[0x400bff] = '\x0f'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400bfe
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400bfeL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400bfeL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400c00, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400c01, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400c02, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400c03, 8)== ord('i'))
        condition = Operators.AND(condition, cpu.read_int(0x400bfe, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bff, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400c04)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x7)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_13_symbolic(self):
        ''' Instruction PCMPESTRI_13
            Groups: sse42
            0x400b86:	pcmpestri	xmm1, xmm2, 0x41
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b86] = 'f'
        mem[0x400b87] = '\x0f'
        mem[0x400b88] = ':'
        mem[0x400b89] = 'a'
        mem[0x400b8a] = '\xca'
        mem[0x400b8b] = 'A'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b86
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b86L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b86L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b86, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b87, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b88, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b89, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b8a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b8b, 8)== ord('A'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b8c)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x8)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_14_symbolic(self):
        ''' Instruction PCMPESTRI_14
            Groups: sse42
            0x400ae4:	pcmpestri	xmm1, xmm2, 0xc
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400ae4] = 'f'
        mem[0x400ae5] = '\x0f'
        mem[0x400ae6] = ':'
        mem[0x400ae7] = 'a'
        mem[0x400ae8] = '\xca'
        mem[0x400ae9] = '\x0c'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400ae4
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400ae4L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400ae4L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400ae4, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ae5, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ae6, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400ae7, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400ae8, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400ae9, 8)== ord('\x0c'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400aea)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x10)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_15_symbolic(self):
        ''' Instruction PCMPESTRI_15
            Groups: sse42
            0x400c04:	pcmpestri	xmm1, xmm2, 0x6c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400c04] = 'f'
        mem[0x400c05] = '\x0f'
        mem[0x400c06] = ':'
        mem[0x400c07] = 'a'
        mem[0x400c08] = '\xca'
        mem[0x400c09] = 'l'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400c04
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400c04L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400c04L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400c04, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c05, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c06, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400c07, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400c08, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400c09, 8)== ord('l'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400c0a)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x10)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_16_symbolic(self):
        ''' Instruction PCMPESTRI_16
            Groups: sse42
            0x400b6e:	pcmpestri	xmm1, xmm2, 0x39
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b6e] = 'f'
        mem[0x400b6f] = '\x0f'
        mem[0x400b70] = ':'
        mem[0x400b71] = 'a'
        mem[0x400b72] = '\xca'
        mem[0x400b73] = '9'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b6e
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b6eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b6eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b6e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b6f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b70, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b71, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b72, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b73, 8)== ord('9'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b74)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_17_symbolic(self):
        ''' Instruction PCMPESTRI_17
            Groups: sse42
            0x400b2c:	pcmpestri	xmm1, xmm2, 0x24
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b2c] = 'f'
        mem[0x400b2d] = '\x0f'
        mem[0x400b2e] = ':'
        mem[0x400b2f] = 'a'
        mem[0x400b30] = '\xca'
        mem[0x400b31] = '$'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b2c
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b2cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b2cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b2c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b2d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b2e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b2f, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b30, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b31, 8)== ord('$'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b32)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x10)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_18_symbolic(self):
        ''' Instruction PCMPESTRI_18
            Groups: sse42
            0x400af0:	pcmpestri	xmm1, xmm2, 0x10
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400af0] = 'f'
        mem[0x400af1] = '\x0f'
        mem[0x400af2] = ':'
        mem[0x400af3] = 'a'
        mem[0x400af4] = '\xca'
        mem[0x400af5] = '\x10'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400af0
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400af0L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400af0L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400af0, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400af1, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400af2, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400af3, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400af4, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400af5, 8)== ord('\x10'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400af6)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_19_symbolic(self):
        ''' Instruction PCMPESTRI_19
            Groups: sse42
            0x400be0:	pcmpestri	xmm1, xmm2, 0x60
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400be0] = 'f'
        mem[0x400be1] = '\x0f'
        mem[0x400be2] = ':'
        mem[0x400be3] = 'a'
        mem[0x400be4] = '\xca'
        mem[0x400be5] = '`'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400be0
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400be0L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400be0L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400be0, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400be1, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400be2, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400be3, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400be4, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400be5, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400be6)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x10)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_2_symbolic(self):
        ''' Instruction PCMPESTRI_2
            Groups: sse42
            0x400b4a:	pcmpestri	xmm1, xmm2, 0x2d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b4a] = 'f'
        mem[0x400b4b] = '\x0f'
        mem[0x400b4c] = ':'
        mem[0x400b4d] = 'a'
        mem[0x400b4e] = '\xca'
        mem[0x400b4f] = '-'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b4a
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b4aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b4aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b4a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b4b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b4c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b4d, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b4e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b4f, 8)== ord('-'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b50)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x8)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_20_symbolic(self):
        ''' Instruction PCMPESTRI_20
            Groups: sse42
            0x400c0a:	pcmpestri	xmm1, xmm2, 0x6d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400c0a] = 'f'
        mem[0x400c0b] = '\x0f'
        mem[0x400c0c] = ':'
        mem[0x400c0d] = 'a'
        mem[0x400c0e] = '\xca'
        mem[0x400c0f] = 'm'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400c0a
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400c0aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400c0aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400c0a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c0b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c0c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400c0d, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400c0e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400c0f, 8)== ord('m'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400c10)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x8)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_21_symbolic(self):
        ''' Instruction PCMPESTRI_21
            Groups: sse42
            0x400b14:	pcmpestri	xmm1, xmm2, 0x1c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b14] = 'f'
        mem[0x400b15] = '\x0f'
        mem[0x400b16] = ':'
        mem[0x400b17] = 'a'
        mem[0x400b18] = '\xca'
        mem[0x400b19] = '\x1c'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b14
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b14L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b14L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b14, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b15, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b16, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b17, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b18, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b19, 8)== ord('\x1c'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b1a)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_22_symbolic(self):
        ''' Instruction PCMPESTRI_22
            Groups: sse42
            0x400bb6:	pcmpestri	xmm1, xmm2, 0x51
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400bb6] = 'f'
        mem[0x400bb7] = '\x0f'
        mem[0x400bb8] = ':'
        mem[0x400bb9] = 'a'
        mem[0x400bba] = '\xca'
        mem[0x400bbb] = 'Q'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400bb6
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400bb6L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400bb6L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400bb6, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bb7, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bb8, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400bb9, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400bba, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400bbb, 8)== ord('Q'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400bbc)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x7)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_23_symbolic(self):
        ''' Instruction PCMPESTRI_23
            Groups: sse42
            0x400b08:	pcmpestri	xmm1, xmm2, 0x18
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b08] = 'f'
        mem[0x400b09] = '\x0f'
        mem[0x400b0a] = ':'
        mem[0x400b0b] = 'a'
        mem[0x400b0c] = '\xca'
        mem[0x400b0d] = '\x18'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b08
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b08L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b08L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b08, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b09, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b0a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b0b, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b0c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b0d, 8)== ord('\x18'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b0e)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_24_symbolic(self):
        ''' Instruction PCMPESTRI_24
            Groups: sse42
            0x400c1c:	pcmpestri	xmm1, xmm2, 0x74
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400c20] = '\xca'
        mem[0x400c21] = 't'
        mem[0x400c1c] = 'f'
        mem[0x400c1d] = '\x0f'
        mem[0x400c1e] = ':'
        mem[0x400c1f] = 'a'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400c1c
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x6)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400c1cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400c1cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400c20, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400c21, 8)== ord('t'))
        condition = Operators.AND(condition, cpu.read_int(0x400c1c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c1d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c1e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400c1f, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400c22)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x6)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_25_symbolic(self):
        ''' Instruction PCMPESTRI_25
            Groups: sse42
            0x400bda:	pcmpestri	xmm1, xmm2, 0x5d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400bda] = 'f'
        mem[0x400bdb] = '\x0f'
        mem[0x400bdc] = ':'
        mem[0x400bdd] = 'a'
        mem[0x400bde] = '\xca'
        mem[0x400bdf] = ']'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400bda
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400bdaL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400bdaL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400bda, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bdb, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bdc, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400bdd, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400bde, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400bdf, 8)== ord(']'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400be0)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x7)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_26_symbolic(self):
        ''' Instruction PCMPESTRI_26
            Groups: sse42
            0x400c10:	pcmpestri	xmm1, xmm2, 0x70
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400c10] = 'f'
        mem[0x400c11] = '\x0f'
        mem[0x400c12] = ':'
        mem[0x400c13] = 'a'
        mem[0x400c14] = '\xca'
        mem[0x400c15] = 'p'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400c10
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400c10L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400c10L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400c10, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c11, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c12, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400c13, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400c14, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400c15, 8)== ord('p'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400c16)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x6)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_27_symbolic(self):
        ''' Instruction PCMPESTRI_27
            Groups: sse42
            0x400c34:	pcmpestri	xmm1, xmm2, 0x7c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400c34] = 'f'
        mem[0x400c35] = '\x0f'
        mem[0x400c36] = ':'
        mem[0x400c37] = 'a'
        mem[0x400c38] = '\xca'
        mem[0x400c39] = '|'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400c34
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400c34L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400c34L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400c34, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c35, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c36, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400c37, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400c38, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400c39, 8)== ord('|'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400c3a)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x6)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_28_symbolic(self):
        ''' Instruction PCMPESTRI_28
            Groups: sse42
            0x400c2e:	pcmpestri	xmm1, xmm2, 0x79
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400c2e] = 'f'
        mem[0x400c2f] = '\x0f'
        mem[0x400c30] = ':'
        mem[0x400c31] = 'a'
        mem[0x400c32] = '\xca'
        mem[0x400c33] = 'y'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400c2e
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400c2eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400c2eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400c2e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c2f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c30, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400c31, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400c32, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400c33, 8)== ord('y'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400c34)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x7)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_29_symbolic(self):
        ''' Instruction PCMPESTRI_29
            Groups: sse42
            0x400b80:	pcmpestri	xmm1, xmm2, 0x40
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b80] = 'f'
        mem[0x400b81] = '\x0f'
        mem[0x400b82] = ':'
        mem[0x400b83] = 'a'
        mem[0x400b84] = '\xca'
        mem[0x400b85] = '@'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b80
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b80L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b80L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b80, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b81, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b82, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b83, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b84, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b85, 8)== ord('@'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b86)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x10)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_3_symbolic(self):
        ''' Instruction PCMPESTRI_3
            Groups: sse42
            0x400ac6:	pcmpestri	xmm1, xmm2, 1
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400ac6] = 'f'
        mem[0x400ac7] = '\x0f'
        mem[0x400ac8] = ':'
        mem[0x400ac9] = 'a'
        mem[0x400aca] = '\xca'
        mem[0x400acb] = '\x01'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400ac6
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400ac6L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400ac6L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400ac6, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ac7, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ac8, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400ac9, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400aca, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400acb, 8)== ord('\x01'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400acc)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x8)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_30_symbolic(self):
        ''' Instruction PCMPESTRI_30
            Groups: sse42
            0x400ba4:	pcmpestri	xmm1, xmm2, 0x4c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400ba4] = 'f'
        mem[0x400ba5] = '\x0f'
        mem[0x400ba6] = ':'
        mem[0x400ba7] = 'a'
        mem[0x400ba8] = '\xca'
        mem[0x400ba9] = 'L'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400ba4
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400ba4L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400ba4L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400ba4, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ba5, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ba6, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400ba7, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400ba8, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400ba9, 8)== ord('L'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400baa)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x10)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_31_symbolic(self):
        ''' Instruction PCMPESTRI_31
            Groups: sse42
            0x400ad8:	pcmpestri	xmm1, xmm2, 8
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400ad8] = 'f'
        mem[0x400ad9] = '\x0f'
        mem[0x400ada] = ':'
        mem[0x400adb] = 'a'
        mem[0x400adc] = '\xca'
        mem[0x400add] = '\x08'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400ad8
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400ad8L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400ad8L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400ad8, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ad9, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ada, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400adb, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400adc, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400add, 8)== ord('\x08'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400ade)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x7)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_32_symbolic(self):
        ''' Instruction PCMPESTRI_32
            Groups: sse42
            0x400b50:	pcmpestri	xmm1, xmm2, 0x30
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b50] = 'f'
        mem[0x400b51] = '\x0f'
        mem[0x400b52] = ':'
        mem[0x400b53] = 'a'
        mem[0x400b54] = '\xca'
        mem[0x400b55] = '0'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b50
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b50L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b50L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b50, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b51, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b52, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b53, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b54, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b55, 8)== ord('0'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b56)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_33_symbolic(self):
        ''' Instruction PCMPESTRI_33
            Groups: sse42
            0x400b44:	pcmpestri	xmm1, xmm2, 0x2c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b44] = 'f'
        mem[0x400b45] = '\x0f'
        mem[0x400b46] = ':'
        mem[0x400b47] = 'a'
        mem[0x400b48] = '\xca'
        mem[0x400b49] = ','
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b44
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b44L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b44L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b44, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b45, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b46, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b47, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b48, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b49, 8)== ord(','))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b4a)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x10)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_34_symbolic(self):
        ''' Instruction PCMPESTRI_34
            Groups: sse42
            0x400bbc:	pcmpestri	xmm1, xmm2, 0x54
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400bc0] = '\xca'
        mem[0x400bc1] = 'T'
        mem[0x400bbc] = 'f'
        mem[0x400bbd] = '\x0f'
        mem[0x400bbe] = ':'
        mem[0x400bbf] = 'a'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400bbc
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400bbcL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400bbcL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400bc0, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400bc1, 8)== ord('T'))
        condition = Operators.AND(condition, cpu.read_int(0x400bbc, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bbd, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bbe, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400bbf, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400bc2)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0xf)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_35_symbolic(self):
        ''' Instruction PCMPESTRI_35
            Groups: sse42
            0x400ad2:	pcmpestri	xmm1, xmm2, 5
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400ad2] = 'f'
        mem[0x400ad3] = '\x0f'
        mem[0x400ad4] = ':'
        mem[0x400ad5] = 'a'
        mem[0x400ad6] = '\xca'
        mem[0x400ad7] = '\x05'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400ad2
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400ad2L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400ad2L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400ad2, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ad3, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ad4, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400ad5, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400ad6, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400ad7, 8)== ord('\x05'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400ad8)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x8)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_36_symbolic(self):
        ''' Instruction PCMPESTRI_36
            Groups: sse42
            0x400b26:	pcmpestri	xmm1, xmm2, 0x21
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b26] = 'f'
        mem[0x400b27] = '\x0f'
        mem[0x400b28] = ':'
        mem[0x400b29] = 'a'
        mem[0x400b2a] = '\xca'
        mem[0x400b2b] = '!'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b26
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b26L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b26L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b26, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b27, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b28, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b29, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b2a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b2b, 8)== ord('!'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b2c)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x8)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_37_symbolic(self):
        ''' Instruction PCMPESTRI_37
            Groups: sse42
            0x400bc8:	pcmpestri	xmm1, xmm2, 0x58
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400bc8] = 'f'
        mem[0x400bc9] = '\x0f'
        mem[0x400bca] = ':'
        mem[0x400bcb] = 'a'
        mem[0x400bcc] = '\xca'
        mem[0x400bcd] = 'X'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400bc8
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400bc8L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400bc8L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400bc8, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bc9, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bca, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400bcb, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400bcc, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400bcd, 8)== ord('X'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400bce)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x6)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_38_symbolic(self):
        ''' Instruction PCMPESTRI_38
            Groups: sse42
            0x400b98:	pcmpestri	xmm1, xmm2, 0x48
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b98] = 'f'
        mem[0x400b99] = '\x0f'
        mem[0x400b9a] = ':'
        mem[0x400b9b] = 'a'
        mem[0x400b9c] = '\xca'
        mem[0x400b9d] = 'H'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b98
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b98L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b98L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b98, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b99, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b9a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b9b, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b9c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b9d, 8)== ord('H'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b9e)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0xf)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_39_symbolic(self):
        ''' Instruction PCMPESTRI_39
            Groups: sse42
            0x400b02:	pcmpestri	xmm1, xmm2, 0x15
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b02] = 'f'
        mem[0x400b03] = '\x0f'
        mem[0x400b04] = ':'
        mem[0x400b05] = 'a'
        mem[0x400b06] = '\xca'
        mem[0x400b07] = '\x15'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b02
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b02L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b02L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b02, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b03, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b04, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b05, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b06, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b07, 8)== ord('\x15'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b08)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_4_symbolic(self):
        ''' Instruction PCMPESTRI_4
            Groups: sse42
            0x400c22:	pcmpestri	xmm1, xmm2, 0x75
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400c22] = 'f'
        mem[0x400c23] = '\x0f'
        mem[0x400c24] = ':'
        mem[0x400c25] = 'a'
        mem[0x400c26] = '\xca'
        mem[0x400c27] = 'u'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400c22
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x6)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400c22L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400c22L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400c22, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c23, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c24, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400c25, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400c26, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400c27, 8)== ord('u'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400c28)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x6)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_40_symbolic(self):
        ''' Instruction PCMPESTRI_40
            Groups: sse42
            0x400c3a:	pcmpestri	xmm1, xmm2, 0x7d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400c3a] = 'f'
        mem[0x400c3b] = '\x0f'
        mem[0x400c3c] = ':'
        mem[0x400c3d] = 'a'
        mem[0x400c3e] = '\xca'
        mem[0x400c3f] = '}'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400c3a
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x6)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400c3aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400c3aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400c3a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c3b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c3c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400c3d, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400c3e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400c3f, 8)== ord('}'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400c40)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x6)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_41_symbolic(self):
        ''' Instruction PCMPESTRI_41
            Groups: sse42
            0x400af6:	pcmpestri	xmm1, xmm2, 0x11
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400af6] = 'f'
        mem[0x400af7] = '\x0f'
        mem[0x400af8] = ':'
        mem[0x400af9] = 'a'
        mem[0x400afa] = '\xca'
        mem[0x400afb] = '\x11'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400af6
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400af6L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400af6L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400af6, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400af7, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400af8, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400af9, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400afa, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400afb, 8)== ord('\x11'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400afc)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_42_symbolic(self):
        ''' Instruction PCMPESTRI_42
            Groups: sse42
            0x400c28:	pcmpestri	xmm1, xmm2, 0x78
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400c28] = 'f'
        mem[0x400c29] = '\x0f'
        mem[0x400c2a] = ':'
        mem[0x400c2b] = 'a'
        mem[0x400c2c] = '\xca'
        mem[0x400c2d] = 'x'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400c28
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x6)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400c28L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400c28L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400c28, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c29, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c2a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400c2b, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400c2c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400c2d, 8)== ord('x'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400c2e)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0xf)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_43_symbolic(self):
        ''' Instruction PCMPESTRI_43
            Groups: sse42
            0x400b62:	pcmpestri	xmm1, xmm2, 0x35
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b62] = 'f'
        mem[0x400b63] = '\x0f'
        mem[0x400b64] = ':'
        mem[0x400b65] = 'a'
        mem[0x400b66] = '\xca'
        mem[0x400b67] = '5'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b62
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b62L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b62L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b62, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b63, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b64, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b65, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b66, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b67, 8)== ord('5'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b68)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_44_symbolic(self):
        ''' Instruction PCMPESTRI_44
            Groups: sse42
            0x400baa:	pcmpestri	xmm1, xmm2, 0x4d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400baa] = 'f'
        mem[0x400bab] = '\x0f'
        mem[0x400bac] = ':'
        mem[0x400bad] = 'a'
        mem[0x400bae] = '\xca'
        mem[0x400baf] = 'M'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400baa
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400baaL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400baaL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400baa, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bab, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bac, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400bad, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400bae, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400baf, 8)== ord('M'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400bb0)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x8)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_45_symbolic(self):
        ''' Instruction PCMPESTRI_45
            Groups: sse42
            0x400b68:	pcmpestri	xmm1, xmm2, 0x38
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b68] = 'f'
        mem[0x400b69] = '\x0f'
        mem[0x400b6a] = ':'
        mem[0x400b6b] = 'a'
        mem[0x400b6c] = '\xca'
        mem[0x400b6d] = '8'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b68
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b68L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b68L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b68, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b69, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b6a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b6b, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b6c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b6d, 8)== ord('8'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b6e)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_46_symbolic(self):
        ''' Instruction PCMPESTRI_46
            Groups: sse42
            0x400c16:	pcmpestri	xmm1, xmm2, 0x71
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400c16] = 'f'
        mem[0x400c17] = '\x0f'
        mem[0x400c18] = ':'
        mem[0x400c19] = 'a'
        mem[0x400c1a] = '\xca'
        mem[0x400c1b] = 'q'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400c16
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x6)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400c16L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400c16L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400c16, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c17, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400c18, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400c19, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400c1a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400c1b, 8)== ord('q'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400c1c)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x6)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_47_symbolic(self):
        ''' Instruction PCMPESTRI_47
            Groups: sse42
            0x400acc:	pcmpestri	xmm1, xmm2, 4
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400acc] = 'f'
        mem[0x400acd] = '\x0f'
        mem[0x400ace] = ':'
        mem[0x400acf] = 'a'
        mem[0x400ad0] = '\xca'
        mem[0x400ad1] = '\x04'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400acc
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400accL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400accL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400acc, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400acd, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ace, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400acf, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400ad0, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400ad1, 8)== ord('\x04'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400ad2)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x10)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_48_symbolic(self):
        ''' Instruction PCMPESTRI_48
            Groups: sse42
            0x400b92:	pcmpestri	xmm1, xmm2, 0x45
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b92] = 'f'
        mem[0x400b93] = '\x0f'
        mem[0x400b94] = ':'
        mem[0x400b95] = 'a'
        mem[0x400b96] = '\xca'
        mem[0x400b97] = 'E'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b92
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b92L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b92L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b92, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b93, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b94, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b95, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b96, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b97, 8)== ord('E'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b98)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x8)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_49_symbolic(self):
        ''' Instruction PCMPESTRI_49
            Groups: sse42
            0x400afc:	pcmpestri	xmm1, xmm2, 0x14
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b00] = '\xca'
        mem[0x400b01] = '\x14'
        mem[0x400afc] = 'f'
        mem[0x400afd] = '\x0f'
        mem[0x400afe] = ':'
        mem[0x400aff] = 'a'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400afc
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400afcL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400afcL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b00, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b01, 8)== ord('\x14'))
        condition = Operators.AND(condition, cpu.read_int(0x400afc, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400afd, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400afe, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400aff, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b02)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_5_symbolic(self):
        ''' Instruction PCMPESTRI_5
            Groups: sse42
            0x400be6:	pcmpestri	xmm1, xmm2, 0x61
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400be6] = 'f'
        mem[0x400be7] = '\x0f'
        mem[0x400be8] = ':'
        mem[0x400be9] = 'a'
        mem[0x400bea] = '\xca'
        mem[0x400beb] = 'a'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400be6
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400be6L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400be6L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400be6, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400be7, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400be8, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400be9, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400bea, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400beb, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400bec)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x8)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_50_symbolic(self):
        ''' Instruction PCMPESTRI_50
            Groups: sse42
            0x400b9e:	pcmpestri	xmm1, xmm2, 0x49
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400ba0] = ':'
        mem[0x400ba1] = 'a'
        mem[0x400ba2] = '\xca'
        mem[0x400ba3] = 'I'
        mem[0x400b9e] = 'f'
        mem[0x400b9f] = '\x0f'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b9e
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b9eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b9eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400ba0, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400ba1, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400ba2, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400ba3, 8)== ord('I'))
        condition = Operators.AND(condition, cpu.read_int(0x400b9e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b9f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400ba4)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x7)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_51_symbolic(self):
        ''' Instruction PCMPESTRI_51
            Groups: sse42
            0x400ac0:	pcmpestri	xmm1, xmm2, 0
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400ac0] = 'f'
        mem[0x400ac1] = '\x0f'
        mem[0x400ac2] = ':'
        mem[0x400ac3] = 'a'
        mem[0x400ac4] = '\xca'
        mem[0x400ac5] = '\x00'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400ac0
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400ac0L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400ac0L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400ac0, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ac1, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400ac2, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400ac3, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400ac4, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400ac5, 8)== ord('\x00'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400ac6)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x10)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_52_symbolic(self):
        ''' Instruction PCMPESTRI_52
            Groups: sse42
            0x400b74:	pcmpestri	xmm1, xmm2, 0x3c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b74] = 'f'
        mem[0x400b75] = '\x0f'
        mem[0x400b76] = ':'
        mem[0x400b77] = 'a'
        mem[0x400b78] = '\xca'
        mem[0x400b79] = '<'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b74
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b74L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b74L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b74, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b75, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b76, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b77, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b78, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b79, 8)== ord('<'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b7a)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_53_symbolic(self):
        ''' Instruction PCMPESTRI_53
            Groups: sse42
            0x400bce:	pcmpestri	xmm1, xmm2, 0x59
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400bce] = 'f'
        mem[0x400bcf] = '\x0f'
        mem[0x400bd0] = ':'
        mem[0x400bd1] = 'a'
        mem[0x400bd2] = '\xca'
        mem[0x400bd3] = 'Y'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400bce
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x6)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400bceL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400bceL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400bce, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bcf, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bd0, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400bd1, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400bd2, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400bd3, 8)== ord('Y'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400bd4)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x6)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_54_symbolic(self):
        ''' Instruction PCMPESTRI_54
            Groups: sse42
            0x400b56:	pcmpestri	xmm1, xmm2, 0x31
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b56] = 'f'
        mem[0x400b57] = '\x0f'
        mem[0x400b58] = ':'
        mem[0x400b59] = 'a'
        mem[0x400b5a] = '\xca'
        mem[0x400b5b] = '1'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b56
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b56L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b56L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b56, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b57, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b58, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b59, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b5a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b5b, 8)== ord('1'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b5c)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_55_symbolic(self):
        ''' Instruction PCMPESTRI_55
            Groups: sse42
            0x400b7a:	pcmpestri	xmm1, xmm2, 0x3d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b7a] = 'f'
        mem[0x400b7b] = '\x0f'
        mem[0x400b7c] = ':'
        mem[0x400b7d] = 'a'
        mem[0x400b7e] = '\xca'
        mem[0x400b7f] = '='
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b7a
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b7aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b7aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b7a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b7b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b7c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b7d, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b7e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b7f, 8)== ord('='))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b80)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_56_symbolic(self):
        ''' Instruction PCMPESTRI_56
            Groups: sse42
            0x400b5c:	pcmpestri	xmm1, xmm2, 0x34
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b60] = '\xca'
        mem[0x400b61] = '4'
        mem[0x400b5c] = 'f'
        mem[0x400b5d] = '\x0f'
        mem[0x400b5e] = ':'
        mem[0x400b5f] = 'a'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b5c
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b5cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b5cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b60, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b61, 8)== ord('4'))
        condition = Operators.AND(condition, cpu.read_int(0x400b5c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b5d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b5e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b5f, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b62)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_57_symbolic(self):
        ''' Instruction PCMPESTRI_57
            Groups: sse42
            0x400ade:	pcmpestri	xmm1, xmm2, 9
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400ae0] = ':'
        mem[0x400ae1] = 'a'
        mem[0x400ae2] = '\xca'
        mem[0x400ae3] = '\t'
        mem[0x400ade] = 'f'
        mem[0x400adf] = '\x0f'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400ade
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400adeL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400adeL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400ae0, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400ae1, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400ae2, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400ae3, 8)== ord('\t'))
        condition = Operators.AND(condition, cpu.read_int(0x400ade, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400adf, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400ae4)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x7)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_58_symbolic(self):
        ''' Instruction PCMPESTRI_58
            Groups: sse42
            0x400b3e:	pcmpestri	xmm1, xmm2, 0x29
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b40] = ':'
        mem[0x400b41] = 'a'
        mem[0x400b42] = '\xca'
        mem[0x400b43] = ')'
        mem[0x400b3e] = 'f'
        mem[0x400b3f] = '\x0f'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b3e
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b3eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b3eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b40, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b41, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b42, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b43, 8)== ord(')'))
        condition = Operators.AND(condition, cpu.read_int(0x400b3e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b3f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b44)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x7)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_59_symbolic(self):
        ''' Instruction PCMPESTRI_59
            Groups: sse42
            0x400bb0:	pcmpestri	xmm1, xmm2, 0x50
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400bb0] = 'f'
        mem[0x400bb1] = '\x0f'
        mem[0x400bb2] = ':'
        mem[0x400bb3] = 'a'
        mem[0x400bb4] = '\xca'
        mem[0x400bb5] = 'P'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400bb0
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400bb0L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400bb0L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400bb0, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bb1, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bb2, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400bb3, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400bb4, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400bb5, 8)== ord('P'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400bb6)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0xf)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_6_symbolic(self):
        ''' Instruction PCMPESTRI_6
            Groups: sse42
            0x400b0e:	pcmpestri	xmm1, xmm2, 0x19
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b0e] = 'f'
        mem[0x400b0f] = '\x0f'
        mem[0x400b10] = ':'
        mem[0x400b11] = 'a'
        mem[0x400b12] = '\xca'
        mem[0x400b13] = '\x19'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b0e
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b0eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b0eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b0e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b0f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b10, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b11, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b12, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b13, 8)== ord('\x19'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b14)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_60_symbolic(self):
        ''' Instruction PCMPESTRI_60
            Groups: sse42
            0x400b1a:	pcmpestri	xmm1, xmm2, 0x1d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b1a] = 'f'
        mem[0x400b1b] = '\x0f'
        mem[0x400b1c] = ':'
        mem[0x400b1d] = 'a'
        mem[0x400b1e] = '\xca'
        mem[0x400b1f] = '\x1d'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400b1a
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b1aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b1aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b1a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b1b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b1c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b1d, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b1e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b1f, 8)== ord('\x1d'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400b20)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x0)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_61_symbolic(self):
        ''' Instruction PCMPESTRI_61
            Groups: sse42
            0x400bf2:	pcmpestri	xmm1, xmm2, 0x65
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400bf2] = 'f'
        mem[0x400bf3] = '\x0f'
        mem[0x400bf4] = ':'
        mem[0x400bf5] = 'a'
        mem[0x400bf6] = '\xca'
        mem[0x400bf7] = 'e'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400bf2
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400bf2L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400bf2L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400bf2, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bf3, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bf4, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400bf5, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400bf6, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400bf7, 8)== ord('e'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400bf8)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x8)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_62_symbolic(self):
        ''' Instruction PCMPESTRI_62
            Groups: sse42
            0x400bd4:	pcmpestri	xmm1, xmm2, 0x5c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400bd4] = 'f'
        mem[0x400bd5] = '\x0f'
        mem[0x400bd6] = ':'
        mem[0x400bd7] = 'a'
        mem[0x400bd8] = '\xca'
        mem[0x400bd9] = '\\'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400bd4
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x6)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400bd4L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400bd4L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400bd4, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bd5, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bd6, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400bd7, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400bd8, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400bd9, 8)== ord('\\'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400bda)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0xf)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_63_symbolic(self):
        ''' Instruction PCMPESTRI_63
            Groups: sse42
            0x400bf8:	pcmpestri	xmm1, xmm2, 0x68
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400bf8] = 'f'
        mem[0x400bf9] = '\x0f'
        mem[0x400bfa] = ':'
        mem[0x400bfb] = 'a'
        mem[0x400bfc] = '\xca'
        mem[0x400bfd] = 'h'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400bf8
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400bf8L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400bf8L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400bf8, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bf9, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bfa, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400bfb, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400bfc, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400bfd, 8)== ord('h'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400bfe)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0xf)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_64_symbolic(self):
        ''' Instruction PCMPESTRI_64
            Groups: sse42
            0x400bc2:	pcmpestri	xmm1, xmm2, 0x55
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400bc2] = 'f'
        mem[0x400bc3] = '\x0f'
        mem[0x400bc4] = ':'
        mem[0x400bc5] = 'a'
        mem[0x400bc6] = '\xca'
        mem[0x400bc7] = 'U'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400bc2
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400bc2L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400bc2L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400bc2, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bc3, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400bc4, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400bc5, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400bc6, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400bc7, 8)== ord('U'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400bc8)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x7)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_7_symbolic(self):
        ''' Instruction PCMPESTRI_7
            Groups: sse42
            0x400b8c:	pcmpestri	xmm1, xmm2, 0x44
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b8c] = 'f'
        mem[0x400b8d] = '\x0f'
        mem[0x400b8e] = ':'
        mem[0x400b8f] = 'a'
        mem[0x400b90] = '\xca'
        mem[0x400b91] = 'D'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b8c
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b8cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b8cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b8c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b8d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b8e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b8f, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b90, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b91, 8)== ord('D'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b92)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x10)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_8_symbolic(self):
        ''' Instruction PCMPESTRI_8
            Groups: sse42
            0x400aea:	pcmpestri	xmm1, xmm2, 0xd
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400aea] = 'f'
        mem[0x400aeb] = '\x0f'
        mem[0x400aec] = ':'
        mem[0x400aed] = 'a'
        mem[0x400aee] = '\xca'
        mem[0x400aef] = '\r'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400aea
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400aeaL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400aeaL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400aea, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400aeb, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400aec, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400aed, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400aee, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400aef, 8)== ord('\r'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400af0)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x8)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRI_9_symbolic(self):
        ''' Instruction PCMPESTRI_9
            Groups: sse42
            0x400b32:	pcmpestri	xmm1, xmm2, 0x25
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400b32] = 'f'
        mem[0x400b33] = '\x0f'
        mem[0x400b34] = ':'
        mem[0x400b35] = 'a'
        mem[0x400b36] = '\xca'
        mem[0x400b37] = '%'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400b32
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400b32L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400b32L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400b32, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b33, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400b34, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400b35, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.read_int(0x400b36, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400b37, 8)== ord('%'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400b38)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)
        condition = Operators.AND(condition, cpu.ECX == 0x8)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_1_symbolic(self):
        ''' Instruction PCMPESTRM_1
            Groups: sse42
            0x4009d0:	pcmpestrm	xmm1, xmm2, 0x38
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009d0] = 'f'
        mem[0x4009d1] = '\x0f'
        mem[0x4009d2] = ':'
        mem[0x4009d3] = '`'
        mem[0x4009d4] = '\xca'
        mem[0x4009d5] = '8'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x4009d0
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009d0L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009d0L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009d0, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009d1, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009d2, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009d3, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009d4, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009d5, 8)== ord('8'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4009d6)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_10_symbolic(self):
        ''' Instruction PCMPESTRM_10
            Groups: sse42
            0x4009ac:	pcmpestrm	xmm1, xmm2, 0x2c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009ac] = 'f'
        mem[0x4009ad] = '\x0f'
        mem[0x4009ae] = ':'
        mem[0x4009af] = '`'
        mem[0x4009b0] = '\xca'
        mem[0x4009b1] = ','
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x4009ac
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009acL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009acL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009ac, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009ad, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009ae, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009af, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009b0, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009b1, 8)== ord(','))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4009b2)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_11_symbolic(self):
        ''' Instruction PCMPESTRM_11
            Groups: sse42
            0x400a24:	pcmpestrm	xmm1, xmm2, 0x54
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a24] = 'f'
        mem[0x400a25] = '\x0f'
        mem[0x400a26] = ':'
        mem[0x400a27] = '`'
        mem[0x400a28] = '\xca'
        mem[0x400a29] = 'T'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a24
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a24L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a24L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a24, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a25, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a26, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a27, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a28, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a29, 8)== ord('T'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a2a)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_12_symbolic(self):
        ''' Instruction PCMPESTRM_12
            Groups: sse42
            0x4009f4:	pcmpestrm	xmm1, xmm2, 0x44
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009f4] = 'f'
        mem[0x4009f5] = '\x0f'
        mem[0x4009f6] = ':'
        mem[0x4009f7] = '`'
        mem[0x4009f8] = '\xca'
        mem[0x4009f9] = 'D'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x4009f4
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009f4L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009f4L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009f4, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009f5, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009f6, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009f7, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009f8, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009f9, 8)== ord('D'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4009fa)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_13_symbolic(self):
        ''' Instruction PCMPESTRM_13
            Groups: sse42
            0x400a1e:	pcmpestrm	xmm1, xmm2, 0x51
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a20] = ':'
        mem[0x400a21] = '`'
        mem[0x400a22] = '\xca'
        mem[0x400a23] = 'Q'
        mem[0x400a1e] = 'f'
        mem[0x400a1f] = '\x0f'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a1e
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a1eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a1eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a20, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a21, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a22, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a23, 8)== ord('Q'))
        condition = Operators.AND(condition, cpu.read_int(0x400a1e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a1f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a24)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_14_symbolic(self):
        ''' Instruction PCMPESTRM_14
            Groups: sse42
            0x400a7e:	pcmpestrm	xmm1, xmm2, 0x71
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a80] = ':'
        mem[0x400a81] = '`'
        mem[0x400a82] = '\xca'
        mem[0x400a83] = 'q'
        mem[0x400a7e] = 'f'
        mem[0x400a7f] = '\x0f'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a7e
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a7eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a7eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a80, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a81, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a82, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a83, 8)== ord('q'))
        condition = Operators.AND(condition, cpu.read_int(0x400a7e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a7f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a84)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_15_symbolic(self):
        ''' Instruction PCMPESTRM_15
            Groups: sse42
            0x400994:	pcmpestrm	xmm1, xmm2, 0x24
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400994] = 'f'
        mem[0x400995] = '\x0f'
        mem[0x400996] = ':'
        mem[0x400997] = '`'
        mem[0x400998] = '\xca'
        mem[0x400999] = '$'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400994
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400994L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400994L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400994, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400995, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400996, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400997, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400998, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400999, 8)== ord('$'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40099a)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_16_symbolic(self):
        ''' Instruction PCMPESTRM_16
            Groups: sse42
            0x400934:	pcmpestrm	xmm1, xmm2, 4
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400934] = 'f'
        mem[0x400935] = '\x0f'
        mem[0x400936] = ':'
        mem[0x400937] = '`'
        mem[0x400938] = '\xca'
        mem[0x400939] = '\x04'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400934
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400934L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400934L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400934, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400935, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400936, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400937, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400938, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400939, 8)== ord('\x04'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40093a)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_17_symbolic(self):
        ''' Instruction PCMPESTRM_17
            Groups: sse42
            0x400a9c:	pcmpestrm	xmm1, xmm2, 0x7c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400aa0] = '\xca'
        mem[0x400aa1] = '|'
        mem[0x400a9c] = 'f'
        mem[0x400a9d] = '\x0f'
        mem[0x400a9e] = ':'
        mem[0x400a9f] = '`'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a9c
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a9cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a9cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400aa0, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400aa1, 8)== ord('|'))
        condition = Operators.AND(condition, cpu.read_int(0x400a9c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a9d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a9e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a9f, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400aa2)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_18_symbolic(self):
        ''' Instruction PCMPESTRM_18
            Groups: sse42
            0x40092e:	pcmpestrm	xmm1, xmm2, 1
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40092e] = 'f'
        mem[0x40092f] = '\x0f'
        mem[0x400930] = ':'
        mem[0x400931] = '`'
        mem[0x400932] = '\xca'
        mem[0x400933] = '\x01'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x40092e
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40092eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40092eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40092e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40092f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400930, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400931, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400932, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400933, 8)== ord('\x01'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400934)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_19_symbolic(self):
        ''' Instruction PCMPESTRM_19
            Groups: sse42
            0x4009a6:	pcmpestrm	xmm1, xmm2, 0x29
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009a6] = 'f'
        mem[0x4009a7] = '\x0f'
        mem[0x4009a8] = ':'
        mem[0x4009a9] = '`'
        mem[0x4009aa] = '\xca'
        mem[0x4009ab] = ')'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x4009a6
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009a6L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009a6L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009a6, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009a7, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009a8, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009a9, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009aa, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009ab, 8)== ord(')'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4009ac)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_2_symbolic(self):
        ''' Instruction PCMPESTRM_2
            Groups: sse42
            0x400a54:	pcmpestrm	xmm1, xmm2, 0x64
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a54] = 'f'
        mem[0x400a55] = '\x0f'
        mem[0x400a56] = ':'
        mem[0x400a57] = '`'
        mem[0x400a58] = '\xca'
        mem[0x400a59] = 'd'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a54
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a54L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a54L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a54, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a55, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a56, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a57, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a58, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a59, 8)== ord('d'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a5a)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_20_symbolic(self):
        ''' Instruction PCMPESTRM_20
            Groups: sse42
            0x400a66:	pcmpestrm	xmm1, xmm2, 0x69
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a66] = 'f'
        mem[0x400a67] = '\x0f'
        mem[0x400a68] = ':'
        mem[0x400a69] = '`'
        mem[0x400a6a] = '\xca'
        mem[0x400a6b] = 'i'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a66
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a66L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a66L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a66, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a67, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a68, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a69, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a6a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a6b, 8)== ord('i'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a6c)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_21_symbolic(self):
        ''' Instruction PCMPESTRM_21
            Groups: sse42
            0x400958:	pcmpestrm	xmm1, xmm2, 0x10
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400958] = 'f'
        mem[0x400959] = '\x0f'
        mem[0x40095a] = ':'
        mem[0x40095b] = '`'
        mem[0x40095c] = '\xca'
        mem[0x40095d] = '\x10'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400958
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400958L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400958L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400958, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400959, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40095a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40095b, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x40095c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40095d, 8)== ord('\x10'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40095e)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_22_symbolic(self):
        ''' Instruction PCMPESTRM_22
            Groups: sse42
            0x40095e:	pcmpestrm	xmm1, xmm2, 0x11
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400960] = ':'
        mem[0x400961] = '`'
        mem[0x400962] = '\xca'
        mem[0x400963] = '\x11'
        mem[0x40095e] = 'f'
        mem[0x40095f] = '\x0f'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x40095e
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40095eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40095eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400960, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400961, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400962, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400963, 8)== ord('\x11'))
        condition = Operators.AND(condition, cpu.read_int(0x40095e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40095f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400964)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_23_symbolic(self):
        ''' Instruction PCMPESTRM_23
            Groups: sse42
            0x400976:	pcmpestrm	xmm1, xmm2, 0x19
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400976] = 'f'
        mem[0x400977] = '\x0f'
        mem[0x400978] = ':'
        mem[0x400979] = '`'
        mem[0x40097a] = '\xca'
        mem[0x40097b] = '\x19'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400976
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400976L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400976L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400976, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400977, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400978, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400979, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x40097a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40097b, 8)== ord('\x19'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40097c)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_24_symbolic(self):
        ''' Instruction PCMPESTRM_24
            Groups: sse42
            0x400a8a:	pcmpestrm	xmm1, xmm2, 0x75
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a8a] = 'f'
        mem[0x400a8b] = '\x0f'
        mem[0x400a8c] = ':'
        mem[0x400a8d] = '`'
        mem[0x400a8e] = '\xca'
        mem[0x400a8f] = 'u'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a8a
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a8aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a8aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a8a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a8b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a8c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a8d, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a8e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a8f, 8)== ord('u'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a90)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_25_symbolic(self):
        ''' Instruction PCMPESTRM_25
            Groups: sse42
            0x400a12:	pcmpestrm	xmm1, xmm2, 0x4d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a12] = 'f'
        mem[0x400a13] = '\x0f'
        mem[0x400a14] = ':'
        mem[0x400a15] = '`'
        mem[0x400a16] = '\xca'
        mem[0x400a17] = 'M'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a12
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a12L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a12L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a12, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a13, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a14, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a15, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a16, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a17, 8)== ord('M'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a18)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_26_symbolic(self):
        ''' Instruction PCMPESTRM_26
            Groups: sse42
            0x40093a:	pcmpestrm	xmm1, xmm2, 5
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40093a] = 'f'
        mem[0x40093b] = '\x0f'
        mem[0x40093c] = ':'
        mem[0x40093d] = '`'
        mem[0x40093e] = '\xca'
        mem[0x40093f] = '\x05'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x40093a
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40093aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40093aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40093a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40093b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40093c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40093d, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x40093e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40093f, 8)== ord('\x05'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400940)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_27_symbolic(self):
        ''' Instruction PCMPESTRM_27
            Groups: sse42
            0x400a30:	pcmpestrm	xmm1, xmm2, 0x58
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a30] = 'f'
        mem[0x400a31] = '\x0f'
        mem[0x400a32] = ':'
        mem[0x400a33] = '`'
        mem[0x400a34] = '\xca'
        mem[0x400a35] = 'X'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a30
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a30L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a30L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a30, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a31, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a32, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a33, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a34, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a35, 8)== ord('X'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a36)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_28_symbolic(self):
        ''' Instruction PCMPESTRM_28
            Groups: sse42
            0x4009ca:	pcmpestrm	xmm1, xmm2, 0x35
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009ca] = 'f'
        mem[0x4009cb] = '\x0f'
        mem[0x4009cc] = ':'
        mem[0x4009cd] = '`'
        mem[0x4009ce] = '\xca'
        mem[0x4009cf] = '5'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x4009ca
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009caL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009caL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009ca, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009cb, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009cc, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009cd, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009ce, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009cf, 8)== ord('5'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4009d0)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_29_symbolic(self):
        ''' Instruction PCMPESTRM_29
            Groups: sse42
            0x400a3c:	pcmpestrm	xmm1, xmm2, 0x5c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a40] = '\xca'
        mem[0x400a41] = '\\'
        mem[0x400a3c] = 'f'
        mem[0x400a3d] = '\x0f'
        mem[0x400a3e] = ':'
        mem[0x400a3f] = '`'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a3c
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a3cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a3cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a40, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a41, 8)== ord('\\'))
        condition = Operators.AND(condition, cpu.read_int(0x400a3c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a3d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a3e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a3f, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a42)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_3_symbolic(self):
        ''' Instruction PCMPESTRM_3
            Groups: sse42
            0x400a18:	pcmpestrm	xmm1, xmm2, 0x50
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a18] = 'f'
        mem[0x400a19] = '\x0f'
        mem[0x400a1a] = ':'
        mem[0x400a1b] = '`'
        mem[0x400a1c] = '\xca'
        mem[0x400a1d] = 'P'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a18
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a18L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a18L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a18, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a19, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a1a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a1b, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a1c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a1d, 8)== ord('P'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a1e)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_30_symbolic(self):
        ''' Instruction PCMPESTRM_30
            Groups: sse42
            0x40098e:	pcmpestrm	xmm1, xmm2, 0x21
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40098e] = 'f'
        mem[0x40098f] = '\x0f'
        mem[0x400990] = ':'
        mem[0x400991] = '`'
        mem[0x400992] = '\xca'
        mem[0x400993] = '!'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x40098e
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40098eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40098eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40098e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40098f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400990, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400991, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400992, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400993, 8)== ord('!'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400994)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_31_symbolic(self):
        ''' Instruction PCMPESTRM_31
            Groups: sse42
            0x400a96:	pcmpestrm	xmm1, xmm2, 0x79
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a96] = 'f'
        mem[0x400a97] = '\x0f'
        mem[0x400a98] = ':'
        mem[0x400a99] = '`'
        mem[0x400a9a] = '\xca'
        mem[0x400a9b] = 'y'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a96
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a96L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a96L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a96, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a97, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a98, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a99, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a9a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a9b, 8)== ord('y'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a9c)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_32_symbolic(self):
        ''' Instruction PCMPESTRM_32
            Groups: sse42
            0x400a90:	pcmpestrm	xmm1, xmm2, 0x78
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a90] = 'f'
        mem[0x400a91] = '\x0f'
        mem[0x400a92] = ':'
        mem[0x400a93] = '`'
        mem[0x400a94] = '\xca'
        mem[0x400a95] = 'x'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a90
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a90L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a90L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a90, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a91, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a92, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a93, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a94, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a95, 8)== ord('x'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a96)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_33_symbolic(self):
        ''' Instruction PCMPESTRM_33
            Groups: sse42
            0x400a06:	pcmpestrm	xmm1, xmm2, 0x49
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a06] = 'f'
        mem[0x400a07] = '\x0f'
        mem[0x400a08] = ':'
        mem[0x400a09] = '`'
        mem[0x400a0a] = '\xca'
        mem[0x400a0b] = 'I'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a06
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a06L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a06L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a06, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a07, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a08, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a09, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a0a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a0b, 8)== ord('I'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a0c)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_34_symbolic(self):
        ''' Instruction PCMPESTRM_34
            Groups: sse42
            0x400928:	pcmpestrm	xmm1, xmm2, 0
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400928] = 'f'
        mem[0x400929] = '\x0f'
        mem[0x40092a] = ':'
        mem[0x40092b] = '`'
        mem[0x40092c] = '\xca'
        mem[0x40092d] = '\x00'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400928
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400928L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400928L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400928, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400929, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40092a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40092b, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x40092c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40092d, 8)== ord('\x00'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40092e)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_35_symbolic(self):
        ''' Instruction PCMPESTRM_35
            Groups: sse42
            0x400a84:	pcmpestrm	xmm1, xmm2, 0x74
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a84] = 'f'
        mem[0x400a85] = '\x0f'
        mem[0x400a86] = ':'
        mem[0x400a87] = '`'
        mem[0x400a88] = '\xca'
        mem[0x400a89] = 't'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a84
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a84L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a84L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a84, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a85, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a86, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a87, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a88, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a89, 8)== ord('t'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a8a)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_36_symbolic(self):
        ''' Instruction PCMPESTRM_36
            Groups: sse42
            0x400a72:	pcmpestrm	xmm1, xmm2, 0x6d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a72] = 'f'
        mem[0x400a73] = '\x0f'
        mem[0x400a74] = ':'
        mem[0x400a75] = '`'
        mem[0x400a76] = '\xca'
        mem[0x400a77] = 'm'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a72
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a72L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a72L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a72, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a73, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a74, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a75, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a76, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a77, 8)== ord('m'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a78)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_37_symbolic(self):
        ''' Instruction PCMPESTRM_37
            Groups: sse42
            0x400946:	pcmpestrm	xmm1, xmm2, 9
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400946] = 'f'
        mem[0x400947] = '\x0f'
        mem[0x400948] = ':'
        mem[0x400949] = '`'
        mem[0x40094a] = '\xca'
        mem[0x40094b] = '\t'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400946
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400946L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400946L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400946, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400947, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400948, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400949, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x40094a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40094b, 8)== ord('\t'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40094c)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_38_symbolic(self):
        ''' Instruction PCMPESTRM_38
            Groups: sse42
            0x400940:	pcmpestrm	xmm1, xmm2, 8
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400940] = 'f'
        mem[0x400941] = '\x0f'
        mem[0x400942] = ':'
        mem[0x400943] = '`'
        mem[0x400944] = '\xca'
        mem[0x400945] = '\x08'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400940
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400940L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400940L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400940, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400941, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400942, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400943, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400944, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400945, 8)== ord('\x08'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400946)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_39_symbolic(self):
        ''' Instruction PCMPESTRM_39
            Groups: sse42
            0x400aa2:	pcmpestrm	xmm1, xmm2, 0x7d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400aa2] = 'f'
        mem[0x400aa3] = '\x0f'
        mem[0x400aa4] = ':'
        mem[0x400aa5] = '`'
        mem[0x400aa6] = '\xca'
        mem[0x400aa7] = '}'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400aa2
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400aa2L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400aa2L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400aa2, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400aa3, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400aa4, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400aa5, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400aa6, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400aa7, 8)== ord('}'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400aa8)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_4_symbolic(self):
        ''' Instruction PCMPESTRM_4
            Groups: sse42
            0x40097c:	pcmpestrm	xmm1, xmm2, 0x1c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400980] = '\xca'
        mem[0x400981] = '\x1c'
        mem[0x40097c] = 'f'
        mem[0x40097d] = '\x0f'
        mem[0x40097e] = ':'
        mem[0x40097f] = '`'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x40097c
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40097cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40097cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400980, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400981, 8)== ord('\x1c'))
        condition = Operators.AND(condition, cpu.read_int(0x40097c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40097d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40097e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40097f, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400982)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_40_symbolic(self):
        ''' Instruction PCMPESTRM_40
            Groups: sse42
            0x400a48:	pcmpestrm	xmm1, xmm2, 0x60
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a48] = 'f'
        mem[0x400a49] = '\x0f'
        mem[0x400a4a] = ':'
        mem[0x400a4b] = '`'
        mem[0x400a4c] = '\xca'
        mem[0x400a4d] = '`'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a48
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a48L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a48L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a48, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a49, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a4a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a4b, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a4c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a4d, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a4e)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_41_symbolic(self):
        ''' Instruction PCMPESTRM_41
            Groups: sse42
            0x400952:	pcmpestrm	xmm1, xmm2, 0xd
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400952] = 'f'
        mem[0x400953] = '\x0f'
        mem[0x400954] = ':'
        mem[0x400955] = '`'
        mem[0x400956] = '\xca'
        mem[0x400957] = '\r'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400952
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400952L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400952L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400952, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400953, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400954, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400955, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400956, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400957, 8)== ord('\r'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400958)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_42_symbolic(self):
        ''' Instruction PCMPESTRM_42
            Groups: sse42
            0x40094c:	pcmpestrm	xmm1, xmm2, 0xc
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40094c] = 'f'
        mem[0x40094d] = '\x0f'
        mem[0x40094e] = ':'
        mem[0x40094f] = '`'
        mem[0x400950] = '\xca'
        mem[0x400951] = '\x0c'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x40094c
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40094cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40094cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40094c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40094d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40094e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40094f, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400950, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400951, 8)== ord('\x0c'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400952)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_43_symbolic(self):
        ''' Instruction PCMPESTRM_43
            Groups: sse42
            0x400a0c:	pcmpestrm	xmm1, xmm2, 0x4c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a0c] = 'f'
        mem[0x400a0d] = '\x0f'
        mem[0x400a0e] = ':'
        mem[0x400a0f] = '`'
        mem[0x400a10] = '\xca'
        mem[0x400a11] = 'L'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a0c
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a0cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a0cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a0c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a0d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a0e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a0f, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a10, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a11, 8)== ord('L'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a12)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_44_symbolic(self):
        ''' Instruction PCMPESTRM_44
            Groups: sse42
            0x400964:	pcmpestrm	xmm1, xmm2, 0x14
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400964] = 'f'
        mem[0x400965] = '\x0f'
        mem[0x400966] = ':'
        mem[0x400967] = '`'
        mem[0x400968] = '\xca'
        mem[0x400969] = '\x14'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400964
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400964L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400964L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400964, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400965, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400966, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400967, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400968, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400969, 8)== ord('\x14'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40096a)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_45_symbolic(self):
        ''' Instruction PCMPESTRM_45
            Groups: sse42
            0x400a36:	pcmpestrm	xmm1, xmm2, 0x59
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a36] = 'f'
        mem[0x400a37] = '\x0f'
        mem[0x400a38] = ':'
        mem[0x400a39] = '`'
        mem[0x400a3a] = '\xca'
        mem[0x400a3b] = 'Y'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a36
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a36L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a36L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a36, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a37, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a38, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a39, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a3a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a3b, 8)== ord('Y'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a3c)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_46_symbolic(self):
        ''' Instruction PCMPESTRM_46
            Groups: sse42
            0x40099a:	pcmpestrm	xmm1, xmm2, 0x25
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40099a] = 'f'
        mem[0x40099b] = '\x0f'
        mem[0x40099c] = ':'
        mem[0x40099d] = '`'
        mem[0x40099e] = '\xca'
        mem[0x40099f] = '%'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x40099a
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40099aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40099aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40099a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40099b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40099c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40099d, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x40099e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40099f, 8)== ord('%'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4009a0)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_47_symbolic(self):
        ''' Instruction PCMPESTRM_47
            Groups: sse42
            0x400988:	pcmpestrm	xmm1, xmm2, 0x20
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400988] = 'f'
        mem[0x400989] = '\x0f'
        mem[0x40098a] = ':'
        mem[0x40098b] = '`'
        mem[0x40098c] = '\xca'
        mem[0x40098d] = ' '
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400988
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400988L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400988L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400988, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400989, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40098a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40098b, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x40098c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40098d, 8)== ord(' '))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40098e)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_48_symbolic(self):
        ''' Instruction PCMPESTRM_48
            Groups: sse42
            0x400a5a:	pcmpestrm	xmm1, xmm2, 0x65
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a5a] = 'f'
        mem[0x400a5b] = '\x0f'
        mem[0x400a5c] = ':'
        mem[0x400a5d] = '`'
        mem[0x400a5e] = '\xca'
        mem[0x400a5f] = 'e'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a5a
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a5aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a5aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a5a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a5b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a5c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a5d, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a5e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a5f, 8)== ord('e'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a60)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_49_symbolic(self):
        ''' Instruction PCMPESTRM_49
            Groups: sse42
            0x40096a:	pcmpestrm	xmm1, xmm2, 0x15
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40096a] = 'f'
        mem[0x40096b] = '\x0f'
        mem[0x40096c] = ':'
        mem[0x40096d] = '`'
        mem[0x40096e] = '\xca'
        mem[0x40096f] = '\x15'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x40096a
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40096aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40096aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40096a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40096b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40096c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40096d, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x40096e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40096f, 8)== ord('\x15'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400970)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_5_symbolic(self):
        ''' Instruction PCMPESTRM_5
            Groups: sse42
            0x4009b2:	pcmpestrm	xmm1, xmm2, 0x2d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009b2] = 'f'
        mem[0x4009b3] = '\x0f'
        mem[0x4009b4] = ':'
        mem[0x4009b5] = '`'
        mem[0x4009b6] = '\xca'
        mem[0x4009b7] = '-'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x4009b2
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009b2L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009b2L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009b2, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009b3, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009b4, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009b5, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009b6, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009b7, 8)== ord('-'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4009b8)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_50_symbolic(self):
        ''' Instruction PCMPESTRM_50
            Groups: sse42
            0x400a60:	pcmpestrm	xmm1, xmm2, 0x68
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a60] = 'f'
        mem[0x400a61] = '\x0f'
        mem[0x400a62] = ':'
        mem[0x400a63] = '`'
        mem[0x400a64] = '\xca'
        mem[0x400a65] = 'h'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a60
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a60L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a60L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a60, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a61, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a62, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a63, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a64, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a65, 8)== ord('h'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a66)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_51_symbolic(self):
        ''' Instruction PCMPESTRM_51
            Groups: sse42
            0x4009be:	pcmpestrm	xmm1, xmm2, 0x31
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009c0] = ':'
        mem[0x4009c1] = '`'
        mem[0x4009c2] = '\xca'
        mem[0x4009c3] = '1'
        mem[0x4009be] = 'f'
        mem[0x4009bf] = '\x0f'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x4009be
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009beL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009beL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009c0, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009c1, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009c2, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009c3, 8)== ord('1'))
        condition = Operators.AND(condition, cpu.read_int(0x4009be, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009bf, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4009c4)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_52_symbolic(self):
        ''' Instruction PCMPESTRM_52
            Groups: sse42
            0x4009e2:	pcmpestrm	xmm1, xmm2, 0x3d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009e2] = 'f'
        mem[0x4009e3] = '\x0f'
        mem[0x4009e4] = ':'
        mem[0x4009e5] = '`'
        mem[0x4009e6] = '\xca'
        mem[0x4009e7] = '='
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x4009e2
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009e2L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009e2L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009e2, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009e3, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009e4, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009e5, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009e6, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009e7, 8)== ord('='))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4009e8)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_53_symbolic(self):
        ''' Instruction PCMPESTRM_53
            Groups: sse42
            0x4009d6:	pcmpestrm	xmm1, xmm2, 0x39
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009d6] = 'f'
        mem[0x4009d7] = '\x0f'
        mem[0x4009d8] = ':'
        mem[0x4009d9] = '`'
        mem[0x4009da] = '\xca'
        mem[0x4009db] = '9'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x4009d6
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009d6L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009d6L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009d6, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009d7, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009d8, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009d9, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009da, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009db, 8)== ord('9'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4009dc)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_54_symbolic(self):
        ''' Instruction PCMPESTRM_54
            Groups: sse42
            0x400a6c:	pcmpestrm	xmm1, xmm2, 0x6c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a6c] = 'f'
        mem[0x400a6d] = '\x0f'
        mem[0x400a6e] = ':'
        mem[0x400a6f] = '`'
        mem[0x400a70] = '\xca'
        mem[0x400a71] = 'l'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a6c
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a6cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a6cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a6c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a6d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a6e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a6f, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a70, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a71, 8)== ord('l'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a72)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_55_symbolic(self):
        ''' Instruction PCMPESTRM_55
            Groups: sse42
            0x4009c4:	pcmpestrm	xmm1, xmm2, 0x34
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009c4] = 'f'
        mem[0x4009c5] = '\x0f'
        mem[0x4009c6] = ':'
        mem[0x4009c7] = '`'
        mem[0x4009c8] = '\xca'
        mem[0x4009c9] = '4'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x4009c4
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009c4L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009c4L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009c4, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009c5, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009c6, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009c7, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009c8, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009c9, 8)== ord('4'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4009ca)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_56_symbolic(self):
        ''' Instruction PCMPESTRM_56
            Groups: sse42
            0x400a00:	pcmpestrm	xmm1, xmm2, 0x48
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a00] = 'f'
        mem[0x400a01] = '\x0f'
        mem[0x400a02] = ':'
        mem[0x400a03] = '`'
        mem[0x400a04] = '\xca'
        mem[0x400a05] = 'H'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a00
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a00L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a00L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a00, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a01, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a02, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a03, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a04, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a05, 8)== ord('H'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a06)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_57_symbolic(self):
        ''' Instruction PCMPESTRM_57
            Groups: sse42
            0x4009e8:	pcmpestrm	xmm1, xmm2, 0x40
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009e8] = 'f'
        mem[0x4009e9] = '\x0f'
        mem[0x4009ea] = ':'
        mem[0x4009eb] = '`'
        mem[0x4009ec] = '\xca'
        mem[0x4009ed] = '@'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x4009e8
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009e8L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009e8L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009e8, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009e9, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009ea, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009eb, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009ec, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009ed, 8)== ord('@'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4009ee)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_58_symbolic(self):
        ''' Instruction PCMPESTRM_58
            Groups: sse42
            0x4009b8:	pcmpestrm	xmm1, xmm2, 0x30
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009b8] = 'f'
        mem[0x4009b9] = '\x0f'
        mem[0x4009ba] = ':'
        mem[0x4009bb] = '`'
        mem[0x4009bc] = '\xca'
        mem[0x4009bd] = '0'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x4009b8
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009b8L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009b8L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009b8, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009b9, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009ba, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009bb, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009bc, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009bd, 8)== ord('0'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4009be)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_59_symbolic(self):
        ''' Instruction PCMPESTRM_59
            Groups: sse42
            0x4009ee:	pcmpestrm	xmm1, xmm2, 0x41
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009ee] = 'f'
        mem[0x4009ef] = '\x0f'
        mem[0x4009f0] = ':'
        mem[0x4009f1] = '`'
        mem[0x4009f2] = '\xca'
        mem[0x4009f3] = 'A'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x4009ee
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009eeL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009eeL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009ee, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009ef, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009f0, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009f1, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009f2, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009f3, 8)== ord('A'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4009f4)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_6_symbolic(self):
        ''' Instruction PCMPESTRM_6
            Groups: sse42
            0x4009a0:	pcmpestrm	xmm1, xmm2, 0x28
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009a0] = 'f'
        mem[0x4009a1] = '\x0f'
        mem[0x4009a2] = ':'
        mem[0x4009a3] = '`'
        mem[0x4009a4] = '\xca'
        mem[0x4009a5] = '('
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x4009a0
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009a0L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009a0L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009a0, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009a1, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009a2, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009a3, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009a4, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009a5, 8)== ord('('))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4009a6)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_60_symbolic(self):
        ''' Instruction PCMPESTRM_60
            Groups: sse42
            0x400970:	pcmpestrm	xmm1, xmm2, 0x18
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400970] = 'f'
        mem[0x400971] = '\x0f'
        mem[0x400972] = ':'
        mem[0x400973] = '`'
        mem[0x400974] = '\xca'
        mem[0x400975] = '\x18'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400970
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400970L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400970L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400970, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400971, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400972, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400973, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400974, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400975, 8)== ord('\x18'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400976)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_61_symbolic(self):
        ''' Instruction PCMPESTRM_61
            Groups: sse42
            0x400a78:	pcmpestrm	xmm1, xmm2, 0x70
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a78] = 'f'
        mem[0x400a79] = '\x0f'
        mem[0x400a7a] = ':'
        mem[0x400a7b] = '`'
        mem[0x400a7c] = '\xca'
        mem[0x400a7d] = 'p'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a78
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a78L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a78L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a78, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a79, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a7a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a7b, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a7c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a7d, 8)== ord('p'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a7e)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_62_symbolic(self):
        ''' Instruction PCMPESTRM_62
            Groups: sse42
            0x400a2a:	pcmpestrm	xmm1, xmm2, 0x55
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a2a] = 'f'
        mem[0x400a2b] = '\x0f'
        mem[0x400a2c] = ':'
        mem[0x400a2d] = '`'
        mem[0x400a2e] = '\xca'
        mem[0x400a2f] = 'U'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a2a
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a2aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a2aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a2a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a2b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a2c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a2d, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a2e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a2f, 8)== ord('U'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a30)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_63_symbolic(self):
        ''' Instruction PCMPESTRM_63
            Groups: sse42
            0x400a42:	pcmpestrm	xmm1, xmm2, 0x5d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a42] = 'f'
        mem[0x400a43] = '\x0f'
        mem[0x400a44] = ':'
        mem[0x400a45] = '`'
        mem[0x400a46] = '\xca'
        mem[0x400a47] = ']'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400a42
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a42L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a42L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a42, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a43, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a44, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a45, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a46, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a47, 8)== ord(']'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400a48)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_64_symbolic(self):
        ''' Instruction PCMPESTRM_64
            Groups: sse42
            0x400a4e:	pcmpestrm	xmm1, xmm2, 0x61
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400a4e] = 'f'
        mem[0x400a4f] = '\x0f'
        mem[0x400a50] = ':'
        mem[0x400a51] = '`'
        mem[0x400a52] = '\xca'
        mem[0x400a53] = 'a'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x400a4e
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400a4eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400a4eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400a4e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a4f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400a50, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400a51, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400a52, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400a53, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a54)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_7_symbolic(self):
        ''' Instruction PCMPESTRM_7
            Groups: sse42
            0x4009dc:	pcmpestrm	xmm1, xmm2, 0x3c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009e0] = '\xca'
        mem[0x4009e1] = '<'
        mem[0x4009dc] = 'f'
        mem[0x4009dd] = '\x0f'
        mem[0x4009de] = ':'
        mem[0x4009df] = '`'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x4009dc
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009dcL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009dcL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009e0, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009e1, 8)== ord('<'))
        condition = Operators.AND(condition, cpu.read_int(0x4009dc, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009dd, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009de, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009df, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4009e2)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_8_symbolic(self):
        ''' Instruction PCMPESTRM_8
            Groups: sse42
            0x4009fa:	pcmpestrm	xmm1, xmm2, 0x45
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4009fa] = 'f'
        mem[0x4009fb] = '\x0f'
        mem[0x4009fc] = ':'
        mem[0x4009fd] = '`'
        mem[0x4009fe] = '\xca'
        mem[0x4009ff] = 'E'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.RIP = 0x4009fa
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4009faL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4009faL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4009fa, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009fb, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4009fc, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4009fd, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x4009fe, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4009ff, 8)== ord('E'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400a00)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPESTRM_9_symbolic(self):
        ''' Instruction PCMPESTRM_9
            Groups: sse42
            0x400982:	pcmpestrm	xmm1, xmm2, 0x1d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400982] = 'f'
        mem[0x400983] = '\x0f'
        mem[0x400984] = ':'
        mem[0x400985] = '`'
        mem[0x400986] = '\xca'
        mem[0x400987] = '\x1d'
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.RIP = 0x400982
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.EAX = cs.new_bitvec(32)
        cs.add(cpu.EAX == 0x6)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.EDX = cs.new_bitvec(32)
        cs.add(cpu.EDX == 0x7)
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400982L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400982L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400982, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400983, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400984, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400985, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400986, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400987, 8)== ord('\x1d'))
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400988)
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.EAX == 0x6)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.EDX == 0x7)
        condition = Operators.AND(condition, cpu.SF == True)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_1_symbolic(self):
        ''' Instruction PCMPISTRI_1
            Groups: sse42
            0x400746:	pcmpistri	xmm1, xmm2, 0x6d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400746] = 'f'
        mem[0x400747] = '\x0f'
        mem[0x400748] = ':'
        mem[0x400749] = 'c'
        mem[0x40074a] = '\xca'
        mem[0x40074b] = 'm'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400746
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400746L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400746L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400746, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400747, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400748, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400749, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40074a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40074b, 8)== ord('m'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x4)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40074c)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_10_symbolic(self):
        ''' Instruction PCMPISTRI_10
            Groups: sse42
            0x400650:	pcmpistri	xmm1, xmm2, 0x1c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400650] = 'f'
        mem[0x400651] = '\x0f'
        mem[0x400652] = ':'
        mem[0x400653] = 'c'
        mem[0x400654] = '\xca'
        mem[0x400655] = '\x1c'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400650
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400650L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400650L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400650, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400651, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400652, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400653, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400654, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400655, 8)== ord('\x1c'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x1)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400656)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_11_symbolic(self):
        ''' Instruction PCMPISTRI_11
            Groups: sse42
            0x400668:	pcmpistri	xmm1, xmm2, 0x24
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400668] = 'f'
        mem[0x400669] = '\x0f'
        mem[0x40066a] = ':'
        mem[0x40066b] = 'c'
        mem[0x40066c] = '\xca'
        mem[0x40066d] = '$'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400668
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400668L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400668L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400668, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400669, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40066a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40066b, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40066c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40066d, 8)== ord('$'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40066e)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_12_symbolic(self):
        ''' Instruction PCMPISTRI_12
            Groups: sse42
            0x400698:	pcmpistri	xmm1, xmm2, 0x34
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400698] = 'f'
        mem[0x400699] = '\x0f'
        mem[0x40069a] = ':'
        mem[0x40069b] = 'c'
        mem[0x40069c] = '\xca'
        mem[0x40069d] = '4'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400698
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400698L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400698L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400698, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400699, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40069a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40069b, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40069c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40069d, 8)== ord('4'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x10)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40069e)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_13_symbolic(self):
        ''' Instruction PCMPISTRI_13
            Groups: sse42
            0x4006c8:	pcmpistri	xmm1, xmm2, 0x44
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006c8] = 'f'
        mem[0x4006c9] = '\x0f'
        mem[0x4006ca] = ':'
        mem[0x4006cb] = 'c'
        mem[0x4006cc] = '\xca'
        mem[0x4006cd] = 'D'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4006c8
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006c8L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006c8L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006c8, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006c9, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006ca, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006cb, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006cc, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006cd, 8)== ord('D'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0xf)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4006ce)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_14_symbolic(self):
        ''' Instruction PCMPISTRI_14
            Groups: sse42
            0x4006bc:	pcmpistri	xmm1, xmm2, 0x40
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006c0] = '\xca'
        mem[0x4006c1] = '@'
        mem[0x4006bc] = 'f'
        mem[0x4006bd] = '\x0f'
        mem[0x4006be] = ':'
        mem[0x4006bf] = 'c'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x1)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4006bc
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006bcL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006bcL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006c0, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006c1, 8)== ord('@'))
        condition = Operators.AND(condition, cpu.read_int(0x4006bc, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006bd, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006be, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006bf, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0xf)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4006c2)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_15_symbolic(self):
        ''' Instruction PCMPISTRI_15
            Groups: sse42
            0x40068c:	pcmpistri	xmm1, xmm2, 0x30
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40068c] = 'f'
        mem[0x40068d] = '\x0f'
        mem[0x40068e] = ':'
        mem[0x40068f] = 'c'
        mem[0x400690] = '\xca'
        mem[0x400691] = '0'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40068c
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40068cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40068cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40068c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40068d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40068e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40068f, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400690, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400691, 8)== ord('0'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x10)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400692)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_16_symbolic(self):
        ''' Instruction PCMPISTRI_16
            Groups: sse42
            0x40062c:	pcmpistri	xmm1, xmm2, 0x10
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40062c] = 'f'
        mem[0x40062d] = '\x0f'
        mem[0x40062e] = ':'
        mem[0x40062f] = 'c'
        mem[0x400630] = '\xca'
        mem[0x400631] = '\x10'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40062c
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40062cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40062cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40062c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40062d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40062e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40062f, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400630, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400631, 8)== ord('\x10'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x10)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400632)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_17_symbolic(self):
        ''' Instruction PCMPISTRI_17
            Groups: sse42
            0x400764:	pcmpistri	xmm1, xmm2, 0x78
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400764] = 'f'
        mem[0x400765] = '\x0f'
        mem[0x400766] = ':'
        mem[0x400767] = 'c'
        mem[0x400768] = '\xca'
        mem[0x400769] = 'x'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400764
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400764L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400764L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400764, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400765, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400766, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400767, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400768, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400769, 8)== ord('x'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x10)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40076a)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_18_symbolic(self):
        ''' Instruction PCMPISTRI_18
            Groups: sse42
            0x4005fc:	pcmpistri	xmm1, xmm2, 0
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400600] = '\xca'
        mem[0x400601] = '\x00'
        mem[0x4005fc] = 'f'
        mem[0x4005fd] = '\x0f'
        mem[0x4005fe] = ':'
        mem[0x4005ff] = 'c'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x82)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4005fc
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == True)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4005fcL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4005fcL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400600, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400601, 8)== ord('\x00'))
        condition = Operators.AND(condition, cpu.read_int(0x4005fc, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4005fd, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4005fe, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4005ff, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400602)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_19_symbolic(self):
        ''' Instruction PCMPISTRI_19
            Groups: sse42
            0x4006ce:	pcmpistri	xmm1, xmm2, 0x45
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006ce] = 'f'
        mem[0x4006cf] = '\x0f'
        mem[0x4006d0] = ':'
        mem[0x4006d1] = 'c'
        mem[0x4006d2] = '\xca'
        mem[0x4006d3] = 'E'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4006ce
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006ceL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006ceL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006ce, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006cf, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006d0, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006d1, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006d2, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006d3, 8)== ord('E'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x7)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4006d4)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_2_symbolic(self):
        ''' Instruction PCMPISTRI_2
            Groups: sse42
            0x400704:	pcmpistri	xmm1, xmm2, 0x58
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400704] = 'f'
        mem[0x400705] = '\x0f'
        mem[0x400706] = ':'
        mem[0x400707] = 'c'
        mem[0x400708] = '\xca'
        mem[0x400709] = 'X'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400704
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400704L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400704L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400704, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400705, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400706, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400707, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400708, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400709, 8)== ord('X'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x10)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40070a)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_20_symbolic(self):
        ''' Instruction PCMPISTRI_20
            Groups: sse42
            0x4006f8:	pcmpistri	xmm1, xmm2, 0x54
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006f8] = 'f'
        mem[0x4006f9] = '\x0f'
        mem[0x4006fa] = ':'
        mem[0x4006fb] = 'c'
        mem[0x4006fc] = '\xca'
        mem[0x4006fd] = 'T'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4006f8
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006f8L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006f8L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006f8, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006f9, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006fa, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006fb, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006fc, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006fd, 8)== ord('T'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x10)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4006fe)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_21_symbolic(self):
        ''' Instruction PCMPISTRI_21
            Groups: sse42
            0x4006c2:	pcmpistri	xmm1, xmm2, 0x41
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006c2] = 'f'
        mem[0x4006c3] = '\x0f'
        mem[0x4006c4] = ':'
        mem[0x4006c5] = 'c'
        mem[0x4006c6] = '\xca'
        mem[0x4006c7] = 'A'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4006c2
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006c2L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006c2L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006c2, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006c3, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006c4, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006c5, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006c6, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006c7, 8)== ord('A'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x7)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4006c8)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_22_symbolic(self):
        ''' Instruction PCMPISTRI_22
            Groups: sse42
            0x40069e:	pcmpistri	xmm1, xmm2, 0x35
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006a0] = ':'
        mem[0x4006a1] = 'c'
        mem[0x4006a2] = '\xca'
        mem[0x4006a3] = '5'
        mem[0x40069e] = 'f'
        mem[0x40069f] = '\x0f'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x40069e
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40069eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40069eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006a0, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006a1, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006a2, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006a3, 8)== ord('5'))
        condition = Operators.AND(condition, cpu.read_int(0x40069e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40069f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4006a4)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_23_symbolic(self):
        ''' Instruction PCMPISTRI_23
            Groups: sse42
            0x4006b6:	pcmpistri	xmm1, xmm2, 0x3d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006b6] = 'f'
        mem[0x4006b7] = '\x0f'
        mem[0x4006b8] = ':'
        mem[0x4006b9] = 'c'
        mem[0x4006ba] = '\xca'
        mem[0x4006bb] = '='
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x1)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4006b6
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006b6L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006b6L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006b6, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006b7, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006b8, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006b9, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006ba, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006bb, 8)== ord('='))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x1)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4006bc)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_24_symbolic(self):
        ''' Instruction PCMPISTRI_24
            Groups: sse42
            0x400620:	pcmpistri	xmm1, xmm2, 0xc
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400620] = 'f'
        mem[0x400621] = '\x0f'
        mem[0x400622] = ':'
        mem[0x400623] = 'c'
        mem[0x400624] = '\xca'
        mem[0x400625] = '\x0c'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400620
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400620L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400620L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400620, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400621, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400622, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400623, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400624, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400625, 8)== ord('\x0c'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400626)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_25_symbolic(self):
        ''' Instruction PCMPISTRI_25
            Groups: sse42
            0x400710:	pcmpistri	xmm1, xmm2, 0x5c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400710] = 'f'
        mem[0x400711] = '\x0f'
        mem[0x400712] = ':'
        mem[0x400713] = 'c'
        mem[0x400714] = '\xca'
        mem[0x400715] = '\\'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400710
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400710L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400710L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400710, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400711, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400712, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400713, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400714, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400715, 8)== ord('\\'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0xf)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400716)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_26_symbolic(self):
        ''' Instruction PCMPISTRI_26
            Groups: sse42
            0x4006b0:	pcmpistri	xmm1, xmm2, 0x3c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006b0] = 'f'
        mem[0x4006b1] = '\x0f'
        mem[0x4006b2] = ':'
        mem[0x4006b3] = 'c'
        mem[0x4006b4] = '\xca'
        mem[0x4006b5] = '<'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4006b0
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006b0L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006b0L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006b0, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006b1, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006b2, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006b3, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006b4, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006b5, 8)== ord('<'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x1)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4006b6)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_27_symbolic(self):
        ''' Instruction PCMPISTRI_27
            Groups: sse42
            0x400740:	pcmpistri	xmm1, xmm2, 0x6c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400740] = 'f'
        mem[0x400741] = '\x0f'
        mem[0x400742] = ':'
        mem[0x400743] = 'c'
        mem[0x400744] = '\xca'
        mem[0x400745] = 'l'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400740
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400740L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400740L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400740, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400741, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400742, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400743, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400744, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400745, 8)== ord('l'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400746)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_28_symbolic(self):
        ''' Instruction PCMPISTRI_28
            Groups: sse42
            0x400692:	pcmpistri	xmm1, xmm2, 0x31
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400692] = 'f'
        mem[0x400693] = '\x0f'
        mem[0x400694] = ':'
        mem[0x400695] = 'c'
        mem[0x400696] = '\xca'
        mem[0x400697] = '1'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400692
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400692L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400692L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400692, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400693, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400694, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400695, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400696, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400697, 8)== ord('1'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400698)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_29_symbolic(self):
        ''' Instruction PCMPISTRI_29
            Groups: sse42
            0x40064a:	pcmpistri	xmm1, xmm2, 0x19
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40064a] = 'f'
        mem[0x40064b] = '\x0f'
        mem[0x40064c] = ':'
        mem[0x40064d] = 'c'
        mem[0x40064e] = '\xca'
        mem[0x40064f] = '\x19'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x40064a
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40064aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40064aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40064a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40064b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40064c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40064d, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40064e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40064f, 8)== ord('\x19'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400650)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_3_symbolic(self):
        ''' Instruction PCMPISTRI_3
            Groups: sse42
            0x400728:	pcmpistri	xmm1, xmm2, 0x64
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400728] = 'f'
        mem[0x400729] = '\x0f'
        mem[0x40072a] = ':'
        mem[0x40072b] = 'c'
        mem[0x40072c] = '\xca'
        mem[0x40072d] = 'd'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400728
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400728L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400728L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400728, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400729, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40072a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40072b, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40072c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40072d, 8)== ord('d'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0xf)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40072e)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_30_symbolic(self):
        ''' Instruction PCMPISTRI_30
            Groups: sse42
            0x40077c:	pcmpistri	xmm1, xmmword ptr [rbp - 0xa0], 0x1b
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem.mmap(0x7fffffffe000, 0x1000, 'rwx')
        mem[0x400780] = '\x8d'
        mem[0x400781] = '`'
        mem[0x400782] = '\xff'
        mem[0x400783] = '\xff'
        mem[0x400784] = '\xff'
        mem[0x400785] = '\x1b'
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe190)
        value = cs.new_bitvec(8)
        cs.add(value == 0x41)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe191)
        value = cs.new_bitvec(8)
        cs.add(value == 0x42)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe192)
        value = cs.new_bitvec(8)
        cs.add(value == 0x43)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe193)
        value = cs.new_bitvec(8)
        cs.add(value == 0x44)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe194)
        value = cs.new_bitvec(8)
        cs.add(value == 0x45)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe195)
        value = cs.new_bitvec(8)
        cs.add(value == 0x46)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe196)
        value = cs.new_bitvec(8)
        cs.add(value == 0x47)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe197)
        value = cs.new_bitvec(8)
        cs.add(value == 0x48)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe198)
        value = cs.new_bitvec(8)
        cs.add(value == 0x41)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe199)
        value = cs.new_bitvec(8)
        cs.add(value == 0x42)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe19a)
        value = cs.new_bitvec(8)
        cs.add(value == 0x43)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe19b)
        value = cs.new_bitvec(8)
        cs.add(value == 0x44)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe19c)
        value = cs.new_bitvec(8)
        cs.add(value == 0x45)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe19d)
        value = cs.new_bitvec(8)
        cs.add(value == 0x46)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe19e)
        value = cs.new_bitvec(8)
        cs.add(value == 0x47)
        mem[addr] = value
        addr = cs.new_bitvec(64)
        cs.add(addr == 0x7fffffffe19f)
        value = cs.new_bitvec(8)
        cs.add(value == 0x48)
        mem[addr] = value
        mem[0x40077c] = 'f'
        mem[0x40077d] = '\x0f'
        mem[0x40077e] = ':'
        mem[0x40077f] = 'c'
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40077c
        cpu.RBP = cs.new_bitvec(64)
        cs.add(cpu.RBP == 0x7fffffffe230)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40077cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'RBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'RBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40077cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400780, 8)== ord('\x8d'))
        condition = Operators.AND(condition, cpu.read_int(0x400781, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x400782, 8)== ord('\xff'))
        condition = Operators.AND(condition, cpu.read_int(0x400783, 8)== ord('\xff'))
        condition = Operators.AND(condition, cpu.read_int(0x400784, 8)== ord('\xff'))
        condition = Operators.AND(condition, cpu.read_int(0x400785, 8)== ord('\x1b'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe190, 8)== ord('A'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe191, 8)== ord('B'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe192, 8)== ord('C'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe193, 8)== ord('D'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe194, 8)== ord('E'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe195, 8)== ord('F'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe196, 8)== ord('G'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe197, 8)== ord('H'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe198, 8)== ord('A'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe199, 8)== ord('B'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe19a, 8)== ord('C'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe19b, 8)== ord('D'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe19c, 8)== ord('E'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe19d, 8)== ord('F'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe19e, 8)== ord('G'))
        condition = Operators.AND(condition, cpu.read_int(0x7fffffffe19f, 8)== ord('H'))
        condition = Operators.AND(condition, cpu.read_int(0x40077c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40077d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40077e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40077f, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.SF == False)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400786)
        condition = Operators.AND(condition, cpu.RBP == 0x7fffffffe230)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_31_symbolic(self):
        ''' Instruction PCMPISTRI_31
            Groups: sse42
            0x400626:	pcmpistri	xmm1, xmm2, 0xd
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400626] = 'f'
        mem[0x400627] = '\x0f'
        mem[0x400628] = ':'
        mem[0x400629] = 'c'
        mem[0x40062a] = '\xca'
        mem[0x40062b] = '\r'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400626
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400626L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400626L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400626, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400627, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400628, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400629, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40062a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40062b, 8)== ord('\r'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40062c)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_32_symbolic(self):
        ''' Instruction PCMPISTRI_32
            Groups: sse42
            0x4006d4:	pcmpistri	xmm1, xmm2, 0x48
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006d4] = 'f'
        mem[0x4006d5] = '\x0f'
        mem[0x4006d6] = ':'
        mem[0x4006d7] = 'c'
        mem[0x4006d8] = '\xca'
        mem[0x4006d9] = 'H'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4006d4
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006d4L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006d4L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006d4, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006d5, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006d6, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006d7, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006d8, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006d9, 8)== ord('H'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0xf)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4006da)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_33_symbolic(self):
        ''' Instruction PCMPISTRI_33
            Groups: sse42
            0x400686:	pcmpistri	xmm1, xmm2, 0x2d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400686] = 'f'
        mem[0x400687] = '\x0f'
        mem[0x400688] = ':'
        mem[0x400689] = 'c'
        mem[0x40068a] = '\xca'
        mem[0x40068b] = '-'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400686
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400686L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400686L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400686, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400687, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400688, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400689, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40068a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40068b, 8)== ord('-'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40068c)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_34_symbolic(self):
        ''' Instruction PCMPISTRI_34
            Groups: sse42
            0x400770:	pcmpistri	xmm1, xmm2, 0x7c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400770] = 'f'
        mem[0x400771] = '\x0f'
        mem[0x400772] = ':'
        mem[0x400773] = 'c'
        mem[0x400774] = '\xca'
        mem[0x400775] = '|'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400770
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400770L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400770L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400770, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400771, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400772, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400773, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400774, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400775, 8)== ord('|'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0xf)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400776)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_35_symbolic(self):
        ''' Instruction PCMPISTRI_35
            Groups: sse42
            0x40071c:	pcmpistri	xmm1, xmm2, 0x60
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400720] = '\xca'
        mem[0x400721] = '`'
        mem[0x40071c] = 'f'
        mem[0x40071d] = '\x0f'
        mem[0x40071e] = ':'
        mem[0x40071f] = 'c'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40071c
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40071cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40071cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400720, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400721, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.read_int(0x40071c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40071d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40071e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40071f, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0xf)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400722)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_36_symbolic(self):
        ''' Instruction PCMPISTRI_36
            Groups: sse42
            0x400776:	pcmpistri	xmm1, xmm2, 0x7d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400776] = 'f'
        mem[0x400777] = '\x0f'
        mem[0x400778] = ':'
        mem[0x400779] = 'c'
        mem[0x40077a] = '\xca'
        mem[0x40077b] = '}'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400776
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400776L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400776L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400776, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400777, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400778, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400779, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40077a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40077b, 8)== ord('}'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x7)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40077c)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_37_symbolic(self):
        ''' Instruction PCMPISTRI_37
            Groups: sse42
            0x400758:	pcmpistri	xmm1, xmm2, 0x74
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400758] = 'f'
        mem[0x400759] = '\x0f'
        mem[0x40075a] = ':'
        mem[0x40075b] = 'c'
        mem[0x40075c] = '\xca'
        mem[0x40075d] = 't'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400758
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400758L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400758L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400758, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400759, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40075a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40075b, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40075c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40075d, 8)== ord('t'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x10)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40075e)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_38_symbolic(self):
        ''' Instruction PCMPISTRI_38
            Groups: sse42
            0x400602:	pcmpistri	xmm1, xmm2, 1
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400602] = 'f'
        mem[0x400603] = '\x0f'
        mem[0x400604] = ':'
        mem[0x400605] = 'c'
        mem[0x400606] = '\xca'
        mem[0x400607] = '\x01'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400602
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400602L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400602L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400602, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400603, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400604, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400605, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400606, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400607, 8)== ord('\x01'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400608)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_39_symbolic(self):
        ''' Instruction PCMPISTRI_39
            Groups: sse42
            0x400608:	pcmpistri	xmm1, xmm2, 4
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400608] = 'f'
        mem[0x400609] = '\x0f'
        mem[0x40060a] = ':'
        mem[0x40060b] = 'c'
        mem[0x40060c] = '\xca'
        mem[0x40060d] = '\x04'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400608
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400608L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400608L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400608, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400609, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40060a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40060b, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40060c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40060d, 8)== ord('\x04'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40060e)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_4_symbolic(self):
        ''' Instruction PCMPISTRI_4
            Groups: sse42
            0x400752:	pcmpistri	xmm1, xmm2, 0x71
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400752] = 'f'
        mem[0x400753] = '\x0f'
        mem[0x400754] = ':'
        mem[0x400755] = 'c'
        mem[0x400756] = '\xca'
        mem[0x400757] = 'q'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400752
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400752L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400752L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400752, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400753, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400754, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400755, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400756, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400757, 8)== ord('q'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400758)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_40_symbolic(self):
        ''' Instruction PCMPISTRI_40
            Groups: sse42
            0x400638:	pcmpistri	xmm1, xmm2, 0x14
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400638] = 'f'
        mem[0x400639] = '\x0f'
        mem[0x40063a] = ':'
        mem[0x40063b] = 'c'
        mem[0x40063c] = '\xca'
        mem[0x40063d] = '\x14'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400638
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400638L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400638L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400638, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400639, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40063a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40063b, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40063c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40063d, 8)== ord('\x14'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x10)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40063e)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_41_symbolic(self):
        ''' Instruction PCMPISTRI_41
            Groups: sse42
            0x40074c:	pcmpistri	xmm1, xmm2, 0x70
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40074c] = 'f'
        mem[0x40074d] = '\x0f'
        mem[0x40074e] = ':'
        mem[0x40074f] = 'c'
        mem[0x400750] = '\xca'
        mem[0x400751] = 'p'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x4)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40074c
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40074cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40074cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40074c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40074d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40074e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40074f, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400750, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400751, 8)== ord('p'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x10)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400752)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_42_symbolic(self):
        ''' Instruction PCMPISTRI_42
            Groups: sse42
            0x400734:	pcmpistri	xmm1, xmm2, 0x68
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400734] = 'f'
        mem[0x400735] = '\x0f'
        mem[0x400736] = ':'
        mem[0x400737] = 'c'
        mem[0x400738] = '\xca'
        mem[0x400739] = 'h'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400734
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400734L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400734L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400734, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400735, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400736, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400737, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400738, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400739, 8)== ord('h'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0xf)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40073a)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_43_symbolic(self):
        ''' Instruction PCMPISTRI_43
            Groups: sse42
            0x400644:	pcmpistri	xmm1, xmm2, 0x18
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400644] = 'f'
        mem[0x400645] = '\x0f'
        mem[0x400646] = ':'
        mem[0x400647] = 'c'
        mem[0x400648] = '\xca'
        mem[0x400649] = '\x18'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400644
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400644L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400644L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400644, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400645, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400646, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400647, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400648, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400649, 8)== ord('\x18'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x10)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40064a)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_44_symbolic(self):
        ''' Instruction PCMPISTRI_44
            Groups: sse42
            0x40065c:	pcmpistri	xmm1, xmm2, 0x20
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400660] = '\xca'
        mem[0x400661] = ' '
        mem[0x40065c] = 'f'
        mem[0x40065d] = '\x0f'
        mem[0x40065e] = ':'
        mem[0x40065f] = 'c'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x1)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40065c
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40065cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40065cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400660, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400661, 8)== ord(' '))
        condition = Operators.AND(condition, cpu.read_int(0x40065c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40065d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40065e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40065f, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400662)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_45_symbolic(self):
        ''' Instruction PCMPISTRI_45
            Groups: sse42
            0x40061a:	pcmpistri	xmm1, xmm2, 9
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40061a] = 'f'
        mem[0x40061b] = '\x0f'
        mem[0x40061c] = ':'
        mem[0x40061d] = 'c'
        mem[0x40061e] = '\xca'
        mem[0x40061f] = '\t'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40061a
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40061aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40061aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40061a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40061b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40061c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40061d, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40061e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40061f, 8)== ord('\t'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400620)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_46_symbolic(self):
        ''' Instruction PCMPISTRI_46
            Groups: sse42
            0x40073a:	pcmpistri	xmm1, xmm2, 0x69
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40073a] = 'f'
        mem[0x40073b] = '\x0f'
        mem[0x40073c] = ':'
        mem[0x40073d] = 'c'
        mem[0x40073e] = '\xca'
        mem[0x40073f] = 'i'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40073a
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40073aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40073aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40073a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40073b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40073c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40073d, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40073e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40073f, 8)== ord('i'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x7)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400740)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_47_symbolic(self):
        ''' Instruction PCMPISTRI_47
            Groups: sse42
            0x40070a:	pcmpistri	xmm1, xmm2, 0x59
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40070a] = 'f'
        mem[0x40070b] = '\x0f'
        mem[0x40070c] = ':'
        mem[0x40070d] = 'c'
        mem[0x40070e] = '\xca'
        mem[0x40070f] = 'Y'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x40070a
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40070aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40070aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40070a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40070b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40070c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40070d, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40070e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40070f, 8)== ord('Y'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400710)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_48_symbolic(self):
        ''' Instruction PCMPISTRI_48
            Groups: sse42
            0x4006aa:	pcmpistri	xmm1, xmm2, 0x39
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006aa] = 'f'
        mem[0x4006ab] = '\x0f'
        mem[0x4006ac] = ':'
        mem[0x4006ad] = 'c'
        mem[0x4006ae] = '\xca'
        mem[0x4006af] = '9'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4006aa
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006aaL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006aaL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006aa, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006ab, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006ac, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006ad, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006ae, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006af, 8)== ord('9'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4006b0)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_49_symbolic(self):
        ''' Instruction PCMPISTRI_49
            Groups: sse42
            0x400716:	pcmpistri	xmm1, xmm2, 0x5d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400716] = 'f'
        mem[0x400717] = '\x0f'
        mem[0x400718] = ':'
        mem[0x400719] = 'c'
        mem[0x40071a] = '\xca'
        mem[0x40071b] = ']'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400716
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400716L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400716L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400716, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400717, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400718, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400719, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40071a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40071b, 8)== ord(']'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x7)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40071c)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_5_symbolic(self):
        ''' Instruction PCMPISTRI_5
            Groups: sse42
            0x40063e:	pcmpistri	xmm1, xmm2, 0x15
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400640] = ':'
        mem[0x400641] = 'c'
        mem[0x400642] = '\xca'
        mem[0x400643] = '\x15'
        mem[0x40063e] = 'f'
        mem[0x40063f] = '\x0f'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x40063e
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40063eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40063eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400640, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400641, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400642, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400643, 8)== ord('\x15'))
        condition = Operators.AND(condition, cpu.read_int(0x40063e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40063f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400644)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_50_symbolic(self):
        ''' Instruction PCMPISTRI_50
            Groups: sse42
            0x400656:	pcmpistri	xmm1, xmm2, 0x1d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400656] = 'f'
        mem[0x400657] = '\x0f'
        mem[0x400658] = ':'
        mem[0x400659] = 'c'
        mem[0x40065a] = '\xca'
        mem[0x40065b] = '\x1d'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x1)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400656
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400656L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400656L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400656, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400657, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400658, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400659, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40065a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40065b, 8)== ord('\x1d'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x1)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40065c)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_51_symbolic(self):
        ''' Instruction PCMPISTRI_51
            Groups: sse42
            0x40072e:	pcmpistri	xmm1, xmm2, 0x65
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40072e] = 'f'
        mem[0x40072f] = '\x0f'
        mem[0x400730] = ':'
        mem[0x400731] = 'c'
        mem[0x400732] = '\xca'
        mem[0x400733] = 'e'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40072e
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40072eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40072eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40072e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40072f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400730, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400731, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400732, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400733, 8)== ord('e'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x7)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400734)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_52_symbolic(self):
        ''' Instruction PCMPISTRI_52
            Groups: sse42
            0x400680:	pcmpistri	xmm1, xmm2, 0x2c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400680] = 'f'
        mem[0x400681] = '\x0f'
        mem[0x400682] = ':'
        mem[0x400683] = 'c'
        mem[0x400684] = '\xca'
        mem[0x400685] = ','
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400680
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400680L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400680L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400680, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400681, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400682, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400683, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400684, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400685, 8)== ord(','))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400686)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_53_symbolic(self):
        ''' Instruction PCMPISTRI_53
            Groups: sse42
            0x400674:	pcmpistri	xmm1, xmm2, 0x28
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400674] = 'f'
        mem[0x400675] = '\x0f'
        mem[0x400676] = ':'
        mem[0x400677] = 'c'
        mem[0x400678] = '\xca'
        mem[0x400679] = '('
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400674
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400674L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400674L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400674, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400675, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400676, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400677, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400678, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400679, 8)== ord('('))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40067a)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_54_symbolic(self):
        ''' Instruction PCMPISTRI_54
            Groups: sse42
            0x40067a:	pcmpistri	xmm1, xmm2, 0x29
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40067a] = 'f'
        mem[0x40067b] = '\x0f'
        mem[0x40067c] = ':'
        mem[0x40067d] = 'c'
        mem[0x40067e] = '\xca'
        mem[0x40067f] = ')'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40067a
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40067aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40067aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40067a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40067b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40067c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40067d, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40067e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40067f, 8)== ord(')'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400680)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_55_symbolic(self):
        ''' Instruction PCMPISTRI_55
            Groups: sse42
            0x400722:	pcmpistri	xmm1, xmm2, 0x61
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400722] = 'f'
        mem[0x400723] = '\x0f'
        mem[0x400724] = ':'
        mem[0x400725] = 'c'
        mem[0x400726] = '\xca'
        mem[0x400727] = 'a'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400722
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400722L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400722L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400722, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400723, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400724, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400725, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400726, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400727, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x7)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400728)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_56_symbolic(self):
        ''' Instruction PCMPISTRI_56
            Groups: sse42
            0x4006e6:	pcmpistri	xmm1, xmm2, 0x4d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006e6] = 'f'
        mem[0x4006e7] = '\x0f'
        mem[0x4006e8] = ':'
        mem[0x4006e9] = 'c'
        mem[0x4006ea] = '\xca'
        mem[0x4006eb] = 'M'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4006e6
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006e6L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006e6L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006e6, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006e7, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006e8, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006e9, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006ea, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006eb, 8)== ord('M'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x4)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4006ec)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_57_symbolic(self):
        ''' Instruction PCMPISTRI_57
            Groups: sse42
            0x40076a:	pcmpistri	xmm1, xmm2, 0x79
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40076a] = 'f'
        mem[0x40076b] = '\x0f'
        mem[0x40076c] = ':'
        mem[0x40076d] = 'c'
        mem[0x40076e] = '\xca'
        mem[0x40076f] = 'y'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x40076a
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40076aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40076aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40076a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40076b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40076c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40076d, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x40076e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40076f, 8)== ord('y'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400770)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_58_symbolic(self):
        ''' Instruction PCMPISTRI_58
            Groups: sse42
            0x4006ec:	pcmpistri	xmm1, xmm2, 0x50
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006ec] = 'f'
        mem[0x4006ed] = '\x0f'
        mem[0x4006ee] = ':'
        mem[0x4006ef] = 'c'
        mem[0x4006f0] = '\xca'
        mem[0x4006f1] = 'P'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x4)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4006ec
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006ecL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006ecL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006ec, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006ed, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006ee, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006ef, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006f0, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006f1, 8)== ord('P'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x10)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4006f2)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_59_symbolic(self):
        ''' Instruction PCMPISTRI_59
            Groups: sse42
            0x400632:	pcmpistri	xmm1, xmm2, 0x11
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400632] = 'f'
        mem[0x400633] = '\x0f'
        mem[0x400634] = ':'
        mem[0x400635] = 'c'
        mem[0x400636] = '\xca'
        mem[0x400637] = '\x11'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400632
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400632L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400632L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400632, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400633, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400634, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400635, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400636, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400637, 8)== ord('\x11'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400638)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_6_symbolic(self):
        ''' Instruction PCMPISTRI_6
            Groups: sse42
            0x40066e:	pcmpistri	xmm1, xmm2, 0x25
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40066e] = 'f'
        mem[0x40066f] = '\x0f'
        mem[0x400670] = ':'
        mem[0x400671] = 'c'
        mem[0x400672] = '\xca'
        mem[0x400673] = '%'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40066e
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40066eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40066eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40066e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40066f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400670, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400671, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400672, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400673, 8)== ord('%'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400674)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_60_symbolic(self):
        ''' Instruction PCMPISTRI_60
            Groups: sse42
            0x4006f2:	pcmpistri	xmm1, xmm2, 0x51
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006f2] = 'f'
        mem[0x4006f3] = '\x0f'
        mem[0x4006f4] = ':'
        mem[0x4006f5] = 'c'
        mem[0x4006f6] = '\xca'
        mem[0x4006f7] = 'Q'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4006f2
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006f2L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006f2L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006f2, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006f3, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006f4, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006f5, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006f6, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006f7, 8)== ord('Q'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4006f8)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_61_symbolic(self):
        ''' Instruction PCMPISTRI_61
            Groups: sse42
            0x400614:	pcmpistri	xmm1, xmm2, 8
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400614] = 'f'
        mem[0x400615] = '\x0f'
        mem[0x400616] = ':'
        mem[0x400617] = 'c'
        mem[0x400618] = '\xca'
        mem[0x400619] = '\x08'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400614
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400614L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400614L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400614, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400615, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400616, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400617, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400618, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400619, 8)== ord('\x08'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40061a)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_62_symbolic(self):
        ''' Instruction PCMPISTRI_62
            Groups: sse42
            0x4006da:	pcmpistri	xmm1, xmm2, 0x49
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006da] = 'f'
        mem[0x4006db] = '\x0f'
        mem[0x4006dc] = ':'
        mem[0x4006dd] = 'c'
        mem[0x4006de] = '\xca'
        mem[0x4006df] = 'I'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0xf)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4006da
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006daL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006daL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006da, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006db, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006dc, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006dd, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006de, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006df, 8)== ord('I'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x7)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4006e0)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_63_symbolic(self):
        ''' Instruction PCMPISTRI_63
            Groups: sse42
            0x4006a4:	pcmpistri	xmm1, xmm2, 0x38
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006a4] = 'f'
        mem[0x4006a5] = '\x0f'
        mem[0x4006a6] = ':'
        mem[0x4006a7] = 'c'
        mem[0x4006a8] = '\xca'
        mem[0x4006a9] = '8'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x8)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4006a4
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006a4L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006a4L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006a4, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006a5, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006a6, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006a7, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006a8, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006a9, 8)== ord('8'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x10)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4006aa)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_64_symbolic(self):
        ''' Instruction PCMPISTRI_64
            Groups: sse42
            0x4006fe:	pcmpistri	xmm1, xmm2, 0x55
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400700] = ':'
        mem[0x400701] = 'c'
        mem[0x400702] = '\xca'
        mem[0x400703] = 'U'
        mem[0x4006fe] = 'f'
        mem[0x4006ff] = '\x0f'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4006fe
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006feL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006feL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400700, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400701, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400702, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400703, 8)== ord('U'))
        condition = Operators.AND(condition, cpu.read_int(0x4006fe, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006ff, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400704)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_65_symbolic(self):
        ''' Instruction PCMPISTRI_65
            Groups: sse42
            0x400662:	pcmpistri	xmm1, xmm2, 0x21
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400662] = 'f'
        mem[0x400663] = '\x0f'
        mem[0x400664] = ':'
        mem[0x400665] = 'c'
        mem[0x400666] = '\xca'
        mem[0x400667] = '!'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400662
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400662L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400662L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400662, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400663, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400664, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400665, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400666, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400667, 8)== ord('!'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400668)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_7_symbolic(self):
        ''' Instruction PCMPISTRI_7
            Groups: sse42
            0x4006e0:	pcmpistri	xmm1, xmm2, 0x4c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4006e0] = 'f'
        mem[0x4006e1] = '\x0f'
        mem[0x4006e2] = ':'
        mem[0x4006e3] = 'c'
        mem[0x4006e4] = '\xca'
        mem[0x4006e5] = 'L'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x7)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4006e0
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4006e0L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4006e0L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4006e0, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006e1, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4006e2, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4006e3, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x4006e4, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4006e5, 8)== ord('L'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4006e6)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_8_symbolic(self):
        ''' Instruction PCMPISTRI_8
            Groups: sse42
            0x40060e:	pcmpistri	xmm1, xmm2, 5
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40060e] = 'f'
        mem[0x40060f] = '\x0f'
        mem[0x400610] = ':'
        mem[0x400611] = 'c'
        mem[0x400612] = '\xca'
        mem[0x400613] = '\x05'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x0)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40060e
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40060eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40060eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40060e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40060f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400610, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400611, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400612, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400613, 8)== ord('\x05'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x0)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400614)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRI_9_symbolic(self):
        ''' Instruction PCMPISTRI_9
            Groups: sse42
            0x40075e:	pcmpistri	xmm1, xmm2, 0x75
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400760] = ':'
        mem[0x400761] = 'c'
        mem[0x400762] = '\xca'
        mem[0x400763] = 'u'
        mem[0x40075e] = 'f'
        mem[0x40075f] = '\x0f'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x48474645444342414847464544434241)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.ECX = cs.new_bitvec(32)
        cs.add(cpu.ECX == 0x10)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x40075e
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40075eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40075eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400760, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400761, 8)== ord('c'))
        condition = Operators.AND(condition, cpu.read_int(0x400762, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400763, 8)== ord('u'))
        condition = Operators.AND(condition, cpu.read_int(0x40075e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40075f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == False)
        condition = Operators.AND(condition, cpu.ECX == 0x8)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400764)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_1_symbolic(self):
        ''' Instruction PCMPISTRM_1
            Groups: sse42
            0x400856:	pcmpistrm	xmm1, xmm2, 0x41
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400856] = 'f'
        mem[0x400857] = '\x0f'
        mem[0x400858] = ':'
        mem[0x400859] = 'b'
        mem[0x40085a] = '\xca'
        mem[0x40085b] = 'A'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400856
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400856L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400856L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400856, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400857, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400858, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400859, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x40085a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40085b, 8)== ord('A'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40085c)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_10_symbolic(self):
        ''' Instruction PCMPISTRM_10
            Groups: sse42
            0x4007cc:	pcmpistrm	xmm1, xmm2, 0x14
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007cc] = 'f'
        mem[0x4007cd] = '\x0f'
        mem[0x4007ce] = ':'
        mem[0x4007cf] = 'b'
        mem[0x4007d0] = '\xca'
        mem[0x4007d1] = '\x14'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4007cc
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007ccL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007ccL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007cc, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007cd, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007ce, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007cf, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007d0, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007d1, 8)== ord('\x14'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4007d2)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_11_symbolic(self):
        ''' Instruction PCMPISTRM_11
            Groups: sse42
            0x40087a:	pcmpistrm	xmm1, xmm2, 0x4d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40087a] = 'f'
        mem[0x40087b] = '\x0f'
        mem[0x40087c] = ':'
        mem[0x40087d] = 'b'
        mem[0x40087e] = '\xca'
        mem[0x40087f] = 'M'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x40087a
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40087aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40087aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40087a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40087b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40087c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40087d, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x40087e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40087f, 8)== ord('M'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400880)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_12_symbolic(self):
        ''' Instruction PCMPISTRM_12
            Groups: sse42
            0x400802:	pcmpistrm	xmm1, xmm2, 0x25
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400802] = 'f'
        mem[0x400803] = '\x0f'
        mem[0x400804] = ':'
        mem[0x400805] = 'b'
        mem[0x400806] = '\xca'
        mem[0x400807] = '%'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400802
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400802L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400802L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400802, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400803, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400804, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400805, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400806, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400807, 8)== ord('%'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400808)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_13_symbolic(self):
        ''' Instruction PCMPISTRM_13
            Groups: sse42
            0x4007fc:	pcmpistrm	xmm1, xmm2, 0x24
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400800] = '\xca'
        mem[0x400801] = '$'
        mem[0x4007fc] = 'f'
        mem[0x4007fd] = '\x0f'
        mem[0x4007fe] = ':'
        mem[0x4007ff] = 'b'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4007fc
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007fcL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007fcL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400800, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400801, 8)== ord('$'))
        condition = Operators.AND(condition, cpu.read_int(0x4007fc, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007fd, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007fe, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007ff, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400802)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_14_symbolic(self):
        ''' Instruction PCMPISTRM_14
            Groups: sse42
            0x4008c8:	pcmpistrm	xmm1, xmm2, 0x68
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008c8] = 'f'
        mem[0x4008c9] = '\x0f'
        mem[0x4008ca] = ':'
        mem[0x4008cb] = 'b'
        mem[0x4008cc] = '\xca'
        mem[0x4008cd] = 'h'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4008c8
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008c8L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008c8L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008c8, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008c9, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008ca, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008cb, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008cc, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008cd, 8)== ord('h'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4008ce)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_15_symbolic(self):
        ''' Instruction PCMPISTRM_15
            Groups: sse42
            0x4008f8:	pcmpistrm	xmm1, xmm2, 0x78
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008f8] = 'f'
        mem[0x4008f9] = '\x0f'
        mem[0x4008fa] = ':'
        mem[0x4008fb] = 'b'
        mem[0x4008fc] = '\xca'
        mem[0x4008fd] = 'x'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4008f8
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008f8L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008f8L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008f8, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008f9, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008fa, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008fb, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008fc, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008fd, 8)== ord('x'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4008fe)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_16_symbolic(self):
        ''' Instruction PCMPISTRM_16
            Groups: sse42
            0x40080e:	pcmpistrm	xmm1, xmm2, 0x29
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40080e] = 'f'
        mem[0x40080f] = '\x0f'
        mem[0x400810] = ':'
        mem[0x400811] = 'b'
        mem[0x400812] = '\xca'
        mem[0x400813] = ')'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x40080e
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40080eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40080eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40080e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40080f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400810, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400811, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400812, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400813, 8)== ord(')'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400814)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_17_symbolic(self):
        ''' Instruction PCMPISTRM_17
            Groups: sse42
            0x40089e:	pcmpistrm	xmm1, xmm2, 0x59
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008a0] = ':'
        mem[0x4008a1] = 'b'
        mem[0x4008a2] = '\xca'
        mem[0x4008a3] = 'Y'
        mem[0x40089e] = 'f'
        mem[0x40089f] = '\x0f'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40089e
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40089eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40089eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008a0, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008a1, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008a2, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008a3, 8)== ord('Y'))
        condition = Operators.AND(condition, cpu.read_int(0x40089e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40089f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4008a4)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_18_symbolic(self):
        ''' Instruction PCMPISTRM_18
            Groups: sse42
            0x4008f2:	pcmpistrm	xmm1, xmm2, 0x75
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008f2] = 'f'
        mem[0x4008f3] = '\x0f'
        mem[0x4008f4] = ':'
        mem[0x4008f5] = 'b'
        mem[0x4008f6] = '\xca'
        mem[0x4008f7] = 'u'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4008f2
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008f2L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008f2L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008f2, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008f3, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008f4, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008f5, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008f6, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008f7, 8)== ord('u'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4008f8)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_19_symbolic(self):
        ''' Instruction PCMPISTRM_19
            Groups: sse42
            0x4007b4:	pcmpistrm	xmm1, xmm2, 0xc
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007b4] = 'f'
        mem[0x4007b5] = '\x0f'
        mem[0x4007b6] = ':'
        mem[0x4007b7] = 'b'
        mem[0x4007b8] = '\xca'
        mem[0x4007b9] = '\x0c'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4007b4
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007b4L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007b4L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007b4, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007b5, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007b6, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007b7, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007b8, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007b9, 8)== ord('\x0c'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4007ba)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_2_symbolic(self):
        ''' Instruction PCMPISTRM_2
            Groups: sse42
            0x4008ec:	pcmpistrm	xmm1, xmm2, 0x74
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008ec] = 'f'
        mem[0x4008ed] = '\x0f'
        mem[0x4008ee] = ':'
        mem[0x4008ef] = 'b'
        mem[0x4008f0] = '\xca'
        mem[0x4008f1] = 't'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4008ec
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008ecL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008ecL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008ec, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008ed, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008ee, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008ef, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008f0, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008f1, 8)== ord('t'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4008f2)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_20_symbolic(self):
        ''' Instruction PCMPISTRM_20
            Groups: sse42
            0x4007d8:	pcmpistrm	xmm1, xmm2, 0x18
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007d8] = 'f'
        mem[0x4007d9] = '\x0f'
        mem[0x4007da] = ':'
        mem[0x4007db] = 'b'
        mem[0x4007dc] = '\xca'
        mem[0x4007dd] = '\x18'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4007d8
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007d8L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007d8L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007d8, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007d9, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007da, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007db, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007dc, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007dd, 8)== ord('\x18'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4007de)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_21_symbolic(self):
        ''' Instruction PCMPISTRM_21
            Groups: sse42
            0x400892:	pcmpistrm	xmm1, xmm2, 0x55
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400892] = 'f'
        mem[0x400893] = '\x0f'
        mem[0x400894] = ':'
        mem[0x400895] = 'b'
        mem[0x400896] = '\xca'
        mem[0x400897] = 'U'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400892
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400892L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400892L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400892, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400893, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400894, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400895, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400896, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400897, 8)== ord('U'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400898)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_22_symbolic(self):
        ''' Instruction PCMPISTRM_22
            Groups: sse42
            0x40084a:	pcmpistrm	xmm1, xmm2, 0x3d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40084a] = 'f'
        mem[0x40084b] = '\x0f'
        mem[0x40084c] = ':'
        mem[0x40084d] = 'b'
        mem[0x40084e] = '\xca'
        mem[0x40084f] = '='
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40084a
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40084aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40084aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40084a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40084b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40084c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40084d, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x40084e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40084f, 8)== ord('='))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400850)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_23_symbolic(self):
        ''' Instruction PCMPISTRM_23
            Groups: sse42
            0x40088c:	pcmpistrm	xmm1, xmm2, 0x54
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40088c] = 'f'
        mem[0x40088d] = '\x0f'
        mem[0x40088e] = ':'
        mem[0x40088f] = 'b'
        mem[0x400890] = '\xca'
        mem[0x400891] = 'T'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40088c
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40088cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40088cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40088c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40088d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40088e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40088f, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400890, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400891, 8)== ord('T'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400892)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_24_symbolic(self):
        ''' Instruction PCMPISTRM_24
            Groups: sse42
            0x4008fe:	pcmpistrm	xmm1, xmm2, 0x79
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400900] = ':'
        mem[0x400901] = 'b'
        mem[0x400902] = '\xca'
        mem[0x400903] = 'y'
        mem[0x4008fe] = 'f'
        mem[0x4008ff] = '\x0f'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4008fe
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008feL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008feL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400900, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400901, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400902, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400903, 8)== ord('y'))
        condition = Operators.AND(condition, cpu.read_int(0x4008fe, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008ff, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400904)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_25_symbolic(self):
        ''' Instruction PCMPISTRM_25
            Groups: sse42
            0x400838:	pcmpistrm	xmm1, xmm2, 0x38
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400838] = 'f'
        mem[0x400839] = '\x0f'
        mem[0x40083a] = ':'
        mem[0x40083b] = 'b'
        mem[0x40083c] = '\xca'
        mem[0x40083d] = '8'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400838
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400838L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400838L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400838, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400839, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40083a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40083b, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x40083c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40083d, 8)== ord('8'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40083e)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_26_symbolic(self):
        ''' Instruction PCMPISTRM_26
            Groups: sse42
            0x400832:	pcmpistrm	xmm1, xmm2, 0x35
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400832] = 'f'
        mem[0x400833] = '\x0f'
        mem[0x400834] = ':'
        mem[0x400835] = 'b'
        mem[0x400836] = '\xca'
        mem[0x400837] = '5'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400832
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400832L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400832L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400832, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400833, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400834, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400835, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400836, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400837, 8)== ord('5'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400838)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_27_symbolic(self):
        ''' Instruction PCMPISTRM_27
            Groups: sse42
            0x400820:	pcmpistrm	xmm1, xmm2, 0x30
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400820] = 'f'
        mem[0x400821] = '\x0f'
        mem[0x400822] = ':'
        mem[0x400823] = 'b'
        mem[0x400824] = '\xca'
        mem[0x400825] = '0'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400820
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400820L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400820L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400820, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400821, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400822, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400823, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400824, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400825, 8)== ord('0'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400826)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_28_symbolic(self):
        ''' Instruction PCMPISTRM_28
            Groups: sse42
            0x400850:	pcmpistrm	xmm1, xmm2, 0x40
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400850] = 'f'
        mem[0x400851] = '\x0f'
        mem[0x400852] = ':'
        mem[0x400853] = 'b'
        mem[0x400854] = '\xca'
        mem[0x400855] = '@'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400850
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400850L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400850L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400850, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400851, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400852, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400853, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400854, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400855, 8)== ord('@'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400856)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_29_symbolic(self):
        ''' Instruction PCMPISTRM_29
            Groups: sse42
            0x4007d2:	pcmpistrm	xmm1, xmm2, 0x15
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007d2] = 'f'
        mem[0x4007d3] = '\x0f'
        mem[0x4007d4] = ':'
        mem[0x4007d5] = 'b'
        mem[0x4007d6] = '\xca'
        mem[0x4007d7] = '\x15'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4007d2
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007d2L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007d2L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007d2, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007d3, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007d4, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007d5, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007d6, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007d7, 8)== ord('\x15'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4007d8)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_3_symbolic(self):
        ''' Instruction PCMPISTRM_3
            Groups: sse42
            0x400826:	pcmpistrm	xmm1, xmm2, 0x31
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400826] = 'f'
        mem[0x400827] = '\x0f'
        mem[0x400828] = ':'
        mem[0x400829] = 'b'
        mem[0x40082a] = '\xca'
        mem[0x40082b] = '1'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400826
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400826L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400826L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400826, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400827, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400828, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400829, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x40082a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40082b, 8)== ord('1'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40082c)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_30_symbolic(self):
        ''' Instruction PCMPISTRM_30
            Groups: sse42
            0x400898:	pcmpistrm	xmm1, xmm2, 0x58
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400898] = 'f'
        mem[0x400899] = '\x0f'
        mem[0x40089a] = ':'
        mem[0x40089b] = 'b'
        mem[0x40089c] = '\xca'
        mem[0x40089d] = 'X'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400898
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400898L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400898L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400898, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400899, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40089a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40089b, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x40089c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40089d, 8)== ord('X'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40089e)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_31_symbolic(self):
        ''' Instruction PCMPISTRM_31
            Groups: sse42
            0x4008aa:	pcmpistrm	xmm1, xmm2, 0x5d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008aa] = 'f'
        mem[0x4008ab] = '\x0f'
        mem[0x4008ac] = ':'
        mem[0x4008ad] = 'b'
        mem[0x4008ae] = '\xca'
        mem[0x4008af] = ']'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4008aa
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008aaL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008aaL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008aa, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008ab, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008ac, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008ad, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008ae, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008af, 8)== ord(']'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4008b0)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_32_symbolic(self):
        ''' Instruction PCMPISTRM_32
            Groups: sse42
            0x4007ea:	pcmpistrm	xmm1, xmm2, 0x1d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007ea] = 'f'
        mem[0x4007eb] = '\x0f'
        mem[0x4007ec] = ':'
        mem[0x4007ed] = 'b'
        mem[0x4007ee] = '\xca'
        mem[0x4007ef] = '\x1d'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4007ea
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007eaL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007eaL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007ea, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007eb, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007ec, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007ed, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007ee, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007ef, 8)== ord('\x1d'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4007f0)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_33_symbolic(self):
        ''' Instruction PCMPISTRM_33
            Groups: sse42
            0x4007f6:	pcmpistrm	xmm1, xmm2, 0x21
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007f6] = 'f'
        mem[0x4007f7] = '\x0f'
        mem[0x4007f8] = ':'
        mem[0x4007f9] = 'b'
        mem[0x4007fa] = '\xca'
        mem[0x4007fb] = '!'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4007f6
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007f6L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007f6L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007f6, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007f7, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007f8, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007f9, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007fa, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007fb, 8)== ord('!'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4007fc)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_34_symbolic(self):
        ''' Instruction PCMPISTRM_34
            Groups: sse42
            0x4008b0:	pcmpistrm	xmm1, xmm2, 0x60
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008b0] = 'f'
        mem[0x4008b1] = '\x0f'
        mem[0x4008b2] = ':'
        mem[0x4008b3] = 'b'
        mem[0x4008b4] = '\xca'
        mem[0x4008b5] = '`'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4008b0
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008b0L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008b0L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008b0, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008b1, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008b2, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008b3, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008b4, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008b5, 8)== ord('`'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4008b6)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_35_symbolic(self):
        ''' Instruction PCMPISTRM_35
            Groups: sse42
            0x4008a4:	pcmpistrm	xmm1, xmm2, 0x5c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008a4] = 'f'
        mem[0x4008a5] = '\x0f'
        mem[0x4008a6] = ':'
        mem[0x4008a7] = 'b'
        mem[0x4008a8] = '\xca'
        mem[0x4008a9] = '\\'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4008a4
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008a4L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008a4L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008a4, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008a5, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008a6, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008a7, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008a8, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008a9, 8)== ord('\\'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4008aa)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_36_symbolic(self):
        ''' Instruction PCMPISTRM_36
            Groups: sse42
            0x4008e0:	pcmpistrm	xmm1, xmm2, 0x70
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008e0] = 'f'
        mem[0x4008e1] = '\x0f'
        mem[0x4008e2] = ':'
        mem[0x4008e3] = 'b'
        mem[0x4008e4] = '\xca'
        mem[0x4008e5] = 'p'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4008e0
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008e0L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008e0L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008e0, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008e1, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008e2, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008e3, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008e4, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008e5, 8)== ord('p'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4008e6)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_37_symbolic(self):
        ''' Instruction PCMPISTRM_37
            Groups: sse42
            0x400904:	pcmpistrm	xmm1, xmm2, 0x7c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400904] = 'f'
        mem[0x400905] = '\x0f'
        mem[0x400906] = ':'
        mem[0x400907] = 'b'
        mem[0x400908] = '\xca'
        mem[0x400909] = '|'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400904
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400904L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400904L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400904, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400905, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400906, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400907, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400908, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400909, 8)== ord('|'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40090a)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_38_symbolic(self):
        ''' Instruction PCMPISTRM_38
            Groups: sse42
            0x4008c2:	pcmpistrm	xmm1, xmm2, 0x65
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008c2] = 'f'
        mem[0x4008c3] = '\x0f'
        mem[0x4008c4] = ':'
        mem[0x4008c5] = 'b'
        mem[0x4008c6] = '\xca'
        mem[0x4008c7] = 'e'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4008c2
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008c2L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008c2L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008c2, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008c3, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008c4, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008c5, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008c6, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008c7, 8)== ord('e'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4008c8)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_39_symbolic(self):
        ''' Instruction PCMPISTRM_39
            Groups: sse42
            0x40081a:	pcmpistrm	xmm1, xmm2, 0x2d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40081a] = 'f'
        mem[0x40081b] = '\x0f'
        mem[0x40081c] = ':'
        mem[0x40081d] = 'b'
        mem[0x40081e] = '\xca'
        mem[0x40081f] = '-'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x40081a
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40081aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40081aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40081a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40081b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40081c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40081d, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x40081e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40081f, 8)== ord('-'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400820)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_4_symbolic(self):
        ''' Instruction PCMPISTRM_4
            Groups: sse42
            0x4008bc:	pcmpistrm	xmm1, xmm2, 0x64
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008c0] = '\xca'
        mem[0x4008c1] = 'd'
        mem[0x4008bc] = 'f'
        mem[0x4008bd] = '\x0f'
        mem[0x4008be] = ':'
        mem[0x4008bf] = 'b'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4008bc
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008bcL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008bcL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008c0, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008c1, 8)== ord('d'))
        condition = Operators.AND(condition, cpu.read_int(0x4008bc, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008bd, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008be, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008bf, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4008c2)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_40_symbolic(self):
        ''' Instruction PCMPISTRM_40
            Groups: sse42
            0x4007de:	pcmpistrm	xmm1, xmm2, 0x19
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007e0] = ':'
        mem[0x4007e1] = 'b'
        mem[0x4007e2] = '\xca'
        mem[0x4007e3] = '\x19'
        mem[0x4007de] = 'f'
        mem[0x4007df] = '\x0f'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4007de
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007deL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007deL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007e0, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007e1, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007e2, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007e3, 8)== ord('\x19'))
        condition = Operators.AND(condition, cpu.read_int(0x4007de, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007df, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4007e4)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_41_symbolic(self):
        ''' Instruction PCMPISTRM_41
            Groups: sse42
            0x400814:	pcmpistrm	xmm1, xmm2, 0x2c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400814] = 'f'
        mem[0x400815] = '\x0f'
        mem[0x400816] = ':'
        mem[0x400817] = 'b'
        mem[0x400818] = '\xca'
        mem[0x400819] = ','
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400814
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400814L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400814L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400814, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400815, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400816, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400817, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400818, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400819, 8)== ord(','))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40081a)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_42_symbolic(self):
        ''' Instruction PCMPISTRM_42
            Groups: sse42
            0x4007c6:	pcmpistrm	xmm1, xmm2, 0x11
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007c6] = 'f'
        mem[0x4007c7] = '\x0f'
        mem[0x4007c8] = ':'
        mem[0x4007c9] = 'b'
        mem[0x4007ca] = '\xca'
        mem[0x4007cb] = '\x11'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4007c6
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007c6L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007c6L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007c6, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007c7, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007c8, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007c9, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007ca, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007cb, 8)== ord('\x11'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4007cc)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_43_symbolic(self):
        ''' Instruction PCMPISTRM_43
            Groups: sse42
            0x400868:	pcmpistrm	xmm1, xmm2, 0x48
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400868] = 'f'
        mem[0x400869] = '\x0f'
        mem[0x40086a] = ':'
        mem[0x40086b] = 'b'
        mem[0x40086c] = '\xca'
        mem[0x40086d] = 'H'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400868
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400868L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400868L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400868, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400869, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40086a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40086b, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x40086c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40086d, 8)== ord('H'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40086e)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_44_symbolic(self):
        ''' Instruction PCMPISTRM_44
            Groups: sse42
            0x4008ce:	pcmpistrm	xmm1, xmm2, 0x69
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008ce] = 'f'
        mem[0x4008cf] = '\x0f'
        mem[0x4008d0] = ':'
        mem[0x4008d1] = 'b'
        mem[0x4008d2] = '\xca'
        mem[0x4008d3] = 'i'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4008ce
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008ceL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008ceL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008ce, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008cf, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008d0, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008d1, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008d2, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008d3, 8)== ord('i'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4008d4)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_45_symbolic(self):
        ''' Instruction PCMPISTRM_45
            Groups: sse42
            0x400874:	pcmpistrm	xmm1, xmm2, 0x4c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400874] = 'f'
        mem[0x400875] = '\x0f'
        mem[0x400876] = ':'
        mem[0x400877] = 'b'
        mem[0x400878] = '\xca'
        mem[0x400879] = 'L'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400874
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400874L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400874L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400874, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400875, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400876, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400877, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400878, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400879, 8)== ord('L'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40087a)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_46_symbolic(self):
        ''' Instruction PCMPISTRM_46
            Groups: sse42
            0x40085c:	pcmpistrm	xmm1, xmm2, 0x44
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400860] = '\xca'
        mem[0x400861] = 'D'
        mem[0x40085c] = 'f'
        mem[0x40085d] = '\x0f'
        mem[0x40085e] = ':'
        mem[0x40085f] = 'b'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x40085c
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40085cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40085cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400860, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400861, 8)== ord('D'))
        condition = Operators.AND(condition, cpu.read_int(0x40085c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40085d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40085e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40085f, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400862)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_47_symbolic(self):
        ''' Instruction PCMPISTRM_47
            Groups: sse42
            0x4007a8:	pcmpistrm	xmm1, xmm2, 8
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007a8] = 'f'
        mem[0x4007a9] = '\x0f'
        mem[0x4007aa] = ':'
        mem[0x4007ab] = 'b'
        mem[0x4007ac] = '\xca'
        mem[0x4007ad] = '\x08'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4007a8
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007a8L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007a8L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007a8, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007a9, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007aa, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007ab, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007ac, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007ad, 8)== ord('\x08'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4007ae)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_48_symbolic(self):
        ''' Instruction PCMPISTRM_48
            Groups: sse42
            0x40082c:	pcmpistrm	xmm1, xmm2, 0x34
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40082c] = 'f'
        mem[0x40082d] = '\x0f'
        mem[0x40082e] = ':'
        mem[0x40082f] = 'b'
        mem[0x400830] = '\xca'
        mem[0x400831] = '4'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40082c
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40082cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40082cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40082c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40082d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40082e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40082f, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400830, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400831, 8)== ord('4'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400832)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_49_symbolic(self):
        ''' Instruction PCMPISTRM_49
            Groups: sse42
            0x4008da:	pcmpistrm	xmm1, xmm2, 0x6d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008da] = 'f'
        mem[0x4008db] = '\x0f'
        mem[0x4008dc] = ':'
        mem[0x4008dd] = 'b'
        mem[0x4008de] = '\xca'
        mem[0x4008df] = 'm'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4008da
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008daL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008daL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008da, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008db, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008dc, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008dd, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008de, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008df, 8)== ord('m'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4008e0)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_5_symbolic(self):
        ''' Instruction PCMPISTRM_5
            Groups: sse42
            0x4007a2:	pcmpistrm	xmm1, xmm2, 5
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007a2] = 'f'
        mem[0x4007a3] = '\x0f'
        mem[0x4007a4] = ':'
        mem[0x4007a5] = 'b'
        mem[0x4007a6] = '\xca'
        mem[0x4007a7] = '\x05'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4007a2
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007a2L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007a2L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007a2, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007a3, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007a4, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007a5, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007a6, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007a7, 8)== ord('\x05'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4007a8)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_50_symbolic(self):
        ''' Instruction PCMPISTRM_50
            Groups: sse42
            0x4007e4:	pcmpistrm	xmm1, xmm2, 0x1c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007e4] = 'f'
        mem[0x4007e5] = '\x0f'
        mem[0x4007e6] = ':'
        mem[0x4007e7] = 'b'
        mem[0x4007e8] = '\xca'
        mem[0x4007e9] = '\x1c'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4007e4
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007e4L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007e4L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007e4, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007e5, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007e6, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007e7, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007e8, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007e9, 8)== ord('\x1c'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4007ea)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_51_symbolic(self):
        ''' Instruction PCMPISTRM_51
            Groups: sse42
            0x400880:	pcmpistrm	xmm1, xmm2, 0x50
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400880] = 'f'
        mem[0x400881] = '\x0f'
        mem[0x400882] = ':'
        mem[0x400883] = 'b'
        mem[0x400884] = '\xca'
        mem[0x400885] = 'P'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400880
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400880L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400880L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400880, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400881, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400882, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400883, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400884, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400885, 8)== ord('P'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400886)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_52_symbolic(self):
        ''' Instruction PCMPISTRM_52
            Groups: sse42
            0x400886:	pcmpistrm	xmm1, xmm2, 0x51
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400886] = 'f'
        mem[0x400887] = '\x0f'
        mem[0x400888] = ':'
        mem[0x400889] = 'b'
        mem[0x40088a] = '\xca'
        mem[0x40088b] = 'Q'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400886
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400886L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400886L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400886, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400887, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400888, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400889, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x40088a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40088b, 8)== ord('Q'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40088c)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_53_symbolic(self):
        ''' Instruction PCMPISTRM_53
            Groups: sse42
            0x4008b6:	pcmpistrm	xmm1, xmm2, 0x61
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008b6] = 'f'
        mem[0x4008b7] = '\x0f'
        mem[0x4008b8] = ':'
        mem[0x4008b9] = 'b'
        mem[0x4008ba] = '\xca'
        mem[0x4008bb] = 'a'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4008b6
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008b6L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008b6L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008b6, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008b7, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008b8, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008b9, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008ba, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008bb, 8)== ord('a'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4008bc)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_54_symbolic(self):
        ''' Instruction PCMPISTRM_54
            Groups: sse42
            0x4007ba:	pcmpistrm	xmm1, xmm2, 0xd
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007ba] = 'f'
        mem[0x4007bb] = '\x0f'
        mem[0x4007bc] = ':'
        mem[0x4007bd] = 'b'
        mem[0x4007be] = '\xca'
        mem[0x4007bf] = '\r'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4007ba
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007baL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007baL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007ba, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007bb, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007bc, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007bd, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007be, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007bf, 8)== ord('\r'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4007c0)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_55_symbolic(self):
        ''' Instruction PCMPISTRM_55
            Groups: sse42
            0x40090a:	pcmpistrm	xmm1, xmm2, 0x7d
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40090a] = 'f'
        mem[0x40090b] = '\x0f'
        mem[0x40090c] = ':'
        mem[0x40090d] = 'b'
        mem[0x40090e] = '\xca'
        mem[0x40090f] = '}'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40090a
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40090aL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40090aL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40090a, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40090b, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40090c, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40090d, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x40090e, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40090f, 8)== ord('}'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400910)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_56_symbolic(self):
        ''' Instruction PCMPISTRM_56
            Groups: sse42
            0x40079c:	pcmpistrm	xmm1, xmm2, 4
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007a0] = '\xca'
        mem[0x4007a1] = '\x04'
        mem[0x40079c] = 'f'
        mem[0x40079d] = '\x0f'
        mem[0x40079e] = ':'
        mem[0x40079f] = 'b'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x40079c
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40079cL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40079cL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007a0, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007a1, 8)== ord('\x04'))
        condition = Operators.AND(condition, cpu.read_int(0x40079c, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40079d, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40079e, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40079f, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4007a2)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_57_symbolic(self):
        ''' Instruction PCMPISTRM_57
            Groups: sse42
            0x4007ae:	pcmpistrm	xmm1, xmm2, 9
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007ae] = 'f'
        mem[0x4007af] = '\x0f'
        mem[0x4007b0] = ':'
        mem[0x4007b1] = 'b'
        mem[0x4007b2] = '\xca'
        mem[0x4007b3] = '\t'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4007ae
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007aeL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007aeL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007ae, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007af, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007b0, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007b1, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007b2, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007b3, 8)== ord('\t'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4007b4)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_58_symbolic(self):
        ''' Instruction PCMPISTRM_58
            Groups: sse42
            0x400844:	pcmpistrm	xmm1, xmm2, 0x3c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400844] = 'f'
        mem[0x400845] = '\x0f'
        mem[0x400846] = ':'
        mem[0x400847] = 'b'
        mem[0x400848] = '\xca'
        mem[0x400849] = '<'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x400844
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400844L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400844L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400844, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400845, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400846, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400847, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400848, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400849, 8)== ord('<'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x40084a)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_59_symbolic(self):
        ''' Instruction PCMPISTRM_59
            Groups: sse42
            0x4008e6:	pcmpistrm	xmm1, xmm2, 0x71
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008e6] = 'f'
        mem[0x4008e7] = '\x0f'
        mem[0x4008e8] = ':'
        mem[0x4008e9] = 'b'
        mem[0x4008ea] = '\xca'
        mem[0x4008eb] = 'q'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4008e6
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008e6L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008e6L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008e6, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008e7, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008e8, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008e9, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008ea, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008eb, 8)== ord('q'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4008ec)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_6_symbolic(self):
        ''' Instruction PCMPISTRM_6
            Groups: sse42
            0x400808:	pcmpistrm	xmm1, xmm2, 0x28
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400808] = 'f'
        mem[0x400809] = '\x0f'
        mem[0x40080a] = ':'
        mem[0x40080b] = 'b'
        mem[0x40080c] = '\xca'
        mem[0x40080d] = '('
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400808
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400808L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400808L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400808, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400809, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x40080a, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x40080b, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x40080c, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40080d, 8)== ord('('))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40080e)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_60_symbolic(self):
        ''' Instruction PCMPISTRM_60
            Groups: sse42
            0x4008d4:	pcmpistrm	xmm1, xmm2, 0x6c
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4008d4] = 'f'
        mem[0x4008d5] = '\x0f'
        mem[0x4008d6] = ':'
        mem[0x4008d7] = 'b'
        mem[0x4008d8] = '\xca'
        mem[0x4008d9] = 'l'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4008d4
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4008d4L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4008d4L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4008d4, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008d5, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4008d6, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4008d7, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4008d8, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4008d9, 8)== ord('l'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4008da)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_61_symbolic(self):
        ''' Instruction PCMPISTRM_61
            Groups: sse42
            0x400796:	pcmpistrm	xmm1, xmm2, 1
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400796] = 'f'
        mem[0x400797] = '\x0f'
        mem[0x400798] = ':'
        mem[0x400799] = 'b'
        mem[0x40079a] = '\xca'
        mem[0x40079b] = '\x01'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400796
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400796L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400796L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400796, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400797, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400798, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400799, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x40079a, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x40079b, 8)== ord('\x01'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x40079c)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_62_symbolic(self):
        ''' Instruction PCMPISTRM_62
            Groups: sse42
            0x40083e:	pcmpistrm	xmm1, xmm2, 0x39
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400840] = ':'
        mem[0x400841] = 'b'
        mem[0x400842] = '\xca'
        mem[0x400843] = '9'
        mem[0x40083e] = 'f'
        mem[0x40083f] = '\x0f'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x40083e
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40083eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40083eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400840, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400841, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400842, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400843, 8)== ord('9'))
        condition = Operators.AND(condition, cpu.read_int(0x40083e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40083f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x400844)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_63_symbolic(self):
        ''' Instruction PCMPISTRM_63
            Groups: sse42
            0x400790:	pcmpistrm	xmm1, xmm2, 0
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400790] = 'f'
        mem[0x400791] = '\x0f'
        mem[0x400792] = ':'
        mem[0x400793] = 'b'
        mem[0x400794] = '\xca'
        mem[0x400795] = '\x00'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == False)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400790
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400790L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400790L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400790, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400791, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400792, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400793, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400794, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400795, 8)== ord('\x00'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400796)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_64_symbolic(self):
        ''' Instruction PCMPISTRM_64
            Groups: sse42
            0x4007c0:	pcmpistrm	xmm1, xmm2, 0x10
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007c0] = 'f'
        mem[0x4007c1] = '\x0f'
        mem[0x4007c2] = ':'
        mem[0x4007c3] = 'b'
        mem[0x4007c4] = '\xca'
        mem[0x4007c5] = '\x10'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x4007c0
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007c0L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007c0L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007c0, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007c1, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007c2, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007c3, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007c4, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007c5, 8)== ord('\x10'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == True)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == True)
        condition = Operators.AND(condition, cpu.RIP == 0x4007c6)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_7_symbolic(self):
        ''' Instruction PCMPISTRM_7
            Groups: sse42
            0x4007f0:	pcmpistrm	xmm1, xmm2, 0x20
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x4007f0] = 'f'
        mem[0x4007f1] = '\x0f'
        mem[0x4007f2] = ':'
        mem[0x4007f3] = 'b'
        mem[0x4007f4] = '\xca'
        mem[0x4007f5] = ' '
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == True)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == True)
        cpu.RIP = 0x4007f0
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x4007f0L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x4007f0L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x4007f0, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007f1, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x4007f2, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x4007f3, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x4007f4, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x4007f5, 8)== ord(' '))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x4007f6)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_8_symbolic(self):
        ''' Instruction PCMPISTRM_8
            Groups: sse42
            0x40086e:	pcmpistrm	xmm1, xmm2, 0x49
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x40086e] = 'f'
        mem[0x40086f] = '\x0f'
        mem[0x400870] = ':'
        mem[0x400871] = 'b'
        mem[0x400872] = '\xca'
        mem[0x400873] = 'I'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x40086e
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x40086eL)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x40086eL)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x40086e, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x40086f, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400870, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400871, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400872, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400873, 8)== ord('I'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400874)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

    def test_PCMPISTRM_9_symbolic(self):
        ''' Instruction PCMPISTRM_9
            Groups: sse42
            0x400862:	pcmpistrm	xmm1, xmm2, 0x45
        '''
        cs = ConstraintSet()
        mem = SMemory64(cs)
        cpu = AMD64Cpu(mem)
        mem.mmap(0x00400000, 0x1000, 'rwx')
        mem[0x400862] = 'f'
        mem[0x400863] = '\x0f'
        mem[0x400864] = ':'
        mem[0x400865] = 'b'
        mem[0x400866] = '\xca'
        mem[0x400867] = 'E'
        cpu.XMM2 = cs.new_bitvec(128)
        cs.add(cpu.XMM2 == 0x363534333231)
        cpu.XMM1 = cs.new_bitvec(128)
        cs.add(cpu.XMM1 == 0x48474645444342414847464544434241)
        cpu.PF = cs.new_bool()
        cs.add(cpu.PF == False)
        cpu.AF = cs.new_bool()
        cs.add(cpu.AF == False)
        cpu.OF = cs.new_bool()
        cs.add(cpu.OF == False)
        cpu.ZF = cs.new_bool()
        cs.add(cpu.ZF == True)
        cpu.CF = cs.new_bool()
        cs.add(cpu.CF == False)
        cpu.RIP = 0x400862
        cpu.SF = cs.new_bool()
        cs.add(cpu.SF == False)

        done = False
        while not done:
            try:
                cpu.execute()
                done = True
            except ConcretizeRegister,e:
                symbol = getattr(cpu, e.reg_name)
                values = solver.get_all_values(cs, symbol)
                self.assertEqual(len(values), 1)
                setattr(cpu, e.reg_name, values[0])
                setattr(cpu, 'RIP', 0x400862L)

            except ConcretizeMemory,e:
                symbol = getattr(cpu, 'EBP')
                if isinstance(symbol, Expression):
                    values = solver.get_all_values(cs, symbol)
                    self.assertEqual(len(values), 1)
                    setattr(cpu, 'EBP', values[0])
                for i in range(e.size):
                    symbol = mem[e.address+i]
                    if isinstance(symbol, Expression):
                        values = solver.get_all_values(cs, symbol)
                        self.assertEqual(len(values), 1)
                        mem[e.address+i] = values[0]
                setattr(cpu, 'RIP', 0x400862L)

        condition = True
        condition = Operators.AND(condition, cpu.read_int(0x400862, 8)== ord('f'))
        condition = Operators.AND(condition, cpu.read_int(0x400863, 8)== ord('\x0f'))
        condition = Operators.AND(condition, cpu.read_int(0x400864, 8)== ord(':'))
        condition = Operators.AND(condition, cpu.read_int(0x400865, 8)== ord('b'))
        condition = Operators.AND(condition, cpu.read_int(0x400866, 8)== ord('\xca'))
        condition = Operators.AND(condition, cpu.read_int(0x400867, 8)== ord('E'))
        condition = Operators.AND(condition, cpu.XMM2 == 0x363534333231)
        condition = Operators.AND(condition, cpu.XMM1 == 0x48474645444342414847464544434241)
        condition = Operators.AND(condition, cpu.PF == False)
        condition = Operators.AND(condition, cpu.AF == False)
        condition = Operators.AND(condition, cpu.OF == False)
        condition = Operators.AND(condition, cpu.ZF == True)
        condition = Operators.AND(condition, cpu.CF == False)
        condition = Operators.AND(condition, cpu.RIP == 0x400868)
        condition = Operators.AND(condition, cpu.SF == False)

        with cs as temp_cs:
            temp_cs.add(condition)
            self.assertTrue(solver.check(temp_cs))
        with cs as temp_cs:
            temp_cs.add(condition == False)
            self.assertFalse(solver.check(temp_cs))
          

if __name__ == '__main__':
    unittest.main()

