// File: luooofan[P]hblzbd_compiler/src/Pass/constant_propagation.cpp
// Function: ConstantPropagation::Run()
void ConstantPropagation::Run() {
  auto m = dynamic_cast<IRModule *>(*m_);

  MyAssert(nullptr != m);

  bool changed = true;

  while (changed) {
    ReachDefine reachdefine = ReachDefine(m_);
    reachdefine.Run();
    changed = false;
    for (auto func : m->func_list_) {
      for (auto bb : func->bb_list_) {
        for (int i = 0; i < bb->ir_list_.size(); ++i) {
          auto ir = bb->ir_list_[i];
          auto map_this_ir = bb->use_def_chains_[i];

          auto process_opn = [&bb, &ir, &map_this_ir, &changed](ir::Opn *opn, int opn_num) {
            if (opn->type_ == ir::Opn::Type::Var) {
              auto opn_set = map_this_ir[opn];
              if (opn_set.size() == 1) {
                auto ir_opn = *opn_set.begin();
                if (ir_opn->op_ == ir::IR::OpKind::ASSIGN && ir_opn->opn1_.type_ == ir::Opn::Type::Imm) {
#ifdef PRINT_DEBUG
                  std::cout << "将变量: " << opn->name_ + "_#" + std::to_string(opn->scope_id_) << " 变为常数"
                            << ir_opn->opn1_.imm_num_ << std::endl;
#endif
                  changed = true;
                  if (opn_num == 1) {
                    ir->opn1_ = ir_opn->opn1_;
                  } else if (opn_num == 2) {
                    ir->opn2_ = ir_opn->opn1_;
                  }
                }
              }
            }
          };

          process_opn(&(ir->opn1_), 1);

          process_opn(&(ir->opn2_), 2);

          if (ir::IR::OpKind::ADD == ir->op_) {
            if (ir->opn1_.type_ == ir::Opn::Type::Imm && ir->opn2_.type_ == ir::Opn::Type::Imm) {
              int res = ir->opn1_.imm_num_ + ir->opn2_.imm_num_;
              ir::Opn opn1 = ir::Opn(ir::Opn::Type::Imm, res);
              ir::Opn res_opn = ir->res_;
              bb->ir_list_[i] = new ir::IR(ir::IR::OpKind::ASSIGN, opn1, res_opn);
              changed = true;
              // if(changed) printf("/*******\n");
            }
          } else if (ir::IR::OpKind::SUB == ir->op_) {
            if (ir->opn1_.type_ == ir::Opn::Type::Imm && ir->opn2_.type_ == ir::Opn::Type::Imm) {
              int res = ir->opn1_.imm_num_ - ir->opn2_.imm_num_;
              ir::Opn opn1 = ir::Opn(ir::Opn::Type::Imm, res);
              ir::Opn res_opn = ir->res_;
              bb->ir_list_[i] = new ir::IR(ir::IR::OpKind::ASSIGN, opn1, res_opn);
              changed = true;
            }
          } else if (ir::IR::OpKind::MUL == ir->op_) {
            if (ir->opn1_.type_ == ir::Opn::Type::Imm && ir->opn2_.type_ == ir::Opn::Type::Imm) {
              int res = ir->opn1_.imm_num_ * ir->opn2_.imm_num_;
              ir::Opn opn1 = ir::Opn(ir::Opn::Type::Imm, res);
              ir::Opn res_opn = ir->res_;
              bb->ir_list_[i] = new ir::IR(ir::IR::OpKind::ASSIGN, opn1, res_opn);
              changed = true;
            }
          } else if (ir::IR::OpKind::DIV == ir->op_) {
            if (ir->opn1_.type_ == ir::Opn::Type::Imm && ir->opn2_.type_ == ir::Opn::Type::Imm) {
              // 没有加对除0的限制，应该没有必要
              int res = ir->opn1_.imm_num_ / ir->opn2_.imm_num_;
              ir::Opn opn1 = ir::Opn(ir::Opn::Type::Imm, res);
              ir::Opn res_opn = ir->res_;
              bb->ir_list_[i] = new ir::IR(ir::IR::OpKind::ASSIGN, opn1, res_opn);
              changed = true;
            }
          } else if (ir::IR::OpKind::MOD == ir->op_) {
            if (ir->opn1_.type_ == ir::Opn::Type::Imm && ir->opn2_.type_ == ir::Opn::Type::Imm) {
              int res = ir->opn1_.imm_num_ % ir->opn2_.imm_num_;
              ir::Opn opn1 = ir::Opn(ir::Opn::Type::Imm, res);
              ir::Opn res_opn = ir->res_;
              bb->ir_list_[i] = new ir::IR(ir::IR::OpKind::ASSIGN, opn1, res_opn);
              changed = true;
            }
          } else if (ir::IR::OpKind::NOT == ir->op_) {
            if (ir->opn1_.type_ == ir::Opn::Type::Imm) {
              int res = !ir->opn1_.imm_num_;
              ir::Opn opn1 = ir::Opn(ir::Opn::Type::Imm, res);
              ir::Opn res_opn = ir->res_;
              bb->ir_list_[i] = new ir::IR(ir::IR::OpKind::ASSIGN, opn1, res_opn);
              changed = true;
            }
          } else if (ir::IR::OpKind::NEG == ir->op_) {
            if (ir->opn1_.type_ == ir::Opn::Type::Imm) {
              int res = -ir->opn1_.imm_num_;
              ir::Opn opn1 = ir::Opn(ir::Opn::Type::Imm, res);
              ir::Opn res_opn = ir->res_;
              bb->ir_list_[i] = new ir::IR(ir::IR::OpKind::ASSIGN, opn1, res_opn);
              changed = true;
            }
          }
        }
      }
    }
    // if(changed) printf("/*******\n");
  }
}

// Assembly:
subq $0x8a8, %rsp            # imm = 0x8A8
movq %rdi, 0x8a0(%rsp)
movq 0x8a0(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, %rax
je 0x81c71
movq 0x58(%rsp), %rdi
leaq 0xc897e(%rip), %rsi     # 0x14a5d8
leaq 0xc93d7(%rip), %rdx     # 0x14b038
xorl %eax, %eax
movl %eax, %ecx
callq 0x8410
movq %rax, 0x48(%rsp)
jmp 0x81c7a
xorl %eax, %eax
movq %rax, 0x48(%rsp)
jmp 0x81c7a
movq 0x48(%rsp), %rax
movq %rax, 0x898(%rsp)
xorl %eax, %eax
cmpq 0x898(%rsp), %rax
jne 0x81cea
movq 0xca34e(%rip), %rdi     # 0x14bfe8
leaq 0x78457(%rip), %rsi     # 0xfa0f8
callq 0x8330
movq %rax, %rdi
leaq 0x7bb02(%rip), %rsi     # 0xfd7b2
callq 0x8330
movq %rax, %rdi
leaq 0x7972b(%rip), %rsi     # 0xfb3ea
callq 0x8330
movq %rax, %rdi
movl $0xb, %esi
callq 0x8650
movq %rax, %rdi
movq 0xca2a5(%rip), %rsi     # 0x14bf80
callq 0x8380
movl $0xff, %edi
callq 0x8460
movb $0x1, 0x897(%rsp)
testb $0x1, 0x897(%rsp)
je 0x82e9c
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x858(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x82ff0
movq 0x40(%rsp), %rdi
callq 0xefa40
jmp 0x81d27
movb $0x0, 0x897(%rsp)
movq 0x898(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x840(%rsp)
movq 0x840(%rsp), %rdi
callq 0x1d3c0
movq %rax, 0x838(%rsp)
movq 0x840(%rsp), %rdi
callq 0x1d240
movq %rax, 0x830(%rsp)
leaq 0x838(%rsp), %rdi
leaq 0x830(%rsp), %rsi
callq 0x49210
testb $0x1, %al
jne 0x81d8b
jmp 0x82e7b
leaq 0x838(%rsp), %rdi
callq 0x49250
movq (%rax), %rax
movq %rax, 0x828(%rsp)
movq 0x828(%rsp), %rax
addq $0x30, %rax
movq %rax, 0x820(%rsp)
movq 0x820(%rsp), %rdi
callq 0x1cc40
movq %rax, 0x818(%rsp)
movq 0x820(%rsp), %rdi
callq 0x1cac0
movq %rax, 0x810(%rsp)
leaq 0x818(%rsp), %rdi
leaq 0x810(%rsp), %rsi
callq 0x492e0
testb $0x1, %al
jne 0x81dff
jmp 0x82e67
leaq 0x818(%rsp), %rdi
callq 0x49320
movq (%rax), %rax
movq %rax, 0x808(%rsp)
movl $0x0, 0x804(%rsp)
movslq 0x804(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x808(%rsp), %rdi
addq $0x8, %rdi
callq 0x18440
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x82e53
movq 0x808(%rsp), %rdi
addq $0x8, %rdi
movslq 0x804(%rsp), %rsi
callq 0x18460
movq (%rax), %rax
movq %rax, 0x7f8(%rsp)
movq 0x808(%rsp), %rdi
addq $0x218, %rdi            # imm = 0x218
movslq 0x804(%rsp), %rsi
callq 0x83030
movq %rax, %rsi
leaq 0x7c0(%rsp), %rdi
callq 0x83050
jmp 0x81ea3
leaq 0x808(%rsp), %rax
movq %rax, 0x7a0(%rsp)
leaq 0x7f8(%rsp), %rax
movq %rax, 0x7a8(%rsp)
leaq 0x7c0(%rsp), %rax
movq %rax, 0x7b0(%rsp)
leaq 0x897(%rsp), %rax
movq %rax, 0x7b8(%rsp)
movq 0x7f8(%rsp), %rsi
addq $0x8, %rsi
leaq 0x7a0(%rsp), %rdi
movl $0x1, %edx
callq 0x82ec0
jmp 0x81f03
movq 0x7f8(%rsp), %rsi
addq $0x48, %rsi
leaq 0x7a0(%rsp), %rdi
movl $0x2, %edx
callq 0x82ec0
jmp 0x81f23
movq 0x7f8(%rsp), %rcx
xorl %eax, %eax
cmpl (%rcx), %eax
jne 0x82177
movq 0x7f8(%rsp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x82172
movq 0x7f8(%rsp), %rax
cmpl $0x1, 0x48(%rax)
jne 0x82172
movq 0x7f8(%rsp), %rcx
movl 0xc(%rcx), %eax
movl 0x4c(%rcx), %ecx
addl %ecx, %eax
movl %eax, 0x79c(%rsp)
movl 0x79c(%rsp), %edx
leaq 0x758(%rsp), %rdi
movl $0x1, %esi
callq 0x1f160
jmp 0x81f8b
movq 0x7f8(%rsp), %rsi
addq $0x88, %rsi
leaq 0x718(%rsp), %rdi
callq 0x43130
jmp 0x81fa9
movl $0xe0, %edi
callq 0x8340
movq %rax, 0x30(%rsp)
jmp 0x81fba
movb $0x1, 0x697(%rsp)
leaq 0x6d8(%rsp), %rdi
leaq 0x758(%rsp), %rsi
callq 0x43130
jmp 0x81fd9
leaq 0x698(%rsp), %rdi
leaq 0x718(%rsp), %rsi
callq 0x43130
jmp 0x81ff0
movq 0x30(%rsp), %rdi
movl $0xc, %esi
leaq 0x6d8(%rsp), %rdx
leaq 0x698(%rsp), %rcx
callq 0x36880
jmp 0x82011
movb $0x0, 0x697(%rsp)
movq 0x808(%rsp), %rdi
addq $0x8, %rdi
movslq 0x804(%rsp), %rsi
callq 0x18460
movq 0x30(%rsp), %rcx
movq %rcx, (%rax)
leaq 0x698(%rsp), %rdi
callq 0x1f210
leaq 0x6d8(%rsp), %rdi
callq 0x1f210
movb $0x1, 0x897(%rsp)
leaq 0x718(%rsp), %rdi
callq 0x1f210
leaq 0x758(%rsp), %rdi
callq 0x1f210
jmp 0x82172
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82e8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82e44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82160
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82153
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82136
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82129
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
leaq 0x698(%rsp), %rdi
callq 0x1f210
leaq 0x6d8(%rsp), %rdi
callq 0x1f210
testb $0x1, 0x697(%rsp)
jne 0x82142
jmp 0x82151
movq 0x30(%rsp), %rdi
movl $0xe0, %esi
callq 0x8350
jmp 0x82153
leaq 0x718(%rsp), %rdi
callq 0x1f210
leaq 0x758(%rsp), %rdi
callq 0x1f210
jmp 0x82e44
jmp 0x82e21
movq 0x7f8(%rsp), %rcx
movl $0x1, %eax
cmpl (%rcx), %eax
jne 0x8239c
movq 0x7f8(%rsp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x82397
movq 0x7f8(%rsp), %rax
cmpl $0x1, 0x48(%rax)
jne 0x82397
movq 0x7f8(%rsp), %rcx
movl 0xc(%rcx), %eax
movl 0x4c(%rcx), %ecx
subl %ecx, %eax
movl %eax, 0x690(%rsp)
movl 0x690(%rsp), %edx
leaq 0x650(%rsp), %rdi
movl $0x1, %esi
callq 0x1f160
jmp 0x821e2
movq 0x7f8(%rsp), %rsi
addq $0x88, %rsi
leaq 0x610(%rsp), %rdi
callq 0x43130
jmp 0x82200
movl $0xe0, %edi
callq 0x8340
movq %rax, 0x28(%rsp)
jmp 0x82211
movb $0x1, 0x58f(%rsp)
leaq 0x5d0(%rsp), %rdi
leaq 0x650(%rsp), %rsi
callq 0x43130
jmp 0x82230
leaq 0x590(%rsp), %rdi
leaq 0x610(%rsp), %rsi
callq 0x43130
jmp 0x82247
movq 0x28(%rsp), %rdi
movl $0xc, %esi
leaq 0x5d0(%rsp), %rdx
leaq 0x590(%rsp), %rcx
callq 0x36880
jmp 0x82268
movb $0x0, 0x58f(%rsp)
movq 0x808(%rsp), %rdi
addq $0x8, %rdi
movslq 0x804(%rsp), %rsi
callq 0x18460
movq 0x28(%rsp), %rcx
movq %rcx, (%rax)
leaq 0x590(%rsp), %rdi
callq 0x1f210
leaq 0x5d0(%rsp), %rdi
callq 0x1f210
movb $0x1, 0x897(%rsp)
leaq 0x610(%rsp), %rdi
callq 0x1f210
leaq 0x650(%rsp), %rdi
callq 0x1f210
jmp 0x82397
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82385
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82378
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x8235b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x8234e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
leaq 0x590(%rsp), %rdi
callq 0x1f210
leaq 0x5d0(%rsp), %rdi
callq 0x1f210
testb $0x1, 0x58f(%rsp)
jne 0x82367
jmp 0x82376
movq 0x28(%rsp), %rdi
movl $0xe0, %esi
callq 0x8350
jmp 0x82378
leaq 0x610(%rsp), %rdi
callq 0x1f210
leaq 0x650(%rsp), %rdi
callq 0x1f210
jmp 0x82e44
jmp 0x82e1f
movq 0x7f8(%rsp), %rcx
movl $0x2, %eax
cmpl (%rcx), %eax
jne 0x825c2
movq 0x7f8(%rsp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x825bd
movq 0x7f8(%rsp), %rax
cmpl $0x1, 0x48(%rax)
jne 0x825bd
movq 0x7f8(%rsp), %rcx
movl 0xc(%rcx), %eax
movl 0x4c(%rcx), %ecx
imull %ecx, %eax
movl %eax, 0x588(%rsp)
movl 0x588(%rsp), %edx
leaq 0x548(%rsp), %rdi
movl $0x1, %esi
callq 0x1f160
jmp 0x82408
movq 0x7f8(%rsp), %rsi
addq $0x88, %rsi
leaq 0x508(%rsp), %rdi
callq 0x43130
jmp 0x82426
movl $0xe0, %edi
callq 0x8340
movq %rax, 0x20(%rsp)
jmp 0x82437
movb $0x1, 0x487(%rsp)
leaq 0x4c8(%rsp), %rdi
leaq 0x548(%rsp), %rsi
callq 0x43130
jmp 0x82456
leaq 0x488(%rsp), %rdi
leaq 0x508(%rsp), %rsi
callq 0x43130
jmp 0x8246d
movq 0x20(%rsp), %rdi
movl $0xc, %esi
leaq 0x4c8(%rsp), %rdx
leaq 0x488(%rsp), %rcx
callq 0x36880
jmp 0x8248e
movb $0x0, 0x487(%rsp)
movq 0x808(%rsp), %rdi
addq $0x8, %rdi
movslq 0x804(%rsp), %rsi
callq 0x18460
movq 0x20(%rsp), %rcx
movq %rcx, (%rax)
leaq 0x488(%rsp), %rdi
callq 0x1f210
leaq 0x4c8(%rsp), %rdi
callq 0x1f210
movb $0x1, 0x897(%rsp)
leaq 0x508(%rsp), %rdi
callq 0x1f210
leaq 0x548(%rsp), %rdi
callq 0x1f210
jmp 0x825bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x825ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x8259e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82581
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82574
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
leaq 0x488(%rsp), %rdi
callq 0x1f210
leaq 0x4c8(%rsp), %rdi
callq 0x1f210
testb $0x1, 0x487(%rsp)
jne 0x8258d
jmp 0x8259c
movq 0x20(%rsp), %rdi
movl $0xe0, %esi
callq 0x8350
jmp 0x8259e
leaq 0x508(%rsp), %rdi
callq 0x1f210
leaq 0x548(%rsp), %rdi
callq 0x1f210
jmp 0x82e44
jmp 0x82e1d
movq 0x7f8(%rsp), %rcx
movl $0x3, %eax
cmpl (%rcx), %eax
jne 0x827e8
movq 0x7f8(%rsp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x827e3
movq 0x7f8(%rsp), %rax
cmpl $0x1, 0x48(%rax)
jne 0x827e3
movq 0x7f8(%rsp), %rcx
movl 0xc(%rcx), %eax
movl 0x4c(%rcx), %ecx
cltd
idivl %ecx
movl %eax, 0x480(%rsp)
movl 0x480(%rsp), %edx
leaq 0x440(%rsp), %rdi
movl $0x1, %esi
callq 0x1f160
jmp 0x8262e
movq 0x7f8(%rsp), %rsi
addq $0x88, %rsi
leaq 0x400(%rsp), %rdi
callq 0x43130
jmp 0x8264c
movl $0xe0, %edi
callq 0x8340
movq %rax, 0x18(%rsp)
jmp 0x8265d
movb $0x1, 0x37f(%rsp)
leaq 0x3c0(%rsp), %rdi
leaq 0x440(%rsp), %rsi
callq 0x43130
jmp 0x8267c
leaq 0x380(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x43130
jmp 0x82693
movq 0x18(%rsp), %rdi
movl $0xc, %esi
leaq 0x3c0(%rsp), %rdx
leaq 0x380(%rsp), %rcx
callq 0x36880
jmp 0x826b4
movb $0x0, 0x37f(%rsp)
movq 0x808(%rsp), %rdi
addq $0x8, %rdi
movslq 0x804(%rsp), %rsi
callq 0x18460
movq 0x18(%rsp), %rcx
movq %rcx, (%rax)
leaq 0x380(%rsp), %rdi
callq 0x1f210
leaq 0x3c0(%rsp), %rdi
callq 0x1f210
movb $0x1, 0x897(%rsp)
leaq 0x400(%rsp), %rdi
callq 0x1f210
leaq 0x440(%rsp), %rdi
callq 0x1f210
jmp 0x827e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x827d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x827c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x827a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x8279a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
leaq 0x380(%rsp), %rdi
callq 0x1f210
leaq 0x3c0(%rsp), %rdi
callq 0x1f210
testb $0x1, 0x37f(%rsp)
jne 0x827b3
jmp 0x827c2
movq 0x18(%rsp), %rdi
movl $0xe0, %esi
callq 0x8350
jmp 0x827c4
leaq 0x400(%rsp), %rdi
callq 0x1f210
leaq 0x440(%rsp), %rdi
callq 0x1f210
jmp 0x82e44
jmp 0x82e1b
movq 0x7f8(%rsp), %rcx
movl $0x4, %eax
cmpl (%rcx), %eax
jne 0x82a0e
movq 0x7f8(%rsp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x82a09
movq 0x7f8(%rsp), %rax
cmpl $0x1, 0x48(%rax)
jne 0x82a09
movq 0x7f8(%rsp), %rcx
movl 0xc(%rcx), %eax
movl 0x4c(%rcx), %ecx
cltd
idivl %ecx
movl %edx, 0x378(%rsp)
movl 0x378(%rsp), %edx
leaq 0x338(%rsp), %rdi
movl $0x1, %esi
callq 0x1f160
jmp 0x82854
movq 0x7f8(%rsp), %rsi
addq $0x88, %rsi
leaq 0x2f8(%rsp), %rdi
callq 0x43130
jmp 0x82872
movl $0xe0, %edi
callq 0x8340
movq %rax, 0x10(%rsp)
jmp 0x82883
movb $0x1, 0x277(%rsp)
leaq 0x2b8(%rsp), %rdi
leaq 0x338(%rsp), %rsi
callq 0x43130
jmp 0x828a2
leaq 0x278(%rsp), %rdi
leaq 0x2f8(%rsp), %rsi
callq 0x43130
jmp 0x828b9
movq 0x10(%rsp), %rdi
movl $0xc, %esi
leaq 0x2b8(%rsp), %rdx
leaq 0x278(%rsp), %rcx
callq 0x36880
jmp 0x828da
movb $0x0, 0x277(%rsp)
movq 0x808(%rsp), %rdi
addq $0x8, %rdi
movslq 0x804(%rsp), %rsi
callq 0x18460
movq 0x10(%rsp), %rcx
movq %rcx, (%rax)
leaq 0x278(%rsp), %rdi
callq 0x1f210
leaq 0x2b8(%rsp), %rdi
callq 0x1f210
movb $0x1, 0x897(%rsp)
leaq 0x2f8(%rsp), %rdi
callq 0x1f210
leaq 0x338(%rsp), %rdi
callq 0x1f210
jmp 0x82a09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x829f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x829ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x829cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x829c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
leaq 0x278(%rsp), %rdi
callq 0x1f210
leaq 0x2b8(%rsp), %rdi
callq 0x1f210
testb $0x1, 0x277(%rsp)
jne 0x829d9
jmp 0x829e8
movq 0x10(%rsp), %rdi
movl $0xe0, %esi
callq 0x8350
jmp 0x829ea
leaq 0x2f8(%rsp), %rdi
callq 0x1f210
leaq 0x338(%rsp), %rdi
callq 0x1f210
jmp 0x82e44
jmp 0x82e19
movq 0x7f8(%rsp), %rcx
movl $0x5, %eax
cmpl (%rcx), %eax
jne 0x82c24
movq 0x7f8(%rsp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x82c1f
movq 0x7f8(%rsp), %rax
movl 0xc(%rax), %eax
testl %eax, %eax
sete %al
movzbl %al, %eax
movl %eax, 0x270(%rsp)
movl 0x270(%rsp), %edx
leaq 0x230(%rsp), %rdi
movl $0x1, %esi
callq 0x1f160
jmp 0x82a6a
movq 0x7f8(%rsp), %rsi
addq $0x88, %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x43130
jmp 0x82a88
movl $0xe0, %edi
callq 0x8340
movq %rax, 0x8(%rsp)
jmp 0x82a99
movb $0x1, 0x16f(%rsp)
leaq 0x1b0(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x43130
jmp 0x82ab8
leaq 0x170(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x43130
jmp 0x82acf
movq 0x8(%rsp), %rdi
movl $0xc, %esi
leaq 0x1b0(%rsp), %rdx
leaq 0x170(%rsp), %rcx
callq 0x36880
jmp 0x82af0
movb $0x0, 0x16f(%rsp)
movq 0x808(%rsp), %rdi
addq $0x8, %rdi
movslq 0x804(%rsp), %rsi
callq 0x18460
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
leaq 0x170(%rsp), %rdi
callq 0x1f210
leaq 0x1b0(%rsp), %rdi
callq 0x1f210
movb $0x1, 0x897(%rsp)
leaq 0x1f0(%rsp), %rdi
callq 0x1f210
leaq 0x230(%rsp), %rdi
callq 0x1f210
jmp 0x82c1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82c0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82c00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82be3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82bd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
leaq 0x170(%rsp), %rdi
callq 0x1f210
leaq 0x1b0(%rsp), %rdi
callq 0x1f210
testb $0x1, 0x16f(%rsp)
jne 0x82bef
jmp 0x82bfe
movq 0x8(%rsp), %rdi
movl $0xe0, %esi
callq 0x8350
jmp 0x82c00
leaq 0x1f0(%rsp), %rdi
callq 0x1f210
leaq 0x230(%rsp), %rdi
callq 0x1f210
jmp 0x82e44
jmp 0x82e17
movq 0x7f8(%rsp), %rcx
movl $0x6, %eax
cmpl (%rcx), %eax
jne 0x82e15
movq 0x7f8(%rsp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x82e13
movq 0x7f8(%rsp), %rax
movl 0xc(%rax), %eax
negl %eax
movl %eax, 0x168(%rsp)
movl 0x168(%rsp), %edx
leaq 0x128(%rsp), %rdi
movl $0x1, %esi
callq 0x1f160
jmp 0x82c7a
movq 0x7f8(%rsp), %rsi
addq $0x88, %rsi
leaq 0xe8(%rsp), %rdi
callq 0x43130
jmp 0x82c98
movl $0xe0, %edi
callq 0x8340
movq %rax, (%rsp)
jmp 0x82ca8
movb $0x1, 0x67(%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x43130
jmp 0x82cc4
leaq 0x68(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x43130
jmp 0x82cd8
movq (%rsp), %rdi
movl $0xc, %esi
leaq 0xa8(%rsp), %rdx
leaq 0x68(%rsp), %rcx
callq 0x36880
jmp 0x82cf5
movb $0x0, 0x67(%rsp)
movq 0x808(%rsp), %rdi
addq $0x8, %rdi
movslq 0x804(%rsp), %rsi
callq 0x18460
movq (%rsp), %rcx
movq %rcx, (%rax)
leaq 0x68(%rsp), %rdi
callq 0x1f210
leaq 0xa8(%rsp), %rdi
callq 0x1f210
movb $0x1, 0x897(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x1f210
leaq 0x128(%rsp), %rdi
callq 0x1f210
jmp 0x82e13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82e04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82df7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82dde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
jmp 0x82dd1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x850(%rsp)
movl %eax, 0x84c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x1f210
leaq 0xa8(%rsp), %rdi
callq 0x1f210
testb $0x1, 0x67(%rsp)
jne 0x82de7
jmp 0x82df5
movq (%rsp), %rdi
movl $0xe0, %esi
callq 0x8350
jmp 0x82df7
leaq 0xe8(%rsp), %rdi
callq 0x1f210
leaq 0x128(%rsp), %rdi
callq 0x1f210
jmp 0x82e44
jmp 0x82e15
jmp 0x82e17
jmp 0x82e19
jmp 0x82e1b
jmp 0x82e1d
jmp 0x82e1f
jmp 0x82e21
leaq 0x7c0(%rsp), %rdi
callq 0x4a730
movl 0x804(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x804(%rsp)
jmp 0x81e22
leaq 0x7c0(%rsp), %rdi
callq 0x4a730
jmp 0x82e8d
jmp 0x82e55
leaq 0x818(%rsp), %rdi
callq 0x49330
jmp 0x81de1
jmp 0x82e69
leaq 0x838(%rsp), %rdi
callq 0x49260
jmp 0x81d6d
leaq 0x858(%rsp), %rdi
callq 0x83080
jmp 0x81cf2
leaq 0x858(%rsp), %rdi
callq 0x83080
jmp 0x82ea4
addq $0x8a8, %rsp            # imm = 0x8A8
retq
movq 0x850(%rsp), %rdi
callq 0x8670
nopw %cs:(%rax,%rax)