// File: /workspace/github_c_makefile_star2_O3/buptlxb[P]xRay/disasm/Routines_Disasm.c
// Function: BuildCompleteInstruction
void __bea_callspec__ BuildCompleteInstruction(PDISASM pMyDisasm)
{
    size_t i = 0;
    /* =============== Copy Instruction Mnemonic */

    if ((*pMyDisasm).Prefix.RepnePrefix == InUsePrefix) {
            (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "repne ");
            i = strlen((char*) &(*pMyDisasm).CompleteInstr);
    }
    if ((*pMyDisasm).Prefix.RepPrefix == InUsePrefix) {
            (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "rep ");
            i = strlen((char*) &(*pMyDisasm).CompleteInstr);
    }
    if ((*pMyDisasm).Prefix.LockPrefix == InUsePrefix) {
            (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "lock ");
            i = strlen((char*) &(*pMyDisasm).CompleteInstr);
    }
    (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, (char*) &(*pMyDisasm).Instruction.Mnemonic);
    i = strlen((char*) &(*pMyDisasm).CompleteInstr);

    /* =============== if TAB = 1, add tabulation */
    if (GV.TAB_ == 1) {
       (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, space_tab[i>10 ? 0 : 10-i]);
        i = strlen((char*) &(*pMyDisasm).CompleteInstr);
    }
    /* =============== if Arg1.IsMemoryType, add decoration-example == "dword ptr ds:[" */
    if ((GV.MemDecoration >0) && (GV.MemDecoration < 99)) {
        if (GV.SYNTAX_ == NasmSyntax) {
            (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, NasmPrefixes[GV.MemDecoration-1]);
            i = strlen((char*) &(*pMyDisasm).CompleteInstr);
            if ((GV.SEGMENTREGS != 0) || (GV.SEGMENTFS != 0)){
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "[");
                i++;
                if (GV.SEGMENTREGS != 0) {
                    (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, SegmentRegs[(*pMyDisasm).Argument1.SegmentReg]);
                }
                else {
                    (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, SegmentRegs[3]);
                }
                i = strlen((char*) &(*pMyDisasm).CompleteInstr);
            }
            else {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "[");
                i++;
            }
        }
        else {
            if (GV.SYNTAX_ == MasmSyntax) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, MasmPrefixes[GV.MemDecoration-1]);
                i = strlen((char*) &(*pMyDisasm).CompleteInstr);
            }
            else {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, GoAsmPrefixes[GV.MemDecoration-1]);
                i = strlen((char*) &(*pMyDisasm).CompleteInstr);
            }
            if ((GV.SEGMENTREGS != 0) || (GV.SEGMENTFS != 0)){
                if (GV.SEGMENTREGS != 0) {
                    (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, SegmentRegs[(*pMyDisasm).Argument1.SegmentReg]);
                }
                else {
                    (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, SegmentRegs[3]);
                }
                i = strlen((char*) &(*pMyDisasm).CompleteInstr);
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "[");
                i++;
            }
            else {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "[");
                i++;
            }
        }
        /* =============== add Arg1.Mnemonic */
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, (char*) &(*pMyDisasm).Argument1.ArgMnemonic);
        i = strlen((char*) &(*pMyDisasm).CompleteInstr);
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "]");
        i++;
    }
    /* =============== add Arg1.Mnemonic */
    else {
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, (char*) &(*pMyDisasm).Argument1.ArgMnemonic);
        i = strlen((char*) &(*pMyDisasm).CompleteInstr);
    }

    /* =============== if Arg2.Exists and Arg1.Exists , add"," */
    if (((UInt8)*((UInt8*) &(*pMyDisasm).Argument1.ArgMnemonic) != 0) && ((UInt8)*((UInt8*) &(*pMyDisasm).Argument2.ArgMnemonic) != 0)) {
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, ", ");
        i += 2;
    }

    /* =============== if Arg2.IsMemoryType, add decoration-example == "dword ptr ds:[" */
    if ((GV.MemDecoration >100) && (GV.MemDecoration < 199)) {
        GV.MemDecoration -= 100;
        if (GV.SYNTAX_ == NasmSyntax) {
            (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, NasmPrefixes[GV.MemDecoration-1]);
            i = strlen((char*) &(*pMyDisasm).CompleteInstr);
            if ((GV.SEGMENTREGS != 0) || (GV.SEGMENTFS != 0)){
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "[");
                i++;
                if (GV.SEGMENTREGS != 0) {
                    (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, SegmentRegs[(*pMyDisasm).Argument2.SegmentReg]);
                }
                else {
                    (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, SegmentRegs[3]);
                }
                i = strlen((char*) &(*pMyDisasm).CompleteInstr);
            }
            else {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "[");
                i++;
            }
        }
        else {
            if (GV.SYNTAX_ == MasmSyntax) {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, MasmPrefixes[GV.MemDecoration-1]);
                i = strlen((char*) &(*pMyDisasm).CompleteInstr);
            }
            else {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, GoAsmPrefixes[GV.MemDecoration-1]);
                i = strlen((char*) &(*pMyDisasm).CompleteInstr);
            }
            if ((GV.SEGMENTREGS != 0) || (GV.SEGMENTFS != 0)){
                if (GV.SEGMENTREGS != 0) {
                    (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, SegmentRegs[(*pMyDisasm).Argument2.SegmentReg]);
                }
                else {
                    (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, SegmentRegs[3]);
                }
                i = strlen((char*) &(*pMyDisasm).CompleteInstr);
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "[");
                i++;
            }
            else {
                (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "[");
                i++;
            }
        }
        /* =============== add Arg2.ArgMnemonic */
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, (char*) &(*pMyDisasm).Argument2.ArgMnemonic);
        i = strlen((char*) &(*pMyDisasm).CompleteInstr);
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, "]");
        i++;
    }
    /* =============== add Arg2.ArgMnemonic */
    else {
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, (char*) &(*pMyDisasm).Argument2.ArgMnemonic);
        i = strlen((char*) &(*pMyDisasm).CompleteInstr);
    }


    /* =============== if Arg3.Exists */
    if (GV.third_arg != 0) {
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, ", ");
        i += 2;
        (void) strcpy ((char*) &(*pMyDisasm).CompleteInstr+i, (char*) &(*pMyDisasm).Argument3.ArgMnemonic);
    }



}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0x1df(%rdi)
jne 0x2bc6c
leaq 0x14(%rbx), %rdi
movl $0x20656e, 0x17(%rbx)   # imm = 0x20656E
movl $0x6e706572, 0x14(%rbx) # imm = 0x6E706572
callq 0x8090
jmp 0x2bc6e
xorl %eax, %eax
cmpb $0x1, 0x1e0(%rbx)
jne 0x2bc8d
leaq 0x14(%rbx), %rdi
movb $0x0, 0x18(%rbx,%rax)
movl $0x20706572, 0x14(%rbx,%rax) # imm = 0x20706572
callq 0x8090
cmpb $0x1, 0x1dc(%rbx)
jne 0x2bcae
leaq 0x14(%rbx), %rdi
movw $0x20, 0x18(%rbx,%rax)
movl $0x6b636f6c, 0x14(%rbx,%rax) # imm = 0x6B636F6C
callq 0x8090
leaq 0x14(%rbx), %r14
leaq (%rbx,%rax), %rdi
addq $0x14, %rdi
leaq 0x68(%rbx), %rsi
callq 0x8150
movq %r14, %rdi
callq 0x8090
cmpl $0x1, 0x27c(%rbx)
jne 0x2bd00
xorl %ecx, %ecx
movl $0xa, %edx
subq %rax, %rdx
cmovaeq %rdx, %rcx
leaq (%r14,%rax), %rdi
shll $0x4, %ecx
leaq 0xca60(%rip), %rsi      # 0x38750
addq %rcx, %rsi
callq 0x8150
movq %r14, %rdi
callq 0x8090
movl 0x210(%rbx), %ecx
decl %ecx
cmpl $0x61, %ecx
ja 0x2bd8c
movl 0x24c(%rbx), %edx
addq %r14, %rax
movl %ecx, %ecx
testl %edx, %edx
je 0x2bdab
cmpl $0x200, %edx            # imm = 0x200
jne 0x2bdbb
leaq 0xcb8d(%rip), %rdx      # 0x388c0
leaq (%rdx,%rcx,8), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
cmpl $0x0, 0x270(%rbx)
jne 0x2bd5d
cmpl $0x0, 0x274(%rbx)
je 0x2be1d
movw $0x5b, 0x14(%rbx,%rax)
cmpl $0x0, 0x270(%rbx)
leaq 0x1(%r14,%rax), %rdi
je 0x2be29
movl 0x100(%rbx), %eax
leaq 0xca7d(%rip), %rcx      # 0x38800
leaq (%rcx,%rax,4), %rsi
jmp 0x2be30
addq %r14, %rax
leaq 0x9c(%rbx), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
jmp 0x2be61
shlq $0x4, %rcx
leaq 0xca8a(%rip), %rsi      # 0x38840
addq %rcx, %rsi
jmp 0x2bdc6
leaq 0xcb3e(%rip), %rdx      # 0x38900
leaq (%rdx,%rcx,4), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
cmpl $0x0, 0x270(%rbx)
je 0x2bdf8
addq %r14, %rax
movl 0x100(%rbx), %ecx
leaq 0xca11(%rip), %rdx      # 0x38800
leaq (%rdx,%rcx,4), %rsi
movq %rax, %rdi
jmp 0x2be10
leaq (%r14,%rax), %rdi
cmpl $0x0, 0x274(%rbx)
je 0x2c02b
leaq 0xc9fc(%rip), %rsi      # 0x3880c
callq 0x8150
movq %r14, %rdi
callq 0x8090
movw $0x5b, (%r14,%rax)
incq %rax
jmp 0x2be3d
leaq 0xc9dc(%rip), %rsi      # 0x3880c
callq 0x8150
movq %r14, %rdi
callq 0x8090
addq %r14, %rax
leaq 0x9c(%rbx), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
movw $0x5d, 0x14(%rbx,%rax)
incq %rax
cmpb $0x0, 0x9c(%rbx)
je 0x2be84
cmpb $0x0, 0x104(%rbx)
je 0x2be84
movb $0x0, 0x2(%r14,%rax)
movw $0x202c, (%r14,%rax)    # imm = 0x202C
addq $0x2, %rax
movl 0x210(%rbx), %edx
leal -0x65(%rdx), %ecx
cmpl $0x61, %ecx
ja 0x2bf1e
addl $-0x64, %edx
movl %edx, 0x210(%rbx)
movl 0x24c(%rbx), %edx
addq %r14, %rax
movl %ecx, %ecx
testl %edx, %edx
je 0x2bf3d
cmpl $0x200, %edx            # imm = 0x200
jne 0x2bf4d
leaq 0xc9fb(%rip), %rdx      # 0x388c0
leaq (%rdx,%rcx,8), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
cmpl $0x0, 0x270(%rbx)
jne 0x2beef
cmpl $0x0, 0x274(%rbx)
je 0x2bfaf
movw $0x5b, 0x14(%rbx,%rax)
cmpl $0x0, 0x270(%rbx)
leaq 0x1(%r14,%rax), %rdi
je 0x2bfbb
movl 0x168(%rbx), %eax
leaq 0xc8eb(%rip), %rcx      # 0x38800
leaq (%rcx,%rax,4), %rsi
jmp 0x2bfc2
addq %r14, %rax
leaq 0x104(%rbx), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
jmp 0x2bff3
shlq $0x4, %rcx
leaq 0xc8f8(%rip), %rsi      # 0x38840
addq %rcx, %rsi
jmp 0x2bf58
leaq 0xc9ac(%rip), %rdx      # 0x38900
leaq (%rdx,%rcx,4), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
cmpl $0x0, 0x270(%rbx)
je 0x2bf8a
addq %r14, %rax
movl 0x168(%rbx), %ecx
leaq 0xc87f(%rip), %rdx      # 0x38800
leaq (%rdx,%rcx,4), %rsi
movq %rax, %rdi
jmp 0x2bfa2
leaq (%r14,%rax), %rdi
cmpl $0x0, 0x274(%rbx)
je 0x2c035
leaq 0xc86a(%rip), %rsi      # 0x3880c
callq 0x8150
movq %r14, %rdi
callq 0x8090
movw $0x5b, (%r14,%rax)
incq %rax
jmp 0x2bfcf
leaq 0xc84a(%rip), %rsi      # 0x3880c
callq 0x8150
movq %r14, %rdi
callq 0x8090
addq %r14, %rax
leaq 0x104(%rbx), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
movw $0x5d, 0x14(%rbx,%rax)
incq %rax
cmpl $0x0, 0x278(%rbx)
je 0x2c023
leaq (%r14,%rax), %rdi
addq $0x2, %rdi
movb $0x0, (%rdi)
movw $0x202c, -0x2(%rdi)     # imm = 0x202C
addq $0x16c, %rbx            # imm = 0x16C
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8150
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movw $0x5b, (%rdi)
jmp 0x2be24
movw $0x5b, (%rdi)
jmp 0x2bfb6