// File: /workspace/github_cpp_makefile_star2_O2/NGageMegaman[P]NEScutre/src/cpu.cpp
// Function: Cpu::debug_dump(unsigned char)
void Cpu::debug_dump(uint8_t inst) {
    cout << "INSTRUCCION" << std::hex << (int) inst << endl;
    cout << "regA =  " << std::hex << (unsigned) regA << endl;
    cout << "regX =  " << std::hex << (unsigned) regX << endl;
    cout << "regY =  " << std::hex << (unsigned) regY << endl;
    cout << "regPC = " << std::hex << (unsigned) regPC << endl;
    cout << "regSP = " << std::hex << (unsigned) regSP << endl;
    cout << "regP =" << endl;
    cout << "    C = " << regP.C;
    cout << "    Z = " << regP.Z;
    cout << "    I = " << regP.I;
    cout << "    D = " << regP.D;
    cout << "    B = " << regP.B;
    cout << "    V = " << regP.V;
    cout << "    N = " << regP.N << endl;
    cout << "cycles = " << clock->cycles << endl;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x4724(%rip), %r14      # 0x6fd8
leaq 0x1c01(%rip), %rsi      # 0x44bc
movq %r14, %rdi
callq 0x1110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x11b0
movq %rax, %rdi
callq 0x1080
leaq 0x1bd7(%rip), %rsi      # 0x44c8
movq %r14, %rdi
callq 0x1110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movzbl 0x10020(%rbx), %esi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
callq 0x1080
leaq 0x1ba5(%rip), %rsi      # 0x44d1
movq %r14, %rdi
callq 0x1110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movzbl 0x10021(%rbx), %esi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
callq 0x1080
leaq 0x1b73(%rip), %rsi      # 0x44da
movq %r14, %rdi
callq 0x1110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movzbl 0x10022(%rbx), %esi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
callq 0x1080
leaq 0x1b41(%rip), %rsi      # 0x44e3
movq %r14, %rdi
callq 0x1110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movzwl 0x10024(%rbx), %esi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
callq 0x1080
leaq 0x1b0f(%rip), %rsi      # 0x44ec
movq %r14, %rdi
callq 0x1110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movzwl 0x10026(%rbx), %esi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
callq 0x1080
leaq 0x1add(%rip), %rsi      # 0x44f5
movq %r14, %rdi
callq 0x1110
movq %rax, %rdi
callq 0x1080
leaq 0x1acd(%rip), %rsi      # 0x44fc
movq %r14, %rdi
callq 0x1110
movzbl 0x10028(%rbx), %esi
movq %rax, %rdi
callq 0x11a0
leaq 0x1ab8(%rip), %rsi      # 0x4505
movq %r14, %rdi
callq 0x1110
movzbl 0x10029(%rbx), %esi
movq %rax, %rdi
callq 0x11a0
leaq 0x1aa3(%rip), %rsi      # 0x450e
movq %r14, %rdi
callq 0x1110
movzbl 0x1002a(%rbx), %esi
movq %rax, %rdi
callq 0x11a0
leaq 0x1a8e(%rip), %rsi      # 0x4517
movq %r14, %rdi
callq 0x1110
movzbl 0x1002b(%rbx), %esi
movq %rax, %rdi
callq 0x11a0
leaq 0x1a79(%rip), %rsi      # 0x4520
movq %r14, %rdi
callq 0x1110
movzbl 0x1002c(%rbx), %esi
movq %rax, %rdi
callq 0x11a0
leaq 0x1a64(%rip), %rsi      # 0x4529
movq %r14, %rdi
callq 0x1110
movzbl 0x1002d(%rbx), %esi
movq %rax, %rdi
callq 0x11a0
leaq 0x1a4f(%rip), %rsi      # 0x4532
movq %r14, %rdi
callq 0x1110
movzbl 0x1002e(%rbx), %esi
movq %rax, %rdi
callq 0x11a0
movq %rax, %rdi
callq 0x1080
leaq 0x1a32(%rip), %rsi      # 0x453b
movq %r14, %rdi
callq 0x1110
movq (%rbx), %rcx
movl (%rcx), %esi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1080
nop