// File: /workspace/github_c_makefile_star2_O2/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 0x25f42
movq 0x1f0(%rbx), %rcx
addq $0x2, %rcx
cmpq %rax, %rcx
jae 0x25f91
cmpl $0x20, 0x214(%rbx)
movq 0x1f0(%rbx), %rax
jl 0x25f58
movslq 0x3(%rax), %r15
jmp 0x25f5d
movswq 0x2(%rax), %r15
movq %r15, 0x5c(%r14)
cmpl $0x400, 0x24c(%rbx)     # imm = 0x400
jne 0x25f8c
testq %r15, %r15
js 0x25fa0
leaq 0x4ae3(%rip), %rdx      # 0x2aa5c
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x283ec
movq %rax, %r12
jmp 0x25fc5
xorl %r12d, %r12d
jmp 0x25fc5
movl $0x1, 0x289(%rbx)
jmp 0x2605c
movw $0x2d, (%r14)
leaq 0x1(%r14), %rsi
movq %r15, %rcx
negq %rcx
leaq 0x4aa5(%rip), %rdx      # 0x2aa5c
movq %rbx, %rdi
callq 0x283ec
movq %rax, %r12
incq %r12
movl $0x40000000, 0x40(%r14) # imm = 0x40000000
cmpl $0x20, 0x214(%rbx)
jl 0x26022
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 0x12fac(%rip), %rax     # 0x38fc0
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq *(%rax,%rcx,8)
jmp 0x26046
leaq 0x10c87(%rip), %r13     # 0x36cb0
movq %r14, %rdi
movq %r13, %rsi
callq 0x8170
movl 0x10e3e(%rip), %eax     # 0x36e78
movl %eax, 0x50(%r14)
movq %r13, %rdi
callq 0x8090
addq %r12, %rax
cmpl $0x400, 0x24c(%rbx)     # imm = 0x400
jne 0x26066
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 0x2607d
movw $0x2b, (%rcx)
jmp 0x26085
movw $0x2d, (%rcx)
negq %r15
leaq 0x49d0(%rip), %rdx      # 0x2aa5c
movq %rbx, %rdi
movq %r15, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x283ec