// File: /workspace/github_c_makefile_star2_O1/buptlxb[P]xRay/disasm/Routines_ModRM.c
// Function: Addr_SIB_disp32
void __bea_callspec__ Addr_SIB_disp32(ARGTYPE* pMyArgument, PDISASM pMyDisasm)
{
    size_t i = 0, j;
    long MyNumber;
    if (!Security(2, pMyDisasm)) return;
    if (GV.AddressSize >= 32) {
        MyNumber = *((Int32*)(UIntPtr) (GV.EIP_+3));
    }
    else {
        MyNumber = *((Int16*)(UIntPtr) (GV.EIP_+2));
    }

    (*pMyArgument).Memory.Displacement = MyNumber;
    if (GV.SYNTAX_ == ATSyntax) {
        if (MyNumber < 0) {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, "-");
            #endif
            i ++;
            j=i;
            #ifndef BEA_LIGHT_DISASSEMBLY
               i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) ~MyNumber+1);
            #endif
        }
        else {
            j = i;
            #ifndef BEA_LIGHT_DISASSEMBLY
               i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) MyNumber);
            #endif
        }
        /*#ifndef BEA_LIGHT_DISASSEMBLY
   (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, "(%");
#endif
         *i+=2; */
    }
    (*pMyArgument).ArgType = MEMORY_TYPE;
    if (GV.AddressSize >= 32) {
        GV.DECALAGE_EIP++;
        GV.BASE_  = ((UInt8) *((UInt8*) (UIntPtr)GV.EIP_+2)) & 0x7;
        GV.SCALE_  = (((UInt8) *((UInt8*) (UIntPtr)GV.EIP_+2)) & 0xc0) >> 6;
        GV.INDEX_  = (((UInt8) *((UInt8*) (UIntPtr)GV.EIP_+2)) & 0x38) >> 3;
        j = i;
        i += SIB[GV.SCALE_ ](pMyArgument, j, pMyDisasm);
    }
    else {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((char*) (*pMyArgument).ArgMnemonic, Registers16Bits[6]);
        #endif
        (*pMyArgument).Memory.BaseRegister = REGS[6];
        i += strlen (Registers16Bits[6]);
    }

    if (GV.SYNTAX_ == ATSyntax) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, ")");
        #endif
        i += 1;
    }
    else {
        if (MyNumber < 0) {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, "-");
            #endif
            i++;
            #ifndef BEA_LIGHT_DISASSEMBLY
               i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) ~MyNumber+1);
            #endif
        }
        else {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, "+");
            #endif
            i++;
            #ifndef BEA_LIGHT_DISASSEMBLY
               i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+i,"%.8X",(Int64) MyNumber);
            #endif
        }
    }

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x250(%rsi), %rax
testq %rax, %rax
je 0x287f9
movq 0x1f0(%rbx), %rcx
addq $0x2, %rcx
cmpq %rax, %rcx
jae 0x28848
cmpl $0x20, 0x214(%rbx)
movq 0x1f0(%rbx), %rax
jl 0x2880f
movslq 0x3(%rax), %r15
jmp 0x28814
movswq 0x2(%rax), %r15
movq %r15, 0x5c(%r14)
cmpl $0x400, 0x24c(%rbx)     # imm = 0x400
jne 0x28843
testq %r15, %r15
js 0x28857
leaq 0x522c(%rip), %rdx      # 0x2da5c
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x2acdf
movq %rax, %r12
jmp 0x2887c
xorl %r12d, %r12d
jmp 0x2887c
movl $0x1, 0x289(%rbx)
jmp 0x28913
movw $0x2d, (%r14)
leaq 0x1(%r14), %rsi
movq %r15, %rcx
negq %rcx
leaq 0x51ee(%rip), %rdx      # 0x2da5c
movq %rbx, %rdi
callq 0x2acdf
movq %rax, %r12
incq %r12
movl $0x40000000, 0x40(%r14) # imm = 0x40000000
cmpl $0x20, 0x214(%rbx)
jl 0x288d9
incl 0x244(%rbx)
movq 0x1f0(%rbx), %rax
movzbl 0x2(%rax), %ecx
andl $0x7, %ecx
movl %ecx, 0x228(%rbx)
movzbl 0x2(%rax), %ecx
shrl $0x6, %ecx
movl %ecx, 0x224(%rbx)
movzbl 0x2(%rax), %eax
shrl $0x3, %eax
andl $0x7, %eax
movl %eax, 0x220(%rbx)
leaq 0x126d5(%rip), %rax     # 0x3afa0
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq *(%rax,%rcx,8)
jmp 0x288fd
leaq 0x103b0(%rip), %r13     # 0x38c90
movq %r14, %rdi
movq %r13, %rsi
callq 0x8150
movl 0x10567(%rip), %eax     # 0x38e58
movl %eax, 0x50(%r14)
movq %r13, %rdi
callq 0x8090
addq %r12, %rax
cmpl $0x400, 0x24c(%rbx)     # imm = 0x400
jne 0x2891d
movw $0x29, (%r14,%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq (%r14,%rax), %rcx
leaq (%r14,%rax), %rsi
incq %rsi
testq %r15, %r15
js 0x28934
movw $0x2b, (%rcx)
jmp 0x2893c
movw $0x2d, (%rcx)
negq %r15
leaq 0x5119(%rip), %rdx      # 0x2da5c
movq %rbx, %rdi
movq %r15, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2acdf