// File: /workspace/github_cpp_makefile_star2_O1/luooofan[P]hblzbd_compiler/src/Pass/arm_offset_fixup.cpp
// Function: SPOffsetFixup::Fixup4Func(ArmFunction*)
void SPOffsetFixup::Fixup4Func(ArmFunction *func) {
#ifdef DEBUG_FIXUP_PROCESS
  std::cout << "Prune Instruction Start:" << std::endl;
#endif
  // 每一个函数确定了之后 更改push/pop指令 更改add/sub sp sp stack_size指令
  int offset_fixup_diff = func->used_callee_saved_regs.size() * 4 + func->stack_size_;
  bool is_lr_used = func->used_callee_saved_regs.find(ArmReg::lr) != func->used_callee_saved_regs.end();

#ifdef DEBUG_FIXUP_PROCESS
  std::cout << "Modify Push Pop Start:" << std::endl;
#endif
  for (auto bb : func->bb_list_) {
    for (auto iter = bb->inst_list_.begin(); iter != bb->inst_list_.end();) {
      if (auto pushpop_inst = dynamic_cast<PushPop *>(*iter)) {
        // pushpop_inst->EmitCode(outfile);
        pushpop_inst->reg_list_.clear();
        Cond cond = pushpop_inst->cond_;
        for (auto reg : func->used_callee_saved_regs) {
          pushpop_inst->reg_list_.push_back(new Reg(reg));
        }
        if (pushpop_inst->opkind_ == PushPop::OpKind::PUSH) {
          if (pushpop_inst->reg_list_.empty()) {
            iter = bb->inst_list_.erase(iter);
            continue;
          }
        } else {
          if (is_lr_used) {  // 把pop lr 改为pop pc
            MyAssert(pushpop_inst->reg_list_.back()->reg_id_ == ArmReg::lr);
            pushpop_inst->reg_list_.back()->reg_id_ = ArmReg::pc;
          }
          if (pushpop_inst->reg_list_.empty()) {
            iter = bb->inst_list_.erase(iter);
          } else {
            ++iter;
          }
          // 此时iter指向原pop指令的下一条指令
          if (!is_lr_used) {  // 不在push中 插入一条 bx lr
            iter = bb->inst_list_.insert(iter, new Branch(false, true, cond, "lr", bb, false));
          }
          continue;
        }
        ++iter;
      } else {
        ++iter;
      }
    }
  }
#ifdef DEBUG_FIXUP_PROCESS
  std::cout << "Modify Push Pop End." << std::endl;
#endif

#ifdef DEBUG_FIXUP_PROCESS
  std::cout << "Fixup sp_arg Start:" << std::endl;
#endif

  auto merge_ldrpseudo_with_ldr = [&func](std::unordered_set<Instruction *>::iterator it) {
    // 把ldrpseudo和后面的ldr合起来
    for (auto bb : func->bb_list_) {
      for (auto inst_it = bb->inst_list_.begin(); inst_it != bb->inst_list_.end(); ++inst_it) {
        if (*inst_it == *it) {
          int imm = 0;
          auto src_inst = dynamic_cast<LdrPseudo *>(*inst_it);
          MyAssert(nullptr != src_inst && src_inst->IsImm());
          imm = src_inst->imm_;
          inst_it = bb->inst_list_.erase(inst_it);
          // inst_it现在指向了ldr vreg sp op2指令 要把op2改为立即数类型
          auto ldr_inst = dynamic_cast<LdrStr *>(*inst_it);
          MyAssert(nullptr != ldr_inst && !ldr_inst->is_offset_imm_ && nullptr != ldr_inst->offset_ &&
                   ldr_inst->rn_->reg_id_ == ArmReg::sp && !ldr_inst->offset_->is_imm_ &&
                   ldr_inst->offset_->reg_->reg_id_ == src_inst->rd_->reg_id_);
          // TODO delete src op2
          ldr_inst->offset_ = new Operand2(imm);
          // *it = ldr_inst;  // 之后sp_arg_fixup中会出现ldr指令
          return;
        }
      }
    }
    MyAssert(0);
  };

  // 针对sp_arg的修复 需要修复栈中高处实参的位置 一定是一条ldr-pseudo指令
  for (auto it = func->sp_arg_fixup_.begin(); it != func->sp_arg_fixup_.end(); ++it) {
    auto src_inst = dynamic_cast<LdrPseudo *>(*it);
    MyAssert(nullptr != src_inst && src_inst->IsImm());
    src_inst->imm_ += offset_fixup_diff;
    if (LdrStr::CheckImm12(src_inst->imm_)) {
      merge_ldrpseudo_with_ldr(it);
    }
  }

  func->sp_arg_fixup_.clear();

#ifdef DEBUG_FIXUP_PROCESS
  std::cout << "Fixup sp_arg End." << std::endl;
  std::cout << "Fixup sp Start:" << std::endl;
#endif

  auto convert_imm_inst = [&func](std::unordered_set<Instruction *>::iterator it) {
    // 把mov/mvn转换成ldrpseudo
    for (auto bb : func->bb_list_) {
      for (auto inst_it = bb->inst_list_.begin(); inst_it != bb->inst_list_.end(); ++inst_it) {
        if (*inst_it == *it) {
          auto src_inst = dynamic_cast<Move *>(*it);
          MyAssert(nullptr != src_inst && src_inst->op2_->is_imm_);
          inst_it = bb->inst_list_.erase(inst_it);
          int imm = 0;
          if (src_inst->is_mvn_) {
            imm = -src_inst->op2_->imm_num_ - 1;
          } else {
            imm = src_inst->op2_->imm_num_;
          }
          auto pseudo_ldr_inst = new LdrPseudo(Cond::AL, src_inst->rd_, imm, bb);
          inst_it = bb->inst_list_.insert(inst_it, pseudo_ldr_inst);
          // TODO: delete
          // *it = pseudo_ldr_inst;
          return;
        }
      }
    }
    MyAssert(0);
  };

  auto merge_with_addsub = [&func](std::unordered_set<Instruction *>::iterator it) {
    // 把mov/ldrpseudo和后面的addsub sp sp 合起来
    for (auto bb : func->bb_list_) {
      for (auto inst_it = bb->inst_list_.begin(); inst_it != bb->inst_list_.end(); ++inst_it) {
        if (*inst_it == *it) {
          int imm = 0;
          if (auto src_inst = dynamic_cast<Move *>(*it)) {
            MyAssert(src_inst->op2_->is_imm_);
            if (src_inst->is_mvn_) return;
            imm = src_inst->op2_->imm_num_;
          } else if (auto src_inst = dynamic_cast<LdrPseudo *>(*it)) {
            MyAssert(src_inst->IsImm());
            imm = src_inst->imm_;
          } else {
            MyAssert(0);
          }
          inst_it = bb->inst_list_.erase(inst_it);
          // inst_it现在指向了add或sub sp sp op2指令 要把op2改为立即数类型
          auto addsub_inst = dynamic_cast<BinaryInst *>(*inst_it);
          MyAssert(nullptr != addsub_inst && addsub_inst->rd_->reg_id_ == ArmReg::sp &&
                   addsub_inst->rn_->reg_id_ == ArmReg::sp);
          // TODO delete src op2
          addsub_inst->op2_ = new Operand2(imm);
          // *it = addsub_inst;  // 之后sp_fixup中会出现addsub指令
          return;
        }
      }
    }
    MyAssert(0);
  };

  // 针对function prologue和epilogue中sp的修复 原来都是0 可能是mov mvn或者pseudo ldr
  for (auto it = func->sp_fixup_.begin(); it != func->sp_fixup_.end(); ++it) {
    if (auto src_inst = dynamic_cast<Move *>(*it)) {
      MyAssert(src_inst->op2_->is_imm_);
      if (src_inst->is_mvn_) {
        MyAssert(0);
        src_inst->op2_->imm_num_ = -func->stack_size_;
      } else {
        src_inst->op2_->imm_num_ = func->stack_size_;
      }
      if (!Operand2::CheckImm8m(src_inst->op2_->imm_num_)) {
        convert_imm_inst(it);
      } else {
        // 满足op2 可以和后面的add/sub合为一条语句
        merge_with_addsub(it);
      }
    } else if (auto src_inst = dynamic_cast<LdrPseudo *>(*it)) {
      MyAssert(src_inst->IsImm());
      src_inst->imm_ = func->stack_size_;
      if (Operand2::CheckImm8m(src_inst->imm_)) {
        // 满足op2 可以和后面的add/sub合为一条语句
        merge_with_addsub(it);
      }
    } else {
      MyAssert(0);
    }
  }

  func->sp_fixup_.clear();

#ifdef DEBUG_FIXUP_PROCESS
  std::cout << "Fixup sp End." << std::endl;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, 0x20(%rsp)
movl 0x100(%rsi), %eax
movq %rax, 0x28(%rsp)
movq 0xe8(%rsi), %rcx
leaq 0xe0(%rsi), %rbx
movq %rbx, %rax
testq %rcx, %rcx
je 0x3d70b
movq %rbx, %rax
xorl %edx, %edx
cmpl $0xe, 0x20(%rcx)
setl %dl
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0x3d6f4
movq 0x28(%rsp), %rcx
shll $0x2, %ecx
movq %rcx, 0x28(%rsp)
movq %rbx, 0x8(%rsp)
cmpq %rbx, %rax
je 0x3d72f
cmpl $0xf, 0x20(%rax)
cmovgeq %rbx, %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rax
addl 0x2c(%rsi), %eax
movq %rax, 0x28(%rsp)
movq 0x38(%rsi), %r14
movq 0x40(%rsi), %rax
movq %rax, 0x68(%rsp)
cmpq %rax, %r14
je 0x3d9d3
leaq 0x50c2f(%rip), %rax     # 0x8e388
addq $0x10, %rax
movq %rax, 0x70(%rsp)
leaq 0x38(%rsp), %r12
movq %rbx, 0x40(%rsp)
movq (%r14), %r15
movq 0x30(%r15), %rbp
cmpq 0x38(%r15), %rbp
je 0x3d9c4
leaq 0x30(%r15), %rax
movq %rax, 0x78(%rsp)
movq %r14, 0x10(%rsp)
movq %r15, 0x30(%rsp)
movq (%rbp), %rdi
testq %rdi, %rdi
je 0x3d7b3
leaq 0x50e28(%rip), %rsi     # 0x8e5c8
leaq 0x50e09(%rip), %rdx     # 0x8e5b0
xorl %ecx, %ecx
callq 0x8320
movq %rax, %r13
jmp 0x3d7b6
xorl %r13d, %r13d
testq %r13, %r13
je 0x3d8b0
movq %rbp, 0x18(%rsp)
movq 0x18(%r13), %rax
cmpq %rax, 0x20(%r13)
je 0x3d7d2
movq %rax, 0x20(%r13)
movl 0x10(%r13), %eax
movl %eax, (%rsp)
movq 0x20(%rsp), %rbx
movq 0xf0(%rbx), %rbp
addq $0xe0, %rbx
cmpq %rbx, %rbp
je 0x3d848
leaq 0x18(%r13), %r14
movl 0x20(%rbp), %r15d
movl $0x40, %edi
callq 0x8290
leaq 0x30(%rax), %rcx
movq %rcx, (%rax)
movq $0x1, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movl $0x3f800000, 0x20(%rax) # imm = 0x3F800000
movups %xmm0, 0x28(%rax)
movl %r15d, 0x38(%rax)
movq %rax, 0x38(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x3d4a0
movq %rbp, %rdi
callq 0x8340
movq %rax, %rbp
cmpq %rbx, %rax
jne 0x3d7f5
cmpl $0x0, 0x14(%r13)
je 0x3d893
movq 0x40(%rsp), %rbx
cmpq %rbx, 0x8(%rsp)
movq 0x10(%rsp), %r14
movq 0x30(%rsp), %r15
movq 0x18(%rsp), %rbp
je 0x3d883
movq 0x20(%r13), %rax
movq -0x8(%rax), %rax
cmpl $0xe, 0x38(%rax)
jne 0x3dfb4
movl $0xf, 0x38(%rax)
movq 0x18(%r13), %rax
cmpq 0x20(%r13), %rax
je 0x3d8b9
addq $0x8, %rbp
jmp 0x3d8d9
movq 0x18(%r13), %rax
cmpq 0x20(%r13), %rax
movq 0x10(%rsp), %r14
movq 0x30(%rsp), %r15
movq 0x18(%rsp), %rbp
je 0x3d99a
addq $0x8, %rbp
jmp 0x3d9ba
movq %rbp, %rsi
addq $0x8, %rsi
movq 0x38(%r15), %rdx
cmpq %rdx, %rsi
je 0x3d8d4
subq %rsi, %rdx
movq %rbp, %rdi
callq 0x84c0
addq $-0x8, 0x38(%r15)
cmpq %rbx, 0x8(%rsp)
jne 0x3d9ba
movq %rbp, %r14
movl $0x40, %edi
callq 0x8290
movq %rax, %r13
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x318c4(%rip), %rsi     # 0x6f1ce
leaq 0x318bf(%rip), %rdx     # 0x6f1d0
callq 0xcaa0
movb $0x1, %bpl
movq %r13, %rdi
movl (%rsp), %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0xa67a
movq 0x70(%rsp), %rax
movq %rax, (%r13)
leaq 0x18(%r13), %rdi
movq %r13, %rax
addq $0x28, %rax
movq %rax, 0x18(%r13)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
callq 0xca10
movw $0x100, 0x38(%r13)      # imm = 0x100
movq %r13, 0x38(%rsp)
xorl %ebp, %ebp
movq 0x78(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0xcd3a
movq %rax, %r14
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3d990
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x82a0
movq %r14, %rbp
movq 0x10(%rsp), %r14
jmp 0x3d9ba
movq %rbp, %rsi
addq $0x8, %rsi
movq 0x38(%r15), %rdx
cmpq %rdx, %rsi
je 0x3d9b5
subq %rsi, %rdx
movq %rbp, %rdi
callq 0x84c0
addq $-0x8, 0x38(%r15)
cmpq 0x38(%r15), %rbp
jne 0x3d790
addq $0x8, %r14
cmpq 0x68(%rsp), %r14
jne 0x3d76c
movq 0x20(%rsp), %r12
movq 0x78(%r12), %rbp
testq %rbp, %rbp
je 0x3dbcf
movq 0x8(%rbp), %rdi
testq %rdi, %rdi
je 0x3da06
leaq 0x50bd2(%rip), %rsi     # 0x8e5c8
leaq 0x50b9b(%rip), %rdx     # 0x8e598
xorl %ecx, %ecx
callq 0x8320
jmp 0x3da08
xorl %eax, %eax
testq %rax, %rax
je 0x3dfef
cmpb $0x0, 0x44(%rax)
je 0x3dfef
movl 0x40(%rax), %ecx
movq 0x28(%rsp), %rsi
leal (%rsi,%rcx), %edx
movl %edx, 0x40(%rax)
leal (%rsi,%rcx), %eax
addl $0xfff, %eax            # imm = 0xFFF
cmpl $0x1ffe, %eax           # imm = 0x1FFE
ja 0x3dbc1
movq 0x38(%r12), %r15
movq 0x40(%r12), %rcx
cmpq %rcx, %r15
je 0x3deb0
xorl %edx, %edx
movq %rbp, 0x8(%rsp)
movq %rcx, (%rsp)
movq (%r15), %r14
movq 0x30(%r14), %r12
movq 0x38(%r14), %r13
cmpq %r13, %r12
je 0x3dba4
movq 0x8(%rbp), %rax
movq (%r12), %rdi
cmpq %rax, %rdi
je 0x3da9e
addq $0x8, %r12
cmpq %r13, %r12
sete %bl
je 0x3dba4
movq (%r12), %rdi
addq $0x8, %r12
cmpq %rax, %rdi
jne 0x3da7f
addq $-0x8, %r12
jmp 0x3daa0
xorl %ebx, %ebx
movl %edx, 0x18(%rsp)
testq %rdi, %rdi
je 0x3dac3
leaq 0x50b18(%rip), %rsi     # 0x8e5c8
leaq 0x50ae1(%rip), %rdx     # 0x8e598
xorl %ecx, %ecx
callq 0x8320
movq %rax, %rbp
jmp 0x3dac5
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x3deee
cmpb $0x0, 0x44(%rbp)
je 0x3deee
movl 0x40(%rbp), %eax
movl %eax, 0x10(%rsp)
movq %r12, %rsi
addq $0x8, %rsi
cmpq %r13, %rsi
je 0x3daf9
subq %rsi, %r13
movq %r12, %rdi
movq %r13, %rdx
callq 0x84c0
addq $-0x8, 0x38(%r14)
movq (%r12), %rdi
testq %rdi, %rdi
je 0x3db21
leaq 0x50aba(%rip), %rsi     # 0x8e5c8
leaq 0x50a6b(%rip), %rdx     # 0x8e580
xorl %ecx, %ecx
callq 0x8320
movq %rax, %r12
jmp 0x3db24
xorl %r12d, %r12d
testq %r12, %r12
je 0x3de72
cmpb $0x0, 0x30(%r12)
jne 0x3de72
movq 0x38(%r12), %rax
testq %rax, %rax
je 0x3de72
movq 0x28(%r12), %rcx
cmpl $0xd, 0x38(%rcx)
jne 0x3de72
cmpb $0x0, (%rax)
jne 0x3de72
movq 0x8(%rax), %rax
movl 0x38(%rax), %eax
movq 0x18(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jne 0x3de72
movl $0x18, %edi
callq 0x8290
movb $0x1, (%rax)
movl 0x10(%rsp), %ecx
movl %ecx, 0x4(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rax, 0x38(%r12)
testb %bl, %bl
movq 0x8(%rsp), %rbp
movq (%rsp), %rcx
movl 0x18(%rsp), %eax
je 0x3dbb9
addq $0x8, %r15
cmpq %rcx, %r15
sete %dl
jne 0x3da5a
jmp 0x3deb0
testb $0x1, %al
jne 0x3deb0
movq (%rbp), %rbp
movq 0x20(%rsp), %r12
jmp 0x3d9dd
addq $0x68, %r12
movq %r12, %rdi
callq 0x3e47e
leaq 0x20(%rsp), %rax
movq %rax, 0x80(%rsp)
movq (%rax), %r15
movq 0xb0(%r15), %r14
testq %r14, %r14
je 0x3de51
leaq 0x507ce(%rip), %rax     # 0x8e3d0
addq $0x10, %rax
movq %rax, 0x40(%rsp)
movq %r14, (%rsp)
movq 0x8(%r14), %r14
testq %r14, %r14
je 0x3dc32
movq %r14, %rdi
leaq 0x509a6(%rip), %rsi     # 0x8e5c8
leaq 0x508df(%rip), %rdx     # 0x8e508
xorl %ecx, %ecx
callq 0x8320
jmp 0x3dc34
xorl %eax, %eax
testq %rax, %rax
je 0x3dddf
movq 0x20(%rax), %rcx
cmpb $0x0, (%rcx)
je 0x3e02d
cmpb $0x1, 0x14(%rax)
movq (%rsp), %r14
je 0x3e06b
movl 0x2c(%r15), %edi
movl %edi, 0x4(%rcx)
callq 0xa656
testb %al, %al
jne 0x3de30
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rdx
movq 0x40(%rax), %r15
cmpq %r15, %rdx
je 0x3df29
xorl %ecx, %ecx
movq %r15, 0x30(%rsp)
movq (%rdx), %r13
movq 0x30(%r13), %r12
movq 0x38(%r13), %rbp
cmpq %rbp, %r12
je 0x3ddca
movq 0x8(%r14), %rdi
cmpq %rdi, (%r12)
je 0x3dcce
addq $0x8, %r12
cmpq %rbp, %r12
sete %bl
je 0x3ddca
leaq 0x8(%r12), %rax
cmpq %rdi, (%r12)
movq %rax, %r12
jne 0x3dcab
addq $-0x8, %rax
movq %rax, %r12
jmp 0x3dcd0
xorl %ebx, %ebx
movq %rdx, 0x10(%rsp)
movl %ecx, 0x18(%rsp)
testq %rdi, %rdi
je 0x3dcf8
leaq 0x508e3(%rip), %rsi     # 0x8e5c8
leaq 0x5081c(%rip), %rdx     # 0x8e508
xorl %ecx, %ecx
callq 0x8320
movq %rax, %r14
jmp 0x3dcfb
xorl %r14d, %r14d
testq %r14, %r14
je 0x3df64
movq 0x20(%r14), %rax
cmpb $0x0, (%rax)
je 0x3df64
movq %r12, %rsi
addq $0x8, %rsi
cmpq %rbp, %rsi
je 0x3dd2b
subq %rsi, %rbp
movq %r12, %rdi
movq %rbp, %rdx
callq 0x84c0
addq $-0x8, 0x38(%r13)
movq %r14, %r15
movzbl 0x14(%r14), %r14d
movq 0x20(%r15), %rax
movl 0x4(%rax), %eax
movl %eax, 0x8(%rsp)
movl $0x48, %edi
callq 0x8290
movq %rax, %rbp
movq 0x18(%r15), %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
movl $0x1, %ecx
callq 0xa67a
addq $0x30, %r13
negl %r14d
movl 0x8(%rsp), %ecx
xorl %r14d, %ecx
movq 0x40(%rsp), %rax
movq %rax, (%rbp)
movq %r15, 0x18(%rbp)
movq %rbp, %rax
addq $0x30, %rax
movq %rax, 0x20(%rbp)
movq $0x0, 0x28(%rbp)
movb $0x0, 0x30(%rbp)
movl %ecx, 0x40(%rbp)
movb $0x1, 0x44(%rbp)
movq %rbp, 0x38(%rsp)
movq %r13, %rdi
movq %r12, %rsi
leaq 0x38(%rsp), %rdx
callq 0xcd3a
testb %bl, %bl
movq (%rsp), %r14
movq 0x30(%rsp), %r15
movl 0x18(%rsp), %eax
movq 0x10(%rsp), %rdx
je 0x3ddfe
addq $0x8, %rdx
cmpq %r15, %rdx
sete %cl
jne 0x3dc89
jmp 0x3df29
testq %r14, %r14
je 0x3de07
movq %r14, %rdi
leaq 0x507da(%rip), %rsi     # 0x8e5c8
leaq 0x507a3(%rip), %rdx     # 0x8e598
xorl %ecx, %ecx
callq 0x8320
jmp 0x3de09
testb $0x1, %al
je 0x3de40
jmp 0x3df29
xorl %eax, %eax
movq (%rsp), %r14
testq %rax, %rax
je 0x3e0e7
cmpb $0x0, 0x44(%rax)
je 0x3e0a9
movl 0x2c(%r15), %edi
movl %edi, 0x40(%rax)
callq 0xa656
testb %al, %al
je 0x3de40
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0x3e174
movq (%r14), %r14
movq 0x20(%rsp), %r15
testq %r14, %r14
jne 0x3dc0b
addq $0xa0, %r15
movq %r15, %rdi
callq 0x3e47e
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x52177(%rip), %rdi     # 0x8fff0
leaq 0x312e8(%rip), %rsi     # 0x6f168
callq 0x8280
leaq 0x347aa(%rip), %rsi     # 0x72636
movq %rax, %rdi
callq 0x8280
leaq 0x32525(%rip), %rsi     # 0x703c0
movq %rax, %rdi
callq 0x8280
movq %rax, %rdi
movl $0x58, %esi
jmp 0x3df9d
movq 0x52139(%rip), %rdi     # 0x8fff0
leaq 0x312aa(%rip), %rsi     # 0x6f168
callq 0x8280
leaq 0x3476c(%rip), %rsi     # 0x72636
movq %rax, %rdi
callq 0x8280
leaq 0x324e7(%rip), %rsi     # 0x703c0
movq %rax, %rdi
callq 0x8280
movq %rax, %rdi
movl $0x60, %esi
jmp 0x3df9d
movq 0x520fb(%rip), %rdi     # 0x8fff0
leaq 0x3126c(%rip), %rsi     # 0x6f168
callq 0x8280
leaq 0x3472e(%rip), %rsi     # 0x72636
movq %rax, %rdi
callq 0x8280
leaq 0x324a9(%rip), %rsi     # 0x703c0
movq %rax, %rdi
callq 0x8280
movq %rax, %rdi
movl $0x51, %esi
jmp 0x3df9d
movq 0x520c0(%rip), %rdi     # 0x8fff0
leaq 0x31231(%rip), %rsi     # 0x6f168
callq 0x8280
leaq 0x346f3(%rip), %rsi     # 0x72636
movq %rax, %rdi
callq 0x8280
leaq 0x3246e(%rip), %rsi     # 0x703c0
movq %rax, %rdi
callq 0x8280
movq %rax, %rdi
movl $0x8a, %esi
jmp 0x3df9d
movq 0x52085(%rip), %rdi     # 0x8fff0
leaq 0x311f6(%rip), %rsi     # 0x6f168
callq 0x8280
leaq 0x346b8(%rip), %rsi     # 0x72636
movq %rax, %rdi
callq 0x8280
leaq 0x32433(%rip), %rsi     # 0x703c0
movq %rax, %rdi
callq 0x8280
movq %rax, %rdi
movl $0x7a, %esi
callq 0x8520
movq %rax, %rdi
callq 0x8180
movl $0xff, %edi
callq 0x8380
movq 0x52035(%rip), %rdi     # 0x8fff0
leaq 0x311a6(%rip), %rsi     # 0x6f168
callq 0x8280
leaq 0x34668(%rip), %rsi     # 0x72636
movq %rax, %rdi
callq 0x8280
leaq 0x323e3(%rip), %rsi     # 0x703c0
movq %rax, %rdi
callq 0x8280
movq %rax, %rdi
movl $0x2e, %esi
jmp 0x3df9d
movq 0x51ffa(%rip), %rdi     # 0x8fff0
leaq 0x3116b(%rip), %rsi     # 0x6f168
callq 0x8280
leaq 0x3462d(%rip), %rsi     # 0x72636
movq %rax, %rdi
callq 0x8280
leaq 0x323a8(%rip), %rsi     # 0x703c0
movq %rax, %rdi
callq 0x8280
movq %rax, %rdi
movl $0x66, %esi
jmp 0x3df9d
movq 0x51fbc(%rip), %rdi     # 0x8fff0
leaq 0x3112d(%rip), %rsi     # 0x6f168
callq 0x8280
leaq 0x345ef(%rip), %rsi     # 0x72636
movq %rax, %rdi
callq 0x8280
leaq 0x3236a(%rip), %rsi     # 0x703c0
movq %rax, %rdi
callq 0x8280
movq %rax, %rdi
movl $0xaf, %esi
jmp 0x3df9d
movq 0x51f7e(%rip), %rdi     # 0x8fff0
leaq 0x310ef(%rip), %rsi     # 0x6f168
callq 0x8280
leaq 0x345b1(%rip), %rsi     # 0x72636
movq %rax, %rdi
callq 0x8280
leaq 0x3232c(%rip), %rsi     # 0x703c0
movq %rax, %rdi
callq 0x8280
movq %rax, %rdi
movl $0xb1, %esi
jmp 0x3df9d
movq 0x51f40(%rip), %rdi     # 0x8fff0
leaq 0x310b1(%rip), %rsi     # 0x6f168
callq 0x8280
leaq 0x34573(%rip), %rsi     # 0x72636
movq %rax, %rdi
callq 0x8280
leaq 0x322ee(%rip), %rsi     # 0x703c0
movq %rax, %rdi
callq 0x8280
movq %rax, %rdi
movl $0xbd, %esi
jmp 0x3df9d
movq 0x51f02(%rip), %rdi     # 0x8fff0
leaq 0x31073(%rip), %rsi     # 0x6f168
callq 0x8280
leaq 0x34535(%rip), %rsi     # 0x72636
movq %rax, %rdi
callq 0x8280
leaq 0x322b0(%rip), %rsi     # 0x703c0
movq %rax, %rdi
callq 0x8280
movq %rax, %rdi
movl $0xc4, %esi
jmp 0x3df9d
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x3e14c
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3e14c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x82a0
testb %bpl, %bpl
je 0x3e16b
movl $0x40, %esi
movq %r13, %rdi
jmp 0x3e166
movq %rax, %rbx
movl $0x48, %esi
movq %rbp, %rdi
callq 0x82a0
movq %rbx, %rdi
callq 0x8540
nop