// File: /workspace/github_c_makefile_star2_O2/buptlxb[P]xRay/disasm/Routines_ModRM.c
// Function: Addr_SIB_disp8
void __bea_callspec__ Addr_SIB_disp8(ARGTYPE* pMyArgument, PDISASM pMyDisasm)
{
    size_t i = 0, j;
    long MyNumber;
    if (!Security(2, pMyDisasm)) return;
    if (GV.AddressSize >= 32) {
        MyNumber = *((Int8*)(UIntPtr) (GV.EIP_+3));
    }
    else {
        MyNumber = *((Int8*)(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,"%.2X",(Int64) ~MyNumber+1);
            #endif
        }
        else {
            j=i;
            #ifndef BEA_LIGHT_DISASSEMBLY
               i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.2X",(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*)(UIntPtr) (GV.EIP_+2))) & 0x7;
        GV.SCALE_  = ((*((UInt8*)(UIntPtr) (GV.EIP_+2))) & 0xc0) >> 6;
        GV.INDEX_  = ((*((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
        i += strlen (Registers16Bits[6]);
        (*pMyArgument).Memory.BaseRegister = REGS[6];

    }

    if (GV.SYNTAX_ == ATSyntax) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, ")");
        #endif
        i++;
    }
    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,"%.2X",(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,"%.2X",(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 0x253e7
movq 0x1f0(%rbx), %rcx
addq $0x2, %rcx
cmpq %rax, %rcx
jae 0x25434
xorl %eax, %eax
cmpl $0x20, 0x214(%rbx)
setge %al
movq 0x1f0(%rbx), %rcx
movsbq 0x2(%rcx,%rax), %r15
movq %r15, 0x5c(%r14)
cmpl $0x400, 0x24c(%rbx)     # imm = 0x400
jne 0x2542f
testb %r15b, %r15b
js 0x25443
leaq 0x55f7(%rip), %rdx      # 0x2aa13
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x283ec
movq %rax, %r12
jmp 0x25468
xorl %r12d, %r12d
jmp 0x25468
movl $0x1, 0x289(%rbx)
jmp 0x254ff
movw $0x2d, (%r14)
leaq 0x1(%r14), %rsi
movq %r15, %rcx
negq %rcx
leaq 0x55b9(%rip), %rdx      # 0x2aa13
movq %rbx, %rdi
callq 0x283ec
movq %rax, %r12
incq %r12
movl $0x40000000, 0x40(%r14) # imm = 0x40000000
cmpl $0x20, 0x214(%rbx)
jl 0x254c5
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 0x13b09(%rip), %rax     # 0x38fc0
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq *(%rax,%rcx,8)
jmp 0x254e9
leaq 0x117e4(%rip), %r13     # 0x36cb0
movq %r14, %rdi
movq %r13, %rsi
callq 0x8170
movq %r13, %rdi
callq 0x8090
movl 0x11993(%rip), %ecx     # 0x36e78
movl %ecx, 0x50(%r14)
addq %r12, %rax
cmpl $0x400, 0x24c(%rbx)     # imm = 0x400
jne 0x25509
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
testb %r15b, %r15b
js 0x25520
movw $0x2b, (%rcx)
jmp 0x25528
movw $0x2d, (%rcx)
negq %r15
leaq 0x54e4(%rip), %rdx      # 0x2aa13
movq %rbx, %rdi
movq %r15, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x283ec