// File: /workspace/github_c_makefile_star2_O1/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 0x274d4
movq 0x250(%rsi), %rax
testq %rax, %rax
je 0x27425
movq 0x1f0(%rsi), %rcx
addq $0x6, %rcx
cmpq %rax, %rcx
jae 0x27501
addl $0x4, 0x244(%rsi)
movq 0x1f0(%rsi), %rax
movslq 0x2(%rax), %rcx
movq %rcx, 0x5c(%rbx)
cmpl $0x40, 0x25c(%rsi)
jne 0x274ee
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
movl $0x2, %eax
cmovll %ecx, %eax
addl %edx, %eax
addl $0x6, %eax
cltq
movl $0x1, 0x258(%rsi)
movq 0x1f8(%rsi), %rcx
testq %rcx, %rcx
jne 0x274b2
movq 0x200(%rsi), %rcx
addq %rax, %rcx
movq %rcx, 0x88(%rsi)
leaq 0x6591(%rip), %rdx      # 0x2da54
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x2acdf
orb $0x4, 0x43(%rbx)
jmp 0x2750b
leaq 0x117bd(%rip), %rsi     # 0x38c98
movq %rbx, %rdi
callq 0x8150
movl 0x11973(%rip), %eax     # 0x38e5c
movl %eax, 0x50(%rbx)
jmp 0x2750b
leaq 0x6567(%rip), %rdx      # 0x2da5c
movq %rsi, %rdi
movq %rbx, %rsi
popq %rbx
jmp 0x2acdf
movl $0x1, 0x289(%rsi)
popq %rbx
retq