// File: /workspace/github_c_makefile_star2_O2/buptlxb[P]xRay/disasm/Routines_ModRM.c
// Function: Addr_disp32
void __bea_callspec__ Addr_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm)
{
    Int32 MyNumber;
    UInt64 MyAddress;
    size_t i = 0;
    (*pMyArgument).ArgType = MEMORY_TYPE;
    if (GV.AddressSize >= 32) {
        if (!Security(6, pMyDisasm)) return;
        GV.DECALAGE_EIP+=4;
        MyNumber = *((Int32*)(UIntPtr) (GV.EIP_+2));
        (*pMyArgument).Memory.Displacement = MyNumber;
        if (GV.Architecture == 64) {
            MyNumber += 6;
            MyNumber += GV.NB_PREFIX;
            if (GV.ImmediatSize == 32) {
                MyNumber += 4;
            }
            if (GV.ImmediatSize == 16) {
                MyNumber += 2;
            }
            if (GV.ImmediatSize == 8) {
                MyNumber += 1;
            }
            if ((*pMyDisasm).Instruction.Opcode >= 0x0F3800) {      /* add two bytes if opcode is a 3-bytes */
                MyNumber +=2;
            }
            else if ((*pMyDisasm).Instruction.Opcode >= 0x0100) {   /* add one byte if opcode is a 2-bytes */
                MyNumber +=1;
            }
            CalculateRelativeAddress(&MyAddress, (Int64)MyNumber, pMyDisasm);
            (*pMyDisasm).Instruction.AddrValue = MyAddress;
            #ifndef BEA_LIGHT_DISASSEMBLY
               i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.16llX", (Int64)MyAddress);
            #endif
            (*pMyArgument).ArgType |= RELATIVE_;
        }
        else {
            #ifndef BEA_LIGHT_DISASSEMBLY
               i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X", (Int64)MyNumber);
            #endif
        }
    }
    else {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((char*) (*pMyArgument).ArgMnemonic, Registers16Bits[7]);
        #endif
        (*pMyArgument).Memory.BaseRegister = REGS[7];
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x40000000, 0x40(%rdi) # imm = 0x40000000
cmpl $0x20, 0x214(%rsi)
jl 0x24b8e
movq 0x1f0(%rsi), %rax
movq 0x250(%rsi), %rcx
leaq 0x6(%rax), %rdx
decq %rcx
cmpq %rdx, %rcx
jae 0x24ba8
movl $0x1, 0x289(%rsi)
jmp 0x24ba6
leaq 0x12123(%rip), %rsi     # 0x36cb8
movq %rbx, %rdi
callq 0x8170
movl 0x122d9(%rip), %eax     # 0x36e7c
movl %eax, 0x50(%rbx)
popq %rbx
retq
addl $0x4, 0x244(%rsi)
movslq 0x2(%rax), %rcx
movq %rcx, 0x5c(%rbx)
cmpl $0x40, 0x25c(%rsi)
jne 0x24c51
addl 0x264(%rsi), %ecx
movl 0x260(%rsi), %eax
xorl %edx, %edx
cmpl $0x20, %eax
sete %dl
leal (%rcx,%rdx,4), %ecx
xorl %edx, %edx
cmpl $0x10, %eax
sete %dl
leal (%rcx,%rdx,2), %ecx
xorl %edx, %edx
cmpl $0x8, %eax
sete %dl
addl %ecx, %edx
movl 0x64(%rsi), %eax
xorl %ecx, %ecx
cmpl $0x100, %eax            # imm = 0x100
setge %cl
cmpl $0xf3800, %eax          # imm = 0xF3800
pushq $0x2
popq %rax
cmovll %ecx, %eax
addl %edx, %eax
addl $0x6, %eax
cltq
movl $0x1, 0x258(%rsi)
movq 0x1f8(%rsi), %rcx
testq %rcx, %rcx
jne 0x24c2c
movq 0x200(%rsi), %rcx
addq %rax, %rcx
movq %rcx, 0x88(%rsi)
leaq 0x5e17(%rip), %rdx      # 0x2aa54
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x283ec
orb $0x4, 0x43(%rbx)
jmp 0x24ba6
leaq 0x5e04(%rip), %rdx      # 0x2aa5c
movq %rsi, %rdi
movq %rbx, %rsi
popq %rbx
jmp 0x283ec