// File: /workspace/github_c_makefile_star2_O2/mrkite[P]regs/src/disasm.cc
// Function: Disassembler::printInst[abi:cxx11](std::shared_ptr<Inst>)
std::string Disassembler::printInst(std::shared_ptr<Inst> inst) {
  std::string args;
  std::string comment;

  if (inst->type == Special) {
    return inst->name;
  }
  switch (inst->operType) {
    case Opr::None:
      break;
    case Opr::Imm8:
      args = "#" + hex(inst->oper, 2);
      break;
    case Opr::Imm16:
      args = "#" + hex(inst->oper, 4);
      if (inst->prevWord && inst->oper) {
        comment = checkDW(inst->oper, inst->prevWord);
      }
      break;
    case Opr::Abs:
      args = hex(inst->oper, 6);
      break;
    case Opr::AbsB:
      args = "B:" + hex(inst->oper, 4);
      comment += lookup(inst->oper);
      break;
    case Opr::AbsD:
      args = "D:" + hex(inst->oper, 2);
      break;
    case Opr::AbsX:
      args = hex(inst->oper, 6) + ", x";
      break;
    case Opr::AbsXB:
      args = "B:" + hex(inst->oper, 4) + ", x";
      comment += lookup(inst->oper);
      break;
    case Opr::AbsXD:
      args = "D:" + hex(inst->oper, 2) + ", x";
      break;
    case Opr::AbsY:
      args = hex(inst->oper, 6) + ", y";
      break;
    case Opr::AbsYB:
      args = "B:" + hex(inst->oper, 4) + ", y";
      comment += lookup(inst->oper);
      break;
    case Opr::AbsYD:
      args = "D:" + hex(inst->oper, 2) + ", y";
      break;
    case Opr::AbsS:
      args = hex(inst->oper, 2) + ", s";
      break;
    case Opr::Ind:
      args = "(" + hex(inst->oper, 6) + ")";
      break;
    case Opr::IndB:
      args = "(B:" + hex(inst->oper, 4) + ")";
      comment += lookup(inst->oper);
      break;
    case Opr::IndD:
      args = "(D:" + hex(inst->oper, 2) + ")";
      break;
    case Opr::IndX:
      args = "(" + hex(inst->oper, 6) + ", x)";
      break;
    case Opr::IndXB:
      args = "(B:" + hex(inst->oper, 4) + ", x)";
      comment += lookup(inst->oper);
      break;
    case Opr::IndXD:
      args = "(D:" + hex(inst->oper, 2) + ")";
      break;
    case Opr::IndY:
      args = "(D:" + hex(inst->oper, 2) + "), y";
      break;
    case Opr::IndL:
      args = "[D:" + hex(inst->oper, 2) + "]";
      break;
    case Opr::IndLY:
      args = "[D:" + hex(inst->oper, 2) + "], y";
      break;
    case Opr::IndS:
      args = "(" + hex(inst->oper, 2) + ", s), y";
      break;
    case Opr::Bank:
      args = hex(inst->oper >> 8, 2) + ", " + hex(inst->oper & 0xff, 2);
      break;
  }
  if (inst->flags & IsEmuChanged) {
    if (inst->flags & IsEmu) {
      comment += " 8-bit mode";
    } else {
      comment += " 16-bit mode";
    }
  }
  if (inst->flags & IsM8Changed) {
    if (inst->flags & IsM8) {
      comment += " a.b";
    } else {
      comment += " a.w";
    }
  }
  if (inst->flags & IsX8Changed) {
    if (inst->flags & IsX8) {
      comment += " x.b";
    } else {
      comment += " x.w";
    }
  }
  std::string r = inst->name;
  while (r.length() < 8) {
    r += " ";
  }
  r += args;
  if (!comment.empty()) {
    while (r.length() < 20) {
      r += " ";
    }
    r += "; " + comment;
  }
  return r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r15
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %rbx
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
movq (%rdx), %rsi
cmpw $0x5, 0x20(%rsi)
jne 0xba60
movq %rbx, %rdi
callq 0x52c0
jmp 0xc37c
movq %rdx, %r14
movl 0x24(%rsi), %eax
decl %eax
cmpl $0x16, %eax
ja 0xc26a
leaq 0x8948(%rip), %rcx      # 0x143c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x28(%rsi), %edx
leaq 0x8(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x8b04(%rip), %rsi      # 0x1459f
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xc609
jmp 0xc158
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x4
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x8ae2(%rip), %rsi      # 0x145ab
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x8ad4(%rip), %rdx      # 0x145b3
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %r12
movq %r12, %rsi
callq 0x5250
movq %r12, %rdi
callq 0x5140
leaq 0x8(%rsp), %rdi
callq 0x5140
leaq 0x48(%rsp), %rdi
callq 0x5140
movq (%r14), %rax
movzwl 0x28(%rax), %edx
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0xc536
leaq 0x88(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x5440
jmp 0xc09d
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x8a4e(%rip), %rsi      # 0x145af
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x9359(%rip), %rdx      # 0x14ed0
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
jmp 0xc23c
movl 0x28(%rsi), %edx
leaq 0x8(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x8a00(%rip), %rdx      # 0x145a5
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
jmp 0xc158
movl 0x28(%rsi), %edx
leaq 0x8(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x89dd(%rip), %rsi      # 0x145b0
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xc609
jmp 0xc158
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x6
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x89a8(%rip), %rsi      # 0x145a9
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x92b9(%rip), %rdx      # 0x14ed0
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
jmp 0xc23c
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x4
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x8967(%rip), %rsi      # 0x145ac
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x896a(%rip), %rdx      # 0x145c5
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %r12
movq %r12, %rsi
callq 0x5250
movq %r12, %rdi
callq 0x5140
leaq 0x8(%rsp), %rdi
callq 0x5140
leaq 0x48(%rsp), %rdi
callq 0x5140
movq (%r14), %rax
movzwl 0x28(%rax), %edx
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0xc536
leaq 0x88(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x5440
jmp 0xc09d
movl 0x28(%rsi), %edx
leaq 0x28(%rsp), %rdi
pushq $0x6
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x68(%rsp), %rdi
jmp 0xbe63
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x6
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x88af(%rip), %rsi      # 0x145a9
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x88a3(%rip), %rdx      # 0x145b3
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
jmp 0xc23c
movl 0x28(%rsi), %edx
leaq 0x8(%rsp), %rdi
pushq $0x4
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x886e(%rip), %rsi      # 0x145ac
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xc609
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %r12
movq %r12, %rsi
callq 0x5250
movq %r12, %rdi
callq 0x5140
leaq 0x8(%rsp), %rdi
callq 0x5140
movq (%r14), %rax
movzwl 0x28(%rax), %edx
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0xc536
leaq 0x88(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x5440
jmp 0xc09d
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x87fa(%rip), %rsi      # 0x145b0
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x87d5(%rip), %rdx      # 0x145a1
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
jmp 0xc23c
movl 0x28(%rsi), %edx
leaq 0x8(%rsp), %rdi
pushq $0x4
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x87a5(%rip), %rsi      # 0x1459f
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xc609
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %r12
movq %r12, %rsi
callq 0x5250
movq %r12, %rdi
callq 0x5140
leaq 0x8(%rsp), %rdi
callq 0x5140
movq (%r14), %rcx
movzwl 0x30(%rcx), %eax
testw %ax, %ax
je 0xc26a
movl 0x28(%rcx), %edx
testl %edx, %edx
je 0xc26a
movzwl %ax, %ecx
movzwl %dx, %edx
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0xc4c4
leaq 0x88(%rsp), %rdi
leaq 0x28(%rsp), %r15
movq %r15, %rsi
callq 0x5250
movq %r15, %rdi
jmp 0xc265
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x871d(%rip), %rsi      # 0x145af
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x9028(%rip), %rdx      # 0x14ed0
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
jmp 0xc23c
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x86e2(%rip), %rsi      # 0x145b8
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x86d0(%rip), %rdx      # 0x145bc
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
jmp 0xc23c
movl 0x28(%rsi), %edx
leaq 0x8(%rsp), %rdi
pushq $0x6
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x8687(%rip), %rdx      # 0x145a1
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
jmp 0xc158
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x8661(%rip), %rsi      # 0x145a9
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x8663(%rip), %rdx      # 0x145c1
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
jmp 0xc23c
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x4
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x861f(%rip), %rsi      # 0x145ab
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x8f2e(%rip), %rdx      # 0x14ed0
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %r12
movq %r12, %rsi
callq 0x5250
movq %r12, %rdi
callq 0x5140
leaq 0x8(%rsp), %rdi
callq 0x5140
leaq 0x48(%rsp), %rdi
callq 0x5140
movq (%r14), %rax
movzwl 0x28(%rax), %edx
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0xc536
leaq 0x88(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x5440
jmp 0xc09d
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x4
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x8588(%rip), %rsi      # 0x145ac
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x8567(%rip), %rdx      # 0x145a1
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %r12
movq %r12, %rsi
callq 0x5250
movq %r12, %rdi
callq 0x5140
leaq 0x8(%rsp), %rdi
callq 0x5140
leaq 0x48(%rsp), %rdi
callq 0x5140
movq (%r14), %rax
movzwl 0x28(%rax), %edx
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0xc536
leaq 0x88(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x5440
leaq 0x28(%rsp), %rdi
jmp 0xc265
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x84ee(%rip), %rsi      # 0x145af
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x84ed(%rip), %rdx      # 0x145c4
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
jmp 0xc23c
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x84ab(%rip), %rsi      # 0x145b0
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x84aa(%rip), %rdx      # 0x145c5
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
jmp 0xc23c
movl 0x28(%rsi), %edx
leaq 0x8(%rsp), %rdi
pushq $0x6
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x847c(%rip), %rdx      # 0x145c5
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %r15
movq %r15, %rsi
callq 0x5250
movq %r15, %rdi
callq 0x5140
leaq 0x8(%rsp), %rdi
jmp 0xc265
movl 0x28(%rsi), %edx
shrl $0x8, %edx
leaq 0x48(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x8430(%rip), %rdx      # 0x145c9
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0xc751
movq (%r14), %rax
movzbl 0x28(%rax), %edx
leaq 0xa8(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0xc770
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %r15
movq %r15, %rsi
callq 0x5250
movq %r15, %rdi
callq 0x5140
leaq 0xa8(%rsp), %rdi
jmp 0xc251
movl 0x28(%rsi), %edx
leaq 0x48(%rsp), %rdi
pushq $0x2
popq %rcx
movq %r15, %rsi
callq 0xb834
leaq 0x83a1(%rip), %rsi      # 0x145b8
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc609
leaq 0x89a6(%rip), %rdx      # 0x14bd3
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc751
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %r15
movq %r15, %rsi
callq 0x5250
movq %r15, %rdi
callq 0x5140
leaq 0x8(%rsp), %rdi
callq 0x5140
leaq 0x48(%rsp), %rdi
callq 0x5140
movq (%r14), %rax
movl 0x2c(%rax), %eax
btl $0xd, %eax
jae 0xc299
btl $0x8, %eax
leaq 0x8357(%rip), %rax      # 0x145d8
leaq 0x8344(%rip), %rsi      # 0x145cc
cmovaeq %rax, %rsi
leaq 0x88(%rsp), %rdi
callq 0x5410
movq (%r14), %rax
movl 0x2c(%rax), %eax
btl $0xa, %eax
jae 0xc2c6
testb $0x20, %al
leaq 0x833c(%rip), %rax      # 0x145ea
leaq 0x8330(%rip), %rsi      # 0x145e5
cmoveq %rax, %rsi
leaq 0x88(%rsp), %rdi
callq 0x5410
movq (%r14), %rax
movl 0x2c(%rax), %eax
btl $0x9, %eax
jae 0xc2f3
testb $0x10, %al
leaq 0x8319(%rip), %rax      # 0x145f4
leaq 0x830d(%rip), %rsi      # 0x145ef
cmoveq %rax, %rsi
leaq 0x88(%rsp), %rdi
callq 0x5410
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x52c0
leaq 0x8b98(%rip), %r14      # 0x14e9d
cmpq $0x7, 0x8(%rbx)
ja 0xc319
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5410
jmp 0xc305
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x5440
cmpq $0x0, 0x90(%rsp)
je 0xc37c
leaq 0x8b65(%rip), %r14      # 0x14e9d
cmpq $0x13, 0x8(%rbx)
ja 0xc34c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5410
jmp 0xc338
leaq 0x82a6(%rip), %rsi      # 0x145f9
leaq 0x28(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0xc7d7
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x5440
leaq 0x28(%rsp), %rdi
callq 0x5140
leaq 0x88(%rsp), %rdi
callq 0x5140
leaq 0x68(%rsp), %rdi
callq 0x5140
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xc492
jmp 0xc3ce
jmp 0xc3ce
jmp 0xc3ce
jmp 0xc3ce
movq %rax, %r14
leaq 0xa8(%rsp), %rdi
callq 0x5140
jmp 0xc409
jmp 0xc492
jmp 0xc492
movq %rax, %r14
leaq 0x28(%rsp), %rdi
jmp 0xc49f
jmp 0xc492
jmp 0xc492
jmp 0xc406
jmp 0xc406
jmp 0xc406
jmp 0xc406
jmp 0xc406
jmp 0xc406
jmp 0xc406
jmp 0xc406
jmp 0xc406
jmp 0xc406
jmp 0xc492
jmp 0xc406
jmp 0xc406
jmp 0xc406
jmp 0xc406
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x5140
jmp 0xc440
jmp 0xc43d
jmp 0xc43d
jmp 0xc447
jmp 0xc43d
jmp 0xc43d
jmp 0xc43d
jmp 0xc43d
jmp 0xc43d
jmp 0xc447
jmp 0xc43d
jmp 0xc43d
jmp 0xc447
jmp 0xc43d
jmp 0xc447
jmp 0xc43d
jmp 0xc43d
jmp 0xc43d
jmp 0xc447
jmp 0xc447
jmp 0xc43d
movq %rax, %r14
leaq 0x48(%rsp), %rdi
jmp 0xc49f
movq %rax, %r14
leaq 0x8(%rsp), %rdi
jmp 0xc49f
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
jmp 0xc492
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x5140
jmp 0xc49c
jmp 0xc499
jmp 0xc499
movq %rax, %r14
jmp 0xc4a4
jmp 0xc499
movq %rax, %r14
movq %rbx, %rdi
callq 0x5140
leaq 0x88(%rsp), %rdi
callq 0x5140
leaq 0x68(%rsp), %rdi
callq 0x5140
movq %r14, %rdi
callq 0x53c0
nop