// File: /workspace/github_cpp_makefile_star2_O1/akshayrajput[P]ARMV8_Simulator/./LDR.cpp
// Function: LDR()
void LDR()
{
    int bit_see = (IR.getLowerData() & 0x01000000);    //24th bit to check post index, pre index, unsigned offset
    int instr_type = (IR.getLowerData() & 0x00400000) >> 22; //22nd bit to check for load/ store
    if(instr_type)      //load LDR immediate
    {
    	printf("[log] - LDR immediate\n");
        if(!bit_see)    //post-index or pre-index
        {
        	
            int size = (IR.getLowerData() & 0xc0000000) >> 30;
            int opc = (IR.getLowerData() & 0x00c00000) >> 22;
            int imm9 = (IR.getLowerData() & 0x001ff000) >> 12;
            int rn = (IR.getLowerData() & 0x000003e0) >> 5;
            int rt = (IR.getLowerData() & 0x0000001f);
            int eleventh_bit = (IR.getLowerData() & 0x00000800);
            
            if(!eleventh_bit)   //post index
            {
                printf("[log] - LDR immediate post index\n");
                if(size == 2)   //32 bit variant
                {
                	printf("[log] - LDR immediate post index 32\n");
                    int addr = R[rn].getLowerData();
                    int imm;
                    //signed extention
                    imm = signExtend(imm9,8);
                    
                    
                    int dat = (int)Memory[addr].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 1].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 2].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 3].getData();
                    
                    R[rt].setLowerData(dat);
                    
                    addr = addr + imm;
                    R[rn].setLowerData(addr);
                }
                
                else            //64 bit variant
                {
                	printf("[log] - LDR immediate post index 64\n");
                    uint64_t addr = R[rn].getData();
                    uint64_t imm;
                    //int bit = (imm9 & 0x00000100) >> 8;
                    //signed extention

                     imm = signExtend(imm9,8);
                    uint64_t dat = (int)Memory[addr].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 1].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 2].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 3].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 4].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 5].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 6].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 7].getData();
                    
                    R[rt].setData(dat);
                    
                    addr = addr + (uint64_t)imm;
                    R[rn].setData(addr);
                }
            }
            
            else                //preindex
            {
            	printf(" [log] - LDR immediate pre index\n");
                if(size == 2)   //32 bit registers
                {
                	printf("[log] - LDR immediate pre index 32\n");
                    int addr = R[rn].getLowerData();
                    int imm;
                    //signed extention
                    
                    imm = signExtend(imm9,8);
                    addr = addr + imm;
                    R[rn].setLowerData(addr);
                    int dat = (int)Memory[addr].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 1].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 2].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 3].getData();
                    
                    R[rt].setLowerData(dat);
  
                    
                }
                
                else        //64 bit registers
                {
                	printf("[log] - LDR immediate pre index 64\n");
                    uint64_t addr = R[rn].getData();
                    uint64_t imm;
                    //signed extention
                    imm = signExtend(imm9,8);
                    addr = addr + imm;
                    R[rn].setData(addr);
                    uint64_t dat = (int)Memory[addr].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 1].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 2].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 3].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 4].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 5].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 6].getData();
                    dat = dat << 8;
                    dat = dat | (int)Memory[addr + 7].getData();
                    
                    R[rt].setData(dat);
                    
                   
                }
            }
        }
        
        else    // unsigned offset
        {
        	printf("[log] - LDR immediate unsigned offset\n");
            int size = (IR.getLowerData() & 0xc0000000) >> 30;
            int opc = (IR.getLowerData() & 0x00c00000) >> 22;
            int imm12 = (IR.getLowerData() & 0x003ffc00) >> 10;
            int rn = (IR.getLowerData() & 0x000003e0) >> 5;
            int rt = (IR.getLowerData() & 0x0000001f);
            if(size == 2)   //32 bit variant
            {
            	printf("LDR immediate unsigned offset 32\n");
                int pimm = imm12 * 4;
                uint64_t addr = R[rn].getData();
                addr += (uint64_t)pimm;
                int dat = (int)Memory[addr].getData();
                dat = dat << 8;
                dat = dat | (int)Memory[addr + 1].getData();
                dat = dat << 8;
                dat = dat | (int)Memory[addr + 2].getData();
                dat = dat << 8;
                dat = dat | (int)Memory[addr + 3].getData();
                
                R[rt].setLowerData(dat);
            }
            
            else    //64 bit variant
            {
            	printf("[log] - LDR immediate unsigned offset 64\n");
                int pimm = imm12 * 8;
                uint64_t addr = R[rn].getData();
                addr += (uint64_t)pimm;
                uint64_t dat = (uint64_t)Memory[addr].getData();
                dat = dat << 8;
                dat = dat | (uint64_t)Memory[addr + 1].getData();
                dat = dat << 8;
                dat = dat | (uint64_t)Memory[addr + 2].getData();
                dat = dat << 8;
                dat = dat | (uint64_t)Memory[addr + 3].getData();
                 dat = dat << 8;
                dat = dat | (uint64_t)Memory[addr + 4].getData();
                 dat = dat << 8;
                dat = dat | (uint64_t)Memory[addr + 5].getData();
                 dat = dat << 8;
                dat = dat | (uint64_t)Memory[addr + 6].getData();
                 dat = dat << 8;
                dat = dat | (uint64_t)Memory[addr + 7].getData();
                
                R[rt].setData(dat);
            }
        }
    }
    
    else    //store STR immediate
    {
    	printf("[log] -STR immediate\n");
        if(!bit_see)    // post or pre index
        {
            int eleventh_bit = (IR.getLowerData() & 0x00000800) >> 11;
            if(!eleventh_bit)   //post index
            {
            	printf("[log] - STR immediate post index\n");
                int size = (IR.getLowerData() & 0xc0000000) >> 30;
                int opc = (IR.getLowerData() & 0x00c00000) >> 22;
                int imm9 = (IR.getLowerData() & 0x001ff000) >> 12;
                int rn = (IR.getLowerData() & 0x000003e0) >> 5;
                
                int rt = (IR.getLowerData() & 0x0000001f);
                uint64_t offset = signExtend(imm9,8);
                uint64_t addr = R[rn].getData();
                addr -= Memory[0].addr;
                if(size == 2)   //32 bit registers
                {
                	printf(" [log] - STR immediate post index 32\n");
                    int data = R[rt].getLowerData();
                    uint8_t dat = (data & 0xff000000)>>24;
                    Memory[addr].setData(dat);
                    dat = (data & 0x00ff0000)>>16;
                    Memory[addr + 1].setData(dat);
                    dat = (data & 0x0000ff00)>>8;
                    Memory[addr + 2].setData(dat);
                    dat = data & 0xff0000ff;
                    Memory[addr + 3].setData(dat);
                }
                
                else  //64 bit registers
                {
                	printf("[log] - STR immediate post index 64\n");
                    uint64_t data = R[rt].getData();
                    uint8_t dat;
                    dat = (data & 0xff00000000000000)>>56;
                    Memory[addr].setData(dat);
                    dat = (data & 0x00ff000000000000)>>48;
                    Memory[addr + 1].setData(dat);
                    dat = (data & 0x0000ff0000000000)>>40;
                    Memory[addr + 2].setData(dat);
                    dat = (data & 0x000000ff00000000)>>32;
                    Memory[addr + 3].setData(dat);
                    dat = (data & 0x00000000ff000000)>>24;
                    Memory[addr + 4].setData(dat);
                    dat = (data & 0xff00000000ff0000)>>16;
                    Memory[addr + 5].setData(dat);
                    dat = (data & 0x000000000000ff00)>>8;
                    Memory[addr + 6].setData(dat);
                    dat = data & 0x00000000000000ff;
                    Memory[addr + 7].setData(dat);
                }
                
                addr = addr + offset;
                R[rn].setData(addr);
            }
            
            else        //pre index
            {
            	printf("[log] - STR immediate pre index\n");
                int size = (IR.getLowerData() & 0xc0000000) >> 30;
                int opc = (IR.getLowerData() & 0x00c00000) >> 22;
                int imm9 = (IR.getLowerData() & 0x001ff000) >> 12;
                int rn = (IR.getLowerData() & 0x000003e0) >> 5;
                
                int rt = (IR.getLowerData() & 0x0000001f);
                uint64_t offset = signExtend(imm9,8);
                uint8_t addr = R[rn].getData();
                
                addr = addr + offset;
                addr -= Memory[0].addr;
                R[rn].setData(addr);
                if(size == 2)   //32 bit registers
                {
                	printf("[log] - STR immediate pre index 32\n");
                    int data = R[rt].getLowerData();
                    uint8_t dat = (data & 0xff000000)>>24;
                    Memory[addr].setData(dat);
                    dat = (data & 0x00ff0000)>>16;
                    Memory[addr + 1].setData(dat);
                    dat = (data & 0x0000ff00)>>8;
                    Memory[addr + 2].setData(dat);
                    dat = data & 0xff0000ff;
                    Memory[addr + 3].setData(dat);
                }
                
                else  //64 bit registers
                {
                	printf("[log] - STR immediate pre index 64\n");
                    uint64_t data = R[rt].getData();
                    uint8_t dat;
                    dat = (data & 0xff00000000000000)>>56;
                    Memory[addr].setData(dat);
                    dat = (data & 0x00ff000000000000)>>48;
                    Memory[addr + 1].setData(dat);
                    dat = (data & 0x0000ff0000000000)>>40;
                    Memory[addr + 2].setData(dat);
                    dat = (data & 0x000000ff00000000)>>32;
                    Memory[addr + 3].setData(dat);
                    dat = (data & 0x00000000ff000000)>>24;
                    Memory[addr + 4].setData(dat);
                    dat = (data & 0xff00000000ff0000)>>16;
                    Memory[addr + 5].setData(dat);
                    dat = (data & 0x000000000000ff00)>>8;
                    Memory[addr + 6].setData(dat);
                    dat = data & 0x00000000000000ff;
                    Memory[addr + 7].setData(dat);
                }
                
               
            }
        }
        
        else    //unsigned offset
        {
        	printf("[log] - STR immediate unsigned offset\n");
            int size = (IR.getLowerData() & 0xc0000000) >> 30;
            int opc = (IR.getLowerData() & 0x00c00000) >> 22;
            int imm12 = (IR.getLowerData() & 0x003ffc00) >> 10;
            int rn = (IR.getLowerData() & 0x000003e0) >> 5;
            int rt = (IR.getLowerData() & 0x0000001f);
            
            uint64_t addr = R[rn].getData();
            uint64_t offset = (0x0000000000000fff) & (uint64_t)imm12;
            addr += offset;
            addr -= Memory[0].addr;
            
            if(size == 2)   //32 bit registers
            {
            	printf("[log] - STR immediate unsigned offset 32\n");
                int data = R[rt].getLowerData();
                uint8_t dat = (data & 0xff000000)>>24;
                    Memory[addr].setData(dat);
                    dat = (data & 0x00ff0000)>>16;
                    Memory[addr + 1].setData(dat);
                    dat = (data & 0x0000ff00)>>8;
                    Memory[addr + 2].setData(dat);
                    dat = data & 0xff0000ff;
                    Memory[addr + 3].setData(dat);
            
                
            }
            
            else        //64 bit registers
            {
            	printf("[log] - STR immediate unsigned offset 64\n");
                uint64_t data = R[rt].getData();
                uint8_t dat;
                    dat = (data & 0xff00000000000000)>>56;
                    Memory[addr].setData(dat);
                    dat = (data & 0x00ff000000000000)>>48;
                    Memory[addr + 1].setData(dat);
                    dat = (data & 0x0000ff0000000000)>>40;
                    Memory[addr + 2].setData(dat);
                    dat = (data & 0x000000ff00000000)>>32;
                    Memory[addr + 3].setData(dat);
                    dat = (data & 0x00000000ff000000)>>24;
                    Memory[addr + 4].setData(dat);
                    dat = (data & 0xff00000000ff0000)>>16;
                    Memory[addr + 5].setData(dat);
                    dat = (data & 0x000000000000ff00)>>8;
                    Memory[addr + 6].setData(dat);
                    dat = data & 0x00000000000000ff;
                    Memory[addr + 7].setData(dat);
            }
            
        }
    }
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x1630e(%rip), %r14     # 0x1a1f0
movq %r14, %rdi
callq 0x5c8a
movl %eax, %ebx
movq %r14, %rdi
callq 0x5c8a
btl $0x16, %eax
jb 0x405a
leaq 0x2a99(%rip), %rdi      # 0x699e
callq 0x1140
btl $0x18, %ebx
jb 0x41c8
leaq 0x162d5(%rip), %rdi     # 0x1a1f0
callq 0x5c8a
btl $0xb, %eax
jb 0x43c1
leaq 0x2a82(%rip), %rdi      # 0x69b3
callq 0x1140
leaq 0x162b3(%rip), %rbx     # 0x1a1f0
movq %rbx, %rdi
callq 0x5c8a
movl %eax, %ebp
movq %rbx, %rdi
callq 0x5c8a
movq %rbx, %rdi
callq 0x5c8a
movl %eax, %r14d
shrl $0xc, %r14d
movl %r14d, %r12d
andl $0x1ff, %r12d           # imm = 0x1FF
movq %rbx, %rdi
callq 0x5c8a
movl %eax, %r15d
shrl $0x5, %r15d
movq %rbx, %rdi
callq 0x5c8a
movl %eax, %r13d
xorl %ecx, %ecx
xorl %ebx, %ebx
movl $0x1, %eax
shll %cl, %eax
andl %r12d, %eax
addq %rax, %rbx
incl %ecx
cmpl $0x8, %ecx
jne 0x3f86
andl $0x1f, %r15d
andl $0x1f, %r13d
andl $0x100, %r14d           # imm = 0x100
subq %r14, %rbx
leaq 0x613d(%rip), %r14      # 0xa0f0
leaq (%r14,%r15,8), %rdi
movq %rdi, (%rsp)
callq 0x5c86
movq %rax, %r15
leaq 0x6226(%rip), %r12      # 0xa1f0
subq 0x621f(%rip), %r15      # 0xa1f0
andl $0xc0000000, %ebp       # imm = 0xC0000000
movq %r15, 0x8(%rsp)
shlq $0x4, %r15
leaq (%r12,%r15), %rax
movq %rax, 0x10(%rsp)
negl %ebp
leaq (%r14,%r13,8), %r13
leaq 0x10(%r15,%r12), %rbp
leaq 0x20(%r15,%r12), %r14
jno 0x4758
leaq 0x29f2(%rip), %rdi      # 0x69f8
callq 0x1140
movq %r13, %rdi
callq 0x5c8a
movl %eax, %r13d
movl %eax, %esi
shrl $0x18, %esi
movq 0x10(%rsp), %rdi
callq 0x5c76
movl %r13d, %esi
shrl $0x10, %esi
movq %r14, %r15
movl $0xff, %r14d
andl %r14d, %esi
movq %rbp, %rdi
callq 0x5c76
movl %r13d, %esi
shrl $0x8, %esi
andl %r14d, %esi
movq %r15, %rdi
callq 0x5c76
movl $0x3, %eax
jmp 0x480e
leaq 0x2a9a(%rip), %rdi      # 0x6afb
callq 0x1140
btl $0x18, %ebx
jb 0x42cc
leaq 0x16179(%rip), %r12     # 0x1a1f0
movq %r12, %rdi
callq 0x5c8a
movl %eax, %ebp
movq %r12, %rdi
callq 0x5c8a
movq %r12, %rdi
callq 0x5c8a
movl %eax, %r15d
shrl $0xc, %r15d
movl %r15d, %r13d
andl $0x1ff, %r13d           # imm = 0x1FF
movq %r12, %rdi
callq 0x5c8a
movl %eax, %r14d
movq %r12, %rdi
callq 0x5c8a
andl $0x1f, %eax
movl %eax, (%rsp)
movq %r12, %rdi
callq 0x5c8a
andl $0xc0000000, %ebp       # imm = 0xC0000000
shrl $0x2, %r14d
andl $0xf8, %r14d
leaq 0x6015(%rip), %rcx      # 0xa0f0
addq %rcx, %r14
btl $0xb, %eax
jb 0x44ef
leaq 0x2a22(%rip), %rdi      # 0x6b11
callq 0x1140
negl %ebp
jno 0x4838
leaq 0x2a53(%rip), %rdi      # 0x6b56
callq 0x1140
movq %r14, %rdi
callq 0x5c8a
xorl %ecx, %ecx
xorl %ebx, %ebx
movl $0x1, %edx
shll %cl, %edx
andl %r13d, %edx
addq %rdx, %rbx
incl %ecx
cmpl $0x8, %ecx
jne 0x4114
andl $0x100, %r15d           # imm = 0x100
movq %r15, 0x8(%rsp)
movslq %eax, %r12
movq %r12, %r13
shlq $0x4, %r13
leaq 0x60ab(%rip), %r15      # 0xa1f0
leaq (%r15,%r13), %rdi
callq 0x5c82
movzbl %al, %ebp
leaq (%r15,%r13), %rdi
addq $0x10, %rdi
callq 0x5c82
movzbl %al, %r15d
shll $0x10, %ebp
shll $0x8, %r15d
orl %ebp, %r15d
leaq 0x607d(%rip), %rax      # 0xa1f0
leaq (%rax,%r13), %rdi
addq $0x20, %rdi
callq 0x5c82
movzbl %al, %ebp
orl %r15d, %ebp
shll $0x8, %ebp
leaq 0x6060(%rip), %rax      # 0xa1f0
leaq (%rax,%r13), %rdi
addq $0x30, %rdi
callq 0x5c82
movzbl %al, %esi
orl %ebp, %esi
movl (%rsp), %eax
leaq 0x5f44(%rip), %rcx      # 0xa0f0
leaq (%rcx,%rax,8), %rdi
callq 0x5c94
subl 0x8(%rsp), %r12d
addl %ebx, %r12d
movq %r14, %rdi
movl %r12d, %esi
jmp 0x45b3
leaq 0x28b4(%rip), %rdi      # 0x6a83
callq 0x1140
leaq 0x16015(%rip), %r14     # 0x1a1f0
movq %r14, %rdi
callq 0x5c8a
movl %eax, %ebp
movq %r14, %rdi
callq 0x5c8a
movq %r14, %rdi
callq 0x5c8a
movl %eax, %ebx
shrl $0xa, %ebx
movq %r14, %rdi
callq 0x5c8a
movl %eax, %r15d
movq %r14, %rdi
callq 0x5c8a
movl %eax, %r14d
andl $0x1f, %r14d
shrl $0x2, %r15d
andl $0xf8, %r15d
leaq 0x5eca(%rip), %r12      # 0xa0f0
addq %r12, %r15
movq %r15, %rdi
callq 0x5c86
andl $0xfff, %ebx            # imm = 0xFFF
addq %rax, %rbx
subq 0x5faf(%rip), %rbx      # 0xa1f0
leaq 0x5fa8(%rip), %r15      # 0xa1f0
andl $0xc0000000, %ebp       # imm = 0xC0000000
shlq $0x4, %rbx
leaq (%r15,%rbx), %r13
negl %ebp
leaq (%r12,%r14,8), %r14
leaq 0x10(%rbx,%r15), %r12
leaq 0x20(%rbx,%r15), %rax
movq %rax, (%rsp)
jno 0x45c6
leaq 0x285b(%rip), %rdi      # 0x6ad2
callq 0x1140
movq %r14, %rdi
callq 0x5c8a
movl %eax, %ebp
movl %eax, %esi
shrl $0x18, %esi
movq %r13, %rdi
callq 0x5c76
movl %ebp, %esi
shrl $0x10, %esi
movl $0xff, %r14d
andl %r14d, %esi
movq %r12, %rdi
callq 0x5c76
movl %ebp, %esi
shrl $0x8, %esi
andl %r14d, %esi
movq (%rsp), %rdi
callq 0x5c76
leaq (%rbx,%r15), %rdi
addq $0x30, %rdi
andl %r14d, %ebp
movl %ebp, %esi
jmp 0x4a2b
leaq 0x290e(%rip), %rdi      # 0x6be1
callq 0x1140
leaq 0x15f11(%rip), %rbx     # 0x1a1f0
movq %rbx, %rdi
callq 0x5c8a
movl %eax, %r14d
movq %rbx, %rdi
callq 0x5c8a
movq %rbx, %rdi
callq 0x5c8a
movl %eax, %ebp
shrl $0xa, %ebp
andl $0xfff, %ebp            # imm = 0xFFF
movq %rbx, %rdi
callq 0x5c8a
movl %eax, %r15d
movq %rbx, %rdi
callq 0x5c8a
movl %eax, %ebx
andl $0x1f, %ebx
andl $0xc0000000, %r14d      # imm = 0xC0000000
shrl $0x2, %r15d
andl $0xf8, %r15d
leaq 0x5dba(%rip), %r12      # 0xa0f0
addq %r12, %r15
negl %r14d
jno 0x467a
leaq 0x28e7(%rip), %rdi      # 0x6c30
callq 0x1140
movq %r15, %rdi
callq 0x5c86
movl %ebp, %ecx
leaq (%rax,%rcx,4), %r14
shlq $0x4, %r14
leaq 0x5e89(%rip), %r15      # 0xa1f0
leaq (%r15,%r14), %rdi
callq 0x5c82
movzbl %al, %ebp
leaq (%r14,%r15), %rdi
addq $0x10, %rdi
callq 0x5c82
movzbl %al, %r13d
shll $0x10, %ebp
shll $0x8, %r13d
orl %ebp, %r13d
leaq (%r14,%r15), %rdi
addq $0x20, %rdi
callq 0x5c82
movzbl %al, %ebp
orl %r13d, %ebp
shll $0x8, %ebp
leaq (%r14,%r15), %rdi
addq $0x30, %rdi
callq 0x5c82
movzbl %al, %esi
orl %ebp, %esi
movl %ebx, %eax
leaq (%r12,%rax,8), %rdi
jmp 0x45b3
leaq 0x2655(%rip), %rdi      # 0x6a1d
callq 0x1140
leaq 0x15e1c(%rip), %r12     # 0x1a1f0
movq %r12, %rdi
callq 0x5c8a
movl %eax, %ebx
movq %r12, %rdi
callq 0x5c8a
movq %r12, %rdi
callq 0x5c8a
movl %eax, %r15d
shrl $0xc, %r15d
movq %r12, %rdi
callq 0x5c8a
movl %eax, %r14d
shrl $0x5, %r14d
movq %r12, %rdi
callq 0x5c8a
movl %eax, %ebp
xorl %ecx, %ecx
xorl %r12d, %r12d
movl $0x1, %eax
shll %cl, %eax
andl %r15d, %eax
addq %rax, %r12
incl %ecx
cmpl $0x8, %ecx
jne 0x4413
andl $0x1f, %r14d
andl $0x1f, %ebp
leaq 0x5cbb(%rip), %r13      # 0xa0f0
leaq (,%r14,8), %r15
addq %r13, %r15
movq %r15, %rdi
callq 0x5c86
addq %rax, %r12
subq 0x5d9e(%rip), %r12      # 0xa1f0
movzbl %r12b, %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0x5c8e
andl $0xc0000000, %ebx       # imm = 0xC0000000
negl %ebx
jno 0x4959
leaq 0x25ea(%rip), %rdi      # 0x6a60
callq 0x1140
movl %ebp, %eax
leaq (,%rax,8), %rdi
addq %r13, %rdi
callq 0x5c8a
movl %eax, %ebx
movl %eax, %esi
shrl $0x18, %esi
shll $0x4, %r14d
leaq 0x5d51(%rip), %r15      # 0xa1f0
addq %r15, %r14
movq %r14, %rdi
callq 0x5c76
movl %ebx, %esi
shrl $0x10, %esi
movl $0xff, %ebp
andl %ebp, %r12d
shll $0x4, %r12d
leaq (%r12,%r15), %rdi
addq $0x10, %rdi
andl %ebp, %esi
callq 0x5c76
movl %ebx, %esi
shrl $0x8, %esi
leaq (%r12,%r15), %rdi
addq $0x20, %rdi
andl %ebp, %esi
callq 0x5c76
leaq (%r12,%r15), %rdi
addq $0x30, %rdi
andl %ebp, %ebx
movl %ebx, %esi
jmp 0x4a2b
leaq 0x2684(%rip), %rdi      # 0x6b7a
callq 0x1140
negl %ebp
jno 0x4a3e
leaq 0x26b4(%rip), %rdi      # 0x6bbe
callq 0x1140
movq %r14, %rdi
callq 0x5c8a
xorl %ecx, %ecx
xorl %r12d, %r12d
movl $0x1, %edx
shll %cl, %edx
andl %r13d, %edx
addq %rdx, %r12
incl %ecx
cmpl $0x8, %ecx
jne 0x451c
andl $0x100, %r15d           # imm = 0x100
subl %r15d, %r12d
addl %eax, %r12d
movq %r14, %rdi
movl %r12d, %esi
callq 0x5c94
movslq %r12d, %rbx
shlq $0x4, %rbx
leaq 0x5c9a(%rip), %r14      # 0xa1f0
leaq (%r14,%rbx), %rdi
callq 0x5c82
movzbl %al, %ebp
leaq (%rbx,%r14), %rdi
addq $0x10, %rdi
callq 0x5c82
movzbl %al, %r15d
shll $0x10, %ebp
shll $0x8, %r15d
orl %ebp, %r15d
leaq (%rbx,%r14), %rdi
addq $0x20, %rdi
callq 0x5c82
movzbl %al, %ebp
orl %r15d, %ebp
shll $0x8, %ebp
leaq (%rbx,%r14), %rdi
addq $0x30, %rdi
callq 0x5c82
movzbl %al, %esi
orl %ebp, %esi
movl (%rsp), %eax
leaq 0x5b41(%rip), %rcx      # 0xa0f0
leaq (%rcx,%rax,8), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5c94
leaq 0x24dc(%rip), %rdi      # 0x6aa9
callq 0x1140
movq %r14, %rdi
callq 0x5c86
movq %rax, %r14
movq %rax, %rsi
shrq $0x38, %rsi
movq %r13, %rdi
callq 0x5c76
movq %r14, %rsi
shrq $0x30, %rsi
movl $0xff, %ebp
andl %ebp, %esi
movq %r12, %rdi
callq 0x5c76
movq %r14, %rsi
shrq $0x28, %rsi
andl %ebp, %esi
movq (%rsp), %rdi
callq 0x5c76
movq %r14, %rsi
shrq $0x20, %rsi
leaq (%rbx,%r15), %rdi
addq $0x30, %rdi
andl %ebp, %esi
callq 0x5c76
movl %r14d, %esi
shrl $0x18, %esi
leaq (%rbx,%r15), %rdi
addq $0x40, %rdi
callq 0x5c76
movl %r14d, %esi
shrl $0x10, %esi
leaq (%rbx,%r15), %rdi
addq $0x50, %rdi
andl %ebp, %esi
callq 0x5c76
movl %r14d, %esi
shrl $0x8, %esi
leaq (%rbx,%r15), %rdi
addq $0x60, %rdi
andl %ebp, %esi
callq 0x5c76
leaq (%rbx,%r15), %rdi
addq $0x70, %rdi
andl %ebp, %r14d
movl %r14d, %esi
jmp 0x4a2b
leaq 0x2586(%rip), %rdi      # 0x6c07
callq 0x1140
movq %r15, %rdi
callq 0x5c86
movl %ebp, %ecx
leaq (%rax,%rcx,8), %r14
shlq $0x4, %r14
leaq 0x5b51(%rip), %r15      # 0xa1f0
leaq (%r15,%r14), %rdi
callq 0x5c82
movl %eax, %ebp
leaq (%r14,%r15), %rdi
addq $0x10, %rdi
callq 0x5c82
movzbl %bpl, %ecx
shll $0x10, %ecx
movzbl %al, %ebp
shll $0x8, %ebp
orl %ecx, %ebp
leaq (%r14,%r15), %rdi
addq $0x20, %rdi
callq 0x5c82
movzbl %al, %r13d
orl %ebp, %r13d
leaq (%r14,%r15), %rdi
addq $0x30, %rdi
callq 0x5c82
shlq $0x10, %r13
movzbl %al, %ebp
shll $0x8, %ebp
orq %r13, %rbp
leaq (%r14,%r15), %rdi
addq $0x40, %rdi
callq 0x5c82
movzbl %al, %r13d
orq %rbp, %r13
leaq (%r14,%r15), %rdi
addq $0x50, %rdi
callq 0x5c82
shlq $0x10, %r13
movzbl %al, %ebp
shll $0x8, %ebp
orq %r13, %rbp
leaq (%r14,%r15), %rdi
addq $0x60, %rdi
callq 0x5c82
movzbl %al, %r13d
orq %rbp, %r13
shlq $0x8, %r13
leaq (%r14,%r15), %rdi
addq $0x70, %rdi
callq 0x5c82
movzbl %al, %esi
orq %r13, %rsi
movl %ebx, %eax
leaq (%r12,%rax,8), %rdi
jmp 0x4b4e
leaq 0x2275(%rip), %rdi      # 0x69d4
callq 0x1140
movq %r13, %rdi
callq 0x5c86
movq %rax, %r13
movq %rax, %rsi
shrq $0x38, %rsi
movq 0x10(%rsp), %rdi
callq 0x5c76
movq %r13, %rsi
shrq $0x30, %rsi
movl $0xff, %eax
andl %eax, %esi
movq %rbp, %rdi
callq 0x5c76
movq %r13, %rsi
shrq $0x28, %rsi
movl $0xff, %eax
andl %eax, %esi
movl $0xff, %ebp
movq %r14, %rdi
callq 0x5c76
movq %r13, %rsi
shrq $0x20, %rsi
leaq (%r15,%r12), %rdi
addq $0x30, %rdi
andl %ebp, %esi
movl $0xff, %ebp
callq 0x5c76
movl %r13d, %esi
shrl $0x18, %esi
leaq (%r15,%r12), %rdi
addq $0x40, %rdi
callq 0x5c76
movl %r13d, %esi
shrl $0x10, %esi
leaq (%r15,%r12), %rdi
addq $0x50, %rdi
andl %ebp, %esi
callq 0x5c76
movl %r13d, %esi
shrl $0x8, %esi
leaq (%r15,%r12), %rdi
addq $0x60, %rdi
andl %ebp, %esi
callq 0x5c76
movl $0x7, %eax
movq 0x8(%rsp), %r14
addq %r14, %rax
shlq $0x4, %rax
addq %rax, %r12
movzbl %r13b, %esi
movq %r12, %rdi
callq 0x5c76
addq %r14, %rbx
movq (%rsp), %rdi
movq %rbx, %rsi
jmp 0x4b4e
leaq 0x22f3(%rip), %rdi      # 0x6b32
callq 0x1140
movq %r14, %rdi
callq 0x5c86
xorl %ecx, %ecx
xorl %ebx, %ebx
movl $0x1, %edx
shll %cl, %edx
andl %r13d, %edx
addq %rdx, %rbx
incl %ecx
cmpl $0x8, %ecx
jne 0x4850
andl $0x100, %r15d           # imm = 0x100
movq %r15, 0x8(%rsp)
movq %rax, %r13
shlq $0x4, %r13
leaq 0x5972(%rip), %r12      # 0xa1f0
leaq (%r12,%r13), %rdi
movq %rax, 0x10(%rsp)
callq 0x5c82
movl %eax, %ebp
leaq (%r12,%r13), %rdi
addq $0x10, %rdi
callq 0x5c82
movzbl %bpl, %ecx
shll $0x10, %ecx
movzbl %al, %ebp
shll $0x8, %ebp
orl %ecx, %ebp
leaq (%r12,%r13), %rdi
addq $0x20, %rdi
callq 0x5c82
movzbl %al, %r15d
orl %ebp, %r15d
leaq (%r12,%r13), %rdi
addq $0x30, %rdi
callq 0x5c82
shlq $0x10, %r15
movzbl %al, %ebp
shll $0x8, %ebp
orq %r15, %rbp
leaq (%r12,%r13), %rdi
addq $0x40, %rdi
callq 0x5c82
movzbl %al, %r15d
orq %rbp, %r15
leaq (%r12,%r13), %rdi
addq $0x50, %rdi
callq 0x5c82
shlq $0x10, %r15
movzbl %al, %ebp
shll $0x8, %ebp
orq %r15, %rbp
leaq (%r12,%r13), %rdi
addq $0x60, %rdi
callq 0x5c82
movzbl %al, %r15d
orq %rbp, %r15
shlq $0x8, %r15
leaq (%r12,%r13), %rdi
addq $0x70, %rdi
callq 0x5c82
movzbl %al, %esi
orq %r15, %rsi
movl (%rsp), %eax
leaq 0x57b5(%rip), %rcx      # 0xa0f0
leaq (%rcx,%rax,8), %rdi
callq 0x5c8e
movq 0x10(%rsp), %rsi
subq 0x8(%rsp), %rsi
addq %rbx, %rsi
movq %r14, %rdi
jmp 0x4b4e
leaq 0x20dd(%rip), %rdi      # 0x6a3d
callq 0x1140
movl %ebp, %eax
leaq (,%rax,8), %rdi
addq %r13, %rdi
callq 0x5c86
movq %rax, %rbx
movq %rax, %rsi
shrq $0x38, %rsi
shll $0x4, %r14d
leaq 0x5864(%rip), %r15      # 0xa1f0
addq %r15, %r14
movq %r14, %rdi
callq 0x5c76
movq %rbx, %rsi
shrq $0x30, %rsi
movl $0xff, %ebp
andl %ebp, %r12d
shll $0x4, %r12d
leaq (%r12,%r15), %rdi
addq $0x10, %rdi
andl %ebp, %esi
callq 0x5c76
movq %rbx, %rsi
shrq $0x28, %rsi
leaq (%r12,%r15), %rdi
addq $0x20, %rdi
andl %ebp, %esi
callq 0x5c76
movq %rbx, %rsi
shrq $0x20, %rsi
leaq (%r12,%r15), %rdi
addq $0x30, %rdi
andl %ebp, %esi
callq 0x5c76
movl %ebx, %esi
shrl $0x18, %esi
leaq (%r12,%r15), %rdi
addq $0x40, %rdi
callq 0x5c76
movl %ebx, %esi
shrl $0x10, %esi
leaq (%r12,%r15), %rdi
addq $0x50, %rdi
andl %ebp, %esi
callq 0x5c76
movl %ebx, %esi
shrl $0x8, %esi
leaq (%r12,%r15), %rdi
addq $0x60, %rdi
andl %ebp, %esi
callq 0x5c76
leaq (%r12,%r15), %rdi
addq $0x70, %rdi
andl %ebp, %ebx
movl %ebx, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5c76
leaq 0x2156(%rip), %rdi      # 0x6b9b
callq 0x1140
movq %r14, %rdi
callq 0x5c86
xorl %ecx, %ecx
xorl %r12d, %r12d
movl $0x1, %edx
shll %cl, %edx
andl %r13d, %edx
addq %rdx, %r12
incl %ecx
cmpl $0x8, %ecx
jne 0x4a57
andl $0x100, %r15d           # imm = 0x100
subq %r15, %r12
addq %rax, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x5c8e
shlq $0x4, %r12
leaq 0x5762(%rip), %rbx      # 0xa1f0
leaq (%rbx,%r12), %rdi
callq 0x5c82
movl %eax, %ebp
leaq (%r12,%rbx), %rdi
addq $0x10, %rdi
callq 0x5c82
movzbl %bpl, %ecx
shll $0x10, %ecx
movzbl %al, %ebp
shll $0x8, %ebp
orl %ecx, %ebp
leaq (%r12,%rbx), %rdi
addq $0x20, %rdi
callq 0x5c82
movzbl %al, %r14d
orl %ebp, %r14d
leaq (%r12,%rbx), %rdi
addq $0x30, %rdi
callq 0x5c82
shlq $0x10, %r14
movzbl %al, %r15d
shll $0x8, %r15d
orq %r14, %r15
leaq (%r12,%rbx), %rdi
addq $0x40, %rdi
callq 0x5c82
movzbl %al, %r14d
orq %r15, %r14
leaq (%r12,%rbx), %rdi
addq $0x50, %rdi
callq 0x5c82
shlq $0x10, %r14
movzbl %al, %r15d
shll $0x8, %r15d
orq %r14, %r15
leaq (%r12,%rbx), %rdi
addq $0x60, %rdi
callq 0x5c82
movzbl %al, %r14d
orq %r15, %r14
shlq $0x8, %r14
leaq (%r12,%rbx), %rdi
addq $0x70, %rdi
callq 0x5c82
movzbl %al, %esi
orq %r14, %rsi
movl (%rsp), %eax
leaq 0x55a6(%rip), %rcx      # 0xa0f0
leaq (%rcx,%rax,8), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5c8e