// File: /workspace/github_c_makefile_star2_O3/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 0x275cc
movq 0x1f0(%rbx), %rcx
addq $0x2, %rcx
cmpq %rax, %rcx
jae 0x27619
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 0x27614
testb %r15b, %r15b
js 0x27628
leaq 0x6412(%rip), %rdx      # 0x2da13
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x2a60b
movq %rax, %r12
jmp 0x2764d
xorl %r12d, %r12d
jmp 0x2764d
movl $0x1, 0x289(%rbx)
jmp 0x276e4
movw $0x2d, (%r14)
leaq 0x1(%r14), %rsi
movq %r15, %rcx
negq %rcx
leaq 0x63d4(%rip), %rdx      # 0x2da13
movq %rbx, %rdi
callq 0x2a60b
movq %rax, %r12
incq %r12
movl $0x40000000, 0x40(%r14) # imm = 0x40000000
cmpl $0x20, 0x214(%rbx)
jl 0x276aa
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 0x13904(%rip), %rax     # 0x3afa0
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq *(%rax,%rcx,8)
jmp 0x276ce
leaq 0x115df(%rip), %r13     # 0x38c90
movq %r14, %rdi
movq %r13, %rsi
callq 0x8150
movq %r13, %rdi
callq 0x8090
movl 0x1178e(%rip), %ecx     # 0x38e58
movl %ecx, 0x50(%r14)
addq %r12, %rax
cmpl $0x400, 0x24c(%rbx)     # imm = 0x400
jne 0x276ee
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 0x27705
movw $0x2b, (%rcx)
jmp 0x2770d
movw $0x2d, (%rcx)
negq %r15
leaq 0x62ff(%rip), %rdx      # 0x2da13
movq %rbx, %rdi
movq %r15, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2a60b