// File: /workspace/github_cpp_makefile_star2_O3/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 0x162bd(%rip), %r14     # 0x1a1f0
movq %r14, %rdi
callq 0x5cb2
movl %eax, %ebx
movq %r14, %rdi
callq 0x5cb2
btl $0x16, %eax
jb 0x40ab
leaq 0x2a48(%rip), %rdi      # 0x699e
callq 0x1140
btl $0x18, %ebx
jb 0x4218
leaq 0x16284(%rip), %rdi     # 0x1a1f0
callq 0x5cb2
btl $0xb, %eax
jb 0x440d
leaq 0x2a31(%rip), %rdi      # 0x69b3
callq 0x1140
leaq 0x16262(%rip), %rbx     # 0x1a1f0
movq %rbx, %rdi
callq 0x5cb2
movl %eax, %ebp
movq %rbx, %rdi
callq 0x5cb2
movq %rbx, %rdi
callq 0x5cb2
movl %eax, %r14d
shrl $0xc, %r14d
movl %r14d, %r12d
andl $0x1ff, %r12d           # imm = 0x1FF
movq %rbx, %rdi
callq 0x5cb2
movl %eax, %r15d
shrl $0x5, %r15d
movq %rbx, %rdi
callq 0x5cb2
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 0x3fd7
andl $0x1f, %r15d
andl $0x1f, %r13d
andl $0x100, %r14d           # imm = 0x100
subq %r14, %rbx
leaq 0x60ec(%rip), %r14      # 0xa0f0
leaq (%r14,%r15,8), %rdi
movq %rdi, (%rsp)
callq 0x5cae
movq %rax, %r15
leaq 0x61d5(%rip), %r12      # 0xa1f0
subq 0x61ce(%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 0x4799
leaq 0x29a1(%rip), %rdi      # 0x69f8
callq 0x1140
movq %r13, %rdi
callq 0x5cb2
movl %eax, %r13d
movl %eax, %esi
shrl $0x18, %esi
movq 0x10(%rsp), %rdi
callq 0x5c9e
movl %r13d, %esi
shrl $0x10, %esi
movq %r14, %r15
movl $0xff, %r14d
andl %r14d, %esi
movq %rbp, %rdi
callq 0x5c9e
movl %r13d, %esi
shrl $0x8, %esi
andl %r14d, %esi
movq %r15, %rdi
callq 0x5c9e
movl $0x3, %eax
jmp 0x484f
leaq 0x2a49(%rip), %rdi      # 0x6afb
callq 0x1140
btl $0x18, %ebx
jb 0x431c
leaq 0x16128(%rip), %r12     # 0x1a1f0
movq %r12, %rdi
callq 0x5cb2
movl %eax, %ebp
movq %r12, %rdi
callq 0x5cb2
movq %r12, %rdi
callq 0x5cb2
movl %eax, %r15d
shrl $0xc, %r15d
movl %r15d, %r13d
andl $0x1ff, %r13d           # imm = 0x1FF
movq %r12, %rdi
callq 0x5cb2
movl %eax, %r14d
movq %r12, %rdi
callq 0x5cb2
andl $0x1f, %eax
movl %eax, (%rsp)
movq %r12, %rdi
callq 0x5cb2
andl $0xc0000000, %ebp       # imm = 0xC0000000
shrl $0x2, %r14d
andl $0xf8, %r14d
leaq 0x5fc4(%rip), %r12      # 0xa0f0
addq %r12, %r14
btl $0xb, %eax
jb 0x453b
leaq 0x29d1(%rip), %rdi      # 0x6b11
callq 0x1140
negl %ebp
jno 0x4879
leaq 0x2a02(%rip), %rdi      # 0x6b56
callq 0x1140
movq %r14, %rdi
callq 0x5cb2
xorl %ecx, %ecx
xorl %ebx, %ebx
movl $0x1, %edx
shll %cl, %edx
andl %r13d, %edx
addl %edx, %ebx
incl %ecx
cmpl $0x8, %ecx
jne 0x4165
andl $0x100, %r15d           # imm = 0x100
movq %r15, 0x8(%rsp)
movslq %eax, %r12
movq %r12, %r13
shlq $0x4, %r13
leaq 0x605b(%rip), %r15      # 0xa1f0
leaq (%r15,%r13), %rdi
callq 0x5caa
movzbl %al, %ebp
leaq (%r15,%r13), %rdi
addq $0x10, %rdi
callq 0x5caa
movzbl %al, %r15d
shll $0x10, %ebp
shll $0x8, %r15d
orl %ebp, %r15d
leaq 0x602d(%rip), %rax      # 0xa1f0
leaq (%rax,%r13), %rdi
addq $0x20, %rdi
callq 0x5caa
movzbl %al, %ebp
orl %r15d, %ebp
shll $0x8, %ebp
leaq 0x6010(%rip), %rax      # 0xa1f0
leaq (%rax,%r13), %rdi
addq $0x30, %rdi
callq 0x5caa
movzbl %al, %esi
orl %ebp, %esi
movl (%rsp), %eax
leaq 0x5ef4(%rip), %rcx      # 0xa0f0
leaq (%rcx,%rax,8), %rdi
callq 0x5cbc
subl 0x8(%rsp), %r12d
addl %ebx, %r12d
movq %r14, %rdi
movl %r12d, %esi
jmp 0x45f4
leaq 0x2864(%rip), %rdi      # 0x6a83
callq 0x1140
leaq 0x15fc5(%rip), %r14     # 0x1a1f0
movq %r14, %rdi
callq 0x5cb2
movl %eax, %ebp
movq %r14, %rdi
callq 0x5cb2
movq %r14, %rdi
callq 0x5cb2
movl %eax, %ebx
shrl $0xa, %ebx
movq %r14, %rdi
callq 0x5cb2
movl %eax, %r15d
movq %r14, %rdi
callq 0x5cb2
movl %eax, %r14d
andl $0x1f, %r14d
shrl $0x2, %r15d
andl $0xf8, %r15d
leaq 0x5e7a(%rip), %r12      # 0xa0f0
addq %r12, %r15
movq %r15, %rdi
callq 0x5cae
andl $0xfff, %ebx            # imm = 0xFFF
addq %rax, %rbx
subq 0x5f5f(%rip), %rbx      # 0xa1f0
leaq 0x5f58(%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 0x4607
leaq 0x280b(%rip), %rdi      # 0x6ad2
callq 0x1140
movq %r14, %rdi
callq 0x5cb2
movl %eax, %ebp
movl %eax, %esi
shrl $0x18, %esi
movq %r13, %rdi
callq 0x5c9e
movl %ebp, %esi
shrl $0x10, %esi
movl $0xff, %r14d
andl %r14d, %esi
movq %r12, %rdi
callq 0x5c9e
movl %ebp, %esi
shrl $0x8, %esi
andl %r14d, %esi
movq (%rsp), %rdi
callq 0x5c9e
leaq (%rbx,%r15), %rdi
addq $0x30, %rdi
andl %r14d, %ebp
movl %ebp, %esi
jmp 0x4a6c
leaq 0x28be(%rip), %rdi      # 0x6be1
callq 0x1140
leaq 0x15ec1(%rip), %rbx     # 0x1a1f0
movq %rbx, %rdi
callq 0x5cb2
movl %eax, %r14d
movq %rbx, %rdi
callq 0x5cb2
movq %rbx, %rdi
callq 0x5cb2
movl %eax, %ebp
shrl $0xa, %ebp
andl $0xfff, %ebp            # imm = 0xFFF
movq %rbx, %rdi
callq 0x5cb2
movl %eax, %r15d
movq %rbx, %rdi
callq 0x5cb2
movl %eax, %ebx
andl $0x1f, %ebx
andl $0xc0000000, %r14d      # imm = 0xC0000000
shrl $0x2, %r15d
andl $0xf8, %r15d
leaq 0x5d6a(%rip), %r12      # 0xa0f0
addq %r12, %r15
negl %r14d
jno 0x46bb
leaq 0x2897(%rip), %rdi      # 0x6c30
callq 0x1140
movq %r15, %rdi
callq 0x5cae
movl %ebp, %ecx
leaq (%rax,%rcx,4), %r14
shlq $0x4, %r14
leaq 0x5e39(%rip), %r15      # 0xa1f0
leaq (%r15,%r14), %rdi
callq 0x5caa
movzbl %al, %ebp
leaq (%r14,%r15), %rdi
addq $0x10, %rdi
callq 0x5caa
movzbl %al, %r13d
shll $0x10, %ebp
shll $0x8, %r13d
orl %ebp, %r13d
leaq (%r14,%r15), %rdi
addq $0x20, %rdi
callq 0x5caa
movzbl %al, %ebp
orl %r13d, %ebp
shll $0x8, %ebp
leaq (%r14,%r15), %rdi
addq $0x30, %rdi
callq 0x5caa
movzbl %al, %esi
orl %ebp, %esi
movl %ebx, %eax
jmp 0x45f0
leaq 0x2609(%rip), %rdi      # 0x6a1d
callq 0x1140
leaq 0x15dd0(%rip), %r12     # 0x1a1f0
movq %r12, %rdi
callq 0x5cb2
movl %eax, %ebx
movq %r12, %rdi
callq 0x5cb2
movq %r12, %rdi
callq 0x5cb2
movl %eax, %r15d
shrl $0xc, %r15d
movq %r12, %rdi
callq 0x5cb2
movl %eax, %r14d
shrl $0x5, %r14d
movq %r12, %rdi
callq 0x5cb2
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 0x445f
andl $0x1f, %r14d
andl $0x1f, %ebp
leaq 0x5c6f(%rip), %r13      # 0xa0f0
leaq (,%r14,8), %r15
addq %r13, %r15
movq %r15, %rdi
callq 0x5cae
addq %rax, %r12
subq 0x5d52(%rip), %r12      # 0xa1f0
movzbl %r12b, %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0x5cb6
andl $0xc0000000, %ebx       # imm = 0xC0000000
negl %ebx
jno 0x499a
leaq 0x259e(%rip), %rdi      # 0x6a60
callq 0x1140
movl %ebp, %eax
leaq (,%rax,8), %rdi
addq %r13, %rdi
callq 0x5cb2
movl %eax, %ebx
movl %eax, %esi
shrl $0x18, %esi
shll $0x4, %r14d
leaq 0x5d05(%rip), %r15      # 0xa1f0
addq %r15, %r14
movq %r14, %rdi
callq 0x5c9e
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 0x5c9e
movl %ebx, %esi
shrl $0x8, %esi
leaq (%r12,%r15), %rdi
addq $0x20, %rdi
andl %ebp, %esi
callq 0x5c9e
leaq (%r12,%r15), %rdi
addq $0x30, %rdi
andl %ebp, %ebx
movl %ebx, %esi
jmp 0x4a6c
leaq 0x2638(%rip), %rdi      # 0x6b7a
callq 0x1140
negl %ebp
jno 0x4a7f
leaq 0x2668(%rip), %rdi      # 0x6bbe
callq 0x1140
movq %r14, %rdi
callq 0x5cb2
xorl %ecx, %ecx
xorl %ebp, %ebp
movl $0x1, %edx
shll %cl, %edx
andl %r13d, %edx
addl %edx, %ebp
incl %ecx
cmpl $0x8, %ecx
jne 0x4567
andl $0x100, %r15d           # imm = 0x100
subl %r15d, %ebp
addl %eax, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x5cbc
movslq %ebp, %rbx
shlq $0x4, %rbx
leaq 0x5c52(%rip), %r14      # 0xa1f0
leaq (%r14,%rbx), %rdi
callq 0x5caa
movzbl %al, %ebp
leaq (%rbx,%r14), %rdi
addq $0x10, %rdi
callq 0x5caa
movzbl %al, %r15d
shll $0x10, %ebp
shll $0x8, %r15d
orl %ebp, %r15d
leaq (%rbx,%r14), %rdi
addq $0x20, %rdi
callq 0x5caa
movzbl %al, %ebp
orl %r15d, %ebp
shll $0x8, %ebp
leaq (%rbx,%r14), %rdi
addq $0x30, %rdi
callq 0x5caa
movzbl %al, %esi
orl %ebp, %esi
movl (%rsp), %eax
leaq (%r12,%rax,8), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5cbc
leaq 0x249b(%rip), %rdi      # 0x6aa9
callq 0x1140
movq %r14, %rdi
callq 0x5cae
movq %rax, %r14
movq %rax, %rsi
shrq $0x38, %rsi
movq %r13, %rdi
callq 0x5c9e
movq %r14, %rsi
shrq $0x30, %rsi
movl $0xff, %ebp
andl %ebp, %esi
movq %r12, %rdi
callq 0x5c9e
movq %r14, %rsi
shrq $0x28, %rsi
andl %ebp, %esi
movq (%rsp), %rdi
callq 0x5c9e
movq %r14, %rsi
shrq $0x20, %rsi
leaq (%rbx,%r15), %rdi
addq $0x30, %rdi
andl %ebp, %esi
callq 0x5c9e
movl %r14d, %esi
shrl $0x18, %esi
leaq (%rbx,%r15), %rdi
addq $0x40, %rdi
callq 0x5c9e
movl %r14d, %esi
shrl $0x10, %esi
leaq (%rbx,%r15), %rdi
addq $0x50, %rdi
andl %ebp, %esi
callq 0x5c9e
movl %r14d, %esi
shrl $0x8, %esi
leaq (%rbx,%r15), %rdi
addq $0x60, %rdi
andl %ebp, %esi
callq 0x5c9e
leaq (%rbx,%r15), %rdi
addq $0x70, %rdi
andl %ebp, %r14d
movl %r14d, %esi
jmp 0x4a6c
leaq 0x2545(%rip), %rdi      # 0x6c07
callq 0x1140
movq %r15, %rdi
callq 0x5cae
movl %ebp, %ecx
leaq (%rax,%rcx,8), %r14
shlq $0x4, %r14
leaq 0x5b10(%rip), %r15      # 0xa1f0
leaq (%r15,%r14), %rdi
callq 0x5caa
movl %eax, %ebp
leaq (%r14,%r15), %rdi
addq $0x10, %rdi
callq 0x5caa
movzbl %bpl, %ecx
shll $0x10, %ecx
movzbl %al, %ebp
shll $0x8, %ebp
orl %ecx, %ebp
leaq (%r14,%r15), %rdi
addq $0x20, %rdi
callq 0x5caa
movzbl %al, %r13d
orl %ebp, %r13d
leaq (%r14,%r15), %rdi
addq $0x30, %rdi
callq 0x5caa
shlq $0x10, %r13
movzbl %al, %ebp
shll $0x8, %ebp
orq %r13, %rbp
leaq (%r14,%r15), %rdi
addq $0x40, %rdi
callq 0x5caa
movzbl %al, %r13d
orq %rbp, %r13
leaq (%r14,%r15), %rdi
addq $0x50, %rdi
callq 0x5caa
shlq $0x10, %r13
movzbl %al, %ebp
shll $0x8, %ebp
orq %r13, %rbp
leaq (%r14,%r15), %rdi
addq $0x60, %rdi
callq 0x5caa
movzbl %al, %r13d
orq %rbp, %r13
shlq $0x8, %r13
leaq (%r14,%r15), %rdi
addq $0x70, %rdi
callq 0x5caa
movzbl %al, %esi
orq %r13, %rsi
movl %ebx, %eax
leaq (%r12,%rax,8), %rdi
jmp 0x4b8f
leaq 0x2234(%rip), %rdi      # 0x69d4
callq 0x1140
movq %r13, %rdi
callq 0x5cae
movq %rax, %r13
movq %rax, %rsi
shrq $0x38, %rsi
movq 0x10(%rsp), %rdi
callq 0x5c9e
movq %r13, %rsi
shrq $0x30, %rsi
movl $0xff, %eax
andl %eax, %esi
movq %rbp, %rdi
callq 0x5c9e
movq %r13, %rsi
shrq $0x28, %rsi
movl $0xff, %eax
andl %eax, %esi
movl $0xff, %ebp
movq %r14, %rdi
callq 0x5c9e
movq %r13, %rsi
shrq $0x20, %rsi
leaq (%r15,%r12), %rdi
addq $0x30, %rdi
andl %ebp, %esi
movl $0xff, %ebp
callq 0x5c9e
movl %r13d, %esi
shrl $0x18, %esi
leaq (%r15,%r12), %rdi
addq $0x40, %rdi
callq 0x5c9e
movl %r13d, %esi
shrl $0x10, %esi
leaq (%r15,%r12), %rdi
addq $0x50, %rdi
andl %ebp, %esi
callq 0x5c9e
movl %r13d, %esi
shrl $0x8, %esi
leaq (%r15,%r12), %rdi
addq $0x60, %rdi
andl %ebp, %esi
callq 0x5c9e
movl $0x7, %eax
movq 0x8(%rsp), %r14
addq %r14, %rax
shlq $0x4, %rax
addq %rax, %r12
movzbl %r13b, %esi
movq %r12, %rdi
callq 0x5c9e
addq %r14, %rbx
movq (%rsp), %rdi
movq %rbx, %rsi
jmp 0x4b8f
leaq 0x22b2(%rip), %rdi      # 0x6b32
callq 0x1140
movq %r14, %rdi
callq 0x5cae
xorl %ecx, %ecx
xorl %ebx, %ebx
movl $0x1, %edx
shll %cl, %edx
andl %r13d, %edx
addq %rdx, %rbx
incl %ecx
cmpl $0x8, %ecx
jne 0x4891
andl $0x100, %r15d           # imm = 0x100
movq %r15, 0x8(%rsp)
movq %rax, %r13
shlq $0x4, %r13
leaq 0x5931(%rip), %r12      # 0xa1f0
leaq (%r12,%r13), %rdi
movq %rax, 0x10(%rsp)
callq 0x5caa
movl %eax, %ebp
leaq (%r12,%r13), %rdi
addq $0x10, %rdi
callq 0x5caa
movzbl %bpl, %ecx
shll $0x10, %ecx
movzbl %al, %ebp
shll $0x8, %ebp
orl %ecx, %ebp
leaq (%r12,%r13), %rdi
addq $0x20, %rdi
callq 0x5caa
movzbl %al, %r15d
orl %ebp, %r15d
leaq (%r12,%r13), %rdi
addq $0x30, %rdi
callq 0x5caa
shlq $0x10, %r15
movzbl %al, %ebp
shll $0x8, %ebp
orq %r15, %rbp
leaq (%r12,%r13), %rdi
addq $0x40, %rdi
callq 0x5caa
movzbl %al, %r15d
orq %rbp, %r15
leaq (%r12,%r13), %rdi
addq $0x50, %rdi
callq 0x5caa
shlq $0x10, %r15
movzbl %al, %ebp
shll $0x8, %ebp
orq %r15, %rbp
leaq (%r12,%r13), %rdi
addq $0x60, %rdi
callq 0x5caa
movzbl %al, %r15d
orq %rbp, %r15
shlq $0x8, %r15
leaq (%r12,%r13), %rdi
addq $0x70, %rdi
callq 0x5caa
movzbl %al, %esi
orq %r15, %rsi
movl (%rsp), %eax
leaq 0x5774(%rip), %rcx      # 0xa0f0
leaq (%rcx,%rax,8), %rdi
callq 0x5cb6
movq 0x10(%rsp), %rsi
subq 0x8(%rsp), %rsi
addq %rbx, %rsi
movq %r14, %rdi
jmp 0x4b8f
leaq 0x209c(%rip), %rdi      # 0x6a3d
callq 0x1140
movl %ebp, %eax
leaq (,%rax,8), %rdi
addq %r13, %rdi
callq 0x5cae
movq %rax, %rbx
movq %rax, %rsi
shrq $0x38, %rsi
shll $0x4, %r14d
leaq 0x5823(%rip), %r15      # 0xa1f0
addq %r15, %r14
movq %r14, %rdi
callq 0x5c9e
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 0x5c9e
movq %rbx, %rsi
shrq $0x28, %rsi
leaq (%r12,%r15), %rdi
addq $0x20, %rdi
andl %ebp, %esi
callq 0x5c9e
movq %rbx, %rsi
shrq $0x20, %rsi
leaq (%r12,%r15), %rdi
addq $0x30, %rdi
andl %ebp, %esi
callq 0x5c9e
movl %ebx, %esi
shrl $0x18, %esi
leaq (%r12,%r15), %rdi
addq $0x40, %rdi
callq 0x5c9e
movl %ebx, %esi
shrl $0x10, %esi
leaq (%r12,%r15), %rdi
addq $0x50, %rdi
andl %ebp, %esi
callq 0x5c9e
movl %ebx, %esi
shrl $0x8, %esi
leaq (%r12,%r15), %rdi
addq $0x60, %rdi
andl %ebp, %esi
callq 0x5c9e
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 0x5c9e
leaq 0x2115(%rip), %rdi      # 0x6b9b
callq 0x1140
movq %r14, %rdi
callq 0x5cae
xorl %ecx, %ecx
xorl %r12d, %r12d
movl $0x1, %edx
shll %cl, %edx
andl %r13d, %edx
addq %rdx, %r12
incl %ecx
cmpl $0x8, %ecx
jne 0x4a98
andl $0x100, %r15d           # imm = 0x100
subq %r15, %r12
addq %rax, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x5cb6
shlq $0x4, %r12
leaq 0x5721(%rip), %rbx      # 0xa1f0
leaq (%rbx,%r12), %rdi
callq 0x5caa
movl %eax, %ebp
leaq (%r12,%rbx), %rdi
addq $0x10, %rdi
callq 0x5caa
movzbl %bpl, %ecx
shll $0x10, %ecx
movzbl %al, %ebp
shll $0x8, %ebp
orl %ecx, %ebp
leaq (%r12,%rbx), %rdi
addq $0x20, %rdi
callq 0x5caa
movzbl %al, %r14d
orl %ebp, %r14d
leaq (%r12,%rbx), %rdi
addq $0x30, %rdi
callq 0x5caa
shlq $0x10, %r14
movzbl %al, %r15d
shll $0x8, %r15d
orq %r14, %r15
leaq (%r12,%rbx), %rdi
addq $0x40, %rdi
callq 0x5caa
movzbl %al, %r14d
orq %r15, %r14
leaq (%r12,%rbx), %rdi
addq $0x50, %rdi
callq 0x5caa
shlq $0x10, %r14
movzbl %al, %r15d
shll $0x8, %r15d
orq %r14, %r15
leaq (%r12,%rbx), %rdi
addq $0x60, %rdi
callq 0x5caa
movzbl %al, %r14d
orq %r15, %r14
shlq $0x8, %r14
leaq (%r12,%rbx), %rdi
addq $0x70, %rdi
callq 0x5caa
movzbl %al, %esi
orq %r14, %rsi
movl (%rsp), %eax
leaq 0x5565(%rip), %rcx      # 0xa0f0
leaq (%rcx,%rax,8), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5cb6