// File: /workspace/github_c_makefile_star2_O3/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 0x1f0(%rsi), %rax
movq 0x250(%rsi), %rcx
incq %rax
decq %rcx
cmpq %rax, %rcx
jae 0x2ab66
movl $0x1, 0x289(%r14)
jmp 0x2ac9e
movq %rdi, %rbx
movzbl (%rax), %eax
shrl $0x3, %eax
andl $0x7, %eax
movl %eax, 0x240(%r14)
cmpb $0x1, 0x285(%r14)
jne 0x2ab8d
orl $0x8, %eax
movl %eax, 0x240(%r14)
cmpl $0x1, 0x22c(%r14)
jne 0x2abd1
movl %eax, %eax
leaq 0xe200(%rip), %rcx      # 0x38da0
leaq (%rcx,%rax,4), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xe286(%rip), %rcx      # 0x38e40
movl $0x20010000, %edx       # imm = 0x20010000
addl (%rcx,%rax,4), %edx
movl %edx, 0x40(%rbx)
movl $0x40, 0x44(%rbx)
jmp 0x2ac9e
cmpl $0x1, 0x23c(%r14)
jne 0x2ac15
movl %eax, %eax
leaq 0xdd3c(%rip), %rcx      # 0x38920
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xe242(%rip), %rcx      # 0x38e40
movl $0x21000000, %edx       # imm = 0x21000000
addl (%rcx,%rax,4), %edx
movl %edx, 0x40(%rbx)
movl $0x10, 0x44(%rbx)
jmp 0x2ac9e
cmpl $0x1, 0x234(%r14)
jne 0x2ac49
movl %eax, %eax
leaq 0xdef8(%rip), %rcx      # 0x38b20
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xe1fe(%rip), %rcx      # 0x38e40
movl $0x20100000, %edx       # imm = 0x20100000
jmp 0x2ac91
cmpl $0x1, 0x238(%r14)
jne 0x2aca6
cmpl $0x400, 0x24c(%r14) # imm = 0x400
leaq 0xde3b(%rip), %rcx      # 0x38aa0
leaq 0xddb4(%rip), %rdx      # 0x38a20
cmoveq %rcx, %rdx
movl %eax, %eax
leaq (%rdx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xe1b4(%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 0x2ace7
movl %eax, %eax
leaq 0xe107(%rip), %rcx      # 0x38dc0
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xe16d(%rip), %rcx      # 0x38e40
movl $0x20080000, %edx       # imm = 0x20080000
addl (%rcx,%rax,4), %edx
movl %edx, 0x40(%rbx)
movl $0x80, 0x44(%rbx)
jmp 0x2ac9e
movl 0x20c(%r14), %ecx
addl $-0x8, %ecx
roll $0x1d, %ecx
cmpl $0x7, %ecx
ja 0x2ac9e
leaq 0x2c98(%rip), %rdx      # 0x2d998
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
cmpb $0x0, 0x288(%r14)
movl %eax, %eax
je 0x2add1
leaq 0xe000(%rip), %rcx      # 0x38d20
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xe106(%rip), %rcx      # 0x38e40
movl $0x20020000, %edx       # imm = 0x20020000
addl (%rcx,%rax,4), %edx
movl %edx, 0x40(%rbx)
jmp 0x2ae0a
movl %eax, %eax
leaq 0xde8d(%rip), %rcx      # 0x38be0
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xe0d3(%rip), %rcx      # 0x38e40
movl $0x20020000, %edx       # imm = 0x20020000
jmp 0x2ac91
movl %eax, %eax
leaq 0xdee0(%rip), %rcx      # 0x38c60
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xe0a6(%rip), %rcx      # 0x38e40
movl $0x20020000, %edx       # imm = 0x20020000
jmp 0x2ac03
movl %eax, %eax
leaq 0xddf3(%rip), %rcx      # 0x38ba0
leaq (%rcx,%rax,4), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xe079(%rip), %rcx      # 0x38e40
movl $0x20020000, %edx       # imm = 0x20020000
jmp 0x2abbf
leaq 0xdf08(%rip), %rcx      # 0x38ce0
leaq (%rcx,%rax,4), %rsi
movq %rbx, %rdi
callq 0x8150
movslq 0x240(%r14), %rax
leaq 0xdf0e(%rip), %rcx      # 0x38d00
movl $0x20020000, %edx       # imm = 0x20020000
addl (%rcx,%rax,4), %edx
movl %edx, 0x40(%rbx)
cmpq $0x4, %rax
jl 0x2ae0a
movl $0x1, 0x48(%rbx)
movl $0x8, 0x44(%rbx)
jmp 0x2ac9e