// File: /workspace/github_cpp_makefile_star2_O3/daniel5151[P]mips241/src/debug.cc
// Function: MIPS::Debugger::debugPrint()
void Debugger::debugPrint() {
  // "clear" screen
  cerr << string(100, '\n');

  print_stackRAM();
  print_progRAM();
  print_CPU();

  if (!watch.empty()) {
    cerr
      << endl
      << "     ADDR    |   HEXVAL   " << endl
      << "  -----------|------------" << endl;
    for (auto addr : watch) {
      cerr
        << "  "
        << toHex(addr)
        << " | "
        << toHex(ram.load(addr))
        << endl
        << endl;

    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x10(%rsp), %rdi
movl $0x64, %esi
movl $0xa, %edx
callq 0x3270
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x77f7(%rip), %rdi      # 0xcff0
callq 0x3250
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x581a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x5576
movq %rbx, %rdi
callq 0x5684
movq 0x77bf(%rip), %r14      # 0xcff0
leaq 0x39e3(%rip), %rsi      # 0x921b
movl $0x49, %edx
movq %r14, %rdi
callq 0x3250
movq %rbx, %rdi
callq 0x489a
cmpq $0x0, 0xa8(%rbx)
je 0x5a45
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3160
movq %rax, %r14
leaq 0x39d9(%rip), %rsi      # 0x9265
movl $0x1a, %edx
movq %rax, %rdi
callq 0x3250
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3160
movq %rax, %r14
leaq 0x39b6(%rip), %rsi      # 0x9280
movl $0x1a, %edx
movq %rax, %rdi
callq 0x3250
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3160
movq 0x98(%rbx), %r14
leaq 0x88(%rbx), %r13
cmpq %r13, %r14
je 0x5a45
movq 0x76d4(%rip), %r15      # 0xcff0
leaq 0x34(%rsp), %rbp
movl 0x20(%r14), %eax
movl %eax, 0xc(%rsp)
movl $0x2, %edx
movq %r15, %rdi
leaq 0x3801(%rip), %rsi      # 0x9139
callq 0x3250
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x6445
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r15, %rdi
callq 0x3250
movq %rax, %r12
movl $0x3, %edx
movq %rax, %rdi
leaq 0x37f9(%rip), %rsi      # 0x9169
callq 0x3250
movq 0x8(%rbx), %rdi
movl 0xc(%rsp), %esi
callq 0x837e
movl %eax, 0x34(%rsp)
leaq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x6445
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r12, %rdi
callq 0x3250
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31e0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3160
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31e0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3160
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x5a15
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5a31
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3200
movq %r14, %rdi
callq 0x3260
movq %rax, %r14
cmpq %r13, %rax
jne 0x5921
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5a5d
movq %rax, %rbx
jmp 0x5a9d
jmp 0x5a5d
movq %rax, %rbx
jmp 0x5a81
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x5a81
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5a9d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x33a0
nop