// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4b8, %rsp            # imm = 0x4B8
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x4, %eax
leaq 0x120(%rsp), %r8
movl %eax, -0x18(%r8)
movq %r8, -0x10(%r8)
movw $0x2d, %cx
movw %cx, (%r8)
movl $0x1, %edx
movq %rdx, -0x8(%r8)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %esi, 0x10(%r8)
xorl %edi, %edi
movq %rdi, 0x18(%r8)
movl %esi, 0x20(%r8)
leaq 0x290(%rsp), %r8
movl %eax, -0x18(%r8)
movq %r8, -0x10(%r8)
movw %cx, (%r8)
movq %rdx, -0x8(%r8)
movl %esi, 0x10(%r8)
movq %rdi, 0x18(%r8)
movl %esi, 0x20(%r8)
movq 0x10(%r15), %rax
movq 0x10(%rax), %rsi
leaq 0x79c9c(%rip), %rdi     # 0x8f590
callq 0x116e2
testq %rax, %rax
je 0x16416
movq 0x38(%rax), %rdx
subq 0x30(%rax), %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
movq 0x18(%r15), %rsi
movq 0x18(%rsi), %rdx
subq 0x10(%rsi), %rdx
sarq $0x3, %rdx
cmpq %rdx, %rcx
jne 0x16449
movq %rax, 0xa0(%rsp)
xorps %xmm0, %xmm0
leaq 0x1e0(%rsp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x26f5a
movq %r15, (%rsp)
movq 0x18(%r15), %rcx
movq 0x10(%rcx), %rax
cmpq %rax, 0x18(%rcx)
je 0x15f74
leaq 0x8(%r14), %rcx
movq %rcx, 0x148(%rsp)
xorl %r15d, %r15d
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movq %rbx, %rdx
callq *0x10(%rax)
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x58f95(%rip), %rsi     # 0x6e93f
callq 0x8100
testl %eax, %eax
je 0x15a22
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x58fa1(%rip), %rsi     # 0x6e967
callq 0x8100
testl %eax, %eax
je 0x15a22
movq 0x50(%r14), %rax
movq 0x58(%r14), %rcx
subq %rax, %rcx
movq 0xa0(%rsp), %rdx
movq 0x30(%rdx), %rsi
leaq (%r15,%r15,2), %rdi
movq (%rsi,%rdi,8), %rdx
movq 0x8(%rsi,%rdi,8), %rsi
subq %rdx, %rsi
cmpq %rsi, %rcx
jne 0x166b0
sarq $0x2, %rcx
cmpq $0x2, %rcx
jb 0x15a22
movl $0x1, %esi
movl (%rax,%rsi,4), %edi
cmpl (%rdx,%rsi,4), %edi
jne 0x1649a
incq %rsi
cmpq %rsi, %rcx
jne 0x15a0e
movq $0x0, 0x78(%rsp)
movl (%r14), %ebp
leaq 0xf8(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
addq %rsi, %rdx
leaq 0xe8(%rsp), %rdi
callq 0xc6dc
movl %ebp, %edi
leaq 0xe8(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x28507
movl %eax, %r13d
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x15a92
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x82a0
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x58e9a(%rip), %rsi     # 0x6e93f
callq 0x8100
testl %eax, %eax
je 0x15aec
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x58ea6(%rip), %rsi     # 0x6e967
callq 0x8100
testl %eax, %eax
setne %cl
movq 0x78(%rsp), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x15aec
cmpb $0x1, (%rax)
jne 0x15aec
cmpb $0x1, 0x1(%rax)
je 0x166e8
leaq 0x108(%rsp), %rdi
movq 0x148(%rsp), %rsi
callq 0x288be
movq 0x78(%rsp), %rax
testq %rax, %rax
je 0x15c1b
cmpb $0x1, (%rax)
jne 0x15c1b
cmpq $0x0, 0x138(%rsp)
jne 0x15c1b
movl $0x40, %edi
callq 0x8290
movq %rax, %rbp
movq %rbx, %r12
movq %rax, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1279c
movq %r14, %rbx
leaq 0xd8(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0xc6dc
movl 0x130(%rsp), %r14d
movl $0x5, 0x8(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xc6dc
movl %r14d, 0x30(%rsp)
movq %rbp, 0x38(%rsp)
movl $0xffffffff, 0x40(%rsp) # imm = 0xFFFFFFFF
leaq 0x108(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x289a2
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
movq %rbx, %r14
je 0x15bf3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
movq %r12, %rbx
je 0x15c1b
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x82a0
orl 0x108(%rsp), %r13d
jne 0x15edb
leaq 0x80(%rsp), %rdi
callq 0x28564
movslq (%r14), %r13
shlq $0x6, %r13
leaq 0x79934(%rip), %rax     # 0x8f578
addq (%rax), %r13
leaq 0x190(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x25368
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
leaq 0x80(%rsp), %rsi
movq %r12, %rdx
callq 0x25400
movq %r13, %rdi
movq %rbp, %rsi
callq 0x26bbc
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x15c95
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x15cac
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x15cc3
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x15cdf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x1c8(%rsp), %rdi
testq %rdi, %rdi
je 0x15cfc
movq 0x1d8(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x1b0(%rsp), %rdi
testq %rdi, %rdi
je 0x15d19
movq 0x1c0(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x198(%rsp), %rdi
testq %rdi, %rdi
je 0x15d36
movq 0x1a8(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0xc6dc
movl (%r14), %ebp
movl $0x0, 0x8(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xc6dc
movl %ebp, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movl $0xffffffff, 0x40(%rsp) # imm = 0xFFFFFFFF
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x15dd2
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x82a0
movl $0xe0, %edi
callq 0x8290
leaq 0x2f8(%rsp), %r12
movq %rax, %r13
leaq 0x238(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x28816
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0x28816
movb $0x1, %bpl
movq %r13, %rdi
movl $0xc, %esi
leaq 0x238(%rsp), %rdx
movq %r12, %rcx
callq 0x25560
movq %r13, 0x190(%rsp)
xorl %ebp, %ebp
movq %rbx, %rdi
leaq 0x190(%rsp), %rsi
callq 0x11182
movq 0x300(%rsp), %rdi
leaq 0x310(%rsp), %rax
cmpq %rax, %rdi
je 0x15e63
movq 0x310(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x240(%rsp), %rdi
leaq 0x250(%rsp), %rax
cmpq %rax, %rdi
je 0x15e88
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x108(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x288be
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x15eb6
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x15edb
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x82a0
movl $0xe0, %edi
callq 0x8290
movq %rax, %r13
leaq 0x2b8(%rsp), %r12
movq %r12, %rdi
leaq 0x108(%rsp), %rsi
callq 0x28816
movb $0x1, %bpl
movq %r13, %rdi
movl $0x8, %esi
movq %r12, %rdx
callq 0x2574c
movq %r13, 0x8(%rsp)
xorl %ebp, %ebp
leaq 0x1e0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x270d0
movq 0x2c0(%rsp), %rdi
leaq 0x2d0(%rsp), %rax
cmpq %rax, %rdi
je 0x15f51
movq 0x2d0(%rsp), %rsi
incq %rsi
callq 0x82a0
incq %r15
movq (%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x10(%rcx), %rax
movq 0x18(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x15987
movq 0x210(%rsp), %rdx
cmpq 0x1f0(%rsp), %rdx
je 0x16040
movq 0x218(%rsp), %rdi
movl $0x200, %r15d           # imm = 0x200
cmpq %rdi, %rdx
jne 0x15fac
movq 0x228(%rsp), %rax
movq -0x8(%rax), %rdx
addq %r15, %rdx
addq $-0x8, %rdx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x15fc7
movq (%rdx), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rbx)
jmp 0x15fcf
movq %rbx, %rdi
callq 0x27332
movq 0x210(%rsp), %rdx
movq 0x218(%rsp), %rdi
cmpq %rdi, %rdx
je 0x15fea
addq $-0x8, %rdx
jmp 0x1602a
movl $0x200, %esi            # imm = 0x200
callq 0x82a0
movq 0x228(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x228(%rsp)
movq -0x8(%rax), %rdi
movq %rdi, 0x218(%rsp)
leaq 0x200(%rdi), %rax
movq %rax, 0x220(%rsp)
leaq 0x1f8(%rdi), %rdx
movq %rdx, 0x210(%rsp)
cmpq 0x1f0(%rsp), %rdx
jne 0x15f98
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x180(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x170(%rsp), %rdi
callq 0xc6dc
leaq 0x10(%rsp), %rdi
movl $0x3, -0x8(%rdi)
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x170(%rsp), %rsi
movq 0x178(%rsp), %rdx
addq %rsi, %rdx
callq 0xc6dc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0x8(%rsp), %rsi
movl %eax, 0x28(%rsi)
movq $0x0, 0x30(%rsi)
movl %eax, 0x38(%rsi)
leaq 0x108(%rsp), %rdi
callq 0x289a2
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x160d9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x170(%rsp), %rdi
cmpq %r15, %rdi
je 0x160f6
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0xa0(%rsp), %r15
movq 0x38(%r15), %rax
subq 0x30(%r15), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %edx # imm = 0xAAAAAAAB
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x1279c
leaq 0x278(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x289a2
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x16148
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
cmpl $0x121, 0x28(%r15)      # imm = 0x121
jne 0x164f2
movl (%r14), %ebp
leaq 0x80(%rsp), %rdi
callq 0x28564
movslq %ebp, %r15
leaq 0x79408(%rip), %rax     # 0x8f578
shlq $0x6, %r15
addq (%rax), %r15
leaq 0x190(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x25368
leaq 0x8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x190(%rsp), %rdx
callq 0x25400
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x26bbc
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x161c6
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x161dd
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x161f4
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1620f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x1c8(%rsp), %rdi
testq %rdi, %rdi
je 0x1622c
movq 0x1d8(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x1b0(%rsp), %rdi
testq %rdi, %rdi
je 0x16249
movq 0x1c0(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x198(%rsp), %rdi
testq %rdi, %rdi
je 0x16266
movq 0x1a8(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
leaq 0x160(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
addq %rsi, %rdx
leaq 0x150(%rsp), %rdi
callq 0xc6dc
leaq 0x10(%rsp), %rdi
movl $0x0, -0x8(%rdi)
movq %r12, (%rdi)
movq 0x150(%rsp), %rsi
movq 0x158(%rsp), %rdx
addq %rsi, %rdx
callq 0xc6dc
movl %ebp, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movl $0xffffffff, 0x40(%rsp) # imm = 0xFFFFFFFF
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0x162eb
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x8(%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x288be
movq 0x50(%r14), %rax
cmpq %rax, 0x58(%r14)
je 0x16307
movq %rax, 0x58(%r14)
movl $0xe0, %edi
callq 0x8290
movq %rax, %r14
leaq 0x478(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x28816
leaq 0x438(%rsp), %rdi
leaq 0x278(%rsp), %rsi
callq 0x28816
leaq 0x3f8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x28816
leaq 0x478(%rsp), %rdx
leaq 0x438(%rsp), %rcx
leaq 0x3f8(%rsp), %r8
movq %r14, %rdi
movl $0x9, %esi
callq 0x256ba
movq %r14, 0x78(%rsp)
leaq 0x410(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1639b
movq 0x410(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x450(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x163bc
movq 0x450(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x490(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x163dd
movq 0x490(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x163f4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16626
movq 0x90(%rsp), %rsi
jmp 0x1661e
movl 0x8(%r15), %ebx
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5877d(%rip), %rsi     # 0x6eba7
leaq 0x5878e(%rip), %rdx     # 0x6ebbf
leaq 0x8(%rsp), %rdi
callq 0xc772
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
callq 0x2b6aa
jmp 0x1647a
movl 0x8(%r15), %ebx
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x58763(%rip), %rsi     # 0x6ebc0
leaq 0x58771(%rip), %rdx     # 0x6ebd5
leaq 0x8(%rsp), %rdi
callq 0xc772
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
callq 0x2b6aa
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x16654
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16654
movq (%rsp), %rax
movl 0x8(%rax), %ebx
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0x58721(%rip), %rsi     # 0x6ebd6
leaq 0x5873b(%rip), %rdx     # 0x6ebf7
callq 0xc772
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
callq 0x2b6aa
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x16647
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16647
leaq 0x8(%rsp), %rsi
movl $0x4, (%rsi)
movq %r12, 0x8(%rsi)
movw $0x2d, 0x18(%rsi)
movq $0x1, 0x10(%rsi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x28(%rsi)
movq $0x0, 0x30(%rsi)
movl %eax, 0x38(%rsi)
leaq 0x8(%r14), %rdi
callq 0x288be
movq 0x50(%r14), %rax
cmpq %rax, 0x58(%r14)
je 0x16539
movq %rax, 0x58(%r14)
movl $0xe0, %edi
callq 0x8290
movq %rax, %r14
leaq 0x3b8(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x28816
leaq 0x378(%rsp), %rdi
leaq 0x278(%rsp), %rsi
callq 0x28816
leaq 0x338(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x28816
leaq 0x3b8(%rsp), %rdx
leaq 0x378(%rsp), %rcx
leaq 0x338(%rsp), %r8
movq %r14, %rdi
movl $0x9, %esi
callq 0x256ba
movq %r14, 0x78(%rsp)
leaq 0x350(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x165cd
movq 0x350(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x390(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x165ee
movq 0x390(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x3d0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1660f
movq 0x3d0(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x16626
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x1663a
movq %r14, (%rsi)
addq $0x8, 0x8(%rbx)
jmp 0x16647
leaq 0x78(%rsp), %rdx
movq %rbx, %rdi
callq 0x27332
leaq 0x1e0(%rsp), %rdi
callq 0x260ce
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x16679
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x1669e
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x82a0
addq $0x4b8, %rsp            # imm = 0x4B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rax
movl 0x8(%rax), %ebx
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5850b(%rip), %rsi     # 0x6ebd6
leaq 0x58525(%rip), %rdx     # 0x6ebf7
callq 0xc772
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
callq 0x2b6aa
jmp 0x164cd
movq (%rsp), %rax
movl 0x8(%rax), %ebx
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0x584f5(%rip), %rsi     # 0x6ebf8
leaq 0x58508(%rip), %rdx     # 0x6ec12
callq 0xc772
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
callq 0x2b6aa
jmp 0x164cd
jmp 0x16892
jmp 0x16b87
jmp 0x16892
jmp 0x16b87
jmp 0x16b87
movq %rax, %rbx
leaq 0x410(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16762
movq 0x410(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16762
movq %rax, %rbx
leaq 0x450(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16788
movq 0x450(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16788
movq %rax, %rbx
leaq 0x490(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x167ae
movq 0x490(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x167ae
movq %rax, %rbx
movl $0xe0, %esi
movq %r14, %rdi
callq 0x82a0
jmp 0x168ba
movq %rax, %rbx
leaq 0x350(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1680a
movq 0x350(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x1680a
movq %rax, %rbx
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0x168d1
movq 0x160(%rsp), %rsi
jmp 0x168c9
movq %rax, %rbx
leaq 0x390(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16832
movq 0x390(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16832
jmp 0x16888
movq %rax, %rbx
leaq 0x3d0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16867
movq 0x3d0(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16867
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x254bc
jmp 0x16879
movq %rax, %rbx
movl $0xe0, %esi
movq %r14, %rdi
callq 0x82a0
jmp 0x168e7
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x2551a
jmp 0x168d1
movq %rax, %rbx
jmp 0x168d1
jmp 0x16b87
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x16b8a
movq 0x18(%rsp), %rsi
jmp 0x16b1b
jmp 0x16b87
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x168d1
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x16b0e
jmp 0x168e4
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x16b8a
movq 0x20(%rsp), %rsi
jmp 0x16b1b
jmp 0x16b87
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x16923
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16923
movq %rax, %rbx
movq 0x170(%rsp), %rdi
cmpq %r15, %rdi
je 0x16b8a
movq 0x180(%rsp), %rsi
jmp 0x16b1b
jmp 0x16b87
jmp 0x16952
jmp 0x16a76
jmp 0x16a76
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x16b97
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16b97
jmp 0x16a76
jmp 0x16b87
movq %rax, %rbx
movl $0x40, %esi
movq %rbp, %rdi
jmp 0x16b80
jmp 0x16b87
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x169b8
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x169b8
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x16b8a
movq 0xd8(%rsp), %rsi
jmp 0x16b1b
jmp 0x16a3c
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x254bc
jmp 0x16a2a
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x16afe
movq 0xb8(%rsp), %rsi
jmp 0x16af6
movq %rax, %rbx
jmp 0x16ad5
jmp 0x16a44
jmp 0x16b87
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x2551a
jmp 0x16afe
movq %rax, %rbx
jmp 0x16afe
movq %rax, %rbx
jmp 0x16ae2
movq %rax, %rbx
movq 0x240(%rsp), %rdi
leaq 0x250(%rsp), %rax
cmpq %rax, %rdi
je 0x16ad5
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16ad5
movq %rax, %rbx
jmp 0x16b97
jmp 0x16b87
movq %rax, %rbx
movq 0x300(%rsp), %rdi
leaq 0x310(%rsp), %rax
cmpq %rax, %rdi
je 0x16aab
movq 0x310(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x240(%rsp), %rdi
leaq 0x250(%rsp), %rax
cmpq %rax, %rdi
je 0x16ad0
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x82a0
testb %bpl, %bpl
je 0x16ae2
movl $0xe0, %esi
movq %r13, %rdi
callq 0x82a0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x16afe
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x16b8a
movq 0x90(%rsp), %rsi
incq %rsi
jmp 0x16b80
jmp 0x16b87
movq %rax, %rbx
jmp 0x16b78
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x16b8a
movq 0xf8(%rsp), %rsi
jmp 0x16b1b
jmp 0x16b87
movq %rax, %rbx
movq 0x2c0(%rsp), %rdi
leaq 0x2d0(%rsp), %rax
cmpq %rax, %rdi
je 0x16b73
movq 0x2d0(%rsp), %rsi
incq %rsi
callq 0x82a0
testb %bpl, %bpl
je 0x16b8a
movl $0xe0, %esi
movq %r13, %rdi
callq 0x82a0
jmp 0x16b8a
movq %rax, %rbx
leaq 0x1e0(%rsp), %rdi
callq 0x260ce
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x16bbc
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x16be1
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x82a0
movq %rbx, %rdi
callq 0x8540
nop