// File: /workspace/github_cpp_makefile_star2_O1/acliusBackHome[P]kamaya/dist/x86.cpp
// Function: x86::Assembler::handleQuas()
void Assembler::handleQuas() {
  const string beginning = "global _start";
  const string block_prefix = "block";
  const string text_label = "[section .text]";
  const string data_label = "[section .data]";
  // 若 bbla(BaseBlockListAndMap)已经赋值，可以直接调用接口打印
  // 否则指令为空
  of << beginning << N;
  of << text_label << N;
  of << "_start:\n"
        "call main\n"
        "mov ebx, eax\n"
        "mov eax, 1\n"
        "int 0x80\n";
  // 打印汇编指令
  map<size_t, size_t> &lineNumToBlockID = get<1>(bbla);
  vector<BaseBlock> &baseblock = get<0>(bbla);
  for (size_t i = 0; i < quas.size(); ++i) {
    auto &qua = quas[i];
    size_t blockid = lineNumToBlockID[i];
    size_t begin_index = baseblock[blockid].get_begin_index();
    if (i == begin_index) {
      of << block_prefix << blockid << ":" << N;
    }
    string sign = get<0>(qua);
    if (quaMap.find(sign) == quaMap.end()) {
      log("cannot find this sign in quaMap" + sign);
      continue;
    }
    QuaType quaType = quaMap[sign];
    if (quaEmit.find(quaType) == quaEmit.end()) {
      log("cannot find this QuaType in quaMap");
      continue;
    }
    quaEmit[quaType](qua);
  }
  of << data_label << N;
  for (int i = 0; i < sectionData.size(); i++) {
    of << sectionData[i].symbol << ":" << T << sectionData[i].wide << T
       << sectionData[i].init << N;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %rbx
leaq -0xa8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xdbb7(%rip), %rsi      # 0x487f6
leaq 0xdbbd(%rip), %rdx      # 0x48803
leaq -0xb8(%rbp), %rdi
callq 0xf65c
leaq -0x88(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xdba0(%rip), %rsi      # 0x48804
leaq 0xdb9e(%rip), %rdx      # 0x48809
leaq -0x98(%rbp), %rdi
callq 0xf65c
leaq -0x68(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xdb83(%rip), %rsi      # 0x4880a
leaq 0xdb8b(%rip), %rdx      # 0x48819
leaq -0x78(%rbp), %rdi
callq 0xf65c
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xdb74(%rip), %rsi      # 0x4881a
leaq 0xdb7c(%rip), %rdx      # 0x48829
leaq -0x58(%rbp), %rdi
callq 0xf65c
movq (%rbx), %rdi
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
callq 0x4340
movq 0x22765(%rip), %rsi     # 0x5d438
movq 0x22766(%rip), %rdx     # 0x5d440
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rdi
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
callq 0x4340
movq 0x2273f(%rip), %rsi     # 0x5d438
movq 0x22740(%rip), %rdx     # 0x5d440
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rdi
leaq 0xdb18(%rip), %rsi      # 0x4882a
movl $0x33, %edx
callq 0x4340
movq $0x0, -0x30(%rbp)
movq 0xa0(%rbx), %rax
movq (%rax), %r13
cmpq %r13, 0x8(%rax)
je 0x3af58
leaq 0xf0(%rbx), %rax
movq %rax, -0xf8(%rbp)
leaq 0x10(%rbx), %rax
movq %rax, -0xc0(%rbp)
leaq 0x18(%rbx), %rax
movq %rax, -0xf0(%rbp)
leaq 0x70(%rbx), %rax
movq %rax, -0xe8(%rbp)
leaq 0x78(%rbx), %r12
xorl %r15d, %r15d
movq -0xf8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x36a48
movq (%rax), %r14
leaq (%r14,%r14,8), %rdi
shlq $0x3, %rdi
addq 0x120(%rbx), %rdi
callq 0x3625c
cmpq %rax, -0x30(%rbp)
jne 0x3ade9
movq (%rbx), %rdi
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
callq 0x4340
movq %rax, %rdi
movq %r14, %rsi
callq 0x4210
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0xca34(%rip), %rsi      # 0x47802
callq 0x4340
movq 0x2265e(%rip), %rsi     # 0x5d438
movq 0x2265f(%rip), %rdx     # 0x5d440
movq %r14, %rdi
callq 0x4340
shlq $0x7, %r15
addq %r15, %r13
leaq -0x108(%rbp), %rax
movq %rax, -0x118(%rbp)
movq 0x60(%r13), %rsi
movq 0x68(%r13), %rdx
addq %rsi, %rdx
leaq -0x118(%rbp), %r14
movq %r14, %rdi
callq 0xf5c2
movq -0xc0(%rbp), %rdi
movq %r14, %rsi
callq 0x3cd2a
leaq -0xe0(%rbp), %r15
cmpq -0xf0(%rbp), %rax
je 0x3aeb1
movq -0xc0(%rbp), %rdi
movq %r14, %rsi
callq 0x3c858
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movq 0x80(%rbx), %rdx
movq %r12, %rcx
testq %rdx, %rdx
je 0x3ae74
movq %r12, %rcx
xorl %esi, %esi
cmpl %eax, 0x20(%rdx)
setl %sil
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x3ae5d
movq %r12, %rdx
cmpq %r12, %rcx
je 0x3ae86
cmpl 0x20(%rcx), %eax
cmovlq %r12, %rcx
movq %rcx, %rdx
cmpq %r12, %rdx
je 0x3aed0
movq -0xe8(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x3c8d8
cmpq $0x0, 0x10(%rax)
je 0x3b0cd
movq %rax, %rdi
movq %r13, %rsi
callq *0x18(%rax)
jmp 0x3af17
movq %r15, %rdi
leaq 0xd9a3(%rip), %rsi      # 0x4885e
movq %r14, %rdx
callq 0xe775
movq %rbx, %rdi
movq %r15, %rsi
callq 0x37a40
jmp 0x3aeff
leaq -0xd0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq %r15, %rdi
leaq 0xd996(%rip), %rsi      # 0x4887e
leaq 0xd9b1(%rip), %rdx      # 0x488a0
callq 0xf65c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x37a40
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x3af17
callq 0x42b0
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x3af2f
callq 0x42b0
movq -0x30(%rbp), %r15
incq %r15
movq %r15, -0x30(%rbp)
movq 0xa0(%rbx), %rax
movq (%rax), %r13
movq 0x8(%rax), %rax
subq %r13, %rax
sarq $0x7, %rax
cmpq %rax, %r15
jb 0x3ad6e
movq (%rbx), %rdi
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x4340
movq 0x224c9(%rip), %rsi     # 0x5d438
movq 0x224ca(%rip), %rdx     # 0x5d440
movq %rax, %rdi
callq 0x4340
movq 0xa8(%rbx), %rax
cmpq %rax, 0xb0(%rbx)
je 0x3b067
xorl %r12d, %r12d
movabsq $-0x5555555555555555, %r13 # imm = 0xAAAAAAAAAAAAAAAB
xorl %r14d, %r14d
movq (%rbx), %rdi
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
callq 0x4340
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xc83d(%rip), %rsi      # 0x47802
callq 0x4340
movq 0x22447(%rip), %rsi     # 0x5d418
movq 0x22448(%rip), %rdx     # 0x5d420
movq %r15, %rdi
callq 0x4340
movq 0xa8(%rbx), %rcx
movq 0x40(%rcx,%r12), %rsi
movq 0x48(%rcx,%r12), %rdx
movq %rax, %rdi
callq 0x4340
movq 0x22418(%rip), %rsi     # 0x5d418
movq 0x22419(%rip), %rdx     # 0x5d420
movq %rax, %rdi
callq 0x4340
movq 0xa8(%rbx), %rcx
movq 0x20(%rcx,%r12), %rsi
movq 0x28(%rcx,%r12), %rdx
movq %rax, %rdi
callq 0x4340
movq 0x22409(%rip), %rsi     # 0x5d438
movq 0x2240a(%rip), %rdx     # 0x5d440
movq %rax, %rdi
callq 0x4340
incq %r14
movq 0xa8(%rbx), %rax
movq 0xb0(%rbx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
imulq %r13, %rcx
addq $0x60, %r12
cmpq %r14, %rcx
ja 0x3afa2
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x3b079
callq 0x42b0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
leaq -0xa8(%rbp), %rbx
leaq -0x88(%rbp), %r14
je 0x3b099
callq 0x42b0
movq -0x98(%rbp), %rdi
cmpq %r14, %rdi
je 0x3b0aa
callq 0x42b0
movq -0xb8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x3b0bb
callq 0x42b0
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4140
movq %rax, %rbx
jmp 0x3b15f
movq %rax, %rbx
jmp 0x3b16d
movq %rax, %rbx
jmp 0x3b17e
jmp 0x3b138
jmp 0x3b0f2
jmp 0x3b119
jmp 0x3b138
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x3b11c
callq 0x42b0
jmp 0x3b11c
jmp 0x3b119
jmp 0x3b119
jmp 0x3b138
jmp 0x3b138
jmp 0x3b119
movq %rax, %rbx
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x3b13b
callq 0x42b0
jmp 0x3b13b
jmp 0x3b138
movq %rax, %rbx
leaq -0xa8(%rbp), %r14
leaq -0x88(%rbp), %r15
leaq -0x68(%rbp), %r12
leaq -0x48(%rbp), %rax
movq -0x58(%rbp), %rdi
cmpq %rax, %rdi
je 0x3b15f
callq 0x42b0
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0x3b16d
callq 0x42b0
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0x3b17e
callq 0x42b0
movq -0xb8(%rbp), %rdi
cmpq %r14, %rdi
je 0x3b18f
callq 0x42b0
movq %rbx, %rdi
callq 0x4560
nop