// File: luooofan[P]hblzbd_compiler/src/arm.cpp
// Function: arm::BinaryInst::EmitCode(std::ostream&)
void BinaryInst::EmitCode(std::ostream& outfile) {
  std::string opcode;
  switch (this->opcode_) {
    case OpCode::ADD:
      opcode = "add";
      break;
    case OpCode::SUB:
      opcode = "sub";
      break;
    case OpCode::RSB:
      opcode = "rsb";
      break;
    case OpCode::MUL:
      opcode = "mul";
      break;
    case OpCode::SMMUL:
      opcode = "smmul";
      break;
    case OpCode::AND:
      opcode = "and";
      break;
    case OpCode::EOR:
      opcode = "eor";
      break;
    case OpCode::ORR:
      opcode = "orr";
      break;
    case OpCode::RON:
      opcode = "ron";
      break;
    case OpCode::BIC:
      opcode = "bic";
      break;
    case OpCode::SDIV:
      opcode = "sdiv";
      break;
    case OpCode::CMP:
      opcode = "cmp";
      break;
    case OpCode::CMN:
      opcode = "cmn";
      break;
    case OpCode::TST:
      opcode = "tst";
      break;
    case OpCode::TEQ:
      opcode = "teq";
      break;
    default:
      MyAssert(0);
      break;
  }
  if (this->HasS()) opcode += "s";
  opcode += CondToString(this->cond_);
  outfile << "\t" << opcode << " " << (nullptr != this->rd_ ? (std::string(*this->rd_) + ", ") : "")
          << std::string(*this->rn_) << ", " << std::string(*this->op2_) << std::endl;
}

// Assembly:
subq $0x168, %rsp            # imm = 0x168
movq %rdi, 0x160(%rsp)
movq %rsi, 0x158(%rsp)
movq 0x160(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x138(%rsp), %rdi
callq 0x8510
movq 0x70(%rsp), %rax
movl 0x14(%rax), %eax
movq %rax, 0x78(%rsp)
subq $0xe, %rax
ja 0xa918
movq 0x78(%rsp), %rax
leaq 0xef8ec(%rip), %rcx     # 0xfa050
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xef9a9(%rip), %rsi     # 0xfa11d
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa783
jmp 0xa995
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
jmp 0xaceb
leaq 0xef979(%rip), %rsi     # 0xfa121
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa7b7
jmp 0xa995
leaq 0xef962(%rip), %rsi     # 0xfa125
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa7d2
jmp 0xa995
leaq 0xef94d(%rip), %rsi     # 0xfa12b
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa7ed
jmp 0xa995
leaq 0xef930(%rip), %rsi     # 0xfa129
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa808
jmp 0xa995
leaq 0xef91b(%rip), %rsi     # 0xfa12f
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa823
jmp 0xa995
leaq 0xef904(%rip), %rsi     # 0xfa133
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa83e
jmp 0xa995
leaq 0xef8ed(%rip), %rsi     # 0xfa137
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa859
jmp 0xa995
leaq 0xef8d6(%rip), %rsi     # 0xfa13b
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa874
jmp 0xa995
leaq 0xef8bf(%rip), %rsi     # 0xfa13f
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa88f
jmp 0xa995
leaq 0xef8a8(%rip), %rsi     # 0xfa143
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa8aa
jmp 0xa995
leaq 0xef892(%rip), %rsi     # 0xfa148
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa8c5
jmp 0xa995
leaq 0xef87b(%rip), %rsi     # 0xfa14c
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa8e0
jmp 0xa995
leaq 0xef864(%rip), %rsi     # 0xfa150
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa8fb
jmp 0xa995
leaq 0xef84d(%rip), %rsi     # 0xfa154
leaq 0x138(%rsp), %rdi
callq 0x8500
jmp 0xa916
jmp 0xa995
movq 0x1416c9(%rip), %rdi    # 0x14bfe8
leaq 0xef7d2(%rip), %rsi     # 0xfa0f8
callq 0x8330
movq %rax, 0x68(%rsp)
jmp 0xa932
movq 0x68(%rsp), %rdi
leaq 0xef7c3(%rip), %rsi     # 0xfa101
callq 0x8330
movq %rax, 0x60(%rsp)
jmp 0xa94a
movq 0x60(%rsp), %rdi
leaq 0xf0a94(%rip), %rsi     # 0xfb3ea
callq 0x8330
movq %rax, 0x58(%rsp)
jmp 0xa962
movq 0x58(%rsp), %rdi
movl $0xa5, %esi
callq 0x8650
movq %rax, 0x50(%rsp)
jmp 0xa978
movq 0x50(%rsp), %rdi
movq 0x1415fc(%rip), %rsi    # 0x14bf80
callq 0x8380
jmp 0xa98b
movl $0xff, %edi
callq 0x8460
movq 0x70(%rsp), %rdi
callq 0xcbc0
movb %al, 0x4f(%rsp)
jmp 0xa9a5
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0xa9af
jmp 0xa9c7
leaq 0xf19de(%rip), %rsi     # 0xfc394
leaq 0x138(%rsp), %rdi
callq 0x8320
jmp 0xa9c5
jmp 0xa9c7
movq 0x70(%rsp), %rax
movl 0x10(%rax), %esi
leaq 0x108(%rsp), %rdi
callq 0x9ab0
jmp 0xa9de
leaq 0x138(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x84b0
jmp 0xa9f5
leaq 0x108(%rsp), %rdi
callq 0x8728
movq 0x158(%rsp), %rdi
leaq 0xef747(%rip), %rsi     # 0xfa158
callq 0x8330
movq %rax, 0x40(%rsp)
jmp 0xaa1d
movq 0x40(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x8310
movq %rax, 0x38(%rsp)
jmp 0xaa36
movq 0x38(%rsp), %rdi
leaq 0xef913(%rip), %rsi     # 0xfa355
callq 0x8330
movq %rax, 0x30(%rsp)
jmp 0xaa4e
movq 0x70(%rsp), %rax
movq 0x20(%rax), %rcx
movb $0x0, 0xc7(%rsp)
movb $0x0, 0xc5(%rsp)
xorl %eax, %eax
cmpq %rcx, %rax
je 0xaaae
movq 0x70(%rsp), %rax
movq 0x20(%rax), %rsi
leaq 0xc8(%rsp), %rdi
callq 0xc8f0
jmp 0xaa86
movb $0x1, 0xc7(%rsp)
leaq 0xef6da(%rip), %rdx     # 0xfa16f
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0xcbd0
jmp 0xaaac
jmp 0xaae5
leaq 0xc6(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x8680
movq 0x28(%rsp), %rdx
movb $0x1, 0xc5(%rsp)
leaq 0xef685(%rip), %rsi     # 0xfa159
leaq 0xe8(%rsp), %rdi
callq 0xc570
jmp 0xaae3
jmp 0xaae5
movq 0x30(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x8310
movq %rax, 0x20(%rsp)
jmp 0xaafe
movq 0x70(%rsp), %rax
movq 0x28(%rax), %rsi
leaq 0xa0(%rsp), %rdi
callq 0xc8f0
jmp 0xab16
movq 0x20(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x8310
movq %rax, 0x18(%rsp)
jmp 0xab2f
movq 0x18(%rsp), %rdi
leaq 0xef634(%rip), %rsi     # 0xfa16f
callq 0x8330
movq %rax, 0x10(%rsp)
jmp 0xab47
movq 0x70(%rsp), %rax
movq 0x30(%rax), %rsi
leaq 0x80(%rsp), %rdi
callq 0xa180
jmp 0xab5f
movq 0x10(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x8310
movq %rax, 0x8(%rsp)
jmp 0xab78
movq 0x8(%rsp), %rdi
movq 0x1413fc(%rip), %rsi    # 0x14bf80
callq 0x8380
jmp 0xab8b
leaq 0x80(%rsp), %rdi
callq 0x8728
leaq 0xa0(%rsp), %rdi
callq 0x8728
leaq 0xe8(%rsp), %rdi
callq 0x8728
testb $0x1, 0xc5(%rsp)
jne 0xabbe
jmp 0xabcb
leaq 0xc6(%rsp), %rdi
callq 0x83c0
testb $0x1, 0xc7(%rsp)
jne 0xabd7
jmp 0xabe4
leaq 0xc8(%rsp), %rdi
callq 0x8728
leaq 0x138(%rsp), %rdi
callq 0x8728
addq $0x168, %rsp            # imm = 0x168
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x8728
jmp 0xaceb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
jmp 0xacd0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
jmp 0xacb5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
jmp 0xaca8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
jmp 0xac9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x8728
leaq 0xa0(%rsp), %rdi
callq 0x8728
leaq 0xe8(%rsp), %rdi
callq 0x8728
testb $0x1, 0xc5(%rsp)
jne 0xacc1
jmp 0xacce
leaq 0xc6(%rsp), %rdi
callq 0x83c0
jmp 0xacd0
testb $0x1, 0xc7(%rsp)
jne 0xacdc
jmp 0xace9
leaq 0xc8(%rsp), %rdi
callq 0x8728
jmp 0xaceb
leaq 0x138(%rsp), %rdi
callq 0x8728
movq 0x130(%rsp), %rdi
callq 0x8670
nopw %cs:(%rax,%rax)