// File: /workspace/github_cpp_makefile_star2_O3/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 0xd5dd(%rip), %rsi      # 0x477f6
leaq 0xd5e3(%rip), %rdx      # 0x47803
leaq -0xb8(%rbp), %rdi
callq 0xf868
leaq -0x88(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xd5c6(%rip), %rsi      # 0x47804
leaq 0xd5c4(%rip), %rdx      # 0x47809
leaq -0x98(%rbp), %rdi
callq 0xf868
leaq -0x68(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xd5a9(%rip), %rsi      # 0x4780a
leaq 0xd5b1(%rip), %rdx      # 0x47819
leaq -0x78(%rbp), %rdi
callq 0xf868
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xd59a(%rip), %rsi      # 0x4781a
leaq 0xd5a2(%rip), %rdx      # 0x47829
leaq -0x58(%rbp), %rdi
callq 0xf868
movq (%rbx), %rdi
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
callq 0x4340
movq 0x2218b(%rip), %rsi     # 0x5c438
movq 0x2218c(%rip), %rdx     # 0x5c440
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rdi
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
callq 0x4340
movq 0x22165(%rip), %rsi     # 0x5c438
movq 0x22166(%rip), %rdx     # 0x5c440
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rdi
leaq 0xd53e(%rip), %rsi      # 0x4782a
movl $0x33, %edx
callq 0x4340
movq $0x0, -0x30(%rbp)
movq 0xa0(%rbx), %rax
movq (%rax), %r13
cmpq %r13, 0x8(%rax)
je 0x3a528
leaq 0xf0(%rbx), %rax
movq %rax, -0xf8(%rbp)
leaq 0x10(%rbx), %r15
leaq 0x18(%rbx), %rax
movq %rax, -0xf0(%rbp)
leaq 0x70(%rbx), %rax
movq %rax, -0xe8(%rbp)
leaq 0x78(%rbx), %rax
movq %rax, -0xc0(%rbp)
xorl %r12d, %r12d
movq -0xf8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x360d8
movq (%rax), %r14
leaq (%r14,%r14,8), %rdi
shlq $0x3, %rdi
addq 0x120(%rbx), %rdi
callq 0x358ee
cmpq %rax, -0x30(%rbp)
jne 0x3a3c3
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 0xc45a(%rip), %rsi      # 0x46802
callq 0x4340
movq 0x22084(%rip), %rsi     # 0x5c438
movq 0x22085(%rip), %rdx     # 0x5c440
movq %r14, %rdi
callq 0x4340
shlq $0x7, %r12
addq %r12, %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 0xf7ca
movq %r15, %rdi
movq %r14, %rsi
callq 0x3c3c0
leaq -0xe0(%rbp), %r12
cmpq -0xf0(%rbp), %rax
je 0x3a48a
movq %r15, %rdi
movq %r14, %rsi
callq 0x3be26
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movq 0x80(%rbx), %rcx
testq %rcx, %rcx
je 0x3a459
movq -0xc0(%rbp), %rdx
xorl %esi, %esi
cmpl %eax, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x3a430
cmpq -0xc0(%rbp), %rdx
je 0x3a459
cmpl 0x20(%rdx), %eax
jge 0x3a502
leaq -0xd0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq %r12, %rdi
leaq 0xd40d(%rip), %rsi      # 0x4787e
leaq 0xd428(%rip), %rdx      # 0x478a0
callq 0xf868
movq %rbx, %rdi
movq %r12, %rsi
callq 0x370da
jmp 0x3a4a7
movq %r12, %rdi
leaq 0xd3ca(%rip), %rsi      # 0x4785e
movq %r14, %rdx
callq 0xe95b
movq %rbx, %rdi
movq %r12, %rsi
callq 0x370da
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x3a4bf
callq 0x42b0
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x3a4d7
callq 0x42b0
movq -0x30(%rbp), %r12
incq %r12
movq %r12, -0x30(%rbp)
movq 0xa0(%rbx), %rax
movq (%rax), %r13
movq 0x8(%rax), %rax
subq %r13, %rax
sarq $0x7, %rax
cmpq %rax, %r12
jb 0x3a348
jmp 0x3a528
movq -0xe8(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x3bea6
cmpq $0x0, 0x10(%rax)
je 0x3a69d
movq %rax, %rdi
movq %r13, %rsi
callq *0x18(%rax)
jmp 0x3a4bf
movq (%rbx), %rdi
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x4340
movq 0x21ef9(%rip), %rsi     # 0x5c438
movq 0x21efa(%rip), %rdx     # 0x5c440
movq %rax, %rdi
callq 0x4340
movq 0xa8(%rbx), %rax
cmpq %rax, 0xb0(%rbx)
je 0x3a637
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 0xc26d(%rip), %rsi      # 0x46802
callq 0x4340
movq 0x21e77(%rip), %rsi     # 0x5c418
movq 0x21e78(%rip), %rdx     # 0x5c420
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 0x21e48(%rip), %rsi     # 0x5c418
movq 0x21e49(%rip), %rdx     # 0x5c420
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 0x21e39(%rip), %rsi     # 0x5c438
movq 0x21e3a(%rip), %rdx     # 0x5c440
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 0x3a572
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x3a649
callq 0x42b0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
leaq -0xa8(%rbp), %rbx
leaq -0x88(%rbp), %r14
je 0x3a669
callq 0x42b0
movq -0x98(%rbp), %rdi
cmpq %r14, %rdi
je 0x3a67a
callq 0x42b0
movq -0xb8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x3a68b
callq 0x42b0
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4140
movq %rax, %rbx
jmp 0x3a72f
movq %rax, %rbx
jmp 0x3a73d
movq %rax, %rbx
jmp 0x3a74e
jmp 0x3a708
jmp 0x3a6e9
jmp 0x3a708
jmp 0x3a6c4
jmp 0x3a6e9
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x3a6ec
callq 0x42b0
jmp 0x3a6ec
jmp 0x3a6e9
jmp 0x3a6e9
jmp 0x3a708
jmp 0x3a708
movq %rax, %rbx
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x3a70b
callq 0x42b0
jmp 0x3a70b
jmp 0x3a708
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 0x3a72f
callq 0x42b0
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0x3a73d
callq 0x42b0
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0x3a74e
callq 0x42b0
movq -0xb8(%rbp), %rdi
cmpq %r14, %rdi
je 0x3a75f
callq 0x42b0
movq %rbx, %rdi
callq 0x4560
nop