// File: /workspace/github_c_makefile_star2_O1/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 0x29ebf
cmpl $0x0, 0x218(%r14)
je 0x29f92
cmpl $0x400, 0x24c(%r14) # imm = 0x400
jne 0x29edd
movb $0x0, 0x2(%r15,%rbx)
movw $0x2528, (%r15,%rbx)    # imm = 0x2528
addq $0x2, %rbx
movl 0x214(%r14), %eax
cmpl $0x20, %eax
je 0x29f42
cmpl $0x40, %eax
jne 0x2a038
leaq (%r15,%rbx), %rdi
cmpb $0x0, 0x287(%r14)
movslq 0x228(%r14), %rax
leaq 0xec94(%rip), %r12      # 0x38ba0
je 0x29fea
leaq (%r12,%rax,4), %rsi
addq $0x20, %rsi
callq 0x8150
movslq 0x228(%r14), %rax
leaq 0xef13(%rip), %rcx      # 0x38e40
movl 0x20(%rcx,%rax,4), %ecx
movl %ecx, 0x50(%r15)
leaq (%r12,%rax,4), %rdi
addq $0x20, %rdi
jmp 0x2a030
leaq (%r15,%rbx), %rdi
cmpb $0x0, 0x287(%r14)
movslq 0x228(%r14), %rax
leaq 0xec84(%rip), %r12      # 0x38be0
je 0x2a00e
leaq (%r12,%rax,8), %rsi
addq $0x40, %rsi
callq 0x8150
movslq 0x228(%r14), %rax
leaq 0xeec3(%rip), %rcx      # 0x38e40
movl 0x20(%rcx,%rax,4), %ecx
movl %ecx, 0x50(%r15)
leaq (%r12,%rax,8), %rdi
addq $0x40, %rdi
jmp 0x2a030
addl $0x4, 0x244(%r14)
movq 0x250(%r14), %rax
testq %rax, %rax
je 0x29fba
movq 0x1f0(%r14), %rcx
addq $0x7, %rcx
cmpq %rax, %rcx
jae 0x2a1db
leaq (%r15,%rbx), %rsi
movq 0x1f0(%r14), %rax
movl 0x3(%rax), %ecx
leaq 0x3a8d(%rip), %rdx      # 0x2da5c
movq %r14, %rdi
callq 0x2acdf
addq %rax, %rbx
movq 0x1f0(%r14), %rax
movl 0x3(%rax), %eax
movq %rax, 0x5c(%r15)
jmp 0x2a038
leaq (%r12,%rax,4), %rsi
callq 0x8150
movslq 0x228(%r14), %rax
leaq 0xee3f(%rip), %rcx      # 0x38e40
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x50(%r15)
leaq (%r12,%rax,4), %rdi
jmp 0x2a030
leaq (%r12,%rax,8), %rsi
callq 0x8150
movslq 0x228(%r14), %rax
leaq 0xee1b(%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 0x2a050
cmpb $0x0, 0x286(%r14)
je 0x2a18f
cmpl $0x400, 0x24c(%r14) # imm = 0x400
jne 0x2a078
leaq (%r15,%rbx), %rax
cmpl $0x5, 0x228(%r14)
jne 0x2a086
movl $0x252c28, (%rax)       # imm = 0x252C28
movl $0x3, %eax
jmp 0x2a094
movw $0x2b, (%r15,%rbx)
movl $0x1, %eax
jmp 0x2a094
movb $0x0, 0x2(%rax)
movw $0x252c, (%rax)         # imm = 0x252C
movl $0x2, %eax
addq %rax, %rbx
movl 0x214(%r14), %eax
cmpl $0x20, %eax
je 0x2a0f8
cmpl $0x40, %eax
jne 0x2a18f
leaq (%r15,%rbx), %rdi
cmpb $0x0, 0x286(%r14)
movslq 0x220(%r14), %rax
leaq 0xeada(%rip), %r12      # 0x38ba0
je 0x2a141
leaq (%r12,%rax,4), %rsi
addq $0x20, %rsi
callq 0x8150
movslq 0x220(%r14), %rax
leaq 0xed5d(%rip), %rcx      # 0x38e40
movl 0x20(%rcx,%rax,4), %ecx
movl %ecx, 0x54(%r15)
leaq (%r12,%rax,4), %rdi
addq $0x20, %rdi
jmp 0x2a187
leaq (%r15,%rbx), %rdi
cmpb $0x0, 0x286(%r14)
movslq 0x220(%r14), %rax
leaq 0xeace(%rip), %r12      # 0x38be0
je 0x2a165
leaq (%r12,%rax,8), %rsi
addq $0x40, %rsi
callq 0x8150
movslq 0x220(%r14), %rax
leaq 0xed11(%rip), %rcx      # 0x38e40
movl 0x20(%rcx,%rax,4), %ecx
movl %ecx, 0x54(%r15)
leaq (%r12,%rax,8), %rdi
addq $0x40, %rdi
jmp 0x2a187
leaq (%r12,%rax,4), %rsi
callq 0x8150
movslq 0x220(%r14), %rax
leaq 0xece8(%rip), %rcx      # 0x38e40
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x54(%r15)
leaq (%r12,%rax,4), %rdi
jmp 0x2a187
leaq (%r12,%rax,8), %rsi
callq 0x8150
movslq 0x220(%r14), %rax
leaq 0xecc4(%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 0x2a1cc
cmpl $0x5, 0x228(%r14)
jne 0x2a1c2
cmpl $0x4, 0x220(%r14)
jne 0x2a1c2
cmpb $0x0, 0x286(%r14)
je 0x2a1cc
movw $0x29, (%r15,%rbx)
incq %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x1, 0x289(%r14)
jmp 0x2a1cc