// File: /workspace/github_c_makefile_star2_O3/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 0x297f3
cmpl $0x0, 0x218(%r14)
je 0x298c3
cmpl $0x400, 0x24c(%r14) # imm = 0x400
jne 0x29811
movb $0x0, 0x2(%r15,%rbx)
movw $0x2528, (%r15,%rbx)    # imm = 0x2528
addq $0x2, %rbx
movl 0x214(%r14), %eax
cmpl $0x20, %eax
je 0x29876
cmpl $0x40, %eax
jne 0x29947
leaq (%r15,%rbx), %rdi
cmpb $0x0, 0x287(%r14)
movslq 0x228(%r14), %rax
leaq 0xf360(%rip), %r12      # 0x38ba0
je 0x298f9
leaq (%r12,%rax,4), %rsi
addq $0x20, %rsi
callq 0x8150
movslq 0x228(%r14), %rax
leaq 0xf5df(%rip), %rcx      # 0x38e40
movl 0x20(%rcx,%rax,4), %ecx
movl %ecx, 0x50(%r15)
leaq (%r12,%rax,4), %rdi
addq $0x20, %rdi
jmp 0x2993f
leaq (%r15,%rbx), %rdi
cmpb $0x0, 0x287(%r14)
movslq 0x228(%r14), %rax
leaq 0xf350(%rip), %r12      # 0x38be0
je 0x2991d
leaq (%r12,%rax,8), %rsi
addq $0x40, %rsi
callq 0x8150
movslq 0x228(%r14), %rax
leaq 0xf58f(%rip), %rcx      # 0x38e40
movl 0x20(%rcx,%rax,4), %ecx
movl %ecx, 0x50(%r15)
leaq (%r12,%rax,8), %rdi
addq $0x40, %rdi
jmp 0x2993f
addl $0x4, 0x244(%r14)
movq 0x1f0(%r14), %rax
movq 0x250(%r14), %rcx
leaq 0x7(%rax), %rdx
decq %rcx
cmpq %rdx, %rcx
jae 0x29a54
movl $0x1, 0x289(%r14)
jmp 0x29b0b
leaq (%r12,%rax,4), %rsi
callq 0x8150
movslq 0x228(%r14), %rax
leaq 0xf530(%rip), %rcx      # 0x38e40
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x50(%r15)
leaq (%r12,%rax,4), %rdi
jmp 0x2993f
leaq (%r12,%rax,8), %rsi
callq 0x8150
movslq 0x228(%r14), %rax
leaq 0xf50c(%rip), %rcx      # 0x38e40
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x50(%r15)
leaq (%r12,%rax,8), %rdi
callq 0x8090
addq %rax, %rbx
cmpl $0x4, 0x220(%r14)
jne 0x2995f
cmpb $0x0, 0x286(%r14)
je 0x29ace
cmpl $0x400, 0x24c(%r14) # imm = 0x400
jne 0x29987
leaq (%r15,%rbx), %rax
cmpl $0x5, 0x228(%r14)
jne 0x29995
movl $0x252c28, (%rax)       # imm = 0x252C28
movl $0x3, %eax
jmp 0x299a3
movw $0x2b, (%r15,%rbx)
movl $0x1, %eax
jmp 0x299a3
movb $0x0, 0x2(%rax)
movw $0x252c, (%rax)         # imm = 0x252C
movl $0x2, %eax
addq %rax, %rbx
movl 0x214(%r14), %eax
cmpl $0x20, %eax
je 0x29a0b
cmpl $0x40, %eax
jne 0x29ace
leaq (%r15,%rbx), %rdi
cmpb $0x0, 0x286(%r14)
movslq 0x220(%r14), %rax
leaq 0xf1cb(%rip), %r12      # 0x38ba0
je 0x29a80
leaq (%r12,%rax,4), %rsi
addq $0x20, %rsi
callq 0x8150
movslq 0x220(%r14), %rax
leaq 0xf44a(%rip), %rcx      # 0x38e40
movl 0x20(%rcx,%rax,4), %ecx
movl %ecx, 0x54(%r15)
leaq (%r12,%rax,4), %rdi
addq $0x20, %rdi
jmp 0x29ac6
leaq (%r15,%rbx), %rdi
cmpb $0x0, 0x286(%r14)
movslq 0x220(%r14), %rax
leaq 0xf1bb(%rip), %r12      # 0x38be0
je 0x29aa4
leaq (%r12,%rax,8), %rsi
addq $0x40, %rsi
callq 0x8150
movslq 0x220(%r14), %rax
leaq 0xf3fe(%rip), %rcx      # 0x38e40
movl 0x20(%rcx,%rax,4), %ecx
movl %ecx, 0x54(%r15)
leaq (%r12,%rax,8), %rdi
addq $0x40, %rdi
jmp 0x29ac6
leaq (%r15,%rbx), %rsi
movl 0x3(%rax), %ecx
leaq 0x3ffa(%rip), %rdx      # 0x2da5c
movq %r14, %rdi
callq 0x2a60b
addq %rax, %rbx
movq 0x1f0(%r14), %rax
movl 0x3(%rax), %eax
movq %rax, 0x5c(%r15)
jmp 0x29947
leaq (%r12,%rax,4), %rsi
callq 0x8150
movslq 0x220(%r14), %rax
leaq 0xf3a9(%rip), %rcx      # 0x38e40
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x54(%r15)
leaq (%r12,%rax,4), %rdi
jmp 0x29ac6
leaq (%r12,%rax,8), %rsi
callq 0x8150
movslq 0x220(%r14), %rax
leaq 0xf385(%rip), %rcx      # 0x38e40
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 0x29b0b
cmpl $0x5, 0x228(%r14)
jne 0x29b01
cmpl $0x4, 0x220(%r14)
jne 0x29b01
cmpb $0x0, 0x286(%r14)
je 0x29b0b
movw $0x29, (%r15,%rbx)
incq %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq