// File: /workspace/github_cpp_makefile_star2_O3/luooofan[P]hblzbd_compiler/src/main.cpp
// Function: main
int main(int argc, char **argv) {
  // MyAssert(0);
  bool opt = false, print_usage = false;
  char *src = nullptr, *output = nullptr, *log_file = nullptr;
  // parse command line options and check
  for (int ch; (ch = getopt(argc, argv, "Sl:o:O:h")) != -1;) {
    switch (ch) {
      case 'S':
        // do nothing
        break;
      case 'l':
        log_file = strdup(optarg);
        break;
      case 'o':
        output = strdup(optarg);
        break;
      case 'O':
        opt = atoi(optarg) > 0;
        break;
      case 'h':
        print_usage = true;
        break;
      default:
        break;
    }
  }

  if (optind <= argc) {
    src = argv[optind];
  }

  if (src == nullptr || print_usage) {
    std::cerr << "Usage: " << argv[0] << " [-S] [-l log_file] [-o output_file] [-O level] input_file" << std::endl;
    return 1;
  }

  if (nullptr != src) {
    freopen(src, "r", stdin);
  }
  std::ofstream logfile;
  if (nullptr != log_file) {
    logfile.open(log_file);
  }

#ifdef DEBUG_PROCESS
  std::cout << "Parser Start:" << std::endl;
#endif
  yyset_lineno(1);
  yyparse();  // if success, ast_root is valid
  // MyAssert(0);
#ifdef DEBUG_PROCESS
  std::cout << "Parser End." << std::endl;
#endif
  yylex_destroy();

  MyAssert(nullptr != ast_root);
  if (logfile.is_open() && AST_LOG) {
    logfile << "AST:" << std::endl;
    ast_root->PrintNode(0, logfile);
  }

#ifdef DEBUG_PROCESS
  std::cout << "Generate IR Start:" << std::endl;
#endif
  std::vector<IR *> *ir_list_ptr = new std::vector<IR *>();
  {
    ir::ContextInfo ctx;
    ast_root->GenerateIR(ctx, *ir_list_ptr);
  }
#ifdef DEBUG_PROCESS
  std::cout << "Generate IR End." << std::endl;
#endif
  // MyAssert(0);
  delete ast_root;

  if (logfile.is_open() && IRLIST_LOG) {
    ir::PrintFuncTable(logfile);
    ir::PrintScopes(logfile);
    logfile << "IRList:" << std::endl;
    for (auto ir : *ir_list_ptr) {
      ir->PrintIR(logfile);
    }
  }

  // it represents IRModule before GenerateArm Pass and ArmModule after GenerateArm Pass.
  // the source space will be released when running GenerateArm Pass.
  Module *module_ptr = static_cast<Module *>(ConstructModule(std::string(src), *ir_list_ptr));
  delete ir_list_ptr;
  // module_ptr->EmitCode(std::cout);
  Module **const module_ptr_addr = &module_ptr;

#ifdef DEBUG_PROCESS
  std::cout << "Passes Start:" << std::endl;
#endif
  PassManager pm(module_ptr_addr);

  // ==================Add Quad-Pass Below==================
  pm.AddPass<SimplifyCFG>(true);
  pm.AddPass<DeadFunctionEliminate>(true);
  // pm.AddPass<ReachDefine>(false);
  pm.AddPass<ConstantPropagation>(true);
  pm.AddPass<Instruction_Combining>(true);
  pm.AddPass<LoopUnroll>(true);
  pm.AddPass<InvariantExtrapolation>(true);
  // ==================Add Quad-Pass Above==================
  pm.AddPass<SimplifyCFG>(true);  // necessary
  pm.AddPass<ComputeDominance>(false);
  pm.AddPass<ConvertSSA>(true);
  // ==================Add SSA-Pass Below==================
  pm.AddPass<DeadCodeEliminate>(false);
  pm.AddPass<SimpleOptimize>(true);
  pm.AddPass<DeadCodeEliminate>(false);
  pm.AddPass<GlobalValueNumbering>(true);  // actually redundant common expression eliminate
  pm.AddPass<SimpleOptimize>(true);
  pm.AddPass<DeadCodeEliminate>(false);
  // ==================Add SSA-Pass Above==================
  pm.AddPass<GenerateArmFromSSA>(true);  // define macro control MUL_TO_SHIFT DIV_TO_SHIFT MOD_TO_AND optimize
  // ==================Add Arm(vreg)-Pass Below==================
  pm.AddPass<SimplifyArm>(true);
  pm.AddPass<CondBrToInsts>(true);
  // ==================Add Arm(vreg)-Pass Above==================
  pm.AddPass<RegAlloc>(true);
  pm.AddPass<SPOffsetFixup>(true);
  // ==================Add Arm-Pass Below==================
  pm.AddPass<SimplifyArm>(false);
  pm.AddPass<CondBrToInsts>(true);
  // ==================Add Arm-Pass Above==================
  if (logfile.is_open()) {
    pm.Run(PASS_LOG, logfile);
  } else {
    pm.Run();
  }

  // exit(0);
#ifdef DEBUG_PROCESS
  std::cout << "Passes End." << std::endl;
#endif
  MyAssert(typeid(*module_ptr) == typeid(ArmModule));

#ifdef DEBUG_PROCESS
  std::cout << "Emit Start:" << std::endl;
#endif
  {
    std::ofstream outfile;
    std::string file_name = "";
    if (nullptr == output) {
      file_name = std::string(src, src + strlen(src) - 1);
    } else {
      file_name = std::string(output);
    }
    outfile.open(file_name);
    if (logfile.is_open()) {
      logfile << "Emitting code to file: " << file_name << std::endl;
    }
    module_ptr->EmitCode(outfile);
    MyAssert(outfile.is_open());
    outfile << std::endl;
    if (logfile.is_open()) {
      logfile << "EmitCode finish." << std::endl;
    }
    outfile.close();
  }
#ifdef DEBUG_PROCESS
  std::cout << "Emit End." << std::endl;
#endif

  if (logfile.is_open()) {
    logfile.close();
  }

  // release the arm module space.
  delete module_ptr;
  module_ptr = nullptr;

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
movq %rsi, %r12
movl %edi, %ebp
xorl %ebx, %ebx
leaq 0x43163(%rip), %r15     # 0x6f34a
movq 0x62da2(%rip), %r14     # 0x8ef90
movq $0x0, 0x30(%rsp)
xorl %r13d, %r13d
movl %ebp, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x80d0
cmpl $0x6b, %eax
jg 0x2c21b
cmpl $-0x1, %eax
je 0x2c241
cmpl $0x68, %eax
jne 0x2c1fa
movb $0x1, %r13b
jmp 0x2c1fa
cmpl $0x6c, %eax
je 0x2c234
cmpl $0x6f, %eax
jne 0x2c1fa
movq (%r14), %rdi
callq 0x8560
movq %rax, 0x30(%rsp)
jmp 0x2c1fa
movq (%r14), %rdi
callq 0x8560
movq %rax, %rbx
jmp 0x2c1fa
movq 0x62d80(%rip), %rax     # 0x8efc8
movslq (%rax), %rax
cmpl %ebp, %eax
jg 0x2c264
movq (%r12,%rax,8), %r15
testq %r15, %r15
sete %al
orb %r13b, %al
testb $0x1, %al
je 0x2c300
movq 0x62d7d(%rip), %rbx     # 0x8efe8
leaq 0x430e1(%rip), %rsi     # 0x6f353
movl $0x7, %edx
movq %rbx, %rdi
callq 0x8330
movq (%r12), %r14
testq %r14, %r14
je 0x2c2a4
movq %r14, %rdi
callq 0x8160
movq 0x62d51(%rip), %rdi     # 0x8efe8
movq %r14, %rsi
movq %rax, %rdx
callq 0x8330
jmp 0x2c2bb
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x8500
leaq 0x43099(%rip), %rsi     # 0x6f35b
movl $0x3a, %edx
movq %rbx, %rdi
callq 0x8330
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8030
movq %rax, %rdi
callq 0x81f0
movl $0x1, %eax
jmp 0x2cbd4
movq 0x62ca1(%rip), %rax     # 0x8efa8
movq (%rax), %rdx
leaq 0x41ec2(%rip), %rsi     # 0x6e1d3
movq %r15, %rdi
callq 0x82f0
leaq 0x78(%rsp), %r12
movq %r12, %rdi
callq 0x8510
testq %rbx, %rbx
je 0x2c33d
leaq 0x78(%rsp), %rdi
movq %rbx, %rsi
movl $0x10, %edx
callq 0x8070
movq 0x62c74(%rip), %rbx     # 0x8efb8
leaq 0x4304b(%rip), %rsi     # 0x6f396
movl $0xd, %edx
movq %rbx, %rdi
callq 0x8330
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
movq 0x62c42(%rip), %rdi     # 0x8efb8
callq 0x8030
movq %rax, %rdi
callq 0x81f0
movl $0x1, %edi
callq 0x33222
callq 0x2f136
movq 0x62c1f(%rip), %rbx     # 0x8efb8
leaq 0x43004(%rip), %rsi     # 0x6f3a4
movl $0xb, %edx
movq %rbx, %rdi
callq 0x8330
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
movq 0x62bed(%rip), %rdi     # 0x8efb8
callq 0x8030
movq %rax, %rdi
callq 0x81f0
callq 0x33247
cmpq $0x0, 0x6323b(%rip)     # 0x8f620
je 0x2cc4c
leaq 0xe8(%rsp), %rbx
movq %rbx, %rdi
callq 0x80e0
testb %al, %al
je 0x2c460
cmpb $0x1, 0x63222(%rip)     # 0x8f628
jne 0x2c460
leaq 0x42fae(%rip), %rsi     # 0x6f3bd
leaq 0x78(%rsp), %r13
movl $0x4, %edx
movq %r13, %rdi
callq 0x8330
movq 0x78(%rsp), %rax
addq -0x18(%rax), %r13
movq %r13, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
leaq 0x78(%rsp), %rdi
callq 0x8030
movq %rax, %rdi
callq 0x81f0
movq 0x631cd(%rip), %rdi     # 0x8f620
movq (%rdi), %rax
leaq 0x78(%rsp), %rdx
xorl %esi, %esi
callq *0x18(%rax)
movq 0x62b51(%rip), %r13     # 0x8efb8
leaq 0x42f54(%rip), %rsi     # 0x6f3c2
movl $0x12, %edx
movq %r13, %rdi
callq 0x8330
movq (%r13), %rax
addq -0x18(%rax), %r13
movq %r13, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
movq 0x62b1e(%rip), %rdi     # 0x8efb8
callq 0x8030
movq %rax, %rdi
callq 0x81f0
movl $0x18, %edi
callq 0x8290
movq %rax, %r13
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
leaq 0x278(%rsp), %rdi
callq 0x2cdbc
movq 0x6314a(%rip), %rdi     # 0x8f620
movq (%rdi), %rax
leaq 0x278(%rsp), %rsi
movq %r13, %rdx
callq *0x10(%rax)
leaq 0x278(%rsp), %rdi
callq 0x2d026
movq 0x62abd(%rip), %rbp     # 0x8efb8
leaq 0x42ed3(%rip), %rsi     # 0x6f3d5
movl $0x10, %edx
movq %rbp, %rdi
callq 0x8330
movq (%rbp), %rax
addq -0x18(%rax), %rbp
movq %rbp, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
movq 0x62a8a(%rip), %rdi     # 0x8efb8
callq 0x8030
movq %rax, %rdi
callq 0x81f0
movq 0x630de(%rip), %rdi     # 0x8f620
testq %rdi, %rdi
je 0x2c54d
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x80e0
testb %al, %al
je 0x2c5e4
cmpb $0x1, 0x62d94(%rip)     # 0x8f2f8
jne 0x2c5e4
leaq 0x78(%rsp), %rdi
callq 0x28180
leaq 0x78(%rsp), %rdi
callq 0x27fbc
leaq 0x42e65(%rip), %rsi     # 0x6f3e6
leaq 0x78(%rsp), %rbp
movl $0x7, %edx
movq %rbp, %rdi
callq 0x8330
movq 0x78(%rsp), %rax
addq -0x18(%rax), %rbp
movq %rbp, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
leaq 0x78(%rsp), %rdi
callq 0x8030
movq %rax, %rdi
callq 0x81f0
movq (%r13), %r14
movq 0x8(%r13), %rbx
cmpq %rbx, %r14
je 0x2c5e4
leaq 0x78(%rsp), %rbp
movq (%r14), %rdi
movq %rbp, %rsi
callq 0x29b96
addq $0x8, %r14
cmpq %rbx, %r14
jne 0x2c5d0
leaq 0x288(%rsp), %r14
movq %r14, -0x10(%r14)
movq %r15, %rdi
callq 0x8160
leaq (%rax,%r15), %rdx
leaq 0x278(%rsp), %rdi
movq %r15, %rsi
callq 0xc772
leaq 0x278(%rsp), %rdi
movq %r13, %rsi
callq 0xfaf8
movq %rax, %rbp
movq 0x278(%rsp), %rdi
cmpq %r14, %rdi
je 0x2c63c
movq 0x288(%rsp), %rsi
incq %rsi
callq 0x82a0
movq %rbp, 0x28(%rsp)
movq (%r13), %rdi
testq %rdi, %rdi
leaq 0xe8(%rsp), %rbx
movq 0x30(%rsp), %r14
je 0x2c663
movq 0x10(%r13), %rsi
subq %rdi, %rsi
callq 0x82a0
movl $0x18, %esi
movq %r13, %rdi
callq 0x82a0
movq 0x62941(%rip), %r13     # 0x8efb8
leaq 0x42d70(%rip), %rsi     # 0x6f3ee
movl $0xd, %edx
movq %r13, %rdi
callq 0x8330
movq (%r13), %rax
addq -0x18(%rax), %r13
movq %r13, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
movq 0x6290e(%rip), %r13     # 0x8efb8
movq %r13, %rdi
callq 0x8030
movq %rax, %rdi
callq 0x81f0
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rdi)
movl $0x1, %esi
callq 0x2d11a
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2d292
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2d40a
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2d582
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2d6fa
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2d872
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2d11a
movq %rsp, %rdi
xorl %esi, %esi
callq 0x2d9ea
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2db4c
movq %rsp, %rdi
xorl %esi, %esi
callq 0x2dcae
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2de4c
movq %rsp, %rdi
xorl %esi, %esi
callq 0x2dcae
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2dfc4
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2de4c
movq %rsp, %rdi
xorl %esi, %esi
callq 0x2dcae
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2e194
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2e2f6
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2e46e
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2e5e6
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2e75e
movq %rsp, %rdi
xorl %esi, %esi
callq 0x2e2f6
movq %rsp, %rdi
movl $0x1, %esi
callq 0x2e46e
movq %rbx, %rdi
callq 0x80e0
movb 0x62e3b(%rip), %cl      # 0x8f629
andb %al, %cl
testb %al, %al
jne 0x2c7f7
movq %r13, %r12
movzbl %cl, %esi
movq %rsp, %rdi
movq %r12, %rdx
callq 0x2e8d6
movq 0x627ac(%rip), %r12     # 0x8efb8
leaq 0x42be9(%rip), %rsi     # 0x6f3fc
movl $0xb, %edx
movq %r12, %rdi
callq 0x8330
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
movq 0x62779(%rip), %rdi     # 0x8efb8
callq 0x8030
movq %rax, %rdi
callq 0x81f0
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x2ccaf
movq (%rax), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x60dc4(%rip), %rax     # 0x8d630
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x2c88b
cmpb $0x2a, (%rdi)
je 0x2cbe6
callq 0x83f0
testl %eax, %eax
jne 0x2cbe6
movq 0x62726(%rip), %r12     # 0x8efb8
leaq 0x42b6f(%rip), %rsi     # 0x6f408
movl $0xb, %edx
movq %r12, %rdi
callq 0x8330
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
movq 0x626f3(%rip), %rdi     # 0x8efb8
callq 0x8030
movq %rax, %rdi
callq 0x81f0
leaq 0x278(%rsp), %rdi
callq 0x8510
leaq 0x48(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x418d9(%rip), %rdx     # 0x6e1c9
leaq 0x38(%rsp), %rdi
movq %rdx, %rsi
callq 0xc772
testq %r14, %r14
je 0x2c94d
leaq 0x68(%rsp), %r15
movq %r15, -0x10(%r15)
movq %r14, %rdi
callq 0x8160
leaq (%rax,%r14), %rdx
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0xc772
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %r14
movq %r14, %rsi
callq 0x83a0
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x2c9a1
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x2c9a1
movq %r15, %rdi
callq 0x8160
leaq (%r15,%rax), %rdx
decq %rdx
leaq 0x68(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0xc6dc
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %r14
movq %r14, %rsi
callq 0x83a0
movq (%r14), %rdi
cmpq %rbx, %rdi
je 0x2c999
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0xe8(%rsp), %rbx
leaq 0x278(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movl $0x10, %edx
callq 0x8170
movq %rbx, %rdi
callq 0x80e0
testb %al, %al
je 0x2ca18
leaq 0x42a49(%rip), %rsi     # 0x6f414
leaq 0x78(%rsp), %rdi
movl $0x17, %edx
callq 0x8330
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
leaq 0x78(%rsp), %rdi
callq 0x8330
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
movq %r14, %rdi
callq 0x8030
movq %rax, %rdi
callq 0x81f0
movq 0x28(%rsp), %rdi
movq (%rdi), %rax
leaq 0x278(%rsp), %r14
movq %r14, %rsi
callq *0x10(%rax)
leaq 0x2e8(%rsp), %rdi
callq 0x80e0
testb %al, %al
je 0x2ccb4
movq 0x278(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
leaq 0x278(%rsp), %rdi
callq 0x8030
movq %rax, %rdi
callq 0x81f0
movq %rbx, %rdi
callq 0x80e0
testb %al, %al
je 0x2cac4
leaq 0x429a5(%rip), %rsi     # 0x6f42c
leaq 0x78(%rsp), %r14
movl $0x10, %edx
movq %r14, %rdi
callq 0x8330
movq 0x78(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
leaq 0x78(%rsp), %rdi
callq 0x8030
movq %rax, %rdi
callq 0x81f0
leaq 0x278(%rsp), %rdi
callq 0x8410
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x2cae8
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x624b1(%rip), %rax     # 0x8efa0
movq (%rax), %r15
movq 0x18(%rax), %r12
leaq 0x280(%rsp), %rdi
movq %r15, -0x8(%rdi)
movq -0x18(%r15), %rax
movq %r12, 0x278(%rsp,%rax)
callq 0x8240
leaq 0x370(%rsp), %rdi
callq 0x8130
movq 0x62491(%rip), %r14     # 0x8efb8
leaq 0x4290f(%rip), %rsi     # 0x6f43d
movl $0x9, %edx
movq %r14, %rdi
callq 0x8330
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x8270
movsbl %al, %esi
movq 0x6245f(%rip), %rdi     # 0x8efb8
callq 0x8030
movq %rax, %rdi
callq 0x81f0
movq %rbx, %rdi
callq 0x80e0
testb %al, %al
je 0x2cb7c
leaq 0x78(%rsp), %rdi
callq 0x8410
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x2cb8c
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x28(%rsp)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2cbab
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
leaq 0x80(%rsp), %rdi
movq %r15, -0x8(%rdi)
movq -0x18(%r15), %rax
movq %r12, 0x78(%rsp,%rax)
callq 0x8240
leaq 0x170(%rsp), %rdi
callq 0x8130
xorl %eax, %eax
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x623fb(%rip), %rdi     # 0x8efe8
leaq 0x41574(%rip), %rsi     # 0x6e168
movl $0x8, %edx
callq 0x8330
movq 0x623e3(%rip), %rdi     # 0x8efe8
leaq 0x427a4(%rip), %rsi     # 0x6f3b0
movl $0xc, %edx
callq 0x8330
movq 0x623cb(%rip), %rdi     # 0x8efe8
leaq 0x4279c(%rip), %rsi     # 0x6f3c0
movl $0x1, %edx
callq 0x8330
movq 0x623b3(%rip), %rdi     # 0x8efe8
movl $0xba, %esi
callq 0x8520
movq %rax, %rdi
callq 0x8180
jmp 0x2cd15
movq 0x62395(%rip), %rdi     # 0x8efe8
leaq 0x4150e(%rip), %rsi     # 0x6e168
movl $0x8, %edx
callq 0x8330
movq 0x6237d(%rip), %rdi     # 0x8efe8
leaq 0x4273e(%rip), %rsi     # 0x6f3b0
movl $0xc, %edx
callq 0x8330
movq 0x62365(%rip), %rdi     # 0x8efe8
leaq 0x42736(%rip), %rsi     # 0x6f3c0
movl $0x1, %edx
callq 0x8330
movq 0x6234d(%rip), %rdi     # 0x8efe8
movl $0x68, %esi
callq 0x8520
movq %rax, %rdi
callq 0x8180
jmp 0x2cd15
callq 0x8300
movq 0x6232d(%rip), %rdi     # 0x8efe8
leaq 0x414a6(%rip), %rsi     # 0x6e168
movl $0x8, %edx
callq 0x8330
movq 0x62315(%rip), %rdi     # 0x8efe8
leaq 0x426d6(%rip), %rsi     # 0x6f3b0
movl $0xc, %edx
callq 0x8330
movq 0x622fd(%rip), %rdi     # 0x8efe8
leaq 0x426ce(%rip), %rsi     # 0x6f3c0
movl $0x1, %edx
callq 0x8330
movq 0x622e5(%rip), %rdi     # 0x8efe8
movl $0xcc, %esi
callq 0x8520
movq %rax, %rdi
callq 0x8180
movl $0xff, %edi
callq 0x8380
jmp 0x2cd63
jmp 0x2cd63
movq %rax, %rbx
jmp 0x2cd7d
jmp 0x2cd91
movq %rax, %rbx
movq 0x278(%rsp), %rdi
cmpq %r14, %rdi
je 0x2cdaa
movq 0x288(%rsp), %rsi
incq %rsi
jmp 0x2cda5
jmp 0x2cd8c
movq %rax, %rbx
leaq 0x278(%rsp), %rdi
callq 0x2d026
jmp 0x2cdaa
jmp 0x2cd8c
jmp 0x2cd8c
jmp 0x2cd8c
jmp 0x2cd8c
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x2cd7d
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x82a0
leaq 0x278(%rsp), %rdi
callq 0x8450
jmp 0x2cd94
movq %rax, %rbx
jmp 0x2cdaa
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2cdaa
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x82a0
leaq 0x78(%rsp), %rdi
callq 0x8450
movq %rbx, %rdi
callq 0x8540