// File: /workspace/github_c_makefile_star2_O2/mrkite[P]regs/src/scanner.cc
// Function: Scanner::dumpHex(std::ostream&, unsigned int, unsigned int)
void Scanner::dumpHex(std::ostream &f, uint32_t from, uint32_t to) {
  auto ptr = getAddress(from);
  if (ptr != nullptr) {
    for (int i = 0; !ptr->eof() && from < to; i += 16) {
      f << hex(from, 6) << ": ";
      std::string ascii;
      int skip = from & 0xf;
      int j = 0;
      for (; j < skip; j++) {
        if (j == 8) {
          f << " ";
          ascii += " ";
        }
        f << "   ";
        ascii += " ";
      }
      for (; j < 16 && !ptr->eof() && from < to; j++) {
        if (j == 8) {
          f << " ";
          ascii += " ";
        }
        uint8_t ch = ptr->r8();
        f << hex(ch, 2) << " ";
        ascii += isprint(ch) ? static_cast<char>(ch) : '.';
        from++;
      }
      for (; j < 16; j++) {
        f << "   ";
      }
      f << "| " << ascii << std::endl;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %ecx, 0x4(%rsp)
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rsi
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x110dc
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x11d7b
movl %ebp, (%rsp)
leaq 0x18(%rsp), %r12
leaq 0x38(%rsp), %rbx
callq 0x88b4
movl (%rsp), %edx
cmpl 0x4(%rsp), %edx
setae %cl
orb %cl, %al
jne 0x11d7b
movq %r12, %rdi
pushq $0x6
popq %rcx
callq 0x11136
movq %r12, %rsi
movq %rbx, %r13
movq %r14, %rdi
callq 0x51f0
movq %rax, %rdi
leaq 0x302c(%rip), %rsi      # 0x14c3e
callq 0x5200
movq %r12, %rdi
callq 0x5140
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
andq $0x0, 0x20(%rsp)
movb $0x0, 0x28(%rsp)
movl (%rsp), %ebp
andl $0xf, %ebp
xorl %ebx, %ebx
cmpl %ebx, %ebp
je 0x11d0b
cmpl $0x8, %ebx
jne 0x11c67
movq %r14, %rdi
leaq 0x324a(%rip), %rsi      # 0x14e9d
callq 0x5200
movq %r12, %rdi
leaq 0x323b(%rip), %rsi      # 0x14e9d
callq 0x5410
movq %r14, %rdi
leaq 0x322a(%rip), %rsi      # 0x14e9b
callq 0x5200
movq %r12, %rdi
leaq 0x321d(%rip), %rsi      # 0x14e9d
callq 0x5410
incl %ebx
jmp 0x11c3c
cmpl $0x8, %ebp
jne 0x11cac
movq %r14, %rdi
leaq 0x3205(%rip), %rsi      # 0x14e9d
callq 0x5200
movq %r12, %rdi
leaq 0x31f6(%rip), %rsi      # 0x14e9d
callq 0x5410
movq 0x8(%rsp), %rdi
callq 0x8966
movzbl %al, %ebx
movq %r13, %r15
movq %r13, %rdi
movl %ebx, %edx
pushq $0x2
popq %rcx
callq 0x11136
movq %r14, %rdi
movq %r15, %rsi
callq 0x51f0
movq %rax, %rdi
leaq 0x31bf(%rip), %rsi      # 0x14e9d
callq 0x5200
movq %r13, %rdi
callq 0x5140
movl %ebx, %edi
callq 0x53d0
pushq $0x2e
popq %rcx
testl %eax, %eax
je 0x11cfb
movl %ebx, %ecx
movsbl %cl, %esi
movq %r12, %rdi
callq 0x51d0
incl (%rsp)
incl %ebp
movq %r13, %rbx
cmpl $0x10, %ebp
je 0x11d42
movq 0x8(%rsp), %rdi
callq 0x88b4
movl (%rsp), %ecx
cmpl 0x4(%rsp), %ecx
setae %cl
orb %cl, %al
je 0x11c89
jmp 0x11d42
movq %r14, %rdi
leaq 0x3160(%rip), %rsi      # 0x14e9b
callq 0x5200
incl %ebp
cmpl $0xf, %ebp
jbe 0x11d31
movq %r14, %rdi
leaq 0x314e(%rip), %rsi      # 0x14e9f
callq 0x5200
movq %rax, %rdi
movq %r12, %rsi
callq 0x51f0
movq %rax, %rdi
callq 0x5150
movq %r12, %rdi
callq 0x5140
movq 0x8(%rsp), %rdi
jmp 0x11bd8
leaq 0x10(%rsp), %rdi
callq 0x61e4
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11d96
movq %rax, %rbx
jmp 0x11dc3
jmp 0x11db6
jmp 0x11db6
jmp 0x11db6
jmp 0x11db6
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5140
jmp 0x11db9
jmp 0x11db6
jmp 0x11db6
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x5140
leaq 0x10(%rsp), %rdi
callq 0x61e4
movq %rbx, %rdi
callq 0x53c0
nop