// File: /workspace/github_c_makefile_star2_O1/buptlxb[P]xRay/disasm/Routines_ModRM.c
// Function: Reg_Opcode
void __bea_callspec__ Reg_Opcode(ARGTYPE* pMyArgument, PDISASM pMyDisasm)
{
    size_t i = 0;
    if (!Security(1, pMyDisasm)) return;
    GV.REGOPCODE = ((*((UInt8*)(UIntPtr) (GV.EIP_+1))) >> 3) & 0x7;
    if (GV.REX.R_ == 1) {
        GV.REGOPCODE += 0x8;
    }
    if (GV.MMX_  == 1) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, RegistersMMX[GV.REGOPCODE]);
        #endif
        (*pMyArgument).ArgType = REGISTER_TYPE+MMX_REG+REGS[GV.REGOPCODE];
        (*pMyArgument).ArgSize = 64;
    }
    else if (GV.SEG_ == 1) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, RegistersSEG[GV.REGOPCODE]);
        #endif
        (*pMyArgument).ArgType = REGISTER_TYPE+SEGMENT_REG+REGS[GV.REGOPCODE];
        (*pMyArgument).ArgSize = 16;
    }
    else if (GV.CR_ == 1) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, RegistersCR[GV.REGOPCODE]);
        #endif
        (*pMyArgument).ArgType = REGISTER_TYPE+CR_REG+REGS[GV.REGOPCODE];
        (*pMyArgument).ArgSize = 32;
    }
    else if (GV.DR_ == 1) {
        if (GV.SYNTAX_ == ATSyntax) {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, RegistersDR_AT[GV.REGOPCODE]);
            #endif
        }
        else {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, RegistersDR[GV.REGOPCODE]);
            #endif
        }
        (*pMyArgument).ArgType = REGISTER_TYPE+DR_REG+REGS[GV.REGOPCODE];
        (*pMyArgument).ArgSize = 32;
    }
    else if (GV.SSE_ == 1) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, RegistersSSE[GV.REGOPCODE]);
        #endif
        (*pMyArgument).ArgType = REGISTER_TYPE+SSE_REG+REGS[GV.REGOPCODE];
        (*pMyArgument).ArgSize = 128;
    }
    else if (GV.OperandSize == 8) {
        if (GV.REX.state == 0) {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, Registers8BitsLegacy[GV.REGOPCODE]);
            #endif
            (*pMyArgument).ArgType = REGISTER_TYPE+GENERAL_REG+REGS8BITS[GV.REGOPCODE];
			if (GV.REGOPCODE >= 4) {
				(*pMyArgument).ArgPosition = HighPosition;
			}
            (*pMyArgument).ArgSize = 8;
        }
        else {
            #ifndef BEA_LIGHT_DISASSEMBLY
               (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, Registers8Bits[GV.REGOPCODE]);
            #endif
            (*pMyArgument).ArgType = REGISTER_TYPE+GENERAL_REG+REGS[GV.REGOPCODE];
            (*pMyArgument).ArgSize = 8;
        }
    }
    else if (GV.OperandSize == 16) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, Registers16Bits[GV.REGOPCODE]);
        #endif
        (*pMyArgument).ArgType = REGISTER_TYPE+GENERAL_REG+REGS[GV.REGOPCODE];
        (*pMyArgument).ArgSize = 16;
    }
    else if (GV.OperandSize == 32) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, Registers32Bits[GV.REGOPCODE]);
        #endif
        (*pMyArgument).ArgType = REGISTER_TYPE+GENERAL_REG+REGS[GV.REGOPCODE];
        (*pMyArgument).ArgSize = 32;
    }
    else if (GV.OperandSize == 64) {
        #ifndef BEA_LIGHT_DISASSEMBLY
           (void) strcpy ((char*) (*pMyArgument).ArgMnemonic+i, Registers64Bits[GV.REGOPCODE]);
        #endif
        (*pMyArgument).ArgType = REGISTER_TYPE+GENERAL_REG+REGS[GV.REGOPCODE];
        (*pMyArgument).ArgSize = 64;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x250(%rsi), %rax
testq %rax, %rax
je 0x2b274
movq 0x1f0(%r14), %rcx
incq %rcx
cmpq %rax, %rcx
jae 0x2b332
movq 0x1f0(%r14), %rax
movzbl 0x1(%rax), %eax
shrl $0x3, %eax
andl $0x7, %eax
movl %eax, 0x240(%r14)
cmpb $0x1, 0x285(%r14)
jne 0x2b2a0
orl $0x8, %eax
movl %eax, 0x240(%r14)
cmpl $0x1, 0x22c(%r14)
jne 0x2b2e9
movslq 0x240(%r14), %rax
leaq 0xdae8(%rip), %rcx      # 0x38da0
leaq (%rcx,%rax,4), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xdb6e(%rip), %rcx      # 0x38e40
movl $0x20010000, %edx       # imm = 0x20010000
addl (%rcx,%rax,4), %edx
movl %edx, 0x40(%rbx)
movl $0x40, 0x44(%rbx)
jmp 0x2b3d5
cmpl $0x1, 0x23c(%r14)
jne 0x2b342
movslq 0x240(%r14), %rax
leaq 0xd61f(%rip), %rcx      # 0x38920
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xdb25(%rip), %rcx      # 0x38e40
movl $0x21000000, %edx       # imm = 0x21000000
addl (%rcx,%rax,4), %edx
movl %edx, 0x40(%rbx)
movl $0x10, 0x44(%rbx)
jmp 0x2b3d5
movl $0x1, 0x289(%r14)
jmp 0x2b3d5
cmpl $0x1, 0x234(%r14)
jne 0x2b37b
movslq 0x240(%r14), %rax
leaq 0xd7c6(%rip), %rcx      # 0x38b20
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xdacc(%rip), %rcx      # 0x38e40
movl $0x20100000, %edx       # imm = 0x20100000
jmp 0x2b3c8
cmpl $0x1, 0x238(%r14)
jne 0x2b3dd
cmpl $0x400, 0x24c(%r14) # imm = 0x400
movslq 0x240(%r14), %rax
leaq 0xd702(%rip), %rcx      # 0x38aa0
leaq 0xd67b(%rip), %rdx      # 0x38a20
cmoveq %rcx, %rdx
leaq (%rdx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xda7d(%rip), %rcx      # 0x38e40
movl $0x20200000, %edx       # imm = 0x20200000
addl (%rcx,%rax,4), %edx
movl %edx, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0x1, 0x230(%r14)
jne 0x2b423
movslq 0x240(%r14), %rax
leaq 0xd9cb(%rip), %rcx      # 0x38dc0
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xda31(%rip), %rcx      # 0x38e40
movl $0x20080000, %edx       # imm = 0x20080000
addl (%rcx,%rax,4), %edx
movl %edx, 0x40(%rbx)
movl $0x80, 0x44(%rbx)
jmp 0x2b3d5
movl 0x20c(%r14), %eax
addl $-0x8, %eax
roll $0x1d, %eax
cmpl $0x7, %eax
ja 0x2b3d5
leaq 0x255c(%rip), %rcx      # 0x2d998
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpb $0x0, 0x288(%r14)
movslq 0x240(%r14), %rax
je 0x2b521
leaq 0xd8bf(%rip), %rcx      # 0x38d20
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xd9c5(%rip), %rcx      # 0x38e40
movl $0x20020000, %edx       # imm = 0x20020000
addl (%rcx,%rax,4), %edx
movl %edx, 0x40(%rbx)
jmp 0x2b55a
movslq 0x240(%r14), %rax
leaq 0xd747(%rip), %rcx      # 0x38be0
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xd98d(%rip), %rcx      # 0x38e40
movl $0x20020000, %edx       # imm = 0x20020000
jmp 0x2b3c8
movslq 0x240(%r14), %rax
leaq 0xd795(%rip), %rcx      # 0x38c60
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xd95b(%rip), %rcx      # 0x38e40
movl $0x20020000, %edx       # imm = 0x20020000
jmp 0x2b320
movslq 0x240(%r14), %rax
leaq 0xd6a3(%rip), %rcx      # 0x38ba0
leaq (%rcx,%rax,4), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xd929(%rip), %rcx      # 0x38e40
movl $0x20020000, %edx       # imm = 0x20020000
jmp 0x2b2d7
leaq 0xd7b8(%rip), %rcx      # 0x38ce0
leaq (%rcx,%rax,4), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xd7be(%rip), %rcx      # 0x38d00
movl $0x20020000, %edx       # imm = 0x20020000
addl (%rcx,%rax,4), %edx
movl %edx, 0x40(%rbx)
cmpq $0x4, %rax
jl 0x2b55a
movl $0x1, 0x48(%rbx)
movl $0x8, 0x44(%rbx)
jmp 0x2b3d5