// File: /workspace/github_c_makefile_star2_O1/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 0x2c40b
leaq 0x14(%rbx), %rdi
movl $0x20656e, 0x17(%rbx)   # imm = 0x20656E
movl $0x6e706572, 0x14(%rbx) # imm = 0x6E706572
callq 0x8090
jmp 0x2c40d
xorl %eax, %eax
cmpb $0x1, 0x1e0(%rbx)
jne 0x2c42c
leaq 0x14(%rbx), %rdi
movb $0x0, 0x18(%rbx,%rax)
movl $0x20706572, 0x14(%rbx,%rax) # imm = 0x20706572
callq 0x8090
cmpb $0x1, 0x1dc(%rbx)
jne 0x2c44d
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 0x2c49f
xorl %ecx, %ecx
movl $0xa, %edx
subq %rax, %rdx
cmovaeq %rdx, %rcx
leaq (%r14,%rax), %rdi
shll $0x4, %ecx
leaq 0xc2c1(%rip), %rsi      # 0x38750
addq %rcx, %rsi
callq 0x8150
movq %r14, %rdi
callq 0x8090
movl 0x210(%rbx), %ecx
decl %ecx
cmpl $0x61, %ecx
ja 0x2c529
movl 0x24c(%rbx), %edx
addq %r14, %rax
testl %edx, %edx
je 0x2c548
cmpl $0x200, %edx            # imm = 0x200
jne 0x2c558
leaq 0xc3f0(%rip), %rdx      # 0x388c0
leaq (%rdx,%rcx,8), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
cmpl $0x0, 0x270(%rbx)
jne 0x2c4fa
cmpl $0x0, 0x274(%rbx)
je 0x2c5a1
movw $0x5b, 0x14(%rbx,%rax)
cmpl $0x0, 0x270(%rbx)
leaq 0x1(%r14,%rax), %rdi
je 0x2c5c6
movl 0x100(%rbx), %eax
leaq 0xc2e0(%rip), %rcx      # 0x38800
leaq (%rcx,%rax,4), %rsi
jmp 0x2c5cd
addq %r14, %rax
leaq 0x9c(%rbx), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
jmp 0x2c5fe
shlq $0x4, %rcx
leaq 0xc2ed(%rip), %rsi      # 0x38840
addq %rcx, %rsi
jmp 0x2c563
leaq 0xc3a1(%rip), %rdx      # 0x38900
leaq (%rdx,%rcx,4), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
movl 0x270(%rbx), %ecx
testl %ecx, %ecx
je 0x2c5ad
addq %r14, %rax
movl 0x100(%rbx), %ecx
leaq 0xc273(%rip), %rdx      # 0x38800
leaq (%rdx,%rcx,4), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
movw $0x5b, (%r14,%rax)
incq %rax
jmp 0x2c5da
cmpl $0x0, 0x274(%rbx)
je 0x2c5a1
testl %ecx, %ecx
jne 0x2c57d
addq %r14, %rax
leaq 0xc248(%rip), %rsi      # 0x3880c
jmp 0x2c591
leaq 0xc23f(%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 0x2c621
cmpb $0x0, 0x104(%rbx)
je 0x2c621
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 0x2c6b9
addl $-0x64, %edx
movl %edx, 0x210(%rbx)
movl 0x24c(%rbx), %edx
addq %r14, %rax
testl %edx, %edx
je 0x2c6d8
cmpl $0x200, %edx            # imm = 0x200
jne 0x2c6e8
leaq 0xc260(%rip), %rdx      # 0x388c0
leaq (%rdx,%rcx,8), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
cmpl $0x0, 0x270(%rbx)
jne 0x2c68a
cmpl $0x0, 0x274(%rbx)
je 0x2c731
movw $0x5b, 0x14(%rbx,%rax)
cmpl $0x0, 0x270(%rbx)
leaq 0x1(%r14,%rax), %rdi
je 0x2c756
movl 0x168(%rbx), %eax
leaq 0xc150(%rip), %rcx      # 0x38800
leaq (%rcx,%rax,4), %rsi
jmp 0x2c75d
addq %r14, %rax
leaq 0x104(%rbx), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
jmp 0x2c78e
shlq $0x4, %rcx
leaq 0xc15d(%rip), %rsi      # 0x38840
addq %rcx, %rsi
jmp 0x2c6f3
leaq 0xc211(%rip), %rdx      # 0x38900
leaq (%rdx,%rcx,4), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
movl 0x270(%rbx), %ecx
testl %ecx, %ecx
je 0x2c73d
addq %r14, %rax
movl 0x168(%rbx), %ecx
leaq 0xc0e3(%rip), %rdx      # 0x38800
leaq (%rdx,%rcx,4), %rsi
movq %rax, %rdi
callq 0x8150
movq %r14, %rdi
callq 0x8090
movw $0x5b, (%r14,%rax)
incq %rax
jmp 0x2c76a
cmpl $0x0, 0x274(%rbx)
je 0x2c731
testl %ecx, %ecx
jne 0x2c70d
addq %r14, %rax
leaq 0xc0b8(%rip), %rsi      # 0x3880c
jmp 0x2c721
leaq 0xc0af(%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 0x2c7be
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