// File: /workspace/github_cpp_makefile_star2_O1/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 $0x2b8, %rsp            # imm = 0x2B8
cmpl $0x0, (%rsi)
je 0x1877f
movl 0x8(%rdi), %ebx
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x574d5(%rip), %rsi     # 0x6fc28
leaq 0x574e3(%rip), %rdx     # 0x6fc3d
leaq 0x10(%rsp), %rdi
callq 0xcaa0
leaq 0x10(%rsp), %rsi
movl %ebx, %edi
callq 0x2b12a
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
jne 0x187f6
jmp 0x192e7
movq %rdx, %rbx
movq %rsi, %r13
movq 0x10(%rdi), %rax
movq 0x10(%rax), %rsi
movq %rdi, %r15
leaq 0x77df9(%rip), %rdi     # 0x90590
callq 0x11a14
testq %rax, %rax
je 0x18808
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 0xca10
leaq 0x574a7(%rip), %rsi     # 0x6fc7b
movq %r14, %rdi
callq 0x8590
leaq 0x10(%rsp), %rsi
movl %ebx, %edi
callq 0x2b12a
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x192e7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x192e7
movq 0x10(%r15), %rax
movq 0x10(%rax), %rsi
leaq 0x1e8(%r13), %rdi
callq 0x81b0
leaq 0x77d55(%rip), %rax     # 0x90578
movq 0x8(%rax), %rcx
subq (%rax), %rcx
shrq $0x6, %rcx
movl %ecx, (%r13)
movl $0xe0, %edi
callq 0x8290
movq %rax, %r14
movq %r15, 0x8(%rsp)
movq 0x10(%r15), %rax
movq 0x10(%rax), %rax
leaq 0x118(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x108(%rsp), %rdi
callq 0xca10
leaq 0x230(%rsp), %rdi
movl $0x3, -0x8(%rdi)
leaq 0x240(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x108(%rsp), %rsi
movq 0x110(%rsp), %rdx
addq %rsi, %rdx
callq 0xca10
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0x228(%rsp), %rdx
movl %eax, 0x28(%rdx)
movq $0x0, 0x30(%rdx)
movl %eax, 0x38(%rdx)
movb $0x1, %bpl
movq %r14, %rdi
movl $0x7, %esi
callq 0x25080
leaq 0x10(%rsp), %rsi
movq %r14, (%rsi)
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x114b8
movq 0x230(%rsp), %rdi
cmpq %r12, %rdi
je 0x188fd
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x108(%rsp), %rdi
cmpq %r15, %rdi
je 0x1891a
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x82a0
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 0x77c26(%rip), %rdi     # 0x90578
leaq 0x10(%rsp), %rsi
callq 0x26072
leaq 0x10(%rsp), %rdi
callq 0x25864
movl $0x20, %edi
callq 0x8290
movq 0x8(%rsp), %rdx
movl 0xc(%rdx), %esi
movl (%r13), %ecx
movl %esi, (%rax)
movl %ecx, 0x4(%rax)
leaq 0x8(%rax), %rcx
movq %rcx, 0x98(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rax, 0x100(%rsp)
movq $0x0, 0x18(%rax)
movb $0x1, 0x208(%r13)
movq 0x18(%rdx), %rcx
movq 0x10(%rcx), %rax
cmpq %rax, 0x18(%rcx)
je 0x191b1
leaq 0xc(%r13), %rcx
movq %rcx, 0xb8(%rsp)
leaq 0x5780f(%rip), %rcx     # 0x701e0
movl (%rcx), %ecx
movl %ecx, 0xac(%rsp)
xorl %ebp, %ebp
movq %rbx, 0x88(%rsp)
movq %r13, 0xa0(%rsp)
movslq (%r13), %r12
shlq $0x6, %r12
leaq 0x77b7d(%rip), %rcx     # 0x90578
addq (%rcx), %r12
movq (%rax,%rbp,8), %rax
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x18a28
movq %r14, %rdi
leaq 0x76423(%rip), %rsi     # 0x8ee38
leaq 0x7611c(%rip), %rdx     # 0x8eb38
xorl %ecx, %ecx
callq 0x8320
movq %rax, %r15
jmp 0x18a2b
xorl %r15d, %r15d
testq %r15, %r15
je 0x18aad
movq 0x10(%r15), %rsi
movq %r12, %rdi
callq 0x12c3c
testq %rax, %rax
je 0x18ad6
movq 0x8(%rsp), %rax
movl 0x8(%rax), %r14d
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), %r12
movq %r12, %rdi
callq 0xca10
movq %r12, %rdi
leaq 0x57196(%rip), %rsi     # 0x6fc13
callq 0x8590
movl %r14d, %edi
movq %r12, %rsi
callq 0x2b12a
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x18d15
movq 0x20(%rsp), %rsi
incq %rsi
jmp 0x18d10
testq %r14, %r14
je 0x18d76
movq %r14, %rdi
leaq 0x76378(%rip), %rsi     # 0x8ee38
leaq 0x76089(%rip), %rdx     # 0x8eb50
xorl %ecx, %ecx
callq 0x8320
movq %rax, %r14
jmp 0x18d79
leaq 0x268(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24c9c
movq 0x10(%r15), %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x25110
movq %r12, %rdi
movq %rbx, %rsi
callq 0x26522
movq %rbx, %r12
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x18b23
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x18b3a
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x18b51
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x18b6d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movl $0xe0, %edi
callq 0x8290
movq %rax, %r14
movq 0x10(%r15), %rax
leaq 0xf0(%rsp), %rcx
movq %rcx, 0xe0(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0xe0(%rsp), %rdi
callq 0xca10
movl (%r13), %ebx
movl $0x0, 0x168(%rsp)
leaq 0x180(%rsp), %rax
movq %rax, 0x170(%rsp)
movq 0xe0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x170(%rsp), %rdi
callq 0xca10
movl %ebx, 0x190(%rsp)
movq $0x0, 0x198(%rsp)
movl $0xffffffff, 0x1a0(%rsp) # imm = 0xFFFFFFFF
leaq 0x1e8(%rsp), %rbx
movq %rbx, %rdi
movl $0x1, %esi
movl %ebp, %edx
callq 0x12ade
movb $0x1, %r15b
movq %r14, %rdi
movl $0x17, %esi
leaq 0x168(%rsp), %rdx
movq %rbx, %rcx
callq 0x24e94
movq 0x88(%rsp), %rbx
movq %r14, 0x10(%rsp)
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x114b8
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0x18c74
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x18c99
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x18cbe
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x2a0(%rsp), %rdi
testq %rdi, %rdi
je 0x18cdb
movq 0x2b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x288(%rsp), %rdi
testq %rdi, %rdi
je 0x18cf8
movq 0x298(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x270(%rsp), %rdi
testq %rdi, %rdi
je 0x18d15
movq 0x280(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x98(%rsp), %rdi
movq %r12, %rsi
callq 0x25e16
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x18d4d
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x8(%rsp), %rdx
incq %rbp
movq 0x18(%rdx), %rcx
movq 0x10(%rcx), %rax
movq 0x18(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbp, %rcx
ja 0x189ec
jmp 0x191b1
xorl %r14d, %r14d
movq 0x8(%rsp), %rdx
testq %r14, %r14
je 0x18d52
movq 0x10(%r14), %rax
movq 0x10(%rax), %rsi
movq %r12, %rdi
callq 0x12c3c
testq %rax, %rax
je 0x18e04
movq 0x8(%rsp), %rax
movl 0x8(%rax), %r15d
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), %r14
movq %r14, %rdi
callq 0xca10
movq %r14, %rdi
leaq 0x56e3f(%rip), %rsi     # 0x6fc13
callq 0x8590
movl %r15d, %edi
movq %r14, %rsi
callq 0x2b12a
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x18d4d
movq 0x20(%rsp), %rsi
incq %rsi
jmp 0x18d48
movq %r14, 0x90(%rsp)
movl $0x50, %edi
callq 0x8290
movq %rax, %rbx
movq %rax, %r13
movq %rax, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x24c9c
movq %rbx, 0xb0(%rsp)
movl $0xe0, %edi
callq 0x8290
movq %rax, %r14
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
leaq 0xd0(%rsp), %rcx
movq %rcx, 0xc0(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0xc0(%rsp), %rdi
callq 0xca10
movq 0xa0(%rsp), %rax
movl (%rax), %ebx
movl $0x40, %edi
callq 0x8290
movq %rax, %r15
movq %rax, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x12ade
movl $0x5, 0x128(%rsp)
leaq 0x140(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x130(%rsp), %rdi
callq 0xca10
movl %ebx, 0x150(%rsp)
movq %r15, 0x158(%rsp)
movl $0xffffffff, 0x160(%rsp) # imm = 0xFFFFFFFF
leaq 0x1a8(%rsp), %rbx
movq %rbx, %rdi
movl $0x1, %esi
movl %ebp, %edx
callq 0x12ade
movb $0x1, %r15b
movq %r14, %rdi
movl $0x17, %esi
leaq 0x128(%rsp), %rdx
movq %rbx, %rcx
callq 0x24e94
movq 0x88(%rsp), %rdi
movq %r14, 0x10(%rsp)
xorl %r15d, %r15d
leaq 0x10(%rsp), %rsi
callq 0x114b8
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x18f63
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
movq 0xb0(%rsp), %rbx
je 0x18f90
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x18fb5
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x8(%rbx), %rdi
movl $0xffffffff, 0x10(%rsp) # imm = 0xFFFFFFFF
movq 0x10(%r13), %rsi
cmpq 0x18(%r13), %rsi
je 0x18fde
movq %rdi, %r14
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
addq $0x4, %rsi
movq %rsi, 0x10(%r13)
jmp 0x18feb
movq %rdi, %r14
leaq 0x10(%rsp), %rdx
callq 0x26d72
movq 0x90(%rsp), %rax
movq 0x18(%rax), %rbx
movq 0x20(%rax), %r15
cmpq %r15, %rbx
je 0x1904f
movq (%rbx), %rdi
movq (%rdi), %rax
movq 0xa0(%rsp), %rsi
movq 0x88(%rsp), %rdx
callq *0x18(%rax)
movq 0x10(%r13), %rsi
cmpq 0x18(%r13), %rsi
je 0x19039
movq 0xb8(%rsp), %rax
movl (%rax), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x10(%r13)
jmp 0x19049
movq %r14, %rdi
movq 0xb8(%rsp), %rdx
callq 0x12d38
addq $0x10, %rbx
jmp 0x18ffb
movq 0xb0(%rsp), %r15
addq $0x20, %r15
movq 0x10(%r13), %rsi
subq 0x8(%r13), %rsi
sarq $0x2, %rsi
incq %rsi
movq %r15, %rdi
callq 0x25250
movq 0x20(%r13), %rax
movq 0x28(%r13), %rdx
movl 0xac(%rsp), %ecx
movl %ecx, -0x4(%rdx)
subq %rax, %rdx
shrq $0x2, %rdx
addl $-0x2, %edx
testl %edx, %edx
jle 0x190b0
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
jg 0x1909e
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rdx
callq 0x25110
movq %r12, %rdi
movq %rbx, %rsi
callq 0x26522
movq 0x88(%rsp), %rbx
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x19100
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x19117
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1912e
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1914a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x98(%rsp), %rdi
movq %r14, %rsi
callq 0x25282
movq 0x38(%r13), %rdi
testq %rdi, %rdi
je 0x1916f
movq 0x48(%r13), %rsi
subq %rdi, %rsi
callq 0x82a0
movq (%r15), %rdi
testq %rdi, %rdi
je 0x19183
movq 0x30(%r13), %rsi
subq %rdi, %rsi
callq 0x82a0
movq (%r14), %rdi
testq %rdi, %rdi
je 0x19197
movq 0x18(%r13), %rsi
subq %rdi, %rsi
callq 0x82a0
movl $0x50, %esi
movq %r13, %rdi
callq 0x82a0
movq 0xa0(%rsp), %r13
jmp 0x18d4d
movq 0x10(%rdx), %rax
movq 0x10(%rax), %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq 0x100(%rsp), %r12
movq %r12, %rdx
callq 0x252ae
leaq 0x773b8(%rip), %rdi     # 0x90590
movq %r14, %rsi
callq 0x25a96
leaq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0x25816
movq -0x28(%r14), %rdi
leaq 0x20(%rsp), %r15
cmpq %r15, %rdi
je 0x19208
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x98(%rsp), %rdi
callq 0x25816
movl $0x20, %esi
movq %r12, %rdi
callq 0x82a0
movb $0x0, 0x48(%r13)
movq 0x8(%rsp), %r14
movq 0x20(%r14), %rdi
movq (%rdi), %rax
movq %r13, %rsi
movq %rbx, %rdx
callq *0x10(%rax)
movq %r14, %rax
cmpl $0x121, 0xc(%r14)       # imm = 0x121
jne 0x192ac
cmpb $0x0, 0x48(%r13)
jne 0x192ac
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 0xca10
leaq 0x569c2(%rip), %rsi     # 0x6fc3e
movq %r14, %rdi
callq 0x8590
leaq 0x10(%rsp), %rsi
movl %ebp, %edi
callq 0x2b12a
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x192a7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x8(%rsp), %rax
cmpl $0x122, 0xc(%rax)       # imm = 0x122
jne 0x192df
movl $0xe0, %edi
callq 0x8290
movq %rax, %r14
movq %rax, %rdi
movl $0xa, %esi
callq 0x2530e
leaq 0x10(%rsp), %rsi
movq %r14, (%rsi)
movq %rbx, %rdi
callq 0x114b8
movl $0x0, (%r13)
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1947c
jmp 0x19341
jmp 0x19341
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x24814
jmp 0x195af
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x25864
jmp 0x195af
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x193c4
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x193e1
jmp 0x19341
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
jne 0x194f5
jmp 0x195af
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x24df0
jmp 0x195af
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x19421
movq %rax, %rbx
movl $0x40, %esi
movq %r15, %rdi
callq 0x82a0
jmp 0x1944b
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x19473
movq %rax, %rbx
movl $0x50, %esi
movq %r13, %rdi
jmp 0x195aa
movq %rax, %rbx
movq 0x230(%rsp), %rdi
cmpq %r12, %rdi
je 0x193c4
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x108(%rsp), %rdi
cmpq %r15, %rdi
je 0x193e1
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x82a0
testb %bpl, %bpl
jne 0x1947c
jmp 0x195af
jmp 0x194df
jmp 0x194df
movq %rax, %rbx
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x19421
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x1944e
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x1944e
movq %rax, %rbx
movb $0x1, %r15b
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x19473
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x82a0
testb %r15b, %r15b
je 0x195af
movl $0xe0, %esi
movq %r14, %rdi
jmp 0x195aa
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
jne 0x194f5
jmp 0x195af
movq %rax, %rbx
jmp 0x195af
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x24df0
jmp 0x19586
jmp 0x194d5
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x1952a
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x1954f
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x19574
movq %rax, %rbx
jmp 0x19586
jmp 0x194df
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x195af
movq 0x20(%rsp), %rsi
incq %rsi
jmp 0x195aa
movq %rax, %rbx
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0x1952a
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x1954f
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x19574
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x82a0
testb %r15b, %r15b
je 0x19586
movl $0xe0, %esi
movq %r14, %rdi
callq 0x82a0
leaq 0x268(%rsp), %rdi
callq 0x24e4e
jmp 0x195af
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x195af
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq %rbx, %rdi
callq 0x8540
nop