// File: daniel5151[P]mips241/src/debug.cc
// Function: MIPS::Debugger::printRAMFrom(unsigned int, int)
void Debugger::printRAMFrom(uint32_t addr, int n) {
  cerr
    << "     ADDR    |   HEXVAL   :     MIPS ASM    " << endl
    << "  -----------|------------------------------" << endl;

  while (n > 0) {
    cerr
      << ( (higlight.count(addr) != 0) ? higlight[addr] : ' ') << " "
      << toHex(addr)
      << " | "
      << toHex(ram.load(addr))
      << " : "
      << disasm(ram.load(addr))
      << endl;

    addr += 4;
    n--;
  }

  cerr << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq 0x10f59(%rip), %rdi     # 0x16ff0
leaq 0xa005(%rip), %rsi      # 0x100a3
callq 0x3250
movq %rax, %rdi
movq 0x10efb(%rip), %rsi     # 0x16fa8
callq 0x32a0
movq %rax, %rdi
leaq 0xa014(%rip), %rsi      # 0x100d0
callq 0x3250
movq %rax, %rdi
movq 0x10edd(%rip), %rsi     # 0x16fa8
callq 0x32a0
cmpl $0x0, -0x10(%rbp)
jle 0x62d8
movq -0x90(%rbp), %rdi
addq $0x18, %rdi
leaq -0xc(%rbp), %rsi
callq 0x8170
cmpq $0x0, %rax
je 0x6112
movq -0x90(%rbp), %rdi
addq $0x18, %rdi
leaq -0xc(%rbp), %rsi
callq 0x81d0
movb (%rax), %al
movb %al, -0x91(%rbp)
jmp 0x611c
movb $0x20, %al
movb %al, -0x91(%rbp)
jmp 0x611c
movb -0x91(%rbp), %al
movsbl %al, %esi
movq 0x10ec4(%rip), %rdi     # 0x16ff0
callq 0x3330
movq %rax, %rdi
leaq 0x9f93(%rip), %rsi      # 0x100ce
callq 0x3250
movq %rax, -0xb0(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
leaq -0xc(%rbp), %rsi
callq 0x82b0
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0x3220
movq %rax, -0xa0(%rbp)
jmp 0x6177
movq -0xa0(%rbp), %rdi
leaq 0x9f78(%rip), %rsi      # 0x100fd
callq 0x3250
movq %rax, -0xb8(%rbp)
jmp 0x6193
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0xc(%rbp), %esi
callq 0xd9e0
movl %eax, -0xbc(%rbp)
jmp 0x61ae
movl -0xbc(%rbp), %eax
movl %eax, -0x64(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x64(%rbp), %rsi
callq 0x82b0
jmp 0x61c6
movq -0xb8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3220
movq %rax, -0xc8(%rbp)
jmp 0x61df
movq -0xc8(%rbp), %rdi
leaq 0xa5c0(%rip), %rsi      # 0x107ad
callq 0x3250
movq %rax, -0xd0(%rbp)
jmp 0x61fb
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0xc(%rbp), %esi
callq 0xd9e0
movl %eax, -0xd4(%rbp)
jmp 0x6216
movl -0xd4(%rbp), %esi
leaq -0x88(%rbp), %rdi
callq 0xbf00
jmp 0x622a
movq -0xd0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3220
movq %rax, -0xe0(%rbp)
jmp 0x6246
movq -0xe0(%rbp), %rdi
movq 0x10d54(%rip), %rsi     # 0x16fa8
callq 0x32a0
jmp 0x625b
leaq -0x88(%rbp), %rdi
callq 0x3528
leaq -0x60(%rbp), %rdi
callq 0x3528
leaq -0x30(%rbp), %rdi
callq 0x3528
movl -0xc(%rbp), %eax
addl $0x4, %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x60d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x62cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x62c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x3528
leaq -0x60(%rbp), %rdi
callq 0x3528
leaq -0x30(%rbp), %rdi
callq 0x3528
jmp 0x62f4
movq 0x10d11(%rip), %rdi     # 0x16ff0
movq 0x10cc2(%rip), %rsi     # 0x16fa8
callq 0x32a0
addq $0xe0, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x34c0
nopl (%rax)