// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rsi
movl $0x2, %edi
callq 0x4d340
cmpl $0x0, %eax
jne 0x49060
jmp 0x49304
movq -0x10(%rbp), %rax
cmpl $0x20, 0x214(%rax)
jl 0x49082
movq -0x10(%rbp), %rax
movq 0x1f0(%rax), %rax
movslq 0x3(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x49096
movq -0x10(%rbp), %rax
movq 0x1f0(%rax), %rax
movswq 0x2(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x400, 0x24c(%rax)     # imm = 0x400
jne 0x49141
cmpq $0x0, -0x28(%rbp)
jge 0x49113
movq -0x8(%rbp), %rdi
addq -0x18(%rbp), %rdi
leaq 0x94ed(%rip), %rsi      # 0x525b9
callq 0x81c0
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rcx
xorq $-0x1, %rcx
addq $0x1, %rcx
leaq 0x83ac(%rip), %rdx      # 0x514b0
callq 0x4d3a0
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x4913f
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rcx
leaq 0x837e(%rip), %rdx      # 0x514b0
callq 0x4d3a0
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x49141
movq -0x8(%rbp), %rax
movl $0x40000000, 0x40(%rax) # imm = 0x40000000
movq -0x10(%rbp), %rax
cmpl $0x20, 0x214(%rax)
jl 0x49203
movq -0x10(%rbp), %rax
movl 0x244(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x244(%rax)
movq -0x10(%rbp), %rax
movq 0x1f0(%rax), %rax
movzbl 0x2(%rax), %ecx
andl $0x7, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x228(%rax)
movq -0x10(%rbp), %rax
movq 0x1f0(%rax), %rax
movzbl 0x2(%rax), %ecx
andl $0xc0, %ecx
sarl $0x6, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x224(%rax)
movq -0x10(%rbp), %rax
movq 0x1f0(%rax), %rax
movzbl 0x2(%rax), %ecx
andl $0x38, %ecx
sarl $0x3, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x220(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movslq 0x224(%rax), %rcx
leaq 0x1be19(%rip), %rax     # 0x65000
movq (%rax,%rcx,8), %rax
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq *%rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x49234
movq -0x8(%rbp), %rdi
leaq 0x19ae2(%rip), %rsi     # 0x62cf0
callq 0x81c0
movl 0x19c9f(%rip), %ecx     # 0x62eb8
movq -0x8(%rbp), %rax
movl %ecx, 0x50(%rax)
leaq 0x19ac9(%rip), %rdi     # 0x62cf0
callq 0x80b0
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x400, 0x24c(%rax)     # imm = 0x400
jne 0x49269
movq -0x8(%rbp), %rdi
addq -0x18(%rbp), %rdi
leaq 0x813f(%rip), %rsi      # 0x51392
callq 0x81c0
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x49304
cmpq $0x0, -0x28(%rbp)
jge 0x492be
movq -0x8(%rbp), %rdi
addq -0x18(%rbp), %rdi
leaq 0x933a(%rip), %rsi      # 0x525b9
callq 0x81c0
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rcx
xorq $-0x1, %rcx
addq $0x1, %rcx
leaq 0x8201(%rip), %rdx      # 0x514b0
callq 0x4d3a0
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x49302
movq -0x8(%rbp), %rdi
addq -0x18(%rbp), %rdi
leaq 0x92ee(%rip), %rsi      # 0x525bb
callq 0x81c0
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rcx
leaq 0x81bb(%rip), %rdx      # 0x514b0
callq 0x4d3a0
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x49304
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)