// File: /workspace/github_c_makefile_star2_O1/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 $0x68, %rsp
movl %ecx, 0x24(%rsp)
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rsi
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x13ff0
movq (%rbx), %rax
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x151c6
leaq 0x2f5b(%rip), %rbx      # 0x17e9d
leaq 0x23e8(%rip), %r12      # 0x17331
movq 0x28(%rsp), %rdi
callq 0x98ea
cmpl 0x24(%rsp), %r15d
setae %cl
orb %cl, %al
jne 0x151c6
movl $0x6, %ecx
movq %rsp, %rdi
movl %r15d, %edx
callq 0x14066
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x5260
movl $0x2, %edx
movq %rax, %rdi
leaq 0x2cab(%rip), %rsi      # 0x17c3e
callq 0x5260
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x14fb3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5230
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movl %r15d, %ebp
andl $0xf, %ebp
je 0x1501f
xorl %r13d, %r13d
cmpl $0x8, %r13d
jne 0x14ff6
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5260
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x5430
movl $0x3, %edx
movq %r14, %rdi
leaq 0x2e96(%rip), %rsi      # 0x17e9b
callq 0x5260
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x5430
incl %r13d
cmpl %r13d, %ebp
jne 0x14fd5
jmp 0x15021
xorl %ebp, %ebp
movl %r15d, %eax
andl $-0x10, %eax
addl $0x10, %eax
movl %eax, 0x34(%rsp)
movq 0x28(%rsp), %rdi
callq 0x98ea
cmpl 0x24(%rsp), %r15d
setae %cl
orb %cl, %al
jne 0x15133
cmpl $0x8, %ebp
jne 0x15068
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5260
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x5430
movq 0x28(%rsp), %rdi
callq 0x999c
movl %eax, %r13d
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movl $0x2, %esi
leaq 0x38(%rsp), %rdi
movl $0x30, %edx
callq 0x5270
movzbl %r13b, %r13d
movl $0x4, %ecx
xorl %eax, %eax
movl %r13d, %edx
shrl %cl, %edx
andl $0xf, %edx
movb (%rdx,%r12), %dl
movq 0x38(%rsp), %rsi
movb %dl, (%rsi,%rax)
incq %rax
addl $-0x4, %ecx
cmpq $0x2, %rax
jne 0x1509e
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r14, %rdi
callq 0x5260
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5260
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x150fc
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5230
movl %r13d, %edi
callq 0x53f0
testl %eax, %eax
movl $0x2e, %eax
cmovel %eax, %r13d
movsbl %r13b, %esi
movq %rsp, %rdi
callq 0x51f0
incl %r15d
incl %ebp
cmpl $0x10, %ebp
jne 0x1502e
movl $0x10, %ebp
movl 0x34(%rsp), %r15d
cmpl $0xf, %ebp
ja 0x15153
addl $-0x10, %ebp
movl $0x3, %edx
movq %r14, %rdi
leaq 0x2d51(%rip), %rsi      # 0x17e9b
callq 0x5260
incl %ebp
jne 0x1513b
movl $0x2, %edx
movq %r14, %rdi
leaq 0x2d3d(%rip), %rsi      # 0x17e9f
callq 0x5260
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x5260
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x5210
movsbl %al, %esi
movq %r13, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5190
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x14f49
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5230
jmp 0x14f49
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x151d5
callq 0x6752
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x151e6
movq %rax, %rbx
jmp 0x15236
jmp 0x15218
jmp 0x15218
jmp 0x15218
jmp 0x15218
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x1521b
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5230
jmp 0x1521b
jmp 0x15218
jmp 0x15218
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x15236
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5230
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x15245
callq 0x6752
movq %rbx, %rdi
callq 0x53e0
nop