// File: luooofan[P]hblzbd_compiler/src/generate_ir.cpp
// Function: ast::FunctionCall::GenerateIR(ir::ContextInfo&, std::vector<ir::IR*, std::allocator<ir::IR*>>&)
void FunctionCall::GenerateIR(ir::ContextInfo &ctx, std::vector<ir::IR *> &gIRList) {
  ir::Opn opn1, opn2;
  auto func_item_iter = ir::gFuncTable.find(name_.name_);
  if (func_item_iter == ir::gFuncTable.end()) {
    ir::SemanticError(line_no_, "调用的函数不存在");
    return;
  }
  auto &func_item = (*func_item_iter).second;
  if (func_item.shape_list_.size() != args_.arg_list_.size()) {
    ir::SemanticError(line_no_, "参数个数不匹配");
    return;
  }

  std::stack<ir::IR *> param_list;
  // NOTE: 正着走
  // for (int i = args_.arg_list_.size() - 1; i >= 0; --i) {
  for (int i = 0; i < args_.arg_list_.size(); ++i) {
    args_.arg_list_[i]->GenerateIR(ctx, gIRList);
    if (name_.name_ != "putarray" && name_.name_ != "memset") {  // NOTE: putarray和memset不检查参数的合法性
      if (ctx.shape_.size() != func_item.shape_list_[i].size()) {
        // std::cerr << ctx.shape_.size() << ' ' << func_item.shape_list_[i].size() << std::endl;
        ir::SemanticError(line_no_, "函数调用参数类型不匹配");
        return;
      } else {
        for (int j = 1; j < ctx.shape_.size(); j++) {
          if (ctx.shape_[j] != func_item.shape_list_[i][j]) {
            ir::SemanticError(line_no_, "函数调用参数类型不匹配");
            return;
          }
        }
      }
    }

    ir::SymbolTableItem *s = nullptr;
    int scope_id = ir::FindSymbol(ctx.scope_id_, ctx.opn_.name_, s);
    if (name_.name_ != "putarray" && name_.name_ != "memset" && s && s->is_array_ && s->is_const_) {
      ir::SemanticError(line_no_, "实参不能是const数组");
      return;
    }

    opn1 = ctx.opn_;
    if (s && s->is_array_ && nullptr == opn1.offset_) {
      ir::Opn *offset = new ir::Opn(OpnType::Imm, 0);
      opn1 = ir::Opn(OpnType::Array, opn1.name_, opn1.scope_id_, offset);
    }

    // NOTE: 全局变量需要先赋值到一个temp中
    // FIX: 全局数组不用
    if (0 == scope_id && opn1.type_ == OpnType::Var) {
      std::string temp = ir::NewTemp();
      ir::gScopes[ctx.scope_id_].symbol_table_.insert({temp, {false, false}});
      auto temp_opn = ir::Opn(OpnType::Var, temp, ctx.scope_id_);
      gIRList.push_back(new ir::IR(IROpKind::ASSIGN, opn1, temp_opn));
      opn1 = temp_opn;
    }

    param_list.push(new ir::IR(IROpKind::PARAM, opn1));
  }

  // NOTE: 倒着写Param语句
  while (!param_list.empty()) {
    gIRList.push_back(param_list.top());
    param_list.pop();
  }

  opn1 = ir::Opn(OpnType::Func, name_.name_);
  opn2 = ir::Opn(OpnType::Imm, func_item.shape_list_.size());

  ir::IR *ir;
  // 当call调用的函数返回INT时 生成(call, func, arg-num, temp) 返回VOID时 (call, func, arg-num, -/NULL)
  if (func_item.ret_type_ == INT) {
    auto scope_id = ctx.scope_id_;

    std::string ret_var = ir::NewTemp();
    // NOTE: 中间变量栈偏移-1 并且不维护scope的dynamic offset
    ir::gScopes[scope_id].symbol_table_.insert({ret_var, {false, false}});

    ir::Opn temp = ir::Opn(OpnType::Var, ret_var, scope_id);
    ctx.opn_ = temp;
    ctx.shape_.clear();
    ir = new ir::IR(IROpKind::CALL, opn1, opn2, temp);
  } else {
    ir::Opn temp = ir::Opn(OpnType::Null);
    ctx.opn_ = temp;
    ctx.shape_.clear();
    ir = new ir::IR(IROpKind::CALL, opn1, opn2, temp);
  }
  // printf("/*********************\n");
  gIRList.push_back(ir);
}

// Assembly:
subq $0x988, %rsp            # imm = 0x988
movq %rdi, 0x980(%rsp)
movq %rsi, 0x978(%rsp)
movq %rdx, 0x970(%rsp)
movq 0x980(%rsp), %rax
movq %rax, 0x108(%rsp)
leaq 0x930(%rsp), %rdi
callq 0x36950
leaq 0x8f0(%rsp), %rdi
callq 0x36950
jmp 0x2458b
movq 0x108(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
leaq 0x12809e(%rip), %rdi    # 0x14c640
callq 0x18680
movq %rax, 0x100(%rsp)
jmp 0x245b1
movq 0x100(%rsp), %rax
movq %rax, 0x8d8(%rsp)
leaq 0x128078(%rip), %rdi    # 0x14c640
callq 0x36170
movq %rax, 0x8d0(%rsp)
leaq 0x8d8(%rsp), %rdi
leaq 0x8d0(%rsp), %rsi
callq 0x36150
testb $0x1, %al
jne 0x245f3
jmp 0x246f3
movq 0x108(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0xf4(%rsp)
leaq 0x8af(%rsp), %rdi
movq %rdi, 0xf8(%rsp)
callq 0x8680
movq 0xf8(%rsp), %rdx
leaq 0xd64f5(%rip), %rsi     # 0xfab1e
leaq 0x8b0(%rsp), %rdi
callq 0xc570
jmp 0x24638
movl 0xf4(%rsp), %edi
leaq 0x8b0(%rsp), %rsi
callq 0x47ce0
jmp 0x2464e
leaq 0x8b0(%rsp), %rdi
callq 0x8728
leaq 0x8af(%rsp), %rdi
callq 0x83c0
movl $0x1, 0x8a8(%rsp)
jmp 0x25a56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x25a92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x25a85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x246e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x8b0(%rsp), %rdi
callq 0x8728
leaq 0x8af(%rsp), %rdi
callq 0x83c0
jmp 0x25a85
leaq 0x8d8(%rsp), %rdi
callq 0x186b0
addq $0x20, %rax
movq %rax, 0x8a0(%rsp)
movq 0x8a0(%rsp), %rdi
addq $0x8, %rdi
callq 0x186d0
movq %rax, %rcx
movq 0x108(%rsp), %rax
movq %rcx, 0xe8(%rsp)
movq 0x18(%rax), %rdi
addq $0x10, %rdi
callq 0x36b40
movq %rax, %rcx
movq 0xe8(%rsp), %rax
cmpq %rcx, %rax
je 0x2481f
movq 0x108(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0xdc(%rsp)
leaq 0x87f(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
callq 0x8680
movq 0xe0(%rsp), %rdx
leaq 0xd63b0(%rip), %rsi     # 0xfab37
leaq 0x880(%rsp), %rdi
callq 0xc570
jmp 0x24796
movl 0xdc(%rsp), %edi
leaq 0x880(%rsp), %rsi
callq 0x47ce0
jmp 0x247ac
leaq 0x880(%rsp), %rdi
callq 0x8728
leaq 0x87f(%rsp), %rdi
callq 0x83c0
movl $0x1, 0x8a8(%rsp)
jmp 0x25a56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x2480d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x880(%rsp), %rdi
callq 0x8728
leaq 0x87f(%rsp), %rdi
callq 0x83c0
jmp 0x25a85
leaq 0x828(%rsp), %rdi
callq 0x36b60
jmp 0x2482e
movl $0x0, 0x824(%rsp)
movq 0x108(%rsp), %rax
movslq 0x824(%rsp), %rcx
movq %rcx, 0xd0(%rsp)
movq 0x18(%rax), %rdi
addq $0x10, %rdi
callq 0x36b40
movq %rax, %rcx
movq 0xd0(%rsp), %rax
cmpq %rcx, %rax
jae 0x25350
movq 0x108(%rsp), %rax
movq 0x18(%rax), %rdi
addq $0x10, %rdi
movslq 0x824(%rsp), %rsi
callq 0x36b90
movq (%rax), %rdi
movq 0x978(%rsp), %rsi
movq 0x970(%rsp), %rdx
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
jmp 0x248ad
movq 0x108(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq 0xd603f(%rip), %rsi     # 0xfa903
callq 0xcc30
movb %al, 0xcf(%rsp)
jmp 0x248d2
movb 0xcf(%rsp), %al
testb $0x1, %al
jne 0x248e2
jmp 0x24bd3
movq 0x108(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq 0xd6032(%rip), %rsi     # 0xfa92b
callq 0xcc30
movb %al, 0xce(%rsp)
jmp 0x24907
movb 0xce(%rsp), %al
testb $0x1, %al
jne 0x24917
jmp 0x24bd3
movq 0x978(%rsp), %rdi
addq $0x50, %rdi
callq 0x10a40
movq %rax, 0xc0(%rsp)
movq 0x8a0(%rsp), %rdi
addq $0x8, %rdi
movslq 0x824(%rsp), %rsi
callq 0x36bb0
movq %rax, %rdi
callq 0x10a40
movq %rax, %rcx
movq 0xc0(%rsp), %rax
cmpq %rcx, %rax
je 0x24a4c
movq 0x108(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0xb4(%rsp)
leaq 0x7ff(%rsp), %rdi
movq %rdi, 0xb8(%rsp)
callq 0x8680
movq 0xb8(%rsp), %rdx
leaq 0xd61b2(%rip), %rsi     # 0xfab4d
leaq 0x800(%rsp), %rdi
callq 0xc570
jmp 0x249aa
movl 0xb4(%rsp), %edi
leaq 0x800(%rsp), %rsi
callq 0x47ce0
jmp 0x249c0
leaq 0x800(%rsp), %rdi
callq 0x8728
leaq 0x7ff(%rsp), %rdi
callq 0x83c0
movl $0x1, 0x8a8(%rsp)
jmp 0x25a49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x25a78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x24a3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x800(%rsp), %rdi
callq 0x8728
leaq 0x7ff(%rsp), %rdi
callq 0x83c0
jmp 0x25a78
movl $0x1, 0x7f8(%rsp)
movslq 0x7f8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x978(%rsp), %rdi
addq $0x50, %rdi
callq 0x10a40
movq %rax, %rcx
movq 0xa8(%rsp), %rax
cmpq %rcx, %rax
jae 0x24bcf
movq 0x978(%rsp), %rdi
addq $0x50, %rdi
movslq 0x7f8(%rsp), %rsi
callq 0x10a60
movl (%rax), %eax
movl %eax, 0xa4(%rsp)
movq 0x8a0(%rsp), %rdi
addq $0x8, %rdi
movslq 0x824(%rsp), %rsi
callq 0x36bb0
movq %rax, %rdi
movslq 0x7f8(%rsp), %rsi
callq 0x10a60
movq %rax, %rcx
movl 0xa4(%rsp), %eax
cmpl (%rcx), %eax
je 0x24bb7
movq 0x108(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x94(%rsp)
leaq 0x7d7(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0x8680
movq 0x98(%rsp), %rdx
leaq 0xd602e(%rip), %rsi     # 0xfab4d
leaq 0x7d8(%rsp), %rdi
callq 0xc570
jmp 0x24b2e
movl 0x94(%rsp), %edi
leaq 0x7d8(%rsp), %rsi
callq 0x47ce0
jmp 0x24b44
leaq 0x7d8(%rsp), %rdi
callq 0x8728
leaq 0x7d7(%rsp), %rdi
callq 0x83c0
movl $0x1, 0x8a8(%rsp)
jmp 0x25a49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x24ba5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x7d8(%rsp), %rdi
callq 0x8728
leaq 0x7d7(%rsp), %rdi
callq 0x83c0
jmp 0x25a78
jmp 0x24bb9
movl 0x7f8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7f8(%rsp)
jmp 0x24a57
jmp 0x24bd1
jmp 0x24bd3
movq $0x0, 0x7c8(%rsp)
movq 0x978(%rsp), %rsi
movl (%rsi), %eax
movl %eax, 0x90(%rsp)
addq $0x10, %rsi
leaq 0x7a0(%rsp), %rdi
callq 0x81a0
jmp 0x24c03
movl 0x90(%rsp), %edi
leaq 0x7a0(%rsp), %rsi
leaq 0x7c8(%rsp), %rdx
callq 0x42f30
movl %eax, 0x8c(%rsp)
jmp 0x24c28
leaq 0x7a0(%rsp), %rdi
callq 0x8728
movl 0x8c(%rsp), %ecx
movq 0x108(%rsp), %rax
movl %ecx, 0x7c4(%rsp)
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq 0xd5ca9(%rip), %rsi     # 0xfa903
callq 0xcc30
movb %al, 0x8b(%rsp)
jmp 0x24c68
movb 0x8b(%rsp), %al
testb $0x1, %al
jne 0x24c78
jmp 0x24dcd
movq 0x108(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq 0xd5c9c(%rip), %rsi     # 0xfa92b
callq 0xcc30
movb %al, 0x8a(%rsp)
jmp 0x24c9d
movb 0x8a(%rsp), %al
testb $0x1, %al
jne 0x24cad
jmp 0x24dcd
cmpq $0x0, 0x7c8(%rsp)
je 0x24dcd
movq 0x7c8(%rsp), %rax
testb $0x1, (%rax)
je 0x24dcd
movq 0x7c8(%rsp), %rax
testb $0x1, 0x1(%rax)
je 0x24dcd
movq 0x108(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x7c(%rsp)
leaq 0x77f(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x8680
movq 0x80(%rsp), %rdx
leaq 0xd5e5d(%rip), %rsi     # 0xfab6f
leaq 0x780(%rsp), %rdi
callq 0xc570
jmp 0x24d21
movl 0x7c(%rsp), %edi
leaq 0x780(%rsp), %rsi
callq 0x47ce0
jmp 0x24d34
leaq 0x780(%rsp), %rdi
callq 0x8728
leaq 0x77f(%rsp), %rdi
callq 0x83c0
movl $0x1, 0x8a8(%rsp)
jmp 0x25a49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x7a0(%rsp), %rdi
callq 0x8728
jmp 0x25a78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x24dbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x780(%rsp), %rdi
callq 0x8728
leaq 0x77f(%rsp), %rdi
callq 0x83c0
jmp 0x25a78
movq 0x978(%rsp), %rsi
addq $0x8, %rsi
leaq 0x930(%rsp), %rdi
callq 0x43230
jmp 0x24de8
cmpq $0x0, 0x7c8(%rsp)
je 0x24f2f
movq 0x7c8(%rsp), %rax
testb $0x1, (%rax)
je 0x24f2f
xorl %eax, %eax
cmpq 0x960(%rsp), %rax
jne 0x24f2f
movl $0x40, %edi
callq 0x8340
movq %rax, 0x70(%rsp)
jmp 0x24e29
movq 0x70(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1f160
jmp 0x24e3c
movq 0x70(%rsp), %rax
movq %rax, 0x770(%rsp)
leaq 0x938(%rsp), %rsi
leaq 0x710(%rsp), %rdi
callq 0x81a0
jmp 0x24e60
movl 0x958(%rsp), %ecx
movq 0x770(%rsp), %r8
leaq 0x730(%rsp), %rdi
movl $0x5, %esi
leaq 0x710(%rsp), %rdx
callq 0x36610
jmp 0x24e8b
leaq 0x930(%rsp), %rdi
leaq 0x730(%rsp), %rsi
callq 0x433c0
jmp 0x24ea2
leaq 0x730(%rsp), %rdi
callq 0x1f210
leaq 0x710(%rsp), %rdi
callq 0x8728
jmp 0x24f2f
movq 0x70(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
movl $0x40, %esi
callq 0x8350
jmp 0x25a78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x24f1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x730(%rsp), %rdi
callq 0x1f210
leaq 0x710(%rsp), %rdi
callq 0x8728
jmp 0x25a78
xorl %eax, %eax
cmpl 0x7c4(%rsp), %eax
jne 0x25261
cmpl $0x0, 0x930(%rsp)
jne 0x25261
leaq 0x6f0(%rsp), %rdi
callq 0x43010
jmp 0x24f5b
movq 0x978(%rsp), %rax
movslq (%rax), %rsi
leaq 0x1276bb(%rip), %rdi    # 0x14c628
callq 0x183c0
movq %rax, 0x68(%rsp)
leaq 0x630(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x366c0
jmp 0x24f8a
leaq 0x680(%rsp), %rdi
leaq 0x6f0(%rsp), %rsi
leaq 0x630(%rsp), %rdx
callq 0x367a0
jmp 0x24fa9
movq 0x68(%rsp), %rdi
leaq 0x680(%rsp), %rsi
callq 0x36670
movb %dl, 0x5f(%rsp)
movq %rax, 0x60(%rsp)
jmp 0x24fc6
movb 0x5f(%rsp), %al
movq 0x60(%rsp), %rcx
movq %rcx, 0x620(%rsp)
movb %al, 0x628(%rsp)
leaq 0x680(%rsp), %rdi
callq 0x36810
leaq 0x630(%rsp), %rdi
callq 0x36840
leaq 0x5c0(%rsp), %rdi
leaq 0x6f0(%rsp), %rsi
callq 0x81a0
jmp 0x2500f
movq 0x978(%rsp), %rax
movl (%rax), %ecx
leaq 0x5e0(%rsp), %rdi
xorl %esi, %esi
leaq 0x5c0(%rsp), %rdx
callq 0x36480
jmp 0x25032
leaq 0x5c0(%rsp), %rdi
callq 0x8728
movq 0x970(%rsp), %rax
movq %rax, 0x48(%rsp)
movl $0xe0, %edi
callq 0x8340
movq %rax, 0x50(%rsp)
jmp 0x2505d
movb $0x1, 0x537(%rsp)
leaq 0x578(%rsp), %rdi
leaq 0x930(%rsp), %rsi
callq 0x43130
jmp 0x2507c
leaq 0x538(%rsp), %rdi
leaq 0x5e0(%rsp), %rsi
callq 0x43130
jmp 0x25093
movq 0x50(%rsp), %rdi
movl $0xc, %esi
leaq 0x578(%rsp), %rdx
leaq 0x538(%rsp), %rcx
callq 0x36880
jmp 0x250b4
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rax
movb $0x0, 0x537(%rsp)
movq %rax, 0x5b8(%rsp)
leaq 0x5b8(%rsp), %rsi
callq 0x185b0
jmp 0x250dd
leaq 0x538(%rsp), %rdi
callq 0x1f210
leaq 0x578(%rsp), %rdi
callq 0x1f210
leaq 0x930(%rsp), %rdi
leaq 0x5e0(%rsp), %rsi
callq 0x43230
jmp 0x2510e
leaq 0x5e0(%rsp), %rdi
callq 0x1f210
leaq 0x6f0(%rsp), %rdi
callq 0x8728
jmp 0x25261
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x2524f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x2517d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x680(%rsp), %rdi
callq 0x36810
leaq 0x630(%rsp), %rdi
callq 0x36840
jmp 0x2524f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x5c0(%rsp), %rdi
callq 0x8728
jmp 0x2524f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x25242
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x25225
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x25218
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x538(%rsp), %rdi
callq 0x1f210
leaq 0x578(%rsp), %rdi
callq 0x1f210
testb $0x1, 0x537(%rsp)
jne 0x25231
jmp 0x25240
movq 0x50(%rsp), %rdi
movl $0xe0, %esi
callq 0x8350
jmp 0x25242
leaq 0x5e0(%rsp), %rdi
callq 0x1f210
leaq 0x6f0(%rsp), %rdi
callq 0x8728
jmp 0x25a78
movl $0xe0, %edi
callq 0x8340
movq %rax, 0x40(%rsp)
jmp 0x25272
movb $0x1, 0x4e7(%rsp)
leaq 0x4e8(%rsp), %rdi
leaq 0x930(%rsp), %rsi
callq 0x43130
jmp 0x25291
movq 0x40(%rsp), %rdi
movl $0x8, %esi
leaq 0x4e8(%rsp), %rdx
callq 0x36c00
jmp 0x252aa
movq 0x40(%rsp), %rax
movb $0x0, 0x4e7(%rsp)
movq %rax, 0x528(%rsp)
leaq 0x828(%rsp), %rdi
leaq 0x528(%rsp), %rsi
callq 0x36bd0
jmp 0x252d6
leaq 0x4e8(%rsp), %rdi
callq 0x1f210
movl 0x824(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x824(%rsp)
jmp 0x24839
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x25330
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x4e8(%rsp), %rdi
callq 0x1f210
testb $0x1, 0x4e7(%rsp)
jne 0x2533c
jmp 0x2534b
movq 0x40(%rsp), %rdi
movl $0xe0, %esi
callq 0x8350
jmp 0x25a78
jmp 0x25352
leaq 0x828(%rsp), %rdi
callq 0x36cc0
movb %al, 0x3f(%rsp)
jmp 0x25365
movb 0x3f(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x25371
jmp 0x253b4
movq 0x970(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x828(%rsp), %rdi
callq 0x36d50
movq %rax, 0x30(%rsp)
jmp 0x25392
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x36ce0
jmp 0x253a3
leaq 0x828(%rsp), %rdi
callq 0x36d60
jmp 0x253b2
jmp 0x25352
movq 0x108(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
leaq 0x480(%rsp), %rdi
callq 0x81a0
jmp 0x253d3
leaq 0x4a0(%rsp), %rdi
movl $0x3, %esi
leaq 0x480(%rsp), %rdx
callq 0x36d70
jmp 0x253ef
leaq 0x930(%rsp), %rdi
leaq 0x4a0(%rsp), %rsi
callq 0x433c0
jmp 0x25406
leaq 0x4a0(%rsp), %rdi
callq 0x1f210
leaq 0x480(%rsp), %rdi
callq 0x8728
movq 0x8a0(%rsp), %rdi
addq $0x8, %rdi
callq 0x186d0
movl %eax, %edx
leaq 0x440(%rsp), %rdi
movl $0x1, %esi
callq 0x1f160
jmp 0x25447
leaq 0x8f0(%rsp), %rdi
leaq 0x440(%rsp), %rsi
callq 0x433c0
jmp 0x2545e
leaq 0x440(%rsp), %rdi
callq 0x1f210
movq 0x8a0(%rsp), %rax
cmpl $0x121, (%rax)          # imm = 0x121
jne 0x25854
movq 0x978(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x434(%rsp)
leaq 0x410(%rsp), %rdi
callq 0x43010
jmp 0x2549f
movslq 0x434(%rsp), %rsi
leaq 0x12717a(%rip), %rdi    # 0x14c628
callq 0x183c0
movq %rax, 0x20(%rsp)
leaq 0x350(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x366c0
jmp 0x254cb
leaq 0x3a0(%rsp), %rdi
leaq 0x410(%rsp), %rsi
leaq 0x350(%rsp), %rdx
callq 0x367a0
jmp 0x254ea
movq 0x20(%rsp), %rdi
leaq 0x3a0(%rsp), %rsi
callq 0x36670
movb %dl, 0x17(%rsp)
movq %rax, 0x18(%rsp)
jmp 0x25507
movb 0x17(%rsp), %al
movq 0x18(%rsp), %rcx
movq %rcx, 0x340(%rsp)
movb %al, 0x348(%rsp)
leaq 0x3a0(%rsp), %rdi
callq 0x36810
leaq 0x350(%rsp), %rdi
callq 0x36840
leaq 0x2e0(%rsp), %rdi
leaq 0x410(%rsp), %rsi
callq 0x81a0
jmp 0x25550
movl 0x434(%rsp), %ecx
leaq 0x300(%rsp), %rdi
xorl %esi, %esi
leaq 0x2e0(%rsp), %rdx
callq 0x36480
jmp 0x25570
leaq 0x2e0(%rsp), %rdi
callq 0x8728
movq 0x978(%rsp), %rdi
addq $0x8, %rdi
leaq 0x300(%rsp), %rsi
callq 0x43230
jmp 0x25598
movq 0x978(%rsp), %rdi
addq $0x50, %rdi
callq 0x361a0
movl $0xe0, %edi
callq 0x8340
movq %rax, 0x8(%rsp)
jmp 0x255ba
movb $0x1, 0x21f(%rsp)
leaq 0x2a0(%rsp), %rdi
leaq 0x930(%rsp), %rsi
callq 0x43130
jmp 0x255d9
leaq 0x260(%rsp), %rdi
leaq 0x8f0(%rsp), %rsi
callq 0x43130
jmp 0x255f0
leaq 0x220(%rsp), %rdi
leaq 0x300(%rsp), %rsi
callq 0x43130
jmp 0x25607
movq 0x8(%rsp), %rdi
movl $0x9, %esi
leaq 0x2a0(%rsp), %rdx
leaq 0x260(%rsp), %rcx
leaq 0x220(%rsp), %r8
callq 0x36a60
jmp 0x25630
movq 0x8(%rsp), %rax
movb $0x0, 0x21f(%rsp)
movq %rax, 0x438(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x1f210
leaq 0x260(%rsp), %rdi
callq 0x1f210
leaq 0x2a0(%rsp), %rdi
callq 0x1f210
leaq 0x300(%rsp), %rdi
callq 0x1f210
leaq 0x410(%rsp), %rdi
callq 0x8728
jmp 0x25a27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x256c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x4a0(%rsp), %rdi
callq 0x1f210
leaq 0x480(%rsp), %rdi
callq 0x8728
jmp 0x25a78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x440(%rsp), %rdi
callq 0x1f210
jmp 0x25a78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x25842
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x2574a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x3a0(%rsp), %rdi
callq 0x36810
leaq 0x350(%rsp), %rdi
callq 0x36840
jmp 0x25842
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x2e0(%rsp), %rdi
callq 0x8728
jmp 0x25842
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x25835
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x25818
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x2580b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x257fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x1f210
leaq 0x260(%rsp), %rdi
callq 0x1f210
leaq 0x2a0(%rsp), %rdi
callq 0x1f210
testb $0x1, 0x21f(%rsp)
jne 0x25824
jmp 0x25833
movq 0x8(%rsp), %rdi
movl $0xe0, %esi
callq 0x8350
jmp 0x25835
leaq 0x300(%rsp), %rdi
callq 0x1f210
leaq 0x410(%rsp), %rdi
callq 0x8728
jmp 0x25a78
leaq 0x1d8(%rsp), %rdi
movl $0x4, %esi
callq 0x36dd0
jmp 0x25868
movq 0x978(%rsp), %rdi
addq $0x8, %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x43230
jmp 0x25883
movq 0x978(%rsp), %rdi
addq $0x50, %rdi
callq 0x361a0
movl $0xe0, %edi
callq 0x8340
movq %rax, (%rsp)
jmp 0x258a4
movb $0x1, 0x117(%rsp)
leaq 0x198(%rsp), %rdi
leaq 0x930(%rsp), %rsi
callq 0x43130
jmp 0x258c3
leaq 0x158(%rsp), %rdi
leaq 0x8f0(%rsp), %rsi
callq 0x43130
jmp 0x258da
leaq 0x118(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x43130
jmp 0x258f1
movq (%rsp), %rdi
movl $0x9, %esi
leaq 0x198(%rsp), %rdx
leaq 0x158(%rsp), %rcx
leaq 0x118(%rsp), %r8
callq 0x36a60
jmp 0x25919
movq (%rsp), %rax
movb $0x0, 0x117(%rsp)
movq %rax, 0x438(%rsp)
leaq 0x118(%rsp), %rdi
callq 0x1f210
leaq 0x158(%rsp), %rdi
callq 0x1f210
leaq 0x198(%rsp), %rdi
callq 0x1f210
leaq 0x1d8(%rsp), %rdi
callq 0x1f210
jmp 0x25a27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x25a18
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x259fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x259ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
jmp 0x259e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8e8(%rsp)
movl %eax, 0x8e4(%rsp)
leaq 0x118(%rsp), %rdi
callq 0x1f210
leaq 0x158(%rsp), %rdi
callq 0x1f210
leaq 0x198(%rsp), %rdi
callq 0x1f210
testb $0x1, 0x117(%rsp)
jne 0x25a08
jmp 0x25a16
movq (%rsp), %rdi
movl $0xe0, %esi
callq 0x8350
jmp 0x25a18
leaq 0x1d8(%rsp), %rdi
callq 0x1f210
jmp 0x25a78
movq 0x970(%rsp), %rdi
leaq 0x438(%rsp), %rsi
callq 0x36ce0
jmp 0x25a3e
movl $0x0, 0x8a8(%rsp)
leaq 0x828(%rsp), %rdi
callq 0x36e70
leaq 0x8f0(%rsp), %rdi
callq 0x1f210
leaq 0x930(%rsp), %rdi
callq 0x1f210
addq $0x988, %rsp            # imm = 0x988
retq
leaq 0x828(%rsp), %rdi
callq 0x36e70
leaq 0x8f0(%rsp), %rdi
callq 0x1f210
leaq 0x930(%rsp), %rdi
callq 0x1f210
movq 0x8e8(%rsp), %rdi
callq 0x8670
nopl (%rax)