// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x400, 0x24c(%rsi)     # imm = 0x400
jne 0x24c88
movb $0x0, 0x2(%rbx)
movw $0x2528, (%rbx)         # imm = 0x2528
pushq $0x2
popq %rax
jmp 0x24c8a
xorl %eax, %eax
movl $0x40000000, 0x40(%rbx) # imm = 0x40000000
movl 0x214(%r14), %ecx
cmpl $0x20, %ecx
je 0x24cb8
cmpl $0x40, %ecx
jne 0x24cdc
addq %rbx, %rax
cmpb $0x1, 0x287(%r14)
jne 0x24d13
leaq 0x11f42(%rip), %rsi     # 0x36bf8
jmp 0x24ccc
addq %rbx, %rax
cmpb $0x1, 0x287(%r14)
jne 0x24d1c
leaq 0x11fa4(%rip), %rsi     # 0x36c70
movq %rax, %rdi
callq 0x8170
movl 0x121be(%rip), %eax     # 0x36e98
jmp 0x24d31
addl $0x2, 0x244(%r14)
movq 0x1f0(%r14), %rdx
movzwl 0x2(%rdx), %ecx
addq $0x2, %rdx
movq %rcx, 0x5c(%rbx)
movq 0x250(%r14), %rsi
decq %rsi
cmpq %rdx, %rsi
jae 0x24d57
movl $0x1, 0x289(%r14)
jmp 0x24d4f
leaq 0x11ebe(%rip), %rsi     # 0x36bd8
jmp 0x24d23
leaq 0x11f0d(%rip), %rsi     # 0x36c30
movq %rax, %rdi
callq 0x8170
movl 0x12147(%rip), %eax     # 0x36e78
movl %eax, 0x50(%rbx)
cmpl $0x400, 0x24c(%r14) # imm = 0x400
jne 0x24d4f
movq %rbx, %rdi
callq 0x8090
movw $0x29, (%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq %rbx, %rax
leaq 0x5d11(%rip), %rdx      # 0x2aa72
movq %r14, %rdi
movq %rax, %rsi
callq 0x283ec
jmp 0x24d34