// File: 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
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x188(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x45f0
movq -0x180(%rbp), %rdx
leaq 0x115fc(%rip), %rsi     # 0x91894
leaq -0x28(%rbp), %rdi
callq 0x4450
jmp 0x802a3
leaq -0x29(%rbp), %rdi
callq 0x4380
leaq -0x61(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x45f0
movq -0x190(%rbp), %rdx
leaq 0x115d8(%rip), %rsi     # 0x918a2
leaq -0x60(%rbp), %rdi
callq 0x4450
jmp 0x802d5
leaq -0x61(%rbp), %rdi
callq 0x4380
leaq -0x89(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x45f0
movq -0x198(%rbp), %rdx
leaq 0x115a9(%rip), %rsi     # 0x918a8
leaq -0x88(%rbp), %rdi
callq 0x4450
jmp 0x8030d
leaq -0x89(%rbp), %rdi
callq 0x4380
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x45f0
movq -0x1a0(%rbp), %rdx
leaq 0x1157e(%rip), %rsi     # 0x918b8
leaq -0xb0(%rbp), %rdi
callq 0x4450
jmp 0x80348
leaq -0xb1(%rbp), %rdi
callq 0x4380
movq -0x188(%rbp), %rax
movq (%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x42b0
movq %rax, -0x1a8(%rbp)
jmp 0x80370
movq -0x1a8(%rbp), %rdi
leaq 0x4710a(%rip), %rsi     # 0xc7488
callq 0x42b0
jmp 0x80385
movq -0x188(%rbp), %rax
movq (%rax), %rdi
leaq -0x88(%rbp), %rsi
callq 0x42b0
movq %rax, -0x1b0(%rbp)
jmp 0x803a4
movq -0x1b0(%rbp), %rdi
leaq 0x470d6(%rip), %rsi     # 0xc7488
callq 0x42b0
jmp 0x803b9
movq -0x188(%rbp), %rax
movq (%rax), %rdi
leaq 0x114fe(%rip), %rsi     # 0x918c8
callq 0x42f0
jmp 0x803d1
movq -0x188(%rbp), %rdi
addq $0xf0, %rdi
callq 0x82200
movq -0x188(%rbp), %rdi
movq %rax, -0xc0(%rbp)
addq $0xf0, %rdi
callq 0x82220
movq %rax, -0xc8(%rbp)
movq $0x0, -0xd0(%rbp)
movq -0x188(%rbp), %rax
movq -0xd0(%rbp), %rcx
movq %rcx, -0x1b8(%rbp)
movq 0xa0(%rax), %rdi
callq 0x786f0
movq %rax, %rcx
movq -0x1b8(%rbp), %rax
cmpq %rcx, %rax
jae 0x80866
movq -0x188(%rbp), %rax
movq 0xa0(%rax), %rdi
movq -0xd0(%rbp), %rsi
callq 0x78b20
movq %rax, -0xd8(%rbp)
movq -0xc0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x78950
movq %rax, -0x1c0(%rbp)
jmp 0x80481
movq -0x1c0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
movq -0xc8(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0x82240
movq %rax, %rdi
callq 0x77f90
movq %rax, -0x1c8(%rbp)
jmp 0x804b6
movq -0x1c8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xd0(%rbp), %rax
cmpq -0xe8(%rbp), %rax
jne 0x805c2
movq -0x188(%rbp), %rax
movq (%rax), %rdi
leaq -0x60(%rbp), %rsi
callq 0x42b0
movq %rax, -0x1d0(%rbp)
jmp 0x804f4
movq -0x1d0(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0x40f0
movq %rax, -0x1d8(%rbp)
jmp 0x80510
movq -0x1d8(%rbp), %rdi
leaq 0x10314(%rip), %rsi     # 0x90832
callq 0x42f0
movq %rax, -0x1e0(%rbp)
jmp 0x8052c
movq -0x1e0(%rbp), %rdi
leaq 0x46f4e(%rip), %rsi     # 0xc7488
callq 0x42b0
jmp 0x80541
jmp 0x805c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x4380
jmp 0x80a5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x61(%rbp), %rdi
callq 0x4380
jmp 0x80a53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x89(%rbp), %rdi
callq 0x4380
jmp 0x80a4a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xb1(%rbp), %rdi
callq 0x4380
jmp 0x80a3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x80a32
movq -0xd8(%rbp), %rdi
callq 0x82260
movq %rax, %rsi
leaq -0x108(%rbp), %rdi
callq 0x4190
jmp 0x805df
movq -0x188(%rbp), %rdi
addq $0x10, %rdi
leaq -0x108(%rbp), %rsi
callq 0x82280
movq %rax, -0x1e8(%rbp)
jmp 0x805ff
movq -0x188(%rbp), %rdi
movq -0x1e8(%rbp), %rax
movq %rax, -0x110(%rbp)
addq $0x10, %rdi
callq 0x822b0
movq %rax, -0x118(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x28be0
testb $0x1, %al
jne 0x8063d
jmp 0x806b7
leaq 0x112b8(%rip), %rsi     # 0x918fc
leaq -0x138(%rbp), %rdi
leaq -0x108(%rbp), %rdx
callq 0x16320
jmp 0x80659
movq -0x188(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x7c5b0
jmp 0x8066e
leaq -0x138(%rbp), %rdi
callq 0x4688
movl $0x4, -0x13c(%rbp)
jmp 0x80822
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x80855
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x4688
jmp 0x80855
movq -0x188(%rbp), %rdi
addq $0x10, %rdi
leaq -0x108(%rbp), %rsi
callq 0x822e0
movq %rax, -0x1f0(%rbp)
jmp 0x806d7
movq -0x188(%rbp), %rdi
movq -0x1f0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x140(%rbp)
addq $0x70, %rdi
leaq -0x140(%rbp), %rsi
callq 0x823c0
movq %rax, -0x1f8(%rbp)
jmp 0x80706
movq -0x188(%rbp), %rdi
movq -0x1f8(%rbp), %rax
movq %rax, -0x148(%rbp)
addq $0x70, %rdi
callq 0x263b0
movq %rax, -0x150(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x26380
testb $0x1, %al
jne 0x80747
jmp 0x807e3
leaq -0x171(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x45f0
movq -0x200(%rbp), %rdx
leaq 0x111b4(%rip), %rsi     # 0x9191c
leaq -0x170(%rbp), %rdi
callq 0x4450
jmp 0x80776
movq -0x188(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x7c5b0
jmp 0x8078b
leaq -0x170(%rbp), %rdi
callq 0x4688
leaq -0x171(%rbp), %rdi
callq 0x4380
movl $0x4, -0x13c(%rbp)
jmp 0x80822
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x807d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x4688
leaq -0x171(%rbp), %rdi
callq 0x4380
jmp 0x80855
movq -0x188(%rbp), %rdi
addq $0x70, %rdi
leaq -0x140(%rbp), %rsi
callq 0x823f0
movq %rax, -0x208(%rbp)
jmp 0x80803
movq -0x208(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x824d0
jmp 0x80818
movl $0x0, -0x13c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x4688
movl -0x13c(%rbp), %eax
testl %eax, %eax
je 0x8083c
jmp 0x8083a
jmp 0x8083e
jmp 0x8083e
movq -0xd0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xd0(%rbp)
jmp 0x80410
leaq -0x108(%rbp), %rdi
callq 0x4688
jmp 0x80a32
movq -0x188(%rbp), %rax
movq (%rax), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x42b0
movq %rax, -0x210(%rbp)
jmp 0x80885
movq -0x210(%rbp), %rdi
leaq 0x46bf5(%rip), %rsi     # 0xc7488
callq 0x42b0
jmp 0x8089a
movl $0x0, -0x178(%rbp)
movq -0x188(%rbp), %rdi
movslq -0x178(%rbp), %rax
movq %rax, -0x218(%rbp)
addq $0xa8, %rdi
callq 0x82510
movq %rax, %rcx
movq -0x218(%rbp), %rax
cmpq %rcx, %rax
jae 0x809ff
movq -0x188(%rbp), %rdi
movq (%rdi), %rax
movq %rax, -0x228(%rbp)
addq $0xa8, %rdi
movslq -0x178(%rbp), %rsi
callq 0x82540
movq -0x228(%rbp), %rdi
movq %rax, %rsi
callq 0x42b0
movq %rax, -0x220(%rbp)
jmp 0x80914
movq -0x220(%rbp), %rdi
leaq 0xff10(%rip), %rsi      # 0x90832
callq 0x42f0
movq %rax, -0x230(%rbp)
jmp 0x80930
movq -0x230(%rbp), %rdi
leaq 0x46b2a(%rip), %rsi     # 0xc7468
callq 0x42b0
movq %rax, -0x238(%rbp)
jmp 0x8094c
movq -0x188(%rbp), %rdi
addq $0xa8, %rdi
movslq -0x178(%rbp), %rsi
callq 0x82540
movq -0x238(%rbp), %rdi
movq %rax, %rsi
addq $0x40, %rsi
callq 0x42b0
movq %rax, -0x240(%rbp)
jmp 0x80982
movq -0x240(%rbp), %rdi
leaq 0x46ad8(%rip), %rsi     # 0xc7468
callq 0x42b0
movq %rax, -0x248(%rbp)
jmp 0x8099e
movq -0x188(%rbp), %rdi
addq $0xa8, %rdi
movslq -0x178(%rbp), %rsi
callq 0x82540
movq -0x248(%rbp), %rdi
movq %rax, %rsi
addq $0x20, %rsi
callq 0x42b0
movq %rax, -0x250(%rbp)
jmp 0x809d4
movq -0x250(%rbp), %rdi
leaq 0x46aa6(%rip), %rsi     # 0xc7488
callq 0x42b0
jmp 0x809e9
jmp 0x809eb
movl -0x178(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x178(%rbp)
jmp 0x808a4
leaq -0xb0(%rbp), %rdi
callq 0x4688
leaq -0x88(%rbp), %rdi
callq 0x4688
leaq -0x60(%rbp), %rdi
callq 0x4688
leaq -0x28(%rbp), %rdi
callq 0x4688
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
leaq -0xb0(%rbp), %rdi
callq 0x4688
leaq -0x88(%rbp), %rdi
callq 0x4688
leaq -0x60(%rbp), %rdi
callq 0x4688
leaq -0x28(%rbp), %rdi
callq 0x4688
movq -0x38(%rbp), %rdi
callq 0x45e0
nopw %cs:(%rax,%rax)
nop