// File: /workspace/github_c_makefile_star2_O1/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 0x27c9d
movq 0x1f0(%rbx), %rcx
addq $0x2, %rcx
cmpq %rax, %rcx
jae 0x27cea
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 0x27ce5
testb %r15b, %r15b
js 0x27cf9
leaq 0x5d41(%rip), %rdx      # 0x2da13
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x2acdf
movq %rax, %r12
jmp 0x27d1e
xorl %r12d, %r12d
jmp 0x27d1e
movl $0x1, 0x289(%rbx)
jmp 0x27db5
movw $0x2d, (%r14)
leaq 0x1(%r14), %rsi
movq %r15, %rcx
negq %rcx
leaq 0x5d03(%rip), %rdx      # 0x2da13
movq %rbx, %rdi
callq 0x2acdf
movq %rax, %r12
incq %r12
movl $0x40000000, 0x40(%r14) # imm = 0x40000000
cmpl $0x20, 0x214(%rbx)
jl 0x27d7b
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 0x13233(%rip), %rax     # 0x3afa0
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq *(%rax,%rcx,8)
jmp 0x27d9f
leaq 0x10f0e(%rip), %r13     # 0x38c90
movq %r14, %rdi
movq %r13, %rsi
callq 0x8150
movq %r13, %rdi
callq 0x8090
movl 0x110bd(%rip), %ecx     # 0x38e58
movl %ecx, 0x50(%r14)
addq %r12, %rax
cmpl $0x400, 0x24c(%rbx)     # imm = 0x400
jne 0x27dbf
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 0x27dd6
movw $0x2b, (%rcx)
jmp 0x27dde
movw $0x2d, (%rcx)
negq %r15
leaq 0x5c2e(%rip), %rdx      # 0x2da13
movq %rbx, %rdi
movq %r15, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2acdf