// File: /workspace/github_cpp_makefile_star2_O1/VanAndelInstitute[P]intent/main.cpp
// Function: main
int main(int argc, char *argv[]) {
  int c, distance = 2 ;
  bool expanded = false;
  bool v2 = false;
  std::set<std::string>::iterator it_bc1;
  std::set<std::string>::iterator it_bc2;
  int format = FORMAT_V3;

  while( ( c = getopt (argc, argv, "xthvd:") ) != -1 )
  {
      switch(c)
      {
          case 'h':
              usage();
              exit(0);
          case 'v':
              std::cout << "\n  intent version " << VERSION << "\n\n";
              exit(0);
          case 'x':
              expanded = true;
              format = FORMAT_EXTENDED;
              break;
          case 'd':
              if(optarg) {
                distance = std::atoi(optarg);
              } else {
                std::cout << "The -d flag requires a value.\n\n";
              }
              break;
          case 't':
              v2 = true;
              format = FORMAT_V3;
              break;
      }
  }

  if(expanded && v2) {
    std::cout << "The -x and -t flags are mutually exclusive. Please select only 1.\n\n";
  }

  if (argv[optind] == NULL || argv[optind + 1]  == NULL) {
    usage();
    exit(0);
  }

  std::string pathR1 = argv[optind];
  std::string pathR2 = argv[optind + 1];
  std::string pathR1_out, pathR2_out;
  auto start_time = std::chrono::steady_clock::now();

  // note R1 and R2 are swapped to mimic 10X libraries
  pathR1_out = reformatFileName(pathR2, "intent_R1.fastq.gz");
  pathR2_out = reformatFileName(pathR1, "intent_R2.fastq.gz");

  std::fstream r1_fs, r2_fs; //, r1_out_fs, r2_out_fs;

  r1_fs.open(pathR1, std::ios::in);
  r2_fs.open(pathR2, std::ios::in);
  //r1_out_fs.open(pathR1_out, std::ios::out);
  //r2_out_fs.open(pathR2_out, std::ios::out);

  zstr::istream r1(r1_fs),
                r2(r2_fs);

  zstr::ofstream r1_out(pathR1_out);
  zstr::ofstream r2_out(pathR2_out);
  
  int in = 0, ok = 0, bad_w1 = 0, other = 0, shortread = 0, bad_barcode = 0, corrected = 0;
  init_stats_table();

  while(r2.peek() != EOF ) {
    in++;
    if((in % 10000) == 0)
       update_stats(start_time, in, ok, bad_w1, shortread, corrected, bad_barcode);

    std::vector<std::string> lines_r1, lines_r2;
    std::vector<int> coords;
    lines_r1 = readFour(r1);
    lines_r2 = readFour(r2);
    ParsedBarcode bc = extract_v2_barcodes(lines_r2[1], lines_r2[3], 2, true);

    if(bc.status == BC_ERROR_SHORTREAD) {
      shortread++;
    } else if(bc.status == BC_ERROR_BAD_W1) {
      bad_w1++;
    } else if(bc.status == BC_ERROR_BAD_BARCODE) {
      bad_barcode++;
    } else if(bc.status == BC_ERROR) {
      other++;
      std::cout << "An undefined error occurred processing this read: \n" << 
      lines_r2[0] << std::endl << 
      lines_r2[1] << std::endl << 
      lines_r2[2] << std::endl << 
      lines_r2[3] << std::endl; 
    } else if(bc.status == BC_OK) {
      ok++;
      if(bc.bc_fixed) {
        corrected++;
      }
      FastqRead r = format_barcode(bc, lines_r2[0], lines_r2[2], format);

      writeFour(r1_out, {r.id,
                         r.read,
                         r.direction,
                         r.quality
                        });
      writeFour(r2_out, lines_r1);

    } else {
      std::cout << "An unknown error occurred processing this read: \n" << 
      lines_r2[0] << std::endl << 
      lines_r2[1] << std::endl << 
      lines_r2[2] << std::endl << 
      lines_r2[3] << std::endl; 
      other++;
    }
  }
  r1_fs.close();
  r2_fs.close();
  //r1_out_fs.close();
  //r2_out_fs.close();

  std::cout << "\n\nComplete. Job summary: " << std::endl <<
        "Reads: " << in <<std:: endl <<
        "OK: " << ok << std::endl <<
        "Poor W1 alignment: " << bad_w1 << std::endl <<
        "Barcode or UMI too short: " << shortread <<std::endl <<
        "Barcode succesfully corrected: " << corrected << std::endl <<
        "Barcode not recognized: " << bad_barcode << std::endl;
  if(other > 0) {
        std::cout << "Unknown errors (!!): " << other << std::endl;
  }
  std::cout << std::endl;
  return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1158, %rsp           # imm = 0x1158
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x18889(%rip), %rdx     # 0x313bc
callq 0x60c0
cmpl $-0x1, %eax
je 0x18bca
movl $0x1, 0x14(%rsp)
xorl %r13d, %r13d
leaq 0x18869(%rip), %r14     # 0x313bc
leaq 0x174e6(%rip), %r15     # 0x30040
xorl %r12d, %r12d
addl $-0x64, %eax
rorl %eax
cmpl $0xa, %eax
ja 0x18baf
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x26401(%rip), %rax     # 0x3ef78
cmpq $0x0, (%rax)
jne 0x18baf
movl $0x1f, %edx
movq 0x2642f(%rip), %rdi     # 0x3efb8
leaq 0x18846(%rip), %rsi     # 0x313d6
callq 0x6450
jmp 0x18baf
movb $0x1, %r12b
movl $0x1, 0x14(%rsp)
jmp 0x18baf
movb $0x1, %r13b
movl $0x2, 0x14(%rsp)
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x60c0
cmpl $-0x1, %eax
jne 0x18b5d
andb %r12b, %r13b
xorb $0x1, %r13b
jmp 0x18bd5
movb $0x1, %r13b
movl $0x1, 0x14(%rsp)
testb $0x1, %r13b
jne 0x18bf3
movq 0x263d6(%rip), %rdi     # 0x3efb8
leaq 0x1880d(%rip), %rsi     # 0x313f6
movl $0x43, %edx
callq 0x6450
movq 0x263c6(%rip), %r14     # 0x3efc0
movslq (%r14), %rax
movq (%rbx,%rax,8), %rsi
testq %rsi, %rsi
je 0x19cbb
cmpq $0x0, 0x8(%rbx,%rax,8)
je 0x19cbb
leaq 0x170(%rsp), %rdi
leaq 0x718(%rsp), %rdx
callq 0x1a160
movslq (%r14), %rax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x150(%rsp), %rdi
leaq 0x718(%rsp), %rdx
callq 0x1a160
leaq 0x118(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x78(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
callq 0x6520
movq %rax, 0x138(%rsp)
leaq 0x280(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x150(%rsp), %rsi
movq 0x158(%rsp), %rdx
addq %rsi, %rdx
leaq 0x270(%rsp), %rdi
callq 0x1c224
leaq 0x260(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18782(%rip), %rsi     # 0x3143a
leaq 0x1878d(%rip), %rdx     # 0x3144c
leaq 0x250(%rsp), %rdi
callq 0x1be64
leaq 0x718(%rsp), %rdi
leaq 0x270(%rsp), %rsi
leaq 0x250(%rsp), %rdx
callq 0x189ad
leaq 0x108(%rsp), %rdi
leaq 0x718(%rsp), %rbx
movq %rbx, %rsi
callq 0x64d0
movq (%rbx), %rdi
leaq 0x728(%rsp), %r15
cmpq %r15, %rdi
je 0x18d21
movq 0x728(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x250(%rsp), %rdi
cmpq %r12, %rdi
je 0x18d3e
movq 0x260(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x270(%rsp), %rdi
cmpq %r14, %rdi
je 0x18d5b
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x240(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x170(%rsp), %rsi
movq 0x178(%rsp), %rdx
addq %rsi, %rdx
leaq 0x230(%rsp), %rdi
callq 0x1c224
leaq 0x220(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x186b2(%rip), %rsi     # 0x3144d
leaq 0x186bd(%rip), %rdx     # 0x3145f
leaq 0x210(%rsp), %rdi
callq 0x1be64
leaq 0x718(%rsp), %rdi
leaq 0x230(%rsp), %rsi
leaq 0x210(%rsp), %rdx
callq 0x189ad
leaq 0x68(%rsp), %rdi
leaq 0x718(%rsp), %rbx
movq %rbx, %rsi
callq 0x64d0
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x18df9
movq 0x728(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x210(%rsp), %rdi
cmpq %r12, %rdi
je 0x18e16
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x230(%rsp), %rdi
cmpq %r14, %rdi
je 0x18e33
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0xc38(%rsp), %rdi
callq 0x64a0
leaq 0xa28(%rsp), %rdi
callq 0x64a0
leaq 0xc38(%rsp), %rdi
leaq 0x170(%rsp), %rsi
movl $0x8, %edx
callq 0x6560
leaq 0xa28(%rsp), %rdi
leaq 0x150(%rsp), %rsi
movl $0x8, %edx
callq 0x6560
leaq 0x600(%rsp), %rdi
leaq 0xc38(%rsp), %rsi
callq 0x1a348
leaq 0x4e8(%rsp), %rdi
leaq 0xa28(%rsp), %rsi
callq 0x1a348
leaq 0x718(%rsp), %rdi
leaq 0x108(%rsp), %rsi
movl $0x10, %edx
callq 0x1a464
leaq 0xe48(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movl $0x10, %edx
callq 0x1a464
movq 0x260d5(%rip), %rdi     # 0x3efb8
leaq 0x1840c(%rip), %rsi     # 0x312f6
movl $0x4c, %edx
callq 0x6450
movq 0x260bd(%rip), %rdi     # 0x3efb8
leaq 0x18441(%rip), %rsi     # 0x31343
movl $0x4a, %edx
callq 0x6450
movl $0xb8, %eax
leaq 0x3e8(%rsp), %rcx
leaq (%rcx,%rax), %rdx
movq %rdx, 0x130(%rsp)
movl $0x98, %edx
addq %rdx, %rcx
movq %rcx, 0x128(%rsp)
leaq 0x310(%rsp), %r13
addq %r13, %rax
movq %rax, 0x148(%rsp)
addq %r13, %rdx
movq %rdx, 0x140(%rsp)
leaq 0x190(%rsp), %r14
xorl %r15d, %r15d
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x28(%rsp)
xorl %ebp, %ebp
movl $0x0, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x0, 0x18(%rsp)
leaq 0x4e8(%rsp), %rdi
callq 0x6180
cmpl $-0x1, %eax
je 0x198d1
incl %r15d
imull $0x3afb7e91, %r15d, %eax # imm = 0x3AFB7E91
rorl $0x4, %eax
cmpl $0x68db8, %eax          # imm = 0x68DB8
ja 0x18fdb
movl 0x20(%rsp), %eax
movl %eax, (%rsp)
movq 0x138(%rsp), %rdi
movl %r15d, %esi
movl 0x1c(%rsp), %edx
movl 0x28(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl 0x18(%rsp), %r9d
callq 0x18a87
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
xorl %eax, %eax
movq %rax, 0x60(%rsp)
movq %rax, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq %r14, %rdi
leaq 0x600(%rsp), %rsi
callq 0x187b1
xorps %xmm0, %xmm0
movaps %xmm0, 0x310(%rsp)
movaps 0x50(%rsp), %xmm0
movq 0x60(%rsp), %rax
movups 0x190(%rsp), %xmm1
movaps %xmm1, 0x50(%rsp)
movq 0x1a0(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movaps 0x310(%rsp), %xmm1
movaps %xmm0, 0x310(%rsp)
movq %rax, 0x320(%rsp)
movups %xmm1, 0x190(%rsp)
movq $0x0, 0x1a0(%rsp)
movq %r13, %rdi
callq 0x1a264
movq %r14, %rdi
callq 0x1a264
movq %r14, %rdi
leaq 0x4e8(%rsp), %rsi
callq 0x187b1
xorps %xmm0, %xmm0
movaps %xmm0, 0x310(%rsp)
movaps 0x30(%rsp), %xmm0
movq 0x40(%rsp), %rax
movups 0x190(%rsp), %xmm1
movaps %xmm1, 0x30(%rsp)
movq 0x1a0(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movaps 0x310(%rsp), %xmm1
movaps %xmm0, 0x310(%rsp)
movq %rax, 0x320(%rsp)
movups %xmm1, 0x190(%rsp)
movq $0x0, 0x1a0(%rsp)
movq %r13, %rdi
callq 0x1a264
movq %r14, %rdi
callq 0x1a264
movq 0x30(%rsp), %rax
leaq 0xb8(%rsp), %rcx
movq %rcx, 0xa8(%rsp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x1c224
movq 0x30(%rsp), %rax
leaq 0xf8(%rsp), %rcx
movq %rcx, 0xe8(%rsp)
movq 0x60(%rax), %rsi
movq 0x68(%rax), %rdx
addq %rsi, %rdx
leaq 0xe8(%rsp), %rbx
movq %rbx, %rdi
callq 0x1c224
movq %r13, %rdi
leaq 0xa8(%rsp), %rsi
movq %rbx, %rdx
movl $0x2, %ecx
movl $0x1, %r8d
callq 0x2df9d
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x1918a
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x191af
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x63c0
movl 0x310(%rsp), %eax
cmpq $0x4, %rax
ja 0x196c7
leaq 0x16ea5(%rip), %rcx     # 0x3006c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %ebp, %ebx
movzbl 0x3d8(%rsp), %ebp
leaq 0x3e8(%rsp), %rdi
movq %r13, %rsi
callq 0x1a59a
movq 0x30(%rsp), %rax
leaq 0x98(%rsp), %rcx
movq %rcx, 0x88(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x1c224
movq 0x30(%rsp), %rax
leaq 0xd8(%rsp), %rcx
movq %rcx, 0xc8(%rsp)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %r12
movq %r12, %rdi
callq 0x1c224
movq %r14, %rdi
leaq 0x3e8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
movq %r12, %rcx
movl 0x14(%rsp), %r8d
callq 0x2e8f9
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x1928b
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x192b0
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x490(%rsp), %rdi
cmpq 0x130(%rsp), %rdi
je 0x192d2
movq 0x4a0(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x470(%rsp), %rdi
cmpq 0x128(%rsp), %rdi
je 0x192f4
movq 0x480(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x450(%rsp), %rdi
leaq 0x460(%rsp), %rax
cmpq %rax, %rdi
je 0x19319
movq 0x460(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x430(%rsp), %rdi
leaq 0x440(%rsp), %rax
cmpq %rax, %rdi
je 0x1933e
movq 0x440(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x410(%rsp), %rdi
leaq 0x420(%rsp), %rax
cmpq %rax, %rdi
je 0x19363
movq 0x420(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x3f0(%rsp), %rdi
leaq 0x400(%rsp), %rax
cmpq %rax, %rdi
je 0x19388
movq 0x400(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x2a0(%rsp), %rax
movq %rax, 0x290(%rsp)
movq 0x190(%rsp), %rsi
movq 0x198(%rsp), %rdx
addq %rsi, %rdx
leaq 0x290(%rsp), %rdi
movq %rdi, %r12
callq 0x1c224
leaq 0x2c0(%rsp), %rax
movq %rax, 0x2b0(%rsp)
movq 0x1b0(%rsp), %rsi
movq 0x1b8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x2b0(%rsp), %rdi
movq %rdi, %r12
callq 0x1c224
leaq 0x2e0(%rsp), %rax
movq %rax, 0x2d0(%rsp)
movq 0x1d0(%rsp), %rsi
movq 0x1d8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x2d0(%rsp), %rdi
movq %rdi, %r12
callq 0x1c224
leaq 0x300(%rsp), %rax
movq %rax, 0x2f0(%rsp)
movq 0x1f0(%rsp), %rsi
movq 0x1f8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x2f0(%rsp), %rdi
movq %rdi, %r12
callq 0x1c224
movl $0x4, %edx
leaq 0x4d0(%rsp), %r12
movq %r12, %rdi
leaq 0x290(%rsp), %rsi
leaq 0x2f(%rsp), %rcx
callq 0x1a81a
leaq 0x718(%rsp), %rdi
movq %r12, %rsi
callq 0x188f6
incl 0x1c(%rsp)
addl %ebp, 0x18(%rsp)
movq %r12, %rdi
callq 0x1a264
movq $-0x80, %r12
leaq 0x300(%rsp), %rbp
movq -0x10(%rbp), %rdi
cmpq %rdi, %rbp
je 0x194ba
movq (%rbp), %rsi
incq %rsi
callq 0x63c0
addq $-0x20, %rbp
addq $0x20, %r12
jne 0x194a5
leaq 0x4b8(%rsp), %r12
movq %r12, %rdi
leaq 0x50(%rsp), %rsi
callq 0x1a862
leaq 0xe48(%rsp), %rdi
movq %r12, %rsi
callq 0x188f6
movl %ebx, %ebp
movq %r12, %rdi
callq 0x1a264
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0x19518
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
cmpq %rax, %rdi
je 0x1953d
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x19562
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x197e0
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x63c0
jmp 0x197e0
incl 0x20(%rsp)
jmp 0x197e0
incl 0x28(%rsp)
jmp 0x197e0
incl 0x24(%rsp)
jmp 0x197e0
movl $0x33, %edx
movq 0x25a01(%rip), %rdi     # 0x3efb8
leaq 0x17ea2(%rip), %rsi     # 0x31460
callq 0x6450
movq 0x30(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x259e2(%rip), %rdi     # 0x3efb8
callq 0x6450
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r12, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq 0x30(%rsp), %rcx
movq 0x20(%rcx), %rsi
movq 0x28(%rcx), %rdx
movq %rax, %rdi
callq 0x6450
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r12, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq 0x30(%rsp), %rcx
movq 0x40(%rcx), %rsi
movq 0x48(%rcx), %rdx
movq %rax, %rdi
callq 0x6450
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r12, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq 0x30(%rsp), %rcx
movq 0x60(%rcx), %rsi
movq 0x68(%rcx), %rdx
movq %rax, %rdi
callq 0x6450
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r12, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
jmp 0x197de
movl $0x31, %edx
movq 0x258e5(%rip), %rdi     # 0x3efb8
leaq 0x17dba(%rip), %rsi     # 0x31494
callq 0x6450
movq 0x30(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x258c6(%rip), %rdi     # 0x3efb8
callq 0x6450
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r12, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq 0x30(%rsp), %rcx
movq 0x20(%rcx), %rsi
movq 0x28(%rcx), %rdx
movq %rax, %rdi
callq 0x6450
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r12, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq 0x30(%rsp), %rcx
movq 0x40(%rcx), %rsi
movq 0x48(%rcx), %rdx
movq %rax, %rdi
callq 0x6450
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r12, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq 0x30(%rsp), %rcx
movq 0x60(%rcx), %rsi
movq 0x68(%rcx), %rdx
movq %rax, %rdi
callq 0x6450
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r12, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
incl %ebp
movq 0x3b8(%rsp), %rdi
cmpq 0x148(%rsp), %rdi
je 0x19802
movq 0x3c8(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x398(%rsp), %rdi
cmpq 0x140(%rsp), %rdi
je 0x19824
movq 0x3a8(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x378(%rsp), %rdi
leaq 0x388(%rsp), %rax
cmpq %rax, %rdi
je 0x19849
movq 0x388(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x358(%rsp), %rdi
leaq 0x368(%rsp), %rax
cmpq %rax, %rdi
je 0x1986e
movq 0x368(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x338(%rsp), %rdi
leaq 0x348(%rsp), %rax
cmpq %rax, %rdi
je 0x19893
movq 0x348(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x318(%rsp), %rdi
leaq 0x328(%rsp), %rax
cmpq %rax, %rdi
je 0x198b8
movq 0x328(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x30(%rsp), %rdi
callq 0x1a264
leaq 0x50(%rsp), %rdi
callq 0x1a264
jmp 0x18f88
leaq 0xc38(%rsp), %rdi
callq 0x6080
leaq 0xa28(%rsp), %rdi
callq 0x6080
movq 0x256c6(%rip), %rbx     # 0x3efb8
leaq 0x17bcd(%rip), %rsi     # 0x314c6
movl $0x19, %edx
movq %rbx, %rdi
callq 0x6450
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq 0x25694(%rip), %rbx     # 0x3efb8
movq %rbx, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq %rax, %r14
leaq 0x17ba2(%rip), %rsi     # 0x314e0
movl $0x7, %edx
movq %rax, %rdi
callq 0x6450
movq %r14, %rdi
movl %r15d, %esi
callq 0x6650
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq %rax, %r14
leaq 0x17b5e(%rip), %rsi     # 0x314e8
movl $0x4, %edx
movq %rax, %rdi
callq 0x6450
movq %r14, %rdi
movl 0x1c(%rsp), %esi
callq 0x6650
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq %rax, %r14
leaq 0x17b16(%rip), %rsi     # 0x314ed
movl $0x13, %edx
movq %rax, %rdi
callq 0x6450
movq %r14, %rdi
movl 0x28(%rsp), %esi
callq 0x6650
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq %rax, %r14
leaq 0x17add(%rip), %rsi     # 0x31501
movl $0x1a, %edx
movq %rax, %rdi
callq 0x6450
movq %r14, %rdi
movl 0x24(%rsp), %esi
callq 0x6650
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq %rax, %r14
leaq 0x17aab(%rip), %rsi     # 0x3151c
movl $0x1f, %edx
movq %rax, %rdi
callq 0x6450
movq %r14, %rdi
movl 0x18(%rsp), %esi
callq 0x6650
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq %rax, %r14
leaq 0x17a7e(%rip), %rsi     # 0x3153c
movl $0x18, %edx
movq %rax, %rdi
callq 0x6450
movq %r14, %rdi
movl 0x20(%rsp), %esi
callq 0x6650
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
testl %ebp, %ebp
jle 0x19b55
movq 0x254ac(%rip), %rdi     # 0x3efb8
leaq 0x17a42(%rip), %rsi     # 0x31555
movl $0x15, %edx
callq 0x6450
movq 0x25494(%rip), %rdi     # 0x3efb8
movl %ebp, %esi
callq 0x6650
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x6390
movsbl %al, %esi
movq 0x25445(%rip), %rdi     # 0x3efb8
callq 0x6040
movq %rax, %rdi
callq 0x62a0
leaq 0x24c39(%rip), %rbx     # 0x3e7c0
leaq 0xe48(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1c15c
movl $0x208, %r14d           # imm = 0x208
addq %r14, %r15
movq %r15, %rdi
callq 0x6140
leaq 0x718(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1c15c
addq %r14, %r15
movq %r15, %rdi
callq 0x6140
leaq 0x24a40(%rip), %rbx     # 0x3e610
leaq 0x4e8(%rsp), %rdi
movq %rbx, %rsi
callq 0x1c1ca
leaq 0x4f8(%rsp), %rdi
callq 0x6140
leaq 0x600(%rsp), %rdi
movq %rbx, %rsi
callq 0x1c1ca
leaq 0x610(%rsp), %rdi
callq 0x6140
leaq 0xa28(%rsp), %rdi
callq 0x60b0
leaq 0xc38(%rsp), %rdi
callq 0x60b0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x19c40
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x19c65
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x160(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x19c86
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x180(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x19ca7
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x63c0
xorl %eax, %eax
addq $0x1158, %rsp           # imm = 0x1158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1852c
jmp 0x19cf3
movq 0x252ef(%rip), %rdi     # 0x3efb8
leaq 0x176f3(%rip), %rsi     # 0x313c3
callq 0x63a0
leaq 0x25b5c(%rip), %rsi     # 0x3f838
movq %rax, %rdi
callq 0x6370
leaq 0x1774c(%rip), %rsi     # 0x31437
movq %rax, %rdi
callq 0x63a0
xorl %edi, %edi
callq 0x64c0
movq %rax, %rbx
jmp 0x19f77
movq %rax, %rbx
jmp 0x19f98
movq %rax, %rbx
jmp 0x19fb9
jmp 0x19dc1
movq %rax, %rbx
jmp 0x19fe7
jmp 0x19db1
movq %rax, %rbx
movq 0x210(%rsp), %rdi
cmpq %r12, %rdi
je 0x19d49
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x63c0
jmp 0x19d49
movq %rax, %rbx
movq 0x230(%rsp), %rdi
cmpq %r14, %rdi
je 0x19ff4
movq 0x240(%rsp), %rsi
jmp 0x19da4
jmp 0x19db1
movq %rax, %rbx
movq 0x250(%rsp), %rdi
cmpq %r12, %rdi
je 0x19d8b
movq 0x260(%rsp), %rsi
incq %rsi
callq 0x63c0
jmp 0x19d8b
movq %rax, %rbx
movq 0x270(%rsp), %rdi
cmpq %r14, %rdi
je 0x19ff4
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x63c0
jmp 0x19ff4
movq %rax, %rbx
jmp 0x19ff4
movq %rax, %rbx
jmp 0x1a056
movq %rax, %rbx
jmp 0x19fda
movq %rax, %rbx
leaq 0x4b8(%rsp), %rdi
callq 0x1a264
jmp 0x19ebf
movq %rax, %rbx
jmp 0x19ebf
movq %rax, %rbx
leaq 0x4d0(%rsp), %rdi
callq 0x1a264
jmp 0x19dfb
movq %rax, %rbx
leaq 0x300(%rsp), %r14
xorl %r15d, %r15d
movq 0x2f0(%rsp,%r15), %rdi
leaq (%r14,%r15), %rax
cmpq %rdi, %rax
je 0x19e22
movq (%rax), %rsi
incq %rsi
callq 0x63c0
addq $-0x20, %r15
cmpq $-0x80, %r15
jne 0x19e06
jmp 0x19ebf
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x19e5e
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x63c0
jmp 0x19e5e
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x19e88
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x63c0
jmp 0x19e88
movq %rax, %rbx
leaq 0x3e8(%rsp), %rdi
callq 0x1a776
jmp 0x19f35
jmp 0x19f32
movq %rax, %rbx
leaq 0x290(%rsp), %rax
cmpq %r12, %rax
je 0x19ebf
leaq 0x290(%rsp), %rsi
movq %r12, %rdi
callq 0x6712
leaq 0x190(%rsp), %rdi
callq 0x1a8ec
jmp 0x19f35
jmp 0x19ed2
jmp 0x19ed2
movq %rax, %rbx
jmp 0x19f42
movq %rax, %rbx
jmp 0x19f04
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x19f04
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x19f42
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x63c0
jmp 0x19f42
jmp 0x19f2d
movq %rax, %rbx
jmp 0x19f56
movq %rax, %rbx
leaq 0x310(%rsp), %rdi
callq 0x1a776
leaq 0x30(%rsp), %rdi
callq 0x1a264
leaq 0x50(%rsp), %rdi
callq 0x1a264
leaq 0x24863(%rip), %rsi     # 0x3e7c0
leaq 0xe48(%rsp), %rdi
callq 0x1c15c
leaq 0x1050(%rsp), %rdi
callq 0x6140
leaq 0x24842(%rip), %rsi     # 0x3e7c0
leaq 0x718(%rsp), %rdi
callq 0x1c15c
leaq 0x920(%rsp), %rdi
callq 0x6140
leaq 0x24671(%rip), %rsi     # 0x3e610
leaq 0x4e8(%rsp), %rdi
callq 0x1c1ca
leaq 0x4f8(%rsp), %rdi
callq 0x6140
leaq 0x24650(%rip), %rsi     # 0x3e610
leaq 0x600(%rsp), %rdi
callq 0x1c1ca
leaq 0x610(%rsp), %rdi
callq 0x6140
leaq 0xa28(%rsp), %rdi
callq 0x60b0
leaq 0xc38(%rsp), %rdi
callq 0x60b0
leaq 0x78(%rsp), %rax
movq 0x68(%rsp), %rdi
cmpq %rax, %rdi
je 0x1a010
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x63c0
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x1a035
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x160(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a056
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x63c0
leaq 0x180(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a077
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x63c0
movq %rbx, %rdi
callq 0x6660