// File: /workspace/github_cpp_makefile_star2_O3/luooofan[P]hblzbd_compiler/src/generate_ir.cpp
// Function: ast::FunctionDefine::GenerateIR(ir::ContextInfo&, std::vector<ir::IR*, std::allocator<ir::IR*>>&)
void FunctionDefine::GenerateIR(ir::ContextInfo &ctx, std::vector<ir::IR *> &gIRList) {
#ifdef GENIR_TIME_CONTROL
  clock_t begin, end;
  double cost;
  begin = clock();
#endif
  // NOTE: 函数无法嵌套定义
  if (ctx.scope_id_ != 0) {
    ir::SemanticError(this->line_no_, "function nest define.");
    return;
  }
  const auto &func_iter = ir::gFuncTable.find(this->name_.name_);
  if (func_iter == ir::gFuncTable.end()) {
    ctx.current_func_name_ = this->name_.name_;
    ctx.scope_id_ = ir::gScopes.size();
    gIRList.push_back(new ir::IR(IROpKind::LABEL, FUNC_OPN(this->name_.name_)));
    // 父作用域id一定为0 函数初始栈偏移为0
    ir::gScopes.push_back({ctx.scope_id_, 0});
    auto tmp = new ir::FuncTableItem(return_type_, ctx.scope_id_);
    ctx.has_aug_scope = true;
    for (int i = 0; i < args_.arg_list_.size(); ++i) {
      // for (const auto &arg : args_.arg_list_) {
      const auto &arg = args_.arg_list_[i];
      auto &scope = ir::gScopes[ctx.scope_id_];
      auto &symbol_table = scope.symbol_table_;
      if (Identifier *ident = dynamic_cast<Identifier *>(&arg->name_)) {
        const auto &var_iter = symbol_table.find(ident->name_);
        if (var_iter == symbol_table.end()) {
          auto &&symbol_item = ir::SymbolTableItem(false, false);
          symbol_table.insert({ident->name_, symbol_item});
          // ADD DECLARE
          gIRList.push_back(new ir::IR{IROpKind::DECLARE, ir::Opn(OpnType::Var, ident->name_, ctx.scope_id_),
                                       ir::Opn(OpnType::Imm, i)});
        } else {
          ir::SemanticError(this->line_no_, ident->name_ + ": variable redefined");
        }
        tmp->shape_list_.push_back(std::vector<int>());
      } else if (ArrayIdentifier *arrident = dynamic_cast<ArrayIdentifier *>(&arg->name_)) {
        const auto &var_iter = symbol_table.find(arrident->name_.name_);
        if (var_iter == symbol_table.end()) {
          auto tmp1 = new ir::SymbolTableItem(true, false);
          // NOTE: 参数中的数组视为一个基址指针
          // ADD DECLARE
          gIRList.push_back(
              new ir::IR{IROpKind::DECLARE,
                         ir::Opn(OpnType::Array, arrident->name_.name_, ctx.scope_id_, new ir::Opn(OpnType::Imm, 0)),
                         ir::Opn(OpnType::Imm, i)});

          // 计算shape和width shape:-1 2 3  width:? 24 12 4
          tmp1->shape_.push_back(-1);  //第一维因为文法规定必须留空，这里记-1
          for (const auto &shape : arrident->shape_list_) {
            shape->Evaluate(ctx, gIRList);
            tmp1->shape_.push_back(ctx.opn_.imm_num_);
          }
          tmp1->width_.resize(tmp1->shape_.size() + 1);
          tmp1->width_[tmp1->width_.size() - 1] = ir::kIntWidth;
          for (int i = tmp1->width_.size() - 2; i > 0; i--) tmp1->width_[i] = tmp1->width_[i + 1] * tmp1->shape_[i];
          tmp1->width_[0] = -1;  // useless
          symbol_table.insert({arrident->name_.name_, *tmp1});
          tmp->shape_list_.push_back(tmp1->shape_);
          delete tmp1;
        } else {
          ir::SemanticError(this->line_no_, arrident->name_.name_ + ": variable redefined");
        }
      }
      // std::cout<<"haha"<<ctx.shape_.size()<<'\n';
      // tmp->shape_list_.push_back(ctx.shape_);
    }
    ir::gFuncTable.insert({name_.name_, *tmp});
    delete tmp;

    ctx.has_return = false;
    this->body_.GenerateIR(ctx, gIRList);

    if (return_type_ == INT && ctx.has_return == false) {
      ir::SemanticError(this->line_no_,
                        this->name_.name_ + ": function's return type is INT,but does not return anything");
    }
    // 保证函数执行流最后会有一条ret语句 方便汇编生成
    if (return_type_ == VOID /*&& ctx.has_return == false*/) {
      gIRList.push_back(new ir::IR(IROpKind::RET));
    }

    // Set current_scope_id
    ctx.scope_id_ = 0;
  } else {
    ir::SemanticError(this->line_no_, this->name_.name_ + ": function redefined");
  }
#ifdef GENIR_TIME_CONTROL
  end = clock();
  cost = (double)(end - begin) / CLOCKS_PER_SEC;
  std::cout << "GenIrFunction cost: " << cost << "s" << std::endl;
  if (cost > 3) exit(233);
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rdi, %r15
cmpl $0x0, (%rsi)
je 0x18527
movl 0x8(%r15), %ebx
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5672d(%rip), %rsi     # 0x6ec28
leaq 0x5673b(%rip), %rdx     # 0x6ec3d
leaq 0x10(%rsp), %rdi
callq 0xc772
leaq 0x10(%rsp), %rsi
movl %ebx, %edi
callq 0x2b6aa
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
jne 0x1859b
jmp 0x19099
movq %rdx, %rbx
movq %rsi, %r13
movq 0x10(%r15), %rax
movq 0x10(%rax), %rsi
leaq 0x77054(%rip), %rdi     # 0x8f590
callq 0x116e2
testq %rax, %rax
je 0x185ad
movl 0x8(%r15), %ebx
movq 0x10(%r15), %rax
movq 0x10(%rax), %rax
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0xc6dc
leaq 0x56702(%rip), %rsi     # 0x6ec7b
movq %r14, %rdi
callq 0x8590
leaq 0x10(%rsp), %rsi
movl %ebx, %edi
callq 0x2b6aa
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x19099
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x19099
movq 0x10(%r15), %rax
movq 0x10(%rax), %rsi
leaq 0x1e8(%r13), %rdi
callq 0x81b0
leaq 0x76fb0(%rip), %rax     # 0x8f578
movq 0x8(%rax), %rcx
subq (%rax), %rcx
shrq $0x6, %rcx
movl %ecx, (%r13)
movl $0xe0, %edi
callq 0x8290
movq %rax, %r14
movq %r15, (%rsp)
movq 0x10(%r15), %rax
movq 0x10(%rax), %rax
leaq 0x100(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0xf0(%rsp), %rdi
callq 0xc6dc
leaq 0x220(%rsp), %rdi
movl $0x3, -0x8(%rdi)
leaq 0x230(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0xf0(%rsp), %rsi
movq 0xf8(%rsp), %rdx
addq %rsi, %rdx
callq 0xc6dc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0x218(%rsp), %rdx
movl %eax, 0x28(%rdx)
movq $0x0, 0x30(%rdx)
movl %eax, 0x38(%rdx)
movb $0x1, %bpl
movq %r14, %rdi
movl $0x7, %esi
callq 0x2574c
leaq 0x10(%rsp), %rsi
movq %r14, (%rsi)
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x11182
movq 0x220(%rsp), %rdi
cmpq %r12, %rdi
je 0x186a1
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0xf0(%rsp), %rdi
cmpq %r15, %rdi
je 0x186be
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x82a0
movq %rbx, 0x80(%rsp)
movl (%r13), %eax
leaq 0x40(%rsp), %rcx
movq %rcx, -0x30(%rcx)
movq $0x1, -0x28(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rcx)
movl $0x3f800000, -0x10(%rcx) # imm = 0x3F800000
movups %xmm0, -0x8(%rcx)
movl %eax, 0x8(%rcx)
movl $0x0, 0xc(%rcx)
leaq 0x76e7a(%rip), %rdi     # 0x8f578
leaq 0x10(%rsp), %rsi
callq 0x26752
movq (%rsp), %r15
leaq 0x10(%rsp), %rdi
callq 0x25f36
movl $0x20, %edi
callq 0x8290
movl 0xc(%r15), %edx
movl (%r13), %ecx
movl %edx, (%rax)
movl %ecx, 0x4(%rax)
leaq 0x8(%rax), %rcx
movq %rcx, 0x90(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rax, 0x110(%rsp)
movq $0x0, 0x18(%rax)
movb $0x1, 0x208(%r13)
movq 0x18(%r15), %rcx
movq 0x10(%rcx), %rax
cmpq %rax, 0x18(%rcx)
je 0x18f5a
leaq 0xc(%r13), %rcx
movq %rcx, 0xc8(%rsp)
leaq 0x56a63(%rip), %rcx     # 0x6f1e0
movl (%rcx), %ecx
movl %ecx, 0xa4(%rsp)
xorl %r12d, %r12d
leaq 0x756d8(%rip), %rbx     # 0x8de68
movq %r13, 0x98(%rsp)
movq (%rax,%r12,8), %rax
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x18b90
movslq (%r13), %rbp
shlq $0x6, %rbp
leaq 0x76dc0(%rip), %rax     # 0x8f578
addq (%rax), %rbp
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x753a0(%rip), %rdx     # 0x8db68
xorl %ecx, %ecx
callq 0x8320
testq %rax, %rax
je 0x18859
movq %rax, %r15
movq 0x10(%rax), %rsi
movq %rbp, %rdi
callq 0x128fa
testq %rax, %rax
je 0x188fc
movq (%rsp), %rax
movl 0x8(%rax), %ebp
movq 0x10(%r15), %rax
leaq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0xc6dc
movq %rbx, %rdi
leaq 0x563ed(%rip), %rsi     # 0x6ec13
callq 0x8590
movl %ebp, %edi
movq %rbx, %rsi
callq 0x2b6aa
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
movq (%rsp), %r15
je 0x18b51
movq 0x20(%rsp), %rsi
incq %rsi
jmp 0x18b4c
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x7531a(%rip), %rdx     # 0x8db80
xorl %ecx, %ecx
callq 0x8320
testq %rax, %rax
movq (%rsp), %r15
je 0x18b90
movq %rax, %r14
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
movq %rbp, %rdi
callq 0x128fa
testq %rax, %rax
je 0x18bb4
movl 0x8(%r15), %ebp
movq 0x10(%r14), %rax
movq 0x10(%rax), %rax
leaq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0xc6dc
movq %rbx, %rdi
leaq 0x56346(%rip), %rsi     # 0x6ec13
callq 0x8590
movl %ebp, %edi
movq %rbx, %rsi
callq 0x2b6aa
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x18b89
movq 0x20(%rsp), %rsi
incq %rsi
jmp 0x18b84
leaq 0x258(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x25368
movq 0x10(%r15), %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x257dc
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x26bbc
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x18946
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1895d
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x18974
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x18990
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movl $0xe0, %edi
callq 0x8290
movq %rax, %rbx
movq 0x10(%r15), %rax
leaq 0xb8(%rsp), %rcx
movq %rcx, 0xa8(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
movq %rbx, 0x8(%rsp)
callq 0xc6dc
movl (%r13), %ebx
movl $0x0, 0x158(%rsp)
leaq 0x170(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x160(%rsp), %rdi
callq 0xc6dc
movq %r13, %r14
movl %ebx, 0x180(%rsp)
movq $0x0, 0x188(%rsp)
movl $0xffffffff, 0x190(%rsp) # imm = 0xFFFFFFFF
leaq 0x1d8(%rsp), %rbx
movq %rbx, %rdi
movl $0x1, %esi
movl %r12d, %edx
callq 0x1279c
movb $0x1, %bpl
movq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x17, %esi
leaq 0x158(%rsp), %rdx
movq %rbx, %rcx
callq 0x25560
movq 0x80(%rsp), %r13
leaq 0x10(%rsp), %rbx
movq %r15, 0x10(%rsp)
xorl %ebp, %ebp
movq %r13, %rdi
movq %rbx, %rsi
callq 0x11182
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0x18aa9
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
movq %r14, %r13
movq (%rsp), %r15
je 0x18ad5
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x18afa
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x290(%rsp), %rdi
testq %rdi, %rdi
je 0x18b17
movq 0x2a0(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x278(%rsp), %rdi
testq %rdi, %rdi
je 0x18b34
movq 0x288(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x260(%rsp), %rdi
testq %rdi, %rdi
je 0x18b51
movq 0x270(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x90(%rsp), %rdi
movq %rbx, %rsi
callq 0x264fa
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x18b89
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
leaq 0x752d8(%rip), %rbx     # 0x8de68
incq %r12
movq 0x18(%r15), %rcx
movq 0x10(%rcx), %rax
movq 0x18(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
ja 0x18798
jmp 0x18f5a
movq %r14, 0x88(%rsp)
movl $0x50, %edi
callq 0x8290
movq %rax, %r13
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x25368
movl $0xe0, %edi
callq 0x8290
movq %rax, %r14
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
leaq 0xe0(%rsp), %rcx
movq %rcx, 0xd0(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0xd0(%rsp), %rdi
callq 0xc6dc
movq 0x98(%rsp), %rax
movl (%rax), %ebx
movl $0x40, %edi
callq 0x8290
movq %rax, %r15
movq %rax, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1279c
movl $0x5, 0x118(%rsp)
leaq 0x130(%rsp), %rax
movq %rax, 0x120(%rsp)
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x120(%rsp), %rdi
callq 0xc6dc
movl %ebx, 0x140(%rsp)
movq %r15, 0x148(%rsp)
movl $0xffffffff, 0x150(%rsp) # imm = 0xFFFFFFFF
leaq 0x198(%rsp), %rbx
movq %rbx, %rdi
movl $0x1, %esi
movl %r12d, %edx
callq 0x1279c
movb $0x1, %r15b
movq %r14, %rdi
movl $0x17, %esi
leaq 0x118(%rsp), %rdx
movq %rbx, %rcx
callq 0x25560
movq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rbx
movq %r14, 0x10(%rsp)
xorl %r15d, %r15d
movq %rbx, %rsi
callq 0x11182
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x18d11
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x18d36
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x18d5b
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rdi
movl $0xffffffff, 0x10(%rsp) # imm = 0xFFFFFFFF
movq 0x10(%r13), %rsi
cmpq 0x18(%r13), %rsi
je 0x18d89
movq %rdi, %r14
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
addq $0x4, %rsi
movq %rsi, 0x10(%r13)
jmp 0x18d94
movq %rdi, %r14
movq %rbx, %rdx
callq 0x2740e
movq 0x88(%rsp), %rax
movq 0x18(%rax), %rbx
movq 0x20(%rax), %r15
cmpq %r15, %rbx
je 0x18df8
movq (%rbx), %rdi
movq (%rdi), %rax
movq 0x98(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq *0x18(%rax)
movq 0x10(%r13), %rsi
cmpq 0x18(%r13), %rsi
je 0x18de2
movq 0xc8(%rsp), %rax
movl (%rax), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x10(%r13)
jmp 0x18df2
movq %r14, %rdi
movq 0xc8(%rsp), %rdx
callq 0x129f6
addq $0x10, %rbx
jmp 0x18da4
movq 0x8(%rsp), %rdi
addq $0x20, %rdi
movq 0x10(%r13), %rsi
subq 0x8(%r13), %rsi
sarq $0x2, %rsi
incq %rsi
movq %rdi, 0x8(%rsp)
callq 0x2591c
movq 0x20(%r13), %rax
movq 0x28(%r13), %rdx
movl 0xa4(%rsp), %ecx
movl %ecx, -0x4(%rdx)
subq %rax, %rdx
shrq $0x2, %rdx
addl $-0x2, %edx
testl %edx, %edx
jle 0x18e58
movq (%r14), %rcx
movl %edx, %edx
movl 0x4(%rax,%rdx,4), %esi
incq %rdx
imull -0x4(%rcx,%rdx,4), %esi
movl %esi, -0x4(%rax,%rdx,4)
decq %rdx
cmpq $0x1, %rdx
ja 0x18e46
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rdx
callq 0x257dc
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x26bbc
movq (%rsp), %r15
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x18ea4
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x18ebb
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x18ed2
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x18eee
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x90(%rsp), %rdi
movq %r14, %rsi
callq 0x2594e
movq 0x38(%r13), %rdi
testq %rdi, %rdi
je 0x18f13
movq 0x48(%r13), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x18f2c
movq 0x30(%r13), %rsi
subq %rdi, %rsi
callq 0x82a0
movq (%r14), %rdi
testq %rdi, %rdi
je 0x18f40
movq 0x18(%r13), %rsi
subq %rdi, %rsi
callq 0x82a0
movl $0x50, %esi
movq %r13, %rdi
callq 0x82a0
movq 0x98(%rsp), %r13
jmp 0x18b89
movq 0x10(%r15), %rax
movq 0x10(%rax), %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq 0x110(%rsp), %r12
movq %r12, %rdx
callq 0x2597a
leaq 0x7660f(%rip), %rdi     # 0x8f590
movq %r14, %rsi
callq 0x2617e
leaq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0x25ee2
movq -0x28(%r14), %rdi
leaq 0x20(%rsp), %r15
cmpq %r15, %rdi
movq 0x80(%rsp), %rbx
je 0x18fb9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x90(%rsp), %rdi
callq 0x25ee2
movl $0x20, %esi
movq %r12, %rdi
callq 0x82a0
movb $0x0, 0x48(%r13)
movq (%rsp), %r14
movq 0x20(%r14), %rdi
movq (%rdi), %rax
movq %r13, %rsi
movq %rbx, %rdx
callq *0x10(%rax)
movl 0xc(%r14), %eax
cmpl $0x121, %eax            # imm = 0x121
jne 0x19060
cmpb $0x0, 0x48(%r13)
jne 0x19060
movq (%rsp), %rax
movl 0x8(%rax), %ebp
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x10(%rsp), %r14
movq %r15, (%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xc6dc
leaq 0x55c10(%rip), %rsi     # 0x6ec3e
movq %r14, %rdi
callq 0x8590
leaq 0x10(%rsp), %rsi
movl %ebp, %edi
callq 0x2b6aa
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x19059
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq (%rsp), %rax
movl 0xc(%rax), %eax
cmpl $0x122, %eax            # imm = 0x122
jne 0x19091
movl $0xe0, %edi
callq 0x8290
movq %rax, %r14
movq %rax, %rdi
movl $0xa, %esi
callq 0x259da
leaq 0x10(%rsp), %rsi
movq %r14, (%rsi)
movq %rbx, %rdi
callq 0x11182
movl $0x0, (%r13)
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1913b
jmp 0x19155
jmp 0x19155
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x24ed2
jmp 0x1939e
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x25f36
jmp 0x1939e
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
cmpq %r15, %rdi
je 0x19243
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x19243
jmp 0x1913b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x254bc
jmp 0x1939e
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x191e8
movq %rax, %rbx
movl $0x40, %esi
movq %r15, %rdi
callq 0x82a0
jmp 0x19212
movq %rax, %rbx
jmp 0x19243
movq %rax, %rbx
movl $0x50, %esi
movq %r13, %rdi
jmp 0x19399
jmp 0x19155
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
jne 0x192e2
jmp 0x1939e
jmp 0x192cc
jmp 0x192cc
movq %rax, %rbx
movq 0x220(%rsp), %rdi
cmpq %r12, %rdi
je 0x19195
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0xf0(%rsp), %rdi
cmpq %r15, %rdi
je 0x191b2
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x82a0
testb %bpl, %bpl
jne 0x19243
jmp 0x1939e
movq %rax, %rbx
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x191e8
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x19215
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x19215
movq %rax, %rbx
movb $0x1, %r15b
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x1923a
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x82a0
testb %r15b, %r15b
je 0x1939e
movl $0xe0, %esi
movq %r14, %rdi
jmp 0x19399
movq %rax, %rbx
jmp 0x19366
jmp 0x1926c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x254bc
jmp 0x19375
movq %rax, %rbx
jmp 0x19375
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x19317
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x19366
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x19366
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
jne 0x192e2
jmp 0x1939e
movq %rax, %rbx
jmp 0x1939e
jmp 0x192cc
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1939e
movq 0x20(%rsp), %rsi
incq %rsi
jmp 0x19399
movq %rax, %rbx
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0x19317
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x1933c
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x19361
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x82a0
testb %bpl, %bpl
je 0x19375
movl $0xe0, %esi
movq 0x8(%rsp), %rdi
callq 0x82a0
leaq 0x258(%rsp), %rdi
callq 0x2551a
jmp 0x1939e
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1939e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq %rbx, %rdi
callq 0x8540