// File: Ciaxur[P]yagb-emu/src/Memory.cc
// Function: Memory::dump(std::ostream&)
void Memory::dump(std::ostream &out) {
  std::ios init(nullptr);
  init.copyfmt(out);
  out << std::hex << std::uppercase << std::setfill('0') << std::setw(4) << 0 << ": ";

  int j = 0;
  for (int i = 0; i < 0xFFFF; i++) {
    if (j == 16) {
      j = 0;
      out << "\n" << std::setw(4) << i << ": ";
    }
    j++;
    out << std::setw(2) << (int)memory[i] << (j == 8 ? "\t\t" : " ");
  }
  out.copyfmt(init);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x150(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x118(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0xd2d0
movq -0x148(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq (%rsi), %rax
movq -0x18(%rax), %rax
addq %rax, %rsi
callq 0xd2e0
jmp 0xbbe11
movq -0x10(%rbp), %rdi
leaq -0x7b3c(%rip), %rsi     # 0xb42e0
callq 0xdb40
movq %rax, -0x158(%rbp)
jmp 0xbbe2a
movq -0x158(%rbp), %rdi
leaq -0x7b88(%rip), %rsi     # 0xb42b0
callq 0xdb40
movq %rax, -0x160(%rbp)
jmp 0xbbe46
movl $0x30, %edi
callq 0xb4290
movb %al, -0x161(%rbp)
jmp 0xbbe58
movq -0x160(%rbp), %rdi
movb -0x161(%rbp), %al
movb %al, -0x125(%rbp)
movzbl -0x125(%rbp), %esi
callq 0xd6f0
movq %rax, -0x170(%rbp)
jmp 0xbbe80
movl $0x4, %edi
callq 0xb4310
movl %eax, -0x174(%rbp)
jmp 0xbbe92
movq -0x170(%rbp), %rdi
movl -0x174(%rbp), %eax
movl %eax, -0x12c(%rbp)
movl -0x12c(%rbp), %esi
callq 0xd530
movq %rax, -0x180(%rbp)
jmp 0xbbeb9
movq -0x180(%rbp), %rdi
xorl %esi, %esi
callq 0xd310
movq %rax, -0x188(%rbp)
jmp 0xbbed0
movq -0x188(%rbp), %rdi
leaq 0xb5de4(%rip), %rsi     # 0x171cc2
callq 0xd5c0
jmp 0xbbee5
movl $0x0, -0x130(%rbp)
movl $0x0, -0x134(%rbp)
cmpl $0xffff, -0x134(%rbp)   # imm = 0xFFFF
jge 0xbc080
cmpl $0x10, -0x130(%rbp)
jne 0xbbfc7
movl $0x0, -0x130(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xc2f99(%rip), %rsi     # 0x17eec4
callq 0xd5c0
movq %rax, -0x190(%rbp)
jmp 0xbbf39
movl $0x4, %edi
callq 0xb4310
movl %eax, -0x194(%rbp)
jmp 0xbbf4b
movq -0x190(%rbp), %rdi
movl -0x194(%rbp), %eax
movl %eax, -0x138(%rbp)
movl -0x138(%rbp), %esi
callq 0xd530
movq %rax, -0x1a0(%rbp)
jmp 0xbbf72
movq -0x1a0(%rbp), %rdi
movl -0x134(%rbp), %esi
callq 0xd310
movq %rax, -0x1a8(%rbp)
jmp 0xbbf8d
movq -0x1a8(%rbp), %rdi
leaq 0xb5d27(%rip), %rsi     # 0x171cc2
callq 0xd5c0
jmp 0xbbfa2
jmp 0xbbfc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x118(%rbp), %rdi
callq 0xd570
jmp 0xbc0b1
movl -0x130(%rbp), %eax
incl %eax
movl %eax, -0x130(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movl $0x2, %edi
callq 0xb4310
movl %eax, -0x1ac(%rbp)
jmp 0xbbff2
movq -0x1b8(%rbp), %rdi
movl -0x1ac(%rbp), %eax
movl %eax, -0x13c(%rbp)
movl -0x13c(%rbp), %esi
callq 0xd530
movq %rax, -0x1c0(%rbp)
jmp 0xbc019
movq -0x1c0(%rbp), %rdi
movq -0x150(%rbp), %rax
movslq -0x134(%rbp), %rcx
movzbl 0x20(%rax,%rcx), %esi
callq 0xd310
movq %rax, -0x1c8(%rbp)
jmp 0xbc041
movq -0x1c8(%rbp), %rdi
movl -0x130(%rbp), %eax
subl $0x8, %eax
leaq 0xb5eaf(%rip), %rax     # 0x171f07
leaq 0xba211(%rip), %rsi     # 0x176270
cmoveq %rax, %rsi
callq 0xd5c0
jmp 0xbc06a
jmp 0xbc06c
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0xbbef9
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
leaq -0x118(%rbp), %rsi
callq 0xd2e0
jmp 0xbc09c
leaq -0x118(%rbp), %rdi
callq 0xd570
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
movq -0x120(%rbp), %rdi
callq 0xd620
nopl (%rax)