// File: /workspace/github_cpp_makefile_star2_O1/khedoros[P]khednes/util.cpp
// Function: util::inst_string[abi:cxx11](int, int, int)
std::string util::inst_string(int byte0, int byte1, int byte2) {
    std::string inst = "";
    if(byte0 >= 0 && byte0 < 256) {
        inst = inst_names[byte0];
    }
    else {
        return std::string("Opcode out of range");
    }
    std::stringstream ss;
    ss<<std::hex;
    switch(inst_types[byte0]) {
        case inv: //invalid operation
            return std::string("Unofficial/invalid opcode");
        //Fall-through for types that don't show any arguments
        case acc: //accumulator
        case imp: //implied
            break;
        case imm: //immediate
            ss<<" #$"<<std::setfill('0')<<std::setw(2)<<byte1;
            break;
        case zpa: //zero-page absolute
            ss<<" $"<<std::setfill('0')<<std::setw(2)<<byte1;
            break;
        case rel: //relative
            ss<<" $"<<std::setfill('0')<<std::setw(2)<<byte1;
            break;
        case abso: //absolute
            ss<<" $"<<std::setfill('0')<<std::setw(2)<<byte2<<std::setfill('0')<<std::setw(2)<<byte1;
            break;
        case absx://absolute, x-indexed
            ss<<" $"<<std::setfill('0')<<std::setw(2)<<byte2<<std::setfill('0')<<std::setw(2)<<byte1<<", X";
            break;
        case absy://absolute, y-indexed
            ss<<" $"<<std::setfill('0')<<std::setw(2)<<byte2<<std::setfill('0')<<std::setw(2)<<byte1<<", Y";
            break;
        case zpx: //zero-page absolute, x-indexed
            ss<<" $"<<std::setfill('0')<<std::setw(2)<<byte1<<", X";
            break;
        case zpy: //zero-page absolute, y-indexed
            ss<<" $"<<std::setfill('0')<<std::setw(2)<<byte1<<", Y";
            break;
        case ind: //indirect
            ss<<" ($"<<std::setfill('0')<<std::setw(2)<<byte2<<std::setfill('0')<<std::setw(2)<<byte1<<")";
            break;
        case zpix://zero-page indirect, x-pre-indexed
            ss<<" ($"<<std::setfill('0')<<std::setw(2)<<byte1<<",X)";
            break;
        case zpiy: //zero-page indirect, y-post-indexed
            ss<<" ($"<<std::setfill('0')<<std::setw(2)<<byte1<<"), Y";
            break;
        default:
            break;
            return std::string("Don't know how you got here.");
    }
    return inst + ss.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movl %ecx, %r15d
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x4113(%rip), %rdx      # 0x14139
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x8dac
cmpl $0xff, %r14d
ja 0x100c7
movl %r14d, %r14d
movq %r14, %rax
shlq $0x5, %rax
leaq 0xc4a1(%rip), %rsi      # 0x1c4f0
addq %rax, %rsi
movq %rsp, %rdi
callq 0x4210
leaq 0x40(%rsp), %rdi
callq 0x42a0
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x68(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x68(%rsp,%rax)
leaq 0x56ae(%rip), %rax      # 0x15730
movl (%rax,%r14,4), %eax
cmpq $0xd, %rax
ja 0x10677
leaq 0x50(%rsp), %r14
leaq 0x5654(%rip), %rcx      # 0x156f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5b45(%rip), %rsi      # 0x15bf8
leaq 0x5b57(%rip), %rdx      # 0x15c11
movq %rbx, %rdi
callq 0x8dac
jmp 0x106ef
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5b0f(%rip), %rsi      # 0x15be4
leaq 0x5b1b(%rip), %rdx      # 0x15bf7
movq %rbx, %rdi
callq 0x8dac
jmp 0x1070d
leaq 0x5b2d(%rip), %rsi      # 0x15c1d
movl $0x3, %edx
movq %r14, %rdi
callq 0x4410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0x131(%rsp,%rax)
jne 0x10130
movq %r15, %rdi
movl $0x20, %esi
callq 0x4390
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x30, 0xe0(%r15)
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x60(%rsp,%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x45e0
movl $0x3, %edx
leaq 0x5ac1(%rip), %rsi      # 0x15c21
jmp 0x1066f
leaq 0x5aaa(%rip), %rsi      # 0x15c16
movl $0x2, %edx
movq %r14, %rdi
callq 0x4410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r12
cmpb $0x0, 0x131(%rsp,%rax)
jne 0x101ae
movq %r12, %rdi
movl $0x20, %esi
callq 0x4390
movb %al, 0xe0(%r12)
movb $0x1, 0xe1(%r12)
movb $0x30, 0xe0(%r12)
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x60(%rsp,%rax)
movq %r14, %rdi
movl %r15d, %esi
callq 0x45e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rax
movq %r14, %r15
addq %rax, %r15
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x104fd
movq %r15, %rdi
movl $0x20, %esi
callq 0x4390
jmp 0x104ee
leaq 0x5a0a(%rip), %rsi      # 0x15c16
movl $0x2, %edx
movq %r14, %rdi
callq 0x4410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r12
cmpb $0x0, 0x131(%rsp,%rax)
jne 0x1024e
movq %r12, %rdi
movl $0x20, %esi
callq 0x4390
movb %al, 0xe0(%r12)
movb $0x1, 0xe1(%r12)
movb $0x30, 0xe0(%r12)
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x60(%rsp,%rax)
movq %r14, %rdi
movl %r15d, %esi
callq 0x45e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rax
movq %r14, %r15
addq %rax, %r15
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x10449
movq %r15, %rdi
movl $0x20, %esi
callq 0x4390
jmp 0x1043a
leaq 0x5971(%rip), %rsi      # 0x15c1d
movl $0x3, %edx
movq %r14, %rdi
callq 0x4410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0x131(%rsp,%rax)
jne 0x102ec
movq %r15, %rdi
movl $0x20, %esi
callq 0x4390
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x30, 0xe0(%r15)
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x60(%rsp,%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x45e0
movl $0x4, %edx
leaq 0x5909(%rip), %rsi      # 0x15c25
jmp 0x1066f
leaq 0x58ea(%rip), %rsi      # 0x15c12
movl $0x3, %edx
movq %r14, %rdi
callq 0x4410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0x131(%rsp,%rax)
jne 0x104fd
movq %r15, %rdi
movl $0x20, %esi
callq 0x4390
jmp 0x104ee
leaq 0x58ad(%rip), %rsi      # 0x15c16
movl $0x2, %edx
movq %r14, %rdi
callq 0x4410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r12
cmpb $0x0, 0x131(%rsp,%rax)
jne 0x103ab
movq %r12, %rdi
movl $0x20, %esi
callq 0x4390
movb %al, 0xe0(%r12)
movb $0x1, 0xe1(%r12)
movb $0x30, 0xe0(%r12)
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x60(%rsp,%rax)
movq %r14, %rdi
movl %r15d, %esi
callq 0x45e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rax
movq %r14, %r15
addq %rax, %r15
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x10641
movq %r15, %rdi
movl $0x20, %esi
callq 0x4390
jmp 0x10632
leaq 0x580d(%rip), %rsi      # 0x15c16
movl $0x2, %edx
movq %r14, %rdi
callq 0x4410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0x131(%rsp,%rax)
jne 0x10449
movq %r15, %rdi
movl $0x20, %esi
callq 0x4390
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x30, 0xe0(%r15)
movq (%r14), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x10(%r14,%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x45e0
movl $0x3, %edx
leaq 0x57a2(%rip), %rsi      # 0x15c19
jmp 0x1066f
leaq 0x5793(%rip), %rsi      # 0x15c16
movl $0x2, %edx
movq %r14, %rdi
callq 0x4410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0x131(%rsp,%rax)
jne 0x104fd
movq %r15, %rdi
movl $0x20, %esi
callq 0x4390
jmp 0x104ee
leaq 0x5759(%rip), %rsi      # 0x15c16
movl $0x2, %edx
movq %r14, %rdi
callq 0x4410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0x131(%rsp,%rax)
jne 0x104fd
movq %r15, %rdi
movl $0x20, %esi
callq 0x4390
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x30, 0xe0(%r15)
movq (%r14), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x10(%r14,%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x45e0
jmp 0x10677
leaq 0x56f2(%rip), %rsi      # 0x15c1d
movl $0x3, %edx
movq %r14, %rdi
callq 0x4410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r12
cmpb $0x0, 0x131(%rsp,%rax)
jne 0x1056d
movq %r12, %rdi
movl $0x20, %esi
callq 0x4390
movb %al, 0xe0(%r12)
movb $0x1, 0xe1(%r12)
movb $0x30, 0xe0(%r12)
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x60(%rsp,%rax)
movq %r14, %rdi
movl %r15d, %esi
callq 0x45e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rax
movq %r14, %r15
addq %rax, %r15
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x105ca
movq %r15, %rdi
movl $0x20, %esi
callq 0x4390
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x30, 0xe0(%r15)
movq (%r14), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x10(%r14,%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x45e0
movl $0x1, %edx
leaq 0x4eaa(%rip), %rsi      # 0x154a2
jmp 0x1066f
leaq 0x5615(%rip), %rsi      # 0x15c16
movl $0x2, %edx
movq %r14, %rdi
callq 0x4410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0x131(%rsp,%rax)
jne 0x10641
movq %r15, %rdi
movl $0x20, %esi
callq 0x4390
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x30, 0xe0(%r15)
movq (%r14), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x10(%r14,%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x45e0
movl $0x3, %edx
leaq 0x55b7(%rip), %rsi      # 0x15c26
movq %rax, %rdi
callq 0x4410
leaq 0x58(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x4560
movq (%rsp), %rcx
movq 0x8(%rsp), %r8
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x43f0
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x106bf
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x106c5
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x106ef
callq 0x4380
movq 0xb892(%rip), %rsi      # 0x1bf88
leaq 0x40(%rsp), %rdi
callq 0x42e0
leaq 0xc0(%rsp), %rdi
callq 0x4140
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x1071b
callq 0x4380
movq %rbx, %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10755
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10758
callq 0x4380
jmp 0x10758
jmp 0x10755
jmp 0x10750
jmp 0x10750
movq %rax, %rbx
jmp 0x10776
movq %rax, %rbx
movq 0xb829(%rip), %rsi      # 0x1bf88
leaq 0x40(%rsp), %rdi
callq 0x42e0
leaq 0xc0(%rsp), %rdi
callq 0x4140
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x10784
callq 0x4380
movq %rbx, %rdi
callq 0x4610