// File: /workspace/github_c_makefile_star2_O1/mrkite[P]regs/src/disasm.cc
// Function: Disassembler::hex[abi:cxx11](unsigned int, int)
std::string Disassembler::hex(uint32_t val, int width) {
  static const char *digits = "0123456789abcdef";
  std::string ret;
  if (width == 6) {
    ret = symbols[val];
    if (!ret.empty()) {
      return ret;
    }
    ret = "$00/0000";
    for (size_t i = 0, j = 5 << 2; i < 6; i++, j -= 4) {
      ret[i < 2 ? i + 1 : i + 2] = digits[(val >> j) & 0xf];
    }
    return ret;
  }
  ret = "$";
  std::string h(width, '0');
  for (int i = 0, j = (width - 1) << 2; i < width; i++, j -= 4) {
    h[i] = digits[(val >> j) & 0xf];
  }
  return ret + h;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movl %edx, 0x4(%rsp)
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
cmpl $0x6, %ecx
jne 0xd90d
leaq 0x4(%rsp), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0xa9ae
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x5170
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0xd9b3
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rcx
cmpq %r15, %rcx
je 0xda2b
movq %rcx, (%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0xda32
movl %ecx, %r14d
leaq 0xa30e(%rip), %rcx      # 0x17c25
leaq 0x8(%rsp), %rdi
movl $0x1, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x5360
movslq %r14d, %rsi
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x28(%rsp), %rdi
movl $0x30, %edx
callq 0x5270
testl %r14d, %r14d
jle 0xd981
movl %r14d, %eax
leal -0x4(,%r14,4), %ecx
xorl %edx, %edx
leaq 0x99d1(%rip), %rsi      # 0x17331
movl 0x4(%rsp), %edi
shrl %cl, %edi
andl $0xf, %edi
movb (%rdi,%rsi), %dil
movq 0x28(%rsp), %r8
movb %dil, (%r8,%rdx)
incq %rdx
addl $-0x4, %ecx
cmpq %rdx, %rax
jne 0xd960
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0xf22d
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0xda5b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5230
jmp 0xda5b
leaq 0x9988(%rip), %rcx      # 0x17342
leaq 0x8(%rsp), %rdi
movl $0x8, %r8d
xorl %esi, %esi
callq 0x5360
movl $0x14, %ecx
xorl %edx, %edx
leaq 0x9957(%rip), %rax      # 0x17331
movl 0x4(%rsp), %esi
shrl %cl, %esi
andl $0xf, %esi
movb (%rsi,%rax), %sil
leaq 0x2(%rdx), %rdi
cmpq $0x2, %rdx
leaq 0x1(%rdx), %r8
cmovbq %r8, %rdi
movq 0x8(%rsp), %rdx
movb %sil, (%rdx,%rdi)
addl $-0x4, %ecx
movq %r8, %rdx
cmpq $0x6, %r8
jne 0xd9da
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rcx
cmpq %r15, %rcx
je 0xda38
movq %rcx, (%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0xda3f
movups (%r15), %xmm0
movups %xmm0, (%rax)
movq %rdx, 0x8(%rbx)
jmp 0xda48
movups (%r15), %xmm0
movups %xmm0, (%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r15, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xda72
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5230
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0xdaa2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5230
jmp 0xdaa2
jmp 0xda9f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xdab9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5230
movq %rbx, %rdi
callq 0x53e0
nop