// File: /workspace/github_c_makefile_star2_O1/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 0x27533
movb $0x0, 0x2(%rbx)
movw $0x2528, (%rbx)         # imm = 0x2528
movl $0x2, %eax
jmp 0x27535
xorl %eax, %eax
movl $0x40000000, 0x40(%rbx) # imm = 0x40000000
movl 0x214(%r14), %ecx
cmpl $0x20, %ecx
je 0x27563
cmpl $0x40, %ecx
jne 0x27587
addq %rbx, %rax
cmpb $0x1, 0x287(%r14)
jne 0x275be
leaq 0x11677(%rip), %rsi     # 0x38bd8
jmp 0x27577
addq %rbx, %rax
cmpb $0x1, 0x287(%r14)
jne 0x275c7
leaq 0x116d9(%rip), %rsi     # 0x38c50
movq %rax, %rdi
callq 0x8150
movl 0x118f3(%rip), %eax     # 0x38e78
jmp 0x275dc
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 0x27602
movl $0x1, 0x289(%r14)
jmp 0x275fa
leaq 0x115f3(%rip), %rsi     # 0x38bb8
jmp 0x275ce
leaq 0x11642(%rip), %rsi     # 0x38c10
movq %rax, %rdi
callq 0x8150
movl 0x1187c(%rip), %eax     # 0x38e58
movl %eax, 0x50(%rbx)
cmpl $0x400, 0x24c(%r14) # imm = 0x400
jne 0x275fa
movq %rbx, %rdi
callq 0x8090
movw $0x29, (%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq %rbx, %rax
leaq 0x6466(%rip), %rdx      # 0x2da72
movq %r14, %rdi
movq %rax, %rsi
callq 0x2acdf
jmp 0x275df