// File: /workspace/github_c_makefile_star2_O2/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 0x299ee
leaq 0x14(%rbx), %rdi
movl $0x20656e, 0x17(%rbx)   # imm = 0x20656E
movl $0x6e706572, 0x14(%rbx) # imm = 0x6E706572
callq 0x8090
jmp 0x299f0
xorl %eax, %eax
cmpb $0x1, 0x1e0(%rbx)
jne 0x29a0f
leaq 0x14(%rbx), %rdi
movb $0x0, 0x18(%rbx,%rax)
movl $0x20706572, 0x14(%rbx,%rax) # imm = 0x20706572
callq 0x8090
cmpb $0x1, 0x1dc(%rbx)
jne 0x29a30
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 0x8170
movq %r14, %rdi
callq 0x8090
cmpl $0x1, 0x27c(%rbx)
jne 0x29a80
xorl %ecx, %ecx
pushq $0xa
popq %rdx
subq %rax, %rdx
cmovaeq %rdx, %rcx
leaq (%r14,%rax), %rdi
shll $0x4, %ecx
leaq 0xcd00(%rip), %rsi      # 0x36770
addq %rcx, %rsi
callq 0x8170
movq %r14, %rdi
callq 0x8090
movl 0x210(%rbx), %ecx
decl %ecx
cmpl $0x61, %ecx
ja 0x29b0c
movl 0x24c(%rbx), %edx
addq %r14, %rax
movl %ecx, %ecx
testl %edx, %edx
je 0x29b2b
cmpl $0x200, %edx            # imm = 0x200
jne 0x29b3b
leaq 0xce2d(%rip), %rdx      # 0x368e0
leaq (%rdx,%rcx,8), %rsi
movq %rax, %rdi
callq 0x8170
movq %r14, %rdi
callq 0x8090
cmpl $0x0, 0x270(%rbx)
jne 0x29add
cmpl $0x0, 0x274(%rbx)
je 0x29b9d
movw $0x5b, 0x14(%rbx,%rax)
cmpl $0x0, 0x270(%rbx)
leaq 0x1(%r14,%rax), %rdi
je 0x29ba9
movl 0x100(%rbx), %eax
leaq 0xcd1d(%rip), %rcx      # 0x36820
leaq (%rcx,%rax,4), %rsi
jmp 0x29bb0
addq %r14, %rax
leaq 0x9c(%rbx), %rsi
movq %rax, %rdi
callq 0x8170
movq %r14, %rdi
callq 0x8090
jmp 0x29be1
shlq $0x4, %rcx
leaq 0xcd2a(%rip), %rsi      # 0x36860
addq %rcx, %rsi
jmp 0x29b46
leaq 0xcdde(%rip), %rdx      # 0x36920
leaq (%rdx,%rcx,4), %rsi
movq %rax, %rdi
callq 0x8170
movq %r14, %rdi
callq 0x8090
cmpl $0x0, 0x270(%rbx)
je 0x29b78
addq %r14, %rax
movl 0x100(%rbx), %ecx
leaq 0xccb1(%rip), %rdx      # 0x36820
leaq (%rdx,%rcx,4), %rsi
movq %rax, %rdi
jmp 0x29b90
leaq (%r14,%rax), %rdi
cmpl $0x0, 0x274(%rbx)
je 0x29dab
leaq 0xcc9c(%rip), %rsi      # 0x3682c
callq 0x8170
movq %r14, %rdi
callq 0x8090
movw $0x5b, (%r14,%rax)
incq %rax
jmp 0x29bbd
leaq 0xcc7c(%rip), %rsi      # 0x3682c
callq 0x8170
movq %r14, %rdi
callq 0x8090
addq %r14, %rax
leaq 0x9c(%rbx), %rsi
movq %rax, %rdi
callq 0x8170
movq %r14, %rdi
callq 0x8090
movw $0x5d, 0x14(%rbx,%rax)
incq %rax
cmpb $0x0, 0x9c(%rbx)
je 0x29c04
cmpb $0x0, 0x104(%rbx)
je 0x29c04
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 0x29c9e
addl $-0x64, %edx
movl %edx, 0x210(%rbx)
movl 0x24c(%rbx), %edx
addq %r14, %rax
movl %ecx, %ecx
testl %edx, %edx
je 0x29cbd
cmpl $0x200, %edx            # imm = 0x200
jne 0x29ccd
leaq 0xcc9b(%rip), %rdx      # 0x368e0
leaq (%rdx,%rcx,8), %rsi
movq %rax, %rdi
callq 0x8170
movq %r14, %rdi
callq 0x8090
cmpl $0x0, 0x270(%rbx)
jne 0x29c6f
cmpl $0x0, 0x274(%rbx)
je 0x29d2f
movw $0x5b, 0x14(%rbx,%rax)
cmpl $0x0, 0x270(%rbx)
leaq 0x1(%r14,%rax), %rdi
je 0x29d3b
movl 0x168(%rbx), %eax
leaq 0xcb8b(%rip), %rcx      # 0x36820
leaq (%rcx,%rax,4), %rsi
jmp 0x29d42
addq %r14, %rax
leaq 0x104(%rbx), %rsi
movq %rax, %rdi
callq 0x8170
movq %r14, %rdi
callq 0x8090
jmp 0x29d73
shlq $0x4, %rcx
leaq 0xcb98(%rip), %rsi      # 0x36860
addq %rcx, %rsi
jmp 0x29cd8
leaq 0xcc4c(%rip), %rdx      # 0x36920
leaq (%rdx,%rcx,4), %rsi
movq %rax, %rdi
callq 0x8170
movq %r14, %rdi
callq 0x8090
cmpl $0x0, 0x270(%rbx)
je 0x29d0a
addq %r14, %rax
movl 0x168(%rbx), %ecx
leaq 0xcb1f(%rip), %rdx      # 0x36820
leaq (%rdx,%rcx,4), %rsi
movq %rax, %rdi
jmp 0x29d22
leaq (%r14,%rax), %rdi
cmpl $0x0, 0x274(%rbx)
je 0x29db5
leaq 0xcb0a(%rip), %rsi      # 0x3682c
callq 0x8170
movq %r14, %rdi
callq 0x8090
movw $0x5b, (%r14,%rax)
incq %rax
jmp 0x29d4f
leaq 0xcaea(%rip), %rsi      # 0x3682c
callq 0x8170
movq %r14, %rdi
callq 0x8090
addq %r14, %rax
leaq 0x104(%rbx), %rsi
movq %rax, %rdi
callq 0x8170
movq %r14, %rdi
callq 0x8090
movw $0x5d, 0x14(%rbx,%rax)
incq %rax
cmpl $0x0, 0x278(%rbx)
je 0x29da3
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 0x8170
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movw $0x5b, (%rdi)
jmp 0x29ba4
movw $0x5b, (%rdi)
jmp 0x29d36