// File: /workspace/github_c_makefile_star2_O0/buptlxb[P]xRay/disasm/Routines_ModRM.c
// Function: Addr_ESI
void __bea_callspec__ Addr_ESI(ARGTYPE* pMyArgument, PDISASM pMyDisasm)
{
    long MyNumber;
    #ifndef BEA_LIGHT_DISASSEMBLY
	size_t i = 0;
    if (GV.SYNTAX_ == ATSyntax) {
        (void) strcpy((char*) (*pMyArgument).ArgMnemonic, "(%");
        i += 2;
    }
	#endif
    (*pMyArgument).ArgType = MEMORY_TYPE;
    if (GV.AddressSize == 64) {
        if (GV.REX.B_ == 1) {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, Registers64Bits[14]);
            #endif
            (*pMyArgument).Memory.BaseRegister = REGS[6+8];
        }
        else {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, Registers64Bits[6]);
            #endif
            (*pMyArgument).Memory.BaseRegister = REGS[6];
        }
    }
    else if (GV.AddressSize == 32) {

        if (GV.REX.B_ == 1) {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, Registers32Bits[14]);
            #endif
            (*pMyArgument).Memory.BaseRegister = REGS[6+8];
        }
        else {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, Registers32Bits[6]);
            #endif
            (*pMyArgument).Memory.BaseRegister = REGS[6];
        }
    }
    else {
        GV.DECALAGE_EIP+=2;
        MyNumber = *((UInt16*)(UIntPtr) (GV.EIP_+2));
        (*pMyArgument).Memory.Displacement = MyNumber;
        if (!Security(2, pMyDisasm)) return;
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.4X", (Int64)MyNumber);
        #endif
    }
    #ifndef BEA_LIGHT_DISASSEMBLY
    i = strlen ((char*) &(*pMyArgument).ArgMnemonic);
    if (GV.SYNTAX_ == ATSyntax) {
        (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, ")");
        i += 1;
    }
	#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x400, 0x24c(%rax)     # imm = 0x400
jne 0x46a64
movq -0x8(%rbp), %rdi
leaq 0xbb63(%rip), %rsi      # 0x525b6
callq 0x81c0
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl $0x40000000, 0x40(%rax) # imm = 0x40000000
movq -0x10(%rbp), %rax
cmpl $0x40, 0x214(%rax)
jne 0x46ad5
movq -0x10(%rbp), %rax
movzbl 0x287(%rax), %eax
cmpl $0x1, %eax
jne 0x46aaf
movq -0x8(%rbp), %rdi
addq -0x20(%rbp), %rdi
leaq 0x1c19d(%rip), %rsi     # 0x62c38
callq 0x81c0
movl 0x1c432(%rip), %ecx     # 0x62ed8
movq -0x8(%rbp), %rax
movl %ecx, 0x50(%rax)
jmp 0x46ad0
movq -0x8(%rbp), %rdi
addq -0x20(%rbp), %rdi
leaq 0x1c15a(%rip), %rsi     # 0x62c18
callq 0x81c0
movl 0x1c3ef(%rip), %ecx     # 0x62eb8
movq -0x8(%rbp), %rax
movl %ecx, 0x50(%rax)
jmp 0x46b9d
movq -0x10(%rbp), %rax
cmpl $0x20, 0x214(%rax)
jne 0x46b38
movq -0x10(%rbp), %rax
movzbl 0x287(%rax), %eax
cmpl $0x1, %eax
jne 0x46b15
movq -0x8(%rbp), %rdi
addq -0x20(%rbp), %rdi
leaq 0x1c1af(%rip), %rsi     # 0x62cb0
callq 0x81c0
movl 0x1c3cc(%rip), %ecx     # 0x62ed8
movq -0x8(%rbp), %rax
movl %ecx, 0x50(%rax)
jmp 0x46b36
movq -0x8(%rbp), %rdi
addq -0x20(%rbp), %rdi
leaq 0x1c14c(%rip), %rsi     # 0x62c70
callq 0x81c0
movl 0x1c389(%rip), %ecx     # 0x62eb8
movq -0x8(%rbp), %rax
movl %ecx, 0x50(%rax)
jmp 0x46b9b
movq -0x10(%rbp), %rax
movl 0x244(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0x244(%rax)
movq -0x10(%rbp), %rax
movq 0x1f0(%rax), %rax
movzwl 0x2(%rax), %eax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x5c(%rax)
movq -0x10(%rbp), %rsi
movl $0x2, %edi
callq 0x4d340
cmpl $0x0, %eax
jne 0x46b7f
jmp 0x46bda
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rcx
leaq 0xa930(%rip), %rdx      # 0x514c6
callq 0x4d3a0
jmp 0x46b9d
movq -0x8(%rbp), %rdi
callq 0x80b0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x400, 0x24c(%rax)     # imm = 0x400
jne 0x46bda
movq -0x8(%rbp), %rdi
addq -0x20(%rbp), %rdi
leaq 0xa7c9(%rip), %rsi      # 0x51392
callq 0x81c0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
addq $0x20, %rsp
popq %rbp
retq