// File: /workspace/github_c_makefile_star2_O2/buptlxb[P]xRay/disasm/Routines_ModRM.c
// Function: SIB_0
size_t __bea_callspec__ SIB_0(ARGTYPE* pMyArgument, size_t i, PDISASM pMyDisasm)
{

    /* ========================= Interpret Base */
    size_t j;
    if ((GV.BASE_  == 5) && (GV.MOD_ == 0)) {
        GV.DECALAGE_EIP += 4;
        if (!Security(7, pMyDisasm)) return i;
        j = i;
        #ifndef BEA_LIGHT_DISASSEMBLY
           i+= CopyFormattedNumber(pMyDisasm, (char*) (*pMyArgument).ArgMnemonic+j,"%.8X",(Int64) *((UInt32*)(UIntPtr) (GV.EIP_+3)));
        #endif
        (*pMyArgument).Memory.Displacement = *((UInt32*)(UIntPtr) (GV.EIP_+3));

    }
    else {

        if (GV.SYNTAX_ == ATSyntax) {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, "(%");
            #endif
            i += 2;
        }
        if (GV.AddressSize == 64) {
            if (GV.REX.B_ == 0) {
                #ifndef BEA_LIGHT_DISASSEMBLY
                   (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, Registers64Bits[GV.BASE_ ]);
                #endif
                (*pMyArgument).Memory.BaseRegister = REGS[GV.BASE_ ];
                i += strlen(Registers64Bits[GV.BASE_ ]);
            }
            else {
                #ifndef BEA_LIGHT_DISASSEMBLY
                   (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, Registers64Bits[GV.BASE_ +8]);
                #endif
                (*pMyArgument).Memory.BaseRegister = REGS[GV.BASE_ +8];
                i += strlen( Registers64Bits[GV.BASE_ +8]);
            }
        }
        else if (GV.AddressSize == 32) {
            if (GV.REX.B_ == 0) {
                #ifndef BEA_LIGHT_DISASSEMBLY
                   (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, Registers32Bits[GV.BASE_ ]);
                #endif
                (*pMyArgument).Memory.BaseRegister = REGS[GV.BASE_ ];
                i += strlen( Registers32Bits[GV.BASE_ ]);
            }
            else {
                #ifndef BEA_LIGHT_DISASSEMBLY
                   (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, Registers32Bits[GV.BASE_ +8]);
                #endif
                (*pMyArgument).Memory.BaseRegister = REGS[GV.BASE_ +8];
                i += strlen( Registers32Bits[GV.BASE_ +8]);
            }
        }
    }
    /* ======================== Interpret Index */


    if (GV.INDEX_  != 4 || GV.REX.X_) {
        if (GV.SYNTAX_ == ATSyntax) {
            if (GV.BASE_  == 5) {
                #ifndef BEA_LIGHT_DISASSEMBLY
                   (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, "(,%");
                #endif
                i+=3;
            }
            else {
                #ifndef BEA_LIGHT_DISASSEMBLY
                   (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, ",%");
                #endif
                i+=2;
            }
        }
        else {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, "+");
            #endif
            i+=1;
        }

        if (GV.AddressSize == 64) {
            if (GV.REX.X_ == 0) {
                #ifndef BEA_LIGHT_DISASSEMBLY
                   (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, Registers64Bits[GV.INDEX_ ]);
                #endif
                (*pMyArgument).Memory.IndexRegister = REGS[GV.INDEX_ ];
                i += strlen( Registers64Bits[GV.INDEX_ ]);
            }
            else {
                #ifndef BEA_LIGHT_DISASSEMBLY
                   (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, Registers64Bits[GV.INDEX_ +8]);
                #endif
                (*pMyArgument).Memory.IndexRegister = REGS[GV.INDEX_ +8];
                i += strlen( Registers64Bits[GV.INDEX_ +8]);
            }
        }
        else if (GV.AddressSize == 32) {
            if (GV.REX.X_ == 0) {
                #ifndef BEA_LIGHT_DISASSEMBLY
                   (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, Registers32Bits[GV.INDEX_ ]);
                #endif
                (*pMyArgument).Memory.IndexRegister = REGS[GV.INDEX_ ];
                i += strlen( Registers32Bits[GV.INDEX_ ]);
            }
            else {
                #ifndef BEA_LIGHT_DISASSEMBLY
                   (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, Registers32Bits[GV.INDEX_ +8]);
                #endif
                (*pMyArgument).Memory.IndexRegister = REGS[GV.INDEX_ +8];
                i += strlen( Registers32Bits[GV.INDEX_ +8]);
            }
        }
    }
    (*pMyArgument).Memory.Scale = 1;
    if ((GV.SYNTAX_ == ATSyntax) && ((GV.BASE_  != 5) || (GV.INDEX_  != 4 || GV.REX.X_))) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy((char*) (*pMyArgument).ArgMnemonic+i, ")");
        #endif
        i++;
    }
    return i;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
cmpl $0x5, 0x228(%rdx)
jne 0x275f6
cmpl $0x0, 0x218(%r14)
je 0x276c6
cmpl $0x400, 0x24c(%r14) # imm = 0x400
jne 0x27614
movb $0x0, 0x2(%r15,%rbx)
movw $0x2528, (%r15,%rbx)    # imm = 0x2528
addq $0x2, %rbx
movl 0x214(%r14), %eax
cmpl $0x20, %eax
je 0x27679
cmpl $0x40, %eax
jne 0x2774a
leaq (%r15,%rbx), %rdi
cmpb $0x0, 0x287(%r14)
movslq 0x228(%r14), %rax
leaq 0xf57d(%rip), %r12      # 0x36bc0
je 0x276fc
leaq (%r12,%rax,4), %rsi
addq $0x20, %rsi
callq 0x8170
movslq 0x228(%r14), %rax
leaq 0xf7fc(%rip), %rcx      # 0x36e60
movl 0x20(%rcx,%rax,4), %ecx
movl %ecx, 0x50(%r15)
leaq (%r12,%rax,4), %rdi
addq $0x20, %rdi
jmp 0x27742
leaq (%r15,%rbx), %rdi
cmpb $0x0, 0x287(%r14)
movslq 0x228(%r14), %rax
leaq 0xf56d(%rip), %r12      # 0x36c00
je 0x27720
leaq (%r12,%rax,8), %rsi
addq $0x40, %rsi
callq 0x8170
movslq 0x228(%r14), %rax
leaq 0xf7ac(%rip), %rcx      # 0x36e60
movl 0x20(%rcx,%rax,4), %ecx
movl %ecx, 0x50(%r15)
leaq (%r12,%rax,8), %rdi
addq $0x40, %rdi
jmp 0x27742
addl $0x4, 0x244(%r14)
movq 0x1f0(%r14), %rax
movq 0x250(%r14), %rcx
leaq 0x7(%rax), %rdx
decq %rcx
cmpq %rdx, %rcx
jae 0x2784f
movl $0x1, 0x289(%r14)
jmp 0x27906
leaq (%r12,%rax,4), %rsi
callq 0x8170
movslq 0x228(%r14), %rax
leaq 0xf74d(%rip), %rcx      # 0x36e60
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x50(%r15)
leaq (%r12,%rax,4), %rdi
jmp 0x27742
leaq (%r12,%rax,8), %rsi
callq 0x8170
movslq 0x228(%r14), %rax
leaq 0xf729(%rip), %rcx      # 0x36e60
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x50(%r15)
leaq (%r12,%rax,8), %rdi
callq 0x8090
addq %rax, %rbx
cmpl $0x4, 0x220(%r14)
jne 0x27762
cmpb $0x0, 0x286(%r14)
je 0x278c9
cmpl $0x400, 0x24c(%r14) # imm = 0x400
jne 0x27787
leaq (%r15,%rbx), %rax
cmpl $0x5, 0x228(%r14)
jne 0x27792
movl $0x252c28, (%rax)       # imm = 0x252C28
pushq $0x3
jmp 0x2779d
movw $0x2b, (%r15,%rbx)
pushq $0x1
jmp 0x2779d
movb $0x0, 0x2(%rax)
movw $0x252c, (%rax)         # imm = 0x252C
pushq $0x2
popq %rax
addq %rax, %rbx
movl 0x214(%r14), %eax
cmpl $0x20, %eax
je 0x27806
cmpl $0x40, %eax
jne 0x278c9
leaq (%r15,%rbx), %rdi
cmpb $0x0, 0x286(%r14)
movslq 0x220(%r14), %rax
leaq 0xf3f0(%rip), %r12      # 0x36bc0
je 0x2787b
leaq (%r12,%rax,4), %rsi
addq $0x20, %rsi
callq 0x8170
movslq 0x220(%r14), %rax
leaq 0xf66f(%rip), %rcx      # 0x36e60
movl 0x20(%rcx,%rax,4), %ecx
movl %ecx, 0x54(%r15)
leaq (%r12,%rax,4), %rdi
addq $0x20, %rdi
jmp 0x278c1
leaq (%r15,%rbx), %rdi
cmpb $0x0, 0x286(%r14)
movslq 0x220(%r14), %rax
leaq 0xf3e0(%rip), %r12      # 0x36c00
je 0x2789f
leaq (%r12,%rax,8), %rsi
addq $0x40, %rsi
callq 0x8170
movslq 0x220(%r14), %rax
leaq 0xf623(%rip), %rcx      # 0x36e60
movl 0x20(%rcx,%rax,4), %ecx
movl %ecx, 0x54(%r15)
leaq (%r12,%rax,8), %rdi
addq $0x40, %rdi
jmp 0x278c1
leaq (%r15,%rbx), %rsi
movl 0x3(%rax), %ecx
leaq 0x31ff(%rip), %rdx      # 0x2aa5c
movq %r14, %rdi
callq 0x283ec
addq %rax, %rbx
movq 0x1f0(%r14), %rax
movl 0x3(%rax), %eax
movq %rax, 0x5c(%r15)
jmp 0x2774a
leaq (%r12,%rax,4), %rsi
callq 0x8170
movslq 0x220(%r14), %rax
leaq 0xf5ce(%rip), %rcx      # 0x36e60
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x54(%r15)
leaq (%r12,%rax,4), %rdi
jmp 0x278c1
leaq (%r12,%rax,8), %rsi
callq 0x8170
movslq 0x220(%r14), %rax
leaq 0xf5aa(%rip), %rcx      # 0x36e60
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x54(%r15)
leaq (%r12,%rax,8), %rdi
callq 0x8090
addq %rax, %rbx
movl $0x1, 0x58(%r15)
cmpl $0x400, 0x24c(%r14) # imm = 0x400
jne 0x27906
cmpl $0x5, 0x228(%r14)
jne 0x278fc
cmpl $0x4, 0x220(%r14)
jne 0x278fc
cmpb $0x0, 0x286(%r14)
je 0x27906
movw $0x29, (%r15,%rbx)
incq %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq