// File: bigtit[P]ps3patcher/patcher.cc
// Function: patcher::do_patch(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
void patcher::do_patch(string name, bool swap){
  string fileout = get_dest_name(name);
  std::ifstream freader(name.c_str(), std::ios::binary);
  freader >> std::noskipws;
  std::ofstream fwriter(fileout.c_str(), std::ios::binary);
  if(swap) status("Go swap");
  status("Creating output file...");
  fwriter << freader.rdbuf(); // copy
  freader.seekg(0, std::ios::end);
  auto pos = freader.tellg();
  freader.close();
  get_ros_pdata("patch.bin", swap);
  status("input size: "+std::to_string(pos)+" bytes");
  if(pos!=0x1000000L && pos!=0x10000000L){
    remove(fileout.c_str());
    error("size error, exits");
    return;
  }
  else if(0x1000000L == pos){ // nor
    status("Go NOR");
    write_patch(0xc0010, fwriter);
    write_patch(0x7c0010, fwriter);
    if(chk_flag(0x1)){
      status("Go trvkpatches");
      get_pdata("nor_rvk.bin", swap);
      write_patch(0x40000, fwriter);
    }
    if(chk_flag(0x2)){
      status("Go forcepatch && rosheader");
      get_pdata("ros_head.bin", swap);
      write_patch(0xc0000, fwriter);
      write_patch(0x7c0000, fwriter);
    }
    status("Done NOR");
  }else{ // nand
    status("Go NAND");
    write_patch(0xc0030, fwriter);
    write_patch(0x7c0020, fwriter);
    if(chk_flag(0x1)){
      status("Go trvkpatches");
      get_pdata("nand_rvk.bin", swap);
      write_patch(0x40000, fwriter);
    }
    if(chk_flag(0x2)){
      status("Go forcepatch && rosheader");
      get_pdata("ros_head.bin", swap);
      write_patch(0xc0020, fwriter);
      write_patch(0x7c0010, fwriter);
    }
    status("Done NAND");
  }

  if(chk_flag(0x4)); // autoexit, reserved
  cout << "Done\n";
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x830, %rsp            # imm = 0x830
movq %rsi, -0x758(%rbp)
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x750(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0x748(%rbp)
callq 0x20c0
movq -0x750(%rbp), %rsi
movq -0x748(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x3010
jmp 0x3205
leaq -0x58(%rbp), %rdi
callq 0x2110
movq -0x758(%rbp), %rdi
callq 0x20b0
movq %rax, %rsi
leaq -0x270(%rbp), %rdi
movl $0x4, %edx
callq 0x2300
jmp 0x3230
leaq 0xea9(%rip), %rsi       # 0x40e0
leaq -0x270(%rbp), %rdi
callq 0x22a0
jmp 0x3245
leaq -0x38(%rbp), %rdi
callq 0x20b0
movq %rax, %rsi
leaq -0x470(%rbp), %rdi
movl $0x4, %edx
callq 0x21e0
jmp 0x3264
testb $0x1, -0x11(%rbp)
je 0x333f
leaq -0x491(%rbp), %rdi
movq %rdi, -0x760(%rbp)
callq 0x22e0
movq -0x760(%rbp), %rdx
leaq 0x2e98(%rip), %rsi      # 0x6127
leaq -0x490(%rbp), %rdi
callq 0x2230
jmp 0x329d
movq -0x750(%rbp), %rdi
leaq -0x490(%rbp), %rsi
callq 0x2d30
jmp 0x32b2
leaq -0x490(%rbp), %rdi
callq 0x2110
leaq -0x491(%rbp), %rdi
callq 0x21d0
jmp 0x333f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x2110
jmp 0x402c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x4023
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x4017
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x332e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x490(%rbp), %rdi
callq 0x2110
leaq -0x491(%rbp), %rdi
callq 0x21d0
jmp 0x400b
leaq -0x4b9(%rbp), %rdi
movq %rdi, -0x768(%rbp)
callq 0x22e0
movq -0x768(%rbp), %rdx
leaq 0x2dcf(%rip), %rsi      # 0x612f
leaq -0x4b8(%rbp), %rdi
callq 0x2230
jmp 0x336e
movq -0x750(%rbp), %rdi
leaq -0x4b8(%rbp), %rsi
callq 0x2d30
jmp 0x3383
leaq -0x4b8(%rbp), %rdi
callq 0x2110
leaq -0x4b9(%rbp), %rdi
callq 0x21d0
leaq -0x270(%rbp), %rdi
callq 0x2270
movq %rax, -0x770(%rbp)
jmp 0x33b0
movq -0x770(%rbp), %rsi
leaq -0x470(%rbp), %rdi
callq 0x2050
jmp 0x33c5
xorl %eax, %eax
movl %eax, %esi
leaq -0x270(%rbp), %rdi
movl $0x2, %edx
callq 0x2220
jmp 0x33dc
leaq -0x270(%rbp), %rdi
callq 0x22c0
movq %rdx, -0x780(%rbp)
movq %rax, -0x778(%rbp)
jmp 0x33f8
movq -0x780(%rbp), %rax
movq -0x778(%rbp), %rcx
movq %rcx, -0x4d0(%rbp)
movq %rax, -0x4c8(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x2040
jmp 0x3422
leaq -0x4f1(%rbp), %rdi
movq %rdi, -0x788(%rbp)
callq 0x22e0
movq -0x788(%rbp), %rdx
leaq 0x2d04(%rip), %rsi      # 0x6147
leaq -0x4f0(%rbp), %rdi
callq 0x2230
jmp 0x3451
movq -0x750(%rbp), %rdi
movzbl -0x11(%rbp), %edx
andl $0x1, %edx
leaq -0x4f0(%rbp), %rsi
callq 0x2fa0
jmp 0x346d
leaq -0x4f0(%rbp), %rdi
callq 0x2110
leaq -0x4f1(%rbp), %rdi
callq 0x21d0
leaq -0x4d0(%rbp), %rdi
callq 0x4110
movq %rax, -0x790(%rbp)
jmp 0x349a
movq -0x790(%rbp), %rsi
leaq -0x558(%rbp), %rdi
callq 0x43d0
jmp 0x34af
leaq 0x2c9b(%rip), %rsi      # 0x6151
leaq -0x538(%rbp), %rdi
leaq -0x558(%rbp), %rdx
callq 0x42a0
jmp 0x34cb
leaq 0x2c4e(%rip), %rdx      # 0x6120
leaq -0x518(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0x4250
jmp 0x34e7
movq -0x750(%rbp), %rdi
leaq -0x518(%rbp), %rsi
callq 0x2d30
jmp 0x34fc
leaq -0x518(%rbp), %rdi
callq 0x2110
leaq -0x538(%rbp), %rdi
callq 0x2110
leaq -0x558(%rbp), %rdi
callq 0x2110
leaq -0x4d0(%rbp), %rdi
callq 0x4110
movq %rax, -0x798(%rbp)
jmp 0x3535
movq -0x798(%rbp), %rax
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0x36ff
leaq -0x4d0(%rbp), %rdi
callq 0x4110
movq %rax, -0x7a0(%rbp)
jmp 0x355d
movq -0x7a0(%rbp), %rax
cmpq $0x10000000, %rax       # imm = 0x10000000
je 0x36ff
leaq -0x38(%rbp), %rdi
callq 0x20b0
movq %rax, %rdi
callq 0x22f0
movq 0x5a40(%rip), %rdi      # 0x8fc8
leaq 0x2bcf(%rip), %rsi      # 0x615e
callq 0x2190
movq %rax, -0x7a8(%rbp)
jmp 0x359d
movq -0x7a8(%rbp), %rdi
leaq 0x2bbe(%rip), %rsi      # 0x6169
callq 0x2190
movq %rax, -0x7b0(%rbp)
jmp 0x35b9
movq -0x7b0(%rbp), %rdi
movl $0x44, %esi
callq 0x22b0
movq %rax, -0x7b8(%rbp)
jmp 0x35d3
movq -0x7b8(%rbp), %rdi
leaq 0x2a28(%rip), %rsi      # 0x6009
callq 0x2190
movq %rax, -0x7c0(%rbp)
jmp 0x35ef
movq -0x7c0(%rbp), %rdi
leaq 0x2b6f(%rip), %rsi      # 0x616c
callq 0x2190
movq %rax, -0x7c8(%rbp)
jmp 0x360b
movq -0x7c8(%rbp), %rdi
movq 0x599f(%rip), %rsi      # 0x8fb8
callq 0x21c0
jmp 0x3620
movl $0x1, -0x55c(%rbp)
jmp 0x3fe1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3655
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x4b8(%rbp), %rdi
callq 0x2110
leaq -0x4b9(%rbp), %rdi
callq 0x21d0
jmp 0x400b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x400b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x369d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x4f0(%rbp), %rdi
callq 0x2110
leaq -0x4f1(%rbp), %rdi
callq 0x21d0
jmp 0x400b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x36ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x36e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x518(%rbp), %rdi
callq 0x2110
leaq -0x538(%rbp), %rdi
callq 0x2110
leaq -0x558(%rbp), %rdi
callq 0x2110
jmp 0x400b
leaq -0x4d0(%rbp), %rdi
callq 0x4110
movq %rax, -0x7d0(%rbp)
jmp 0x3714
movq -0x7d0(%rbp), %rcx
movl $0x1000000, %eax        # imm = 0x1000000
cmpq %rcx, %rax
jne 0x3b6b
leaq -0x581(%rbp), %rdi
movq %rdi, -0x7d8(%rbp)
callq 0x22e0
movq -0x7d8(%rbp), %rdx
leaq 0x2a34(%rip), %rsi      # 0x617e
leaq -0x580(%rbp), %rdi
callq 0x2230
jmp 0x3758
movq -0x750(%rbp), %rdi
leaq -0x580(%rbp), %rsi
callq 0x2d30
jmp 0x376d
leaq -0x580(%rbp), %rdi
callq 0x2110
leaq -0x581(%rbp), %rdi
callq 0x21d0
movq -0x750(%rbp), %rdi
movl $0xc0010, %esi          # imm = 0xC0010
leaq -0x470(%rbp), %rdx
callq 0x3050
jmp 0x379f
movq -0x750(%rbp), %rdi
movl $0x7c0010, %esi         # imm = 0x7C0010
leaq -0x470(%rbp), %rdx
callq 0x3050
jmp 0x37b9
movq -0x750(%rbp), %rdi
movl $0x1, %esi
callq 0x2d00
testb $0x1, %al
jne 0x37d3
jmp 0x3956
leaq -0x5a9(%rbp), %rdi
movq %rdi, -0x7e0(%rbp)
callq 0x22e0
movq -0x7e0(%rbp), %rdx
leaq 0x2991(%rip), %rsi      # 0x6185
leaq -0x5a8(%rbp), %rdi
callq 0x2230
jmp 0x3802
movq -0x750(%rbp), %rdi
leaq -0x5a8(%rbp), %rsi
callq 0x2d30
jmp 0x3817
leaq -0x5a8(%rbp), %rdi
callq 0x2110
leaq -0x5a9(%rbp), %rdi
callq 0x21d0
leaq -0x5d1(%rbp), %rdi
movq %rdi, -0x7e8(%rbp)
callq 0x22e0
movq -0x7e8(%rbp), %rdx
leaq 0x2944(%rip), %rsi      # 0x6194
leaq -0x5d0(%rbp), %rdi
callq 0x2230
jmp 0x385e
movq -0x750(%rbp), %rdi
movzbl -0x11(%rbp), %edx
andl $0x1, %edx
leaq -0x5d0(%rbp), %rsi
callq 0x2d80
jmp 0x387a
leaq -0x5d0(%rbp), %rdi
callq 0x2110
leaq -0x5d1(%rbp), %rdi
callq 0x21d0
movq -0x750(%rbp), %rdi
movl $0x40000, %esi          # imm = 0x40000
leaq -0x470(%rbp), %rdx
callq 0x3050
jmp 0x38ac
jmp 0x3956
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x38d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x580(%rbp), %rdi
callq 0x2110
leaq -0x581(%rbp), %rdi
callq 0x21d0
jmp 0x400b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x390e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x5a8(%rbp), %rdi
callq 0x2110
leaq -0x5a9(%rbp), %rdi
callq 0x21d0
jmp 0x400b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3945
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x5d0(%rbp), %rdi
callq 0x2110
leaq -0x5d1(%rbp), %rdi
callq 0x21d0
jmp 0x400b
movq -0x750(%rbp), %rdi
movl $0x2, %esi
callq 0x2d00
testb $0x1, %al
jne 0x3970
jmp 0x3ad3
leaq -0x5f9(%rbp), %rdi
movq %rdi, -0x7f0(%rbp)
callq 0x22e0
movq -0x7f0(%rbp), %rdx
leaq 0x280f(%rip), %rsi      # 0x61a0
leaq -0x5f8(%rbp), %rdi
callq 0x2230
jmp 0x399f
movq -0x750(%rbp), %rdi
leaq -0x5f8(%rbp), %rsi
callq 0x2d30
jmp 0x39b4
leaq -0x5f8(%rbp), %rdi
callq 0x2110
leaq -0x5f9(%rbp), %rdi
callq 0x21d0
leaq -0x621(%rbp), %rdi
movq %rdi, -0x7f8(%rbp)
callq 0x22e0
movq -0x7f8(%rbp), %rdx
leaq 0x27ce(%rip), %rsi      # 0x61bb
leaq -0x620(%rbp), %rdi
callq 0x2230
jmp 0x39fb
movq -0x750(%rbp), %rdi
movzbl -0x11(%rbp), %edx
andl $0x1, %edx
leaq -0x620(%rbp), %rsi
callq 0x2d80
jmp 0x3a17
leaq -0x620(%rbp), %rdi
callq 0x2110
leaq -0x621(%rbp), %rdi
callq 0x21d0
movq -0x750(%rbp), %rdi
movl $0xc0000, %esi          # imm = 0xC0000
leaq -0x470(%rbp), %rdx
callq 0x3050
jmp 0x3a49
movq -0x750(%rbp), %rdi
movl $0x7c0000, %esi         # imm = 0x7C0000
leaq -0x470(%rbp), %rdx
callq 0x3050
jmp 0x3a63
jmp 0x3ad3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3a8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x5f8(%rbp), %rdi
callq 0x2110
leaq -0x5f9(%rbp), %rdi
callq 0x21d0
jmp 0x400b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3ac2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x620(%rbp), %rdi
callq 0x2110
leaq -0x621(%rbp), %rdi
callq 0x21d0
jmp 0x400b
leaq -0x649(%rbp), %rdi
movq %rdi, -0x800(%rbp)
callq 0x22e0
movq -0x800(%rbp), %rdx
leaq 0x26d4(%rip), %rsi      # 0x61c8
leaq -0x648(%rbp), %rdi
callq 0x2230
jmp 0x3b02
movq -0x750(%rbp), %rdi
leaq -0x648(%rbp), %rsi
callq 0x2d30
jmp 0x3b17
leaq -0x648(%rbp), %rdi
callq 0x2110
leaq -0x649(%rbp), %rdi
callq 0x21d0
jmp 0x3fa7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3b5a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x648(%rbp), %rdi
callq 0x2110
leaq -0x649(%rbp), %rdi
callq 0x21d0
jmp 0x400b
leaq -0x671(%rbp), %rdi
movq %rdi, -0x808(%rbp)
callq 0x22e0
movq -0x808(%rbp), %rdx
leaq 0x2645(%rip), %rsi      # 0x61d1
leaq -0x670(%rbp), %rdi
callq 0x2230
jmp 0x3b9a
movq -0x750(%rbp), %rdi
leaq -0x670(%rbp), %rsi
callq 0x2d30
jmp 0x3baf
leaq -0x670(%rbp), %rdi
callq 0x2110
leaq -0x671(%rbp), %rdi
callq 0x21d0
movq -0x750(%rbp), %rdi
movl $0xc0030, %esi          # imm = 0xC0030
leaq -0x470(%rbp), %rdx
callq 0x3050
jmp 0x3be1
movq -0x750(%rbp), %rdi
movl $0x7c0020, %esi         # imm = 0x7C0020
leaq -0x470(%rbp), %rdx
callq 0x3050
jmp 0x3bfb
movq -0x750(%rbp), %rdi
movl $0x1, %esi
callq 0x2d00
testb $0x1, %al
jne 0x3c15
jmp 0x3d98
leaq -0x699(%rbp), %rdi
movq %rdi, -0x810(%rbp)
callq 0x22e0
movq -0x810(%rbp), %rdx
leaq 0x254f(%rip), %rsi      # 0x6185
leaq -0x698(%rbp), %rdi
callq 0x2230
jmp 0x3c44
movq -0x750(%rbp), %rdi
leaq -0x698(%rbp), %rsi
callq 0x2d30
jmp 0x3c59
leaq -0x698(%rbp), %rdi
callq 0x2110
leaq -0x699(%rbp), %rdi
callq 0x21d0
leaq -0x6c1(%rbp), %rdi
movq %rdi, -0x818(%rbp)
callq 0x22e0
movq -0x818(%rbp), %rdx
leaq 0x2547(%rip), %rsi      # 0x61d9
leaq -0x6c0(%rbp), %rdi
callq 0x2230
jmp 0x3ca0
movq -0x750(%rbp), %rdi
movzbl -0x11(%rbp), %edx
andl $0x1, %edx
leaq -0x6c0(%rbp), %rsi
callq 0x2d80
jmp 0x3cbc
leaq -0x6c0(%rbp), %rdi
callq 0x2110
leaq -0x6c1(%rbp), %rdi
callq 0x21d0
movq -0x750(%rbp), %rdi
movl $0x40000, %esi          # imm = 0x40000
leaq -0x470(%rbp), %rdx
callq 0x3050
jmp 0x3cee
jmp 0x3d98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3d19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x670(%rbp), %rdi
callq 0x2110
leaq -0x671(%rbp), %rdi
callq 0x21d0
jmp 0x400b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3d50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x698(%rbp), %rdi
callq 0x2110
leaq -0x699(%rbp), %rdi
callq 0x21d0
jmp 0x400b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3d87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x6c0(%rbp), %rdi
callq 0x2110
leaq -0x6c1(%rbp), %rdi
callq 0x21d0
jmp 0x400b
movq -0x750(%rbp), %rdi
movl $0x2, %esi
callq 0x2d00
testb $0x1, %al
jne 0x3db2
jmp 0x3f15
leaq -0x6e9(%rbp), %rdi
movq %rdi, -0x820(%rbp)
callq 0x22e0
movq -0x820(%rbp), %rdx
leaq 0x23cd(%rip), %rsi      # 0x61a0
leaq -0x6e8(%rbp), %rdi
callq 0x2230
jmp 0x3de1
movq -0x750(%rbp), %rdi
leaq -0x6e8(%rbp), %rsi
callq 0x2d30
jmp 0x3df6
leaq -0x6e8(%rbp), %rdi
callq 0x2110
leaq -0x6e9(%rbp), %rdi
callq 0x21d0
leaq -0x711(%rbp), %rdi
movq %rdi, -0x828(%rbp)
callq 0x22e0
movq -0x828(%rbp), %rdx
leaq 0x238c(%rip), %rsi      # 0x61bb
leaq -0x710(%rbp), %rdi
callq 0x2230
jmp 0x3e3d
movq -0x750(%rbp), %rdi
movzbl -0x11(%rbp), %edx
andl $0x1, %edx
leaq -0x710(%rbp), %rsi
callq 0x2d80
jmp 0x3e59
leaq -0x710(%rbp), %rdi
callq 0x2110
leaq -0x711(%rbp), %rdi
callq 0x21d0
movq -0x750(%rbp), %rdi
movl $0xc0020, %esi          # imm = 0xC0020
leaq -0x470(%rbp), %rdx
callq 0x3050
jmp 0x3e8b
movq -0x750(%rbp), %rdi
movl $0x7c0010, %esi         # imm = 0x7C0010
leaq -0x470(%rbp), %rdx
callq 0x3050
jmp 0x3ea5
jmp 0x3f15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3ecd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x6e8(%rbp), %rdi
callq 0x2110
leaq -0x6e9(%rbp), %rdi
callq 0x21d0
jmp 0x400b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3f04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x710(%rbp), %rdi
callq 0x2110
leaq -0x711(%rbp), %rdi
callq 0x21d0
jmp 0x400b
leaq -0x739(%rbp), %rdi
movq %rdi, -0x830(%rbp)
callq 0x22e0
movq -0x830(%rbp), %rdx
leaq 0x22b0(%rip), %rsi      # 0x61e6
leaq -0x738(%rbp), %rdi
callq 0x2230
jmp 0x3f44
movq -0x750(%rbp), %rdi
leaq -0x738(%rbp), %rsi
callq 0x2d30
jmp 0x3f59
leaq -0x738(%rbp), %rdi
callq 0x2110
leaq -0x739(%rbp), %rdi
callq 0x21d0
jmp 0x3fa7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3f99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x738(%rbp), %rdi
callq 0x2110
leaq -0x739(%rbp), %rdi
callq 0x21d0
jmp 0x400b
jmp 0x3fa9
movq -0x750(%rbp), %rdi
movl $0x4, %esi
callq 0x2d00
testb $0x1, %al
jne 0x3fc0
jmp 0x3fc2
jmp 0x3fc2
movq 0x4fff(%rip), %rdi      # 0x8fc8
leaq 0x2220(%rip), %rsi      # 0x61f0
callq 0x2190
jmp 0x3fd7
movl $0x1, -0x55c(%rbp)
leaq -0x470(%rbp), %rdi
callq 0x2250
leaq -0x270(%rbp), %rdi
callq 0x2070
leaq -0x38(%rbp), %rdi
callq 0x2110
addq $0x830, %rsp            # imm = 0x830
popq %rbp
retq
leaq -0x470(%rbp), %rdi
callq 0x2250
leaq -0x270(%rbp), %rdi
callq 0x2070
leaq -0x38(%rbp), %rdi
callq 0x2110
movq -0x60(%rbp), %rdi
callq 0x22d0
nopw %cs:(%rax,%rax)
nop