// File: /workspace/github_cpp_makefile_star2_O1/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 0x250(%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 0x7a9dc(%rip), %rdi     # 0x90590
callq 0x11a14
testq %rax, %rax
je 0x166d3
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 0x16706
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 0x268c4
movq %r15, (%rsp)
movq 0x18(%r15), %rcx
movq 0x10(%rcx), %rax
cmpq %rax, 0x18(%rcx)
je 0x16234
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 0x59cd5(%rip), %rsi     # 0x6f93f
callq 0x8100
testl %eax, %eax
je 0x15ce2
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x59ce1(%rip), %rsi     # 0x6f967
callq 0x8100
testl %eax, %eax
je 0x15ce2
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 0x16972
sarq $0x2, %rcx
cmpq $0x2, %rcx
jb 0x15ce2
movl $0x1, %esi
movl (%rax,%rsi,4), %edi
cmpl (%rdx,%rsi,4), %edi
jne 0x16757
incq %rsi
cmpq %rsi, %rcx
jne 0x15cce
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 0xca10
movl %ebp, %edi
leaq 0xe8(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x27e6f
movl %eax, %r13d
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x15d52
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x82a0
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x59bda(%rip), %rsi     # 0x6f93f
callq 0x8100
testl %eax, %eax
je 0x15dac
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x59be6(%rip), %rsi     # 0x6f967
callq 0x8100
testl %eax, %eax
setne %cl
movq 0x78(%rsp), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x15dac
cmpb $0x1, (%rax)
jne 0x15dac
cmpb $0x1, 0x1(%rax)
je 0x169aa
leaq 0x108(%rsp), %rdi
movq 0x148(%rsp), %rsi
callq 0x2822e
movq 0x78(%rsp), %rax
testq %rax, %rax
je 0x15edb
cmpb $0x1, (%rax)
jne 0x15edb
cmpq $0x0, 0x138(%rsp)
jne 0x15edb
movl $0x40, %edi
callq 0x8290
movq %rax, %rbp
movq %rbx, %r12
movq %rax, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x12ade
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 0xca10
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 0xca10
movl %r14d, 0x30(%rsp)
movq %rbp, 0x38(%rsp)
movl $0xffffffff, 0x40(%rsp) # imm = 0xFFFFFFFF
leaq 0x108(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x28312
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
movq %rbx, %r14
je 0x15eb3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
movq %r12, %rbx
je 0x15edb
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x82a0
orl 0x108(%rsp), %r13d
jne 0x1619b
leaq 0x80(%rsp), %rdi
callq 0x27ed3
movslq (%r14), %r13
shlq $0x6, %r13
leaq 0x7a674(%rip), %rax     # 0x90578
addq (%rax), %r13
leaq 0x190(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24c9c
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
leaq 0x80(%rsp), %rsi
movq %r12, %rdx
callq 0x24d34
movq %r13, %rdi
movq %rbp, %rsi
callq 0x26522
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x15f55
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x15f6c
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x15f83
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x15f9f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x1c8(%rsp), %rdi
testq %rdi, %rdi
je 0x15fbc
movq 0x1d8(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x1b0(%rsp), %rdi
testq %rdi, %rdi
je 0x15fd9
movq 0x1c0(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x198(%rsp), %rdi
testq %rdi, %rdi
je 0x15ff6
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 0xca10
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 0xca10
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 0x16092
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x82a0
movl $0xe0, %edi
callq 0x8290
leaq 0x2f8(%rsp), %r12
movq %rax, %r13
leaq 0x278(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x28186
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0x28186
movb $0x1, %bpl
movq %r13, %rdi
movl $0xc, %esi
leaq 0x278(%rsp), %rdx
movq %r12, %rcx
callq 0x24e94
movq %r13, 0x190(%rsp)
xorl %ebp, %ebp
movq %rbx, %rdi
leaq 0x190(%rsp), %rsi
callq 0x114b8
movq 0x300(%rsp), %rdi
leaq 0x310(%rsp), %rax
cmpq %rax, %rdi
je 0x16123
movq 0x310(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x16148
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x108(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2822e
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x16176
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x1619b
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 0x28186
movb $0x1, %bpl
movq %r13, %rdi
movl $0x8, %esi
movq %r12, %rdx
callq 0x25080
movq %r13, 0x8(%rsp)
xorl %ebp, %ebp
leaq 0x1e0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x26a3a
movq 0x2c0(%rsp), %rdi
leaq 0x2d0(%rsp), %rax
cmpq %rax, %rdi
je 0x16211
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 0x15c47
movq 0x210(%rsp), %rdx
cmpq 0x1f0(%rsp), %rdx
je 0x162fd
movl $0x200, %r15d           # imm = 0x200
cmpq 0x218(%rsp), %rdx
jne 0x16269
movq 0x228(%rsp), %rax
movq -0x8(%rax), %rdx
addq %r15, %rdx
addq $-0x8, %rdx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x16284
movq (%rdx), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rbx)
jmp 0x1628c
movq %rbx, %rdi
callq 0x26c96
movq 0x210(%rsp), %rdx
movq 0x218(%rsp), %rdi
cmpq %rdi, %rdx
je 0x162a7
addq $-0x8, %rdx
jmp 0x162e7
movl $0x200, %esi            # imm = 0x200
callq 0x82a0
movq 0x228(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x228(%rsp)
movq -0x8(%rax), %rdx
movq %rdx, 0x218(%rsp)
leaq 0x200(%rdx), %rax
movq %rax, 0x220(%rsp)
addq $0x1f8, %rdx            # imm = 0x1F8
movq %rdx, 0x210(%rsp)
cmpq 0x1f0(%rsp), %rdx
jne 0x16250
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 0xca10
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 0xca10
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 0x28312
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x16396
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x170(%rsp), %rdi
cmpq %r15, %rdi
je 0x163b3
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 0x12ade
leaq 0x238(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x28312
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x16405
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
cmpl $0x121, 0x28(%r15)      # imm = 0x121
jne 0x167af
movl (%r14), %ebp
leaq 0x80(%rsp), %rdi
callq 0x27ed3
movslq %ebp, %r15
leaq 0x7a14b(%rip), %rax     # 0x90578
shlq $0x6, %r15
addq (%rax), %r15
leaq 0x190(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24c9c
leaq 0x8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x190(%rsp), %rdx
callq 0x24d34
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x26522
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x16483
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x1649a
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x164b1
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x164cc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x1c8(%rsp), %rdi
testq %rdi, %rdi
je 0x164e9
movq 0x1d8(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x1b0(%rsp), %rdi
testq %rdi, %rdi
je 0x16506
movq 0x1c0(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
movq 0x198(%rsp), %rdi
testq %rdi, %rdi
je 0x16523
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 0xca10
leaq 0x10(%rsp), %rdi
movl $0x0, -0x8(%rdi)
movq %r12, (%rdi)
movq 0x150(%rsp), %rsi
movq 0x158(%rsp), %rdx
addq %rsi, %rdx
callq 0xca10
movl %ebp, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movl $0xffffffff, 0x40(%rsp) # imm = 0xFFFFFFFF
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0x165a8
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x8(%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2822e
movq 0x50(%r14), %rax
cmpq %rax, 0x58(%r14)
je 0x165c4
movq %rax, 0x58(%r14)
movl $0xe0, %edi
callq 0x8290
movq %rax, %r14
leaq 0x478(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x28186
leaq 0x438(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0x28186
leaq 0x3f8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x28186
leaq 0x478(%rsp), %rdx
leaq 0x438(%rsp), %rcx
leaq 0x3f8(%rsp), %r8
movq %r14, %rdi
movl $0x9, %esi
callq 0x24fee
movq %r14, 0x78(%rsp)
leaq 0x410(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16658
movq 0x410(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x450(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16679
movq 0x450(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x490(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1669a
movq 0x490(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x166b1
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x168e3
movq 0x90(%rsp), %rsi
jmp 0x168db
movl 0x8(%r15), %ebx
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x594c0(%rip), %rsi     # 0x6fba7
leaq 0x594d1(%rip), %rdx     # 0x6fbbf
leaq 0x8(%rsp), %rdi
callq 0xcaa0
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
callq 0x2b12a
jmp 0x16737
movl 0x8(%r15), %ebx
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x594a6(%rip), %rsi     # 0x6fbc0
leaq 0x594b4(%rip), %rdx     # 0x6fbd5
leaq 0x8(%rsp), %rdi
callq 0xcaa0
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
callq 0x2b12a
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x16916
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16916
movq (%rsp), %rax
movl 0x8(%rax), %ebx
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0x59464(%rip), %rsi     # 0x6fbd6
leaq 0x5947e(%rip), %rdx     # 0x6fbf7
callq 0xcaa0
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
callq 0x2b12a
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x16909
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16909
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 0x2822e
movq 0x50(%r14), %rax
cmpq %rax, 0x58(%r14)
je 0x167f6
movq %rax, 0x58(%r14)
movl $0xe0, %edi
callq 0x8290
movq %rax, %r14
leaq 0x3b8(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x28186
leaq 0x378(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0x28186
leaq 0x338(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x28186
leaq 0x3b8(%rsp), %rdx
leaq 0x378(%rsp), %rcx
leaq 0x338(%rsp), %r8
movq %r14, %rdi
movl $0x9, %esi
callq 0x24fee
movq %r14, 0x78(%rsp)
leaq 0x350(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1688a
movq 0x350(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x390(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x168ab
movq 0x390(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x3d0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x168cc
movq 0x3d0(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x168e3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x168fc
movq 0x78(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rbx)
jmp 0x16909
leaq 0x78(%rsp), %rdx
movq %rbx, %rdi
callq 0x26c96
leaq 0x1e0(%rsp), %rdi
callq 0x259f6
movq 0x240(%rsp), %rdi
leaq 0x250(%rsp), %rax
cmpq %rax, %rdi
je 0x1693b
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x16960
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 0x59249(%rip), %rsi     # 0x6fbd6
leaq 0x59263(%rip), %rdx     # 0x6fbf7
callq 0xcaa0
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
callq 0x2b12a
jmp 0x1678a
movq (%rsp), %rax
movl 0x8(%rax), %ebx
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0x59233(%rip), %rsi     # 0x6fbf8
leaq 0x59246(%rip), %rdx     # 0x6fc12
callq 0xcaa0
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
callq 0x2b12a
jmp 0x1678a
jmp 0x16b54
jmp 0x16e2a
jmp 0x16b54
jmp 0x16e2a
jmp 0x16e2a
movq %rax, %rbx
leaq 0x410(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16a24
movq 0x410(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16a24
movq %rax, %rbx
leaq 0x450(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16a4a
movq 0x450(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16a4a
movq %rax, %rbx
leaq 0x490(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16a70
movq 0x490(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16a70
movq %rax, %rbx
movl $0xe0, %esi
movq %r14, %rdi
callq 0x82a0
jmp 0x16b7c
movq %rax, %rbx
leaq 0x350(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16acc
movq 0x350(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16acc
movq %rax, %rbx
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0x16b93
movq 0x160(%rsp), %rsi
jmp 0x16b8b
movq %rax, %rbx
leaq 0x390(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16af4
movq 0x390(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16af4
jmp 0x16b4a
movq %rax, %rbx
leaq 0x3d0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16b29
movq 0x3d0(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16b29
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x24df0
jmp 0x16b3b
movq %rax, %rbx
movl $0xe0, %esi
movq %r14, %rdi
callq 0x82a0
jmp 0x16ba9
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x24e4e
jmp 0x16b93
movq %rax, %rbx
jmp 0x16b93
jmp 0x16e2a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x16e2d
movq 0x18(%rsp), %rsi
jmp 0x16dbb
jmp 0x16e2a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x16b93
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x16dae
jmp 0x16ba6
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x16e2d
movq 0x20(%rsp), %rsi
jmp 0x16dbb
jmp 0x16e2a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x16be5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16be5
movq %rax, %rbx
movq 0x170(%rsp), %rdi
cmpq %r15, %rdi
je 0x16e2d
movq 0x180(%rsp), %rsi
jmp 0x16dbb
jmp 0x16e2a
jmp 0x16c14
jmp 0x16d16
jmp 0x16d16
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x16e3a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16e3a
jmp 0x16d16
jmp 0x16e2a
movq %rax, %rbx
movl $0x40, %esi
movq %rbp, %rdi
jmp 0x16e23
jmp 0x16e2a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x16c7a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x16c7a
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x16e2d
movq 0xd8(%rsp), %rsi
jmp 0x16dbb
jmp 0x16d01
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x24df0
jmp 0x16cef
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x16d9e
movq 0xb8(%rsp), %rsi
jmp 0x16d96
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x16d70
jmp 0x16d09
jmp 0x16e2a
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x24e4e
jmp 0x16d9e
movq %rax, %rbx
jmp 0x16d9e
movq %rax, %rbx
jmp 0x16d82
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x16d4b
movq %rax, %rbx
jmp 0x16e3a
jmp 0x16e2a
movq %rax, %rbx
movq 0x300(%rsp), %rdi
leaq 0x310(%rsp), %rax
cmpq %rax, %rdi
je 0x16d4b
movq 0x310(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x16d70
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x82a0
testb %bpl, %bpl
je 0x16d82
movl $0xe0, %esi
movq %r13, %rdi
callq 0x82a0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x16d9e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x16e2d
movq 0x90(%rsp), %rsi
incq %rsi
jmp 0x16e23
jmp 0x16e2a
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x16e16
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x16e2d
movq 0xf8(%rsp), %rsi
jmp 0x16dbb
jmp 0x16e2a
movq %rax, %rbx
movq 0x2c0(%rsp), %rdi
leaq 0x2d0(%rsp), %rax
cmpq %rax, %rdi
je 0x16e16
movq 0x2d0(%rsp), %rsi
incq %rsi
callq 0x82a0
testb %bpl, %bpl
je 0x16e2d
movl $0xe0, %esi
movq %r13, %rdi
callq 0x82a0
jmp 0x16e2d
movq %rax, %rbx
leaq 0x1e0(%rsp), %rdi
callq 0x259f6
movq 0x240(%rsp), %rdi
leaq 0x250(%rsp), %rax
cmpq %rax, %rdi
je 0x16e5f
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x16e84
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x82a0
movq %rbx, %rdi
callq 0x8540