// File: Altius[P]hotspot2/src/hotspot2_part1.cpp
// Function: main
int main(int argc, char* argv[])
{

  // Option defaults
  int background_size = 50001;
  int sampling_interval = 1;
  int smoothing_parameter = 5; // recommend ca. 15 when the maximum # of sampled observations is ca. 250
  int print_help = 0;
  int print_version = 0;
  string infilename = "";
  string outfilename = "";
  string outfilenameChromNames = "";
  string outfilenamePvals = "";

  // Long-opt definitions
  static struct option long_options[] = {
    { "background_size", required_argument, 0, 'b' },
    { "sampling_interval", required_argument, 0, 'n' },
    { "smoothing_parameter", required_argument, 0, 'm' },
    { "input", required_argument, 0, 'i' },
    { "output", required_argument, 0, 'o' },
    { "outputChromlist", required_argument, 0, 'c' },
    { "outputPvals", required_argument, 0, 'p' }, // note we had been using 'p' for num_pvals
    { "help", no_argument, &print_help, 1 },
    { "version", no_argument, &print_version, 1 },
    { 0, 0, 0, 0 }
  };

  // Parse options
  char c;
  stringstream ss; // Used for parsing doubles (allows scientific notation)
  while ((c = getopt_long(argc, argv, "b:f:m:n:p:s:i:o:c:hvV", long_options, NULL)) != -1)
    {
      switch (c)
        {
        case 'b':
          background_size = atoi(optarg);
          break;
        case 'n':
          sampling_interval = atoi(optarg);
          break;
        case 'm':
          smoothing_parameter = atoi(optarg);
          break;
        case 'p':
	  outfilenamePvals = optarg;
          break;
        case 'i':
          infilename = optarg;
          break;
        case 'o':
          outfilename = optarg;
          break;
	case 'c':
          outfilenameChromNames = optarg;
          break;
	case 'h':
          print_help = 1;
          break;
        case 'v':
        case 'V':
          print_version = 1;
          break;
        case 0:
          // long option received, do nothing
          break;
        default:
          print_help = 1;
        }
    }

  if (!print_help && !print_version && outfilenameChromNames.empty())
    {
      cerr << "Error:  No filename supplied for (temporary) output file of integer-to-chromosomeName mapping."
	   << endl
	   << endl;
      print_help = 1;
    }
  if (!print_help && !print_version && outfilenamePvals.empty())
    {
      cerr << "Error:  No filename supplied for (temporary) output file of scaled -log10(P) values."
	   << endl
	   << endl;
      print_help = 1;
    }
  
  // Print usage and exit if necessary
  if (print_help)
    {
      cerr << "Usage:  " << argv[0] << " [options] < in.cutcounts.bed > out.pvalues.bed\n"
           << "\n"
           << "Options: \n"
           << "  -b, --background_size=SIZE     The size of the background region (50001)\n"
           << "  -n, --sampling_interval=INT    How often (bp) to sample for null modeling (1)\n"
           << "  -m, --smoothing_prameter=INT   Smoothing parameter used in null modeling (5)\n"
           << "  -i, --input=FILE               A file to read input from (STDIN)\n"
           << "  -o, --output=FILE              A file to write output to (STDOUT)\n"
	   << "  -c, --outputChromlist=FILE     Output file to store chromName-to-int mapping\n"
	   << "  -p, --outputPvals=FILE         Output file to store scaled -log10(P) values and # occurrences\n"
	   << "  -v, --version                  Print the version information and exit\n"
           << "  -h, --help                     Display this helpful help\n"
           << "\n"
           << " output (sent to stdout) will be a .bed4 file with a scaled transformation of the P-value in field 4\n"
           << " input (received from stdin) requires IDs in field 4 and counts in field 5.\n"
           << endl
           << endl;
      return -1;
    }

  if (print_version)
    {
      cout << argv[0] << " version " << hotspot2_VERSION_MAJOR
           << '.' << hotspot2_VERSION_MINOR << endl;
      return 0;
    }

  ios_base::sync_with_stdio(false); // calling this static method in this way turns off checks, speeds up I/O

  if (!infilename.empty() && infilename != "-")
    {
      if (freopen(infilename.c_str(), "r", stdin) == NULL)
        {
          cerr << "Error: Couldn't open input file " << infilename << endl;
          return 1;
        }
    }
  if (!outfilename.empty() && outfilename != "-")
    {
      if (freopen(outfilename.c_str(), "w", stdout) == NULL)
        {
          cerr << "Error: Couldn't open output file " << outfilename << " for writing" << endl;
          return 1;
        }
    }

  ofstream ofsIntToChrnameMapping(outfilenameChromNames.c_str());
  if (!ofsIntToChrnameMapping)
    {
      cerr << "Error:  Unable to open file \"" << outfilenameChromNames << "\" for write."
	   << endl
	   << endl;
      return -1;
    }
  ofstream ofsPvals(outfilenamePvals.c_str());
  if (!ofsPvals)
    {
      cerr << "Error:  Unable to open file \"" << outfilenamePvals << "\" for write."
	   << endl
	   << endl;
      return -1;
    }
  
  if (!parseAndProcessInput(background_size, sampling_interval, smoothing_parameter,
			    ofsPvals))
    return -1;

  for (map<string*, int>::const_iterator it = chromAsInt.begin(); it != chromAsInt.end(); it++)
    ofsIntToChrnameMapping << it->second << '\t' << *(it->first) << '\n';
  
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x850, %rsp            # imm = 0x850
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0xc351, -0x14(%rbp)    # imm = 0xC351
movl $0x1, -0x18(%rbp)
movl $0x5, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0x698(%rbp)
callq 0x3440
movq -0x698(%rbp), %rdx
leaq 0xa717(%rip), %rsi      # 0x137d1
leaq -0x48(%rbp), %rdi
callq 0xb000
jmp 0x90c5
leaq -0x49(%rbp), %rdi
callq 0x32b0
leaq -0x81(%rbp), %rdi
movq %rdi, -0x6a0(%rbp)
callq 0x3440
movq -0x6a0(%rbp), %rdx
leaq 0xa6e2(%rip), %rsi      # 0x137d1
leaq -0x80(%rbp), %rdi
callq 0xb000
jmp 0x90fa
leaq -0x81(%rbp), %rdi
callq 0x32b0
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x6a8(%rbp)
callq 0x3440
movq -0x6a8(%rbp), %rdx
leaq 0xa6aa(%rip), %rsi      # 0x137d1
leaq -0xa8(%rbp), %rdi
callq 0xb000
jmp 0x9135
leaq -0xa9(%rbp), %rdi
callq 0x32b0
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x6b0(%rbp)
callq 0x3440
movq -0x6b0(%rbp), %rdx
leaq 0xa66f(%rip), %rsi      # 0x137d1
leaq -0xd0(%rbp), %rdi
callq 0xb000
jmp 0x9170
leaq -0xd1(%rbp), %rdi
callq 0x32b0
cmpb $0x0, 0x122ad(%rip)     # 0x1b430
jne 0x9359
leaq 0x122a0(%rip), %rdi     # 0x1b430
callq 0x3460
cmpl $0x0, %eax
je 0x9359
leaq 0xa64d(%rip), %rax      # 0x137f2
movq %rax, 0x12144(%rip)     # 0x1b2f0
movl $0x1, 0x12142(%rip)     # 0x1b2f8
movq $0x0, 0x1213f(%rip) # 0x1b300
movl $0x62, 0x1213d(%rip)    # 0x1b308
leaq 0xa630(%rip), %rax      # 0x13802
movq %rax, 0x12137(%rip)     # 0x1b310
movl $0x1, 0x12135(%rip)     # 0x1b318
movq $0x0, 0x12132(%rip) # 0x1b320
movl $0x6e, 0x12130(%rip)    # 0x1b328
leaq 0xa615(%rip), %rax      # 0x13814
movq %rax, 0x1212a(%rip)     # 0x1b330
movl $0x1, 0x12128(%rip)     # 0x1b338
movq $0x0, 0x12125(%rip) # 0x1b340
movl $0x6d, 0x12123(%rip)    # 0x1b348
leaq 0xa5fc(%rip), %rax      # 0x13828
movq %rax, 0x1211d(%rip)     # 0x1b350
movl $0x1, 0x1211b(%rip)     # 0x1b358
movq $0x0, 0x12118(%rip) # 0x1b360
movl $0x69, 0x12116(%rip)    # 0x1b368
leaq 0xa5d5(%rip), %rax      # 0x1382e
movq %rax, 0x12110(%rip)     # 0x1b370
movl $0x1, 0x1210e(%rip)     # 0x1b378
movq $0x0, 0x1210b(%rip) # 0x1b380
movl $0x6f, 0x12109(%rip)    # 0x1b388
leaq 0xa5af(%rip), %rax      # 0x13835
movq %rax, 0x12103(%rip)     # 0x1b390
movl $0x1, 0x12101(%rip)     # 0x1b398
movq $0x0, 0x120fe(%rip) # 0x1b3a0
movl $0x63, 0x120fc(%rip)    # 0x1b3a8
leaq 0xa592(%rip), %rax      # 0x13845
movq %rax, 0x120f6(%rip)     # 0x1b3b0
movl $0x1, 0x120f4(%rip)     # 0x1b3b8
movq $0x0, 0x120f1(%rip) # 0x1b3c0
movl $0x70, 0x120ef(%rip)    # 0x1b3c8
leaq 0xa571(%rip), %rax      # 0x13851
movq %rax, 0x120e9(%rip)     # 0x1b3d0
movl $0x0, 0x120e7(%rip)     # 0x1b3d8
leaq -0x20(%rbp), %rax
movq %rax, 0x120e4(%rip)     # 0x1b3e0
movl $0x1, 0x120e2(%rip)     # 0x1b3e8
leaq 0xa549(%rip), %rax      # 0x13856
movq %rax, 0x120dc(%rip)     # 0x1b3f0
movl $0x0, 0x120da(%rip)     # 0x1b3f8
leaq -0x24(%rbp), %rax
movq %rax, 0x120d7(%rip)     # 0x1b400
movl $0x1, 0x120d5(%rip)     # 0x1b408
leaq 0x11fb6(%rip), %rdi     # 0x1b2f0
addq $0x120, %rdi            # imm = 0x120
xorl %esi, %esi
movl $0x20, %edx
callq 0x3130
leaq 0x120dc(%rip), %rdi     # 0x1b430
callq 0x3170
leaq -0x260(%rbp), %rdi
callq 0x31b0
jmp 0x9367
jmp 0x9369
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0xa4e7(%rip), %rdx      # 0x1385e
leaq 0x11f72(%rip), %rcx     # 0x1b2f0
xorl %eax, %eax
movl %eax, %r8d
callq 0x33f0
movb %al, -0xd2(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x95b8
movsbl -0xd2(%rbp), %eax
movl %eax, -0x6b4(%rbp)
testl %eax, %eax
je 0x95aa
jmp 0x93b1
movl -0x6b4(%rbp), %eax
subl $0x56, %eax
je 0x95a1
jmp 0x93c2
movl -0x6b4(%rbp), %eax
subl $0x62, %eax
je 0x94e0
jmp 0x93d3
movl -0x6b4(%rbp), %eax
subl $0x63, %eax
je 0x957e
jmp 0x93e4
movl -0x6b4(%rbp), %eax
subl $0x68, %eax
je 0x9598
jmp 0x93f5
movl -0x6b4(%rbp), %eax
subl $0x69, %eax
je 0x9550
jmp 0x9406
movl -0x6b4(%rbp), %eax
subl $0x6d, %eax
je 0x950e
jmp 0x9417
movl -0x6b4(%rbp), %eax
subl $0x6e, %eax
je 0x94f7
jmp 0x9428
movl -0x6b4(%rbp), %eax
subl $0x6f, %eax
je 0x9567
jmp 0x9439
movl -0x6b4(%rbp), %eax
subl $0x70, %eax
je 0x9525
jmp 0x944a
movl -0x6b4(%rbp), %eax
subl $0x76, %eax
je 0x95a1
jmp 0x95ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x32b0
jmp 0x9f3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x81(%rbp), %rdi
callq 0x32b0
jmp 0x9f36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa9(%rbp), %rdi
callq 0x32b0
jmp 0x9f2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xd1(%rbp), %rdi
callq 0x32b0
jmp 0x9f21
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x9f15
movq 0x11ac9(%rip), %rax     # 0x1afb0
movq (%rax), %rdi
callq 0x33b0
movl %eax, -0x14(%rbp)
jmp 0x95b3
movq 0x11ab2(%rip), %rax     # 0x1afb0
movq (%rax), %rdi
callq 0x33b0
movl %eax, -0x18(%rbp)
jmp 0x95b3
movq 0x11a9b(%rip), %rax     # 0x1afb0
movq (%rax), %rdi
callq 0x33b0
movl %eax, -0x1c(%rbp)
jmp 0x95b3
movq 0x11a84(%rip), %rax     # 0x1afb0
movq (%rax), %rsi
leaq -0xd0(%rbp), %rdi
callq 0x3370
jmp 0x953d
jmp 0x95b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x9f09
movq 0x11a59(%rip), %rax     # 0x1afb0
movq (%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3370
jmp 0x9565
jmp 0x95b3
movq 0x11a42(%rip), %rax     # 0x1afb0
movq (%rax), %rsi
leaq -0x80(%rbp), %rdi
callq 0x3370
jmp 0x957c
jmp 0x95b3
movq 0x11a2b(%rip), %rax     # 0x1afb0
movq (%rax), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x3370
jmp 0x9596
jmp 0x95b3
movl $0x1, -0x20(%rbp)
jmp 0x95b3
movl $0x1, -0x24(%rbp)
jmp 0x95b3
jmp 0x95b3
movl $0x1, -0x20(%rbp)
jmp 0x9369
cmpl $0x0, -0x20(%rbp)
jne 0x962a
cmpl $0x0, -0x24(%rbp)
jne 0x962a
leaq -0xa8(%rbp), %rdi
callq 0x3400
testb $0x1, %al
jne 0x95d6
jmp 0x962a
movq 0x11a13(%rip), %rdi     # 0x1aff0
leaq 0xa290(%rip), %rsi      # 0x13874
callq 0x3240
movq %rax, -0x6c0(%rbp)
jmp 0x95f2
movq -0x6c0(%rbp), %rdi
movq 0x119a8(%rip), %rsi     # 0x1afa8
callq 0x3280
movq %rax, -0x6c8(%rbp)
jmp 0x960e
movq -0x6c8(%rbp), %rdi
movq 0x1198c(%rip), %rsi     # 0x1afa8
callq 0x3280
jmp 0x9623
movl $0x1, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x969c
cmpl $0x0, -0x24(%rbp)
jne 0x969c
leaq -0xd0(%rbp), %rdi
callq 0x3400
testb $0x1, %al
jne 0x9648
jmp 0x969c
movq 0x119a1(%rip), %rdi     # 0x1aff0
leaq 0xa27d(%rip), %rsi      # 0x138d3
callq 0x3240
movq %rax, -0x6d0(%rbp)
jmp 0x9664
movq -0x6d0(%rbp), %rdi
movq 0x11936(%rip), %rsi     # 0x1afa8
callq 0x3280
movq %rax, -0x6d8(%rbp)
jmp 0x9680
movq -0x6d8(%rbp), %rdi
movq 0x1191a(%rip), %rsi     # 0x1afa8
callq 0x3280
jmp 0x9695
movl $0x1, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x98c9
movq 0x11943(%rip), %rdi     # 0x1aff0
leaq 0xa274(%rip), %rsi      # 0x13928
callq 0x3240
movq %rax, -0x6e0(%rbp)
jmp 0x96c2
movq -0x6e0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x3240
movq %rax, -0x6e8(%rbp)
jmp 0x96de
movq -0x6e8(%rbp), %rdi
leaq 0xa245(%rip), %rsi      # 0x13931
callq 0x3240
movq %rax, -0x6f0(%rbp)
jmp 0x96fa
movq -0x6f0(%rbp), %rdi
leaq 0xa263(%rip), %rsi      # 0x1396b
callq 0x3240
movq %rax, -0x6f8(%rbp)
jmp 0x9716
movq -0x6f8(%rbp), %rdi
leaq 0xa23e(%rip), %rsi      # 0x13962
callq 0x3240
movq %rax, -0x700(%rbp)
jmp 0x9732
movq -0x700(%rbp), %rdi
leaq 0xa22d(%rip), %rsi      # 0x1396d
callq 0x3240
movq %rax, -0x708(%rbp)
jmp 0x974e
movq -0x708(%rbp), %rdi
leaq 0xa25d(%rip), %rsi      # 0x139b9
callq 0x3240
movq %rax, -0x710(%rbp)
jmp 0x976a
movq -0x710(%rbp), %rdi
leaq 0xa292(%rip), %rsi      # 0x13a0a
callq 0x3240
movq %rax, -0x718(%rbp)
jmp 0x9786
movq -0x718(%rbp), %rdi
leaq 0xa2c6(%rip), %rsi      # 0x13a5a
callq 0x3240
movq %rax, -0x720(%rbp)
jmp 0x97a2
movq -0x720(%rbp), %rdi
leaq 0xa2ee(%rip), %rsi      # 0x13a9e
callq 0x3240
movq %rax, -0x728(%rbp)
jmp 0x97be
movq -0x728(%rbp), %rdi
leaq 0xa317(%rip), %rsi      # 0x13ae3
callq 0x3240
movq %rax, -0x730(%rbp)
jmp 0x97da
movq -0x730(%rbp), %rdi
leaq 0xa34b(%rip), %rsi      # 0x13b33
callq 0x3240
movq %rax, -0x738(%rbp)
jmp 0x97f6
movq -0x738(%rbp), %rdi
leaq 0xa390(%rip), %rsi      # 0x13b94
callq 0x3240
movq %rax, -0x740(%rbp)
jmp 0x9812
movq -0x740(%rbp), %rdi
leaq 0xa3bd(%rip), %rsi      # 0x13bdd
callq 0x3240
movq %rax, -0x748(%rbp)
jmp 0x982e
movq -0x748(%rbp), %rdi
leaq 0xa12f(%rip), %rsi      # 0x1396b
callq 0x3240
movq %rax, -0x750(%rbp)
jmp 0x984a
movq -0x750(%rbp), %rdi
leaq 0xa3c1(%rip), %rsi      # 0x13c19
callq 0x3240
movq %rax, -0x758(%rbp)
jmp 0x9866
movq -0x758(%rbp), %rdi
leaq 0xa40b(%rip), %rsi      # 0x13c7f
callq 0x3240
movq %rax, -0x760(%rbp)
jmp 0x9882
movq -0x760(%rbp), %rdi
movq 0x11718(%rip), %rsi     # 0x1afa8
callq 0x3280
movq %rax, -0x768(%rbp)
jmp 0x989e
movq -0x768(%rbp), %rdi
movq 0x116fc(%rip), %rsi     # 0x1afa8
callq 0x3280
jmp 0x98b3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x264(%rbp)
jmp 0x9ec7
cmpl $0x0, -0x24(%rbp)
je 0x9984
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq 0x116e7(%rip), %rdi     # 0x1afc8
callq 0x3240
movq %rax, -0x770(%rbp)
jmp 0x98ef
movq -0x770(%rbp), %rdi
leaq 0xa3cf(%rip), %rsi      # 0x13ccc
callq 0x3240
movq %rax, -0x778(%rbp)
jmp 0x990b
movq -0x778(%rbp), %rdi
movl $0x2, %esi
callq 0x3420
movq %rax, -0x780(%rbp)
jmp 0x9925
movq -0x780(%rbp), %rdi
movl $0x2e, %esi
callq 0x3310
movq %rax, -0x788(%rbp)
jmp 0x993f
movq -0x788(%rbp), %rdi
movl $0x1, %esi
callq 0x3420
movq %rax, -0x790(%rbp)
jmp 0x9959
movq -0x790(%rbp), %rdi
movq 0x11641(%rip), %rsi     # 0x1afa8
callq 0x3280
jmp 0x996e
movl $0x0, -0x4(%rbp)
movl $0x1, -0x264(%rbp)
jmp 0x9ec7
xorl %edi, %edi
callq 0x30d0
jmp 0x998d
leaq -0x48(%rbp), %rdi
callq 0x3400
testb $0x1, %al
jne 0x9a5f
leaq 0xa331(%rip), %rsi      # 0x13cd6
leaq -0x48(%rbp), %rdi
callq 0xb170
movb %al, -0x791(%rbp)
jmp 0x99b6
movb -0x791(%rbp), %al
testb $0x1, %al
jne 0x99c5
jmp 0x9a5f
leaq -0x48(%rbp), %rdi
callq 0x30c0
movq %rax, %rdi
movq 0x115e8(%rip), %rax     # 0x1afc0
movq (%rax), %rdx
leaq 0x9e44(%rip), %rsi      # 0x13826
callq 0x32a0
movq %rax, -0x7a0(%rbp)
jmp 0x99f0
movq -0x7a0(%rbp), %rax
cmpq $0x0, %rax
jne 0x9a5d
movq 0x115ec(%rip), %rdi     # 0x1aff0
leaq 0xa2cd(%rip), %rsi      # 0x13cd8
callq 0x3240
movq %rax, -0x7a8(%rbp)
jmp 0x9a19
movq -0x7a8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3230
movq %rax, -0x7b0(%rbp)
jmp 0x9a32
movq -0x7b0(%rbp), %rdi
movq 0x11568(%rip), %rsi     # 0x1afa8
callq 0x3280
jmp 0x9a47
movl $0x1, -0x4(%rbp)
movl $0x1, -0x264(%rbp)
jmp 0x9ec7
jmp 0x9a5f
leaq -0x80(%rbp), %rdi
callq 0x3400
testb $0x1, %al
jne 0x9b4d
leaq 0xa25f(%rip), %rsi      # 0x13cd6
leaq -0x80(%rbp), %rdi
callq 0xb170
movb %al, -0x7b1(%rbp)
jmp 0x9a88
movb -0x7b1(%rbp), %al
testb $0x1, %al
jne 0x9a97
jmp 0x9b4d
leaq -0x80(%rbp), %rdi
callq 0x30c0
movq %rax, %rdi
movq 0x114ee(%rip), %rax     # 0x1af98
movq (%rax), %rdx
leaq 0xa245(%rip), %rsi      # 0x13cf9
callq 0x32a0
movq %rax, -0x7c0(%rbp)
jmp 0x9ac2
movq -0x7c0(%rbp), %rax
cmpq $0x0, %rax
jne 0x9b4b
movq 0x1151a(%rip), %rdi     # 0x1aff0
leaq 0xa21e(%rip), %rsi      # 0x13cfb
callq 0x3240
movq %rax, -0x7c8(%rbp)
jmp 0x9aeb
movq -0x7c8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3230
movq %rax, -0x7d0(%rbp)
jmp 0x9b04
movq -0x7d0(%rbp), %rdi
leaq 0xa20b(%rip), %rsi      # 0x13d1d
callq 0x3240
movq %rax, -0x7d8(%rbp)
jmp 0x9b20
movq -0x7d8(%rbp), %rdi
movq 0x1147a(%rip), %rsi     # 0x1afa8
callq 0x3280
jmp 0x9b35
movl $0x1, -0x4(%rbp)
movl $0x1, -0x264(%rbp)
jmp 0x9ec7
jmp 0x9b4d
leaq -0xa8(%rbp), %rdi
callq 0x30c0
movq %rax, %rsi
leaq -0x468(%rbp), %rdi
movl $0x10, %edx
callq 0x32c0
jmp 0x9b6f
movq -0x468(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x468(%rbp,%rax), %rdi
callq 0x3100
movb %al, -0x7d9(%rbp)
jmp 0x9b8f
movb -0x7d9(%rbp), %al
testb $0x1, %al
jne 0x9b9e
jmp 0x9c4a
movq 0x1144b(%rip), %rdi     # 0x1aff0
leaq 0xa17e(%rip), %rsi      # 0x13d2a
callq 0x3240
movq %rax, -0x7e8(%rbp)
jmp 0x9bba
movq -0x7e8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3230
movq %rax, -0x7f0(%rbp)
jmp 0x9bd6
movq -0x7f0(%rbp), %rdi
leaq 0xa164(%rip), %rsi      # 0x13d48
callq 0x3240
movq %rax, -0x7f8(%rbp)
jmp 0x9bf2
movq -0x7f8(%rbp), %rdi
movq 0x113a8(%rip), %rsi     # 0x1afa8
callq 0x3280
movq %rax, -0x800(%rbp)
jmp 0x9c0e
movq -0x800(%rbp), %rdi
movq 0x1138c(%rip), %rsi     # 0x1afa8
callq 0x3280
jmp 0x9c23
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x264(%rbp)
jmp 0x9eab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x9eb9
leaq -0xd0(%rbp), %rdi
callq 0x30c0
movq %rax, %rsi
leaq -0x668(%rbp), %rdi
movl $0x10, %edx
callq 0x32c0
jmp 0x9c6c
movq -0x668(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x668(%rbp,%rax), %rdi
callq 0x3100
movb %al, -0x801(%rbp)
jmp 0x9c8c
movb -0x801(%rbp), %al
testb $0x1, %al
jne 0x9c9b
jmp 0x9d53
movq 0x1134e(%rip), %rdi     # 0x1aff0
leaq 0xa081(%rip), %rsi      # 0x13d2a
callq 0x3240
movq %rax, -0x810(%rbp)
jmp 0x9cb7
movq -0x810(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x3230
movq %rax, -0x818(%rbp)
jmp 0x9cd3
movq -0x818(%rbp), %rdi
leaq 0xa067(%rip), %rsi      # 0x13d48
callq 0x3240
movq %rax, -0x820(%rbp)
jmp 0x9cef
movq -0x820(%rbp), %rdi
movq 0x112ab(%rip), %rsi     # 0x1afa8
callq 0x3280
movq %rax, -0x828(%rbp)
jmp 0x9d0b
movq -0x828(%rbp), %rdi
movq 0x1128f(%rip), %rsi     # 0x1afa8
callq 0x3280
jmp 0x9d20
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x264(%rbp)
jmp 0x9e9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x668(%rbp), %rdi
callq 0x3390
jmp 0x9eb9
leaq -0x14(%rbp), %rdi
leaq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
leaq -0x668(%rbp), %rcx
callq 0x8a80
movb %al, -0x829(%rbp)
jmp 0x9d73
movb -0x829(%rbp), %al
testb $0x1, %al
jne 0x9d95
jmp 0x9d7f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x264(%rbp)
jmp 0x9e9f
leaq 0x1150c(%rip), %rdi     # 0x1b2a8
callq 0xb1a0
movq %rax, -0x678(%rbp)
leaq -0x670(%rbp), %rdi
leaq -0x678(%rbp), %rsi
callq 0xa290
leaq 0x114e6(%rip), %rdi     # 0x1b2a8
callq 0xa2e0
movq %rax, -0x688(%rbp)
leaq -0x680(%rbp), %rdi
leaq -0x688(%rbp), %rsi
callq 0xa290
leaq -0x670(%rbp), %rdi
leaq -0x680(%rbp), %rsi
callq 0xb1d0
testb $0x1, %al
jne 0x9dfd
jmp 0x9e8e
leaq -0x670(%rbp), %rdi
callq 0xa310
movl 0x8(%rax), %esi
leaq -0x468(%rbp), %rdi
callq 0x3420
movq %rax, -0x838(%rbp)
jmp 0x9e21
movq -0x838(%rbp), %rdi
movl $0x9, %esi
callq 0x3310
movq %rax, -0x840(%rbp)
jmp 0x9e3b
leaq -0x670(%rbp), %rdi
callq 0xa310
movq -0x840(%rbp), %rdi
movq (%rax), %rsi
callq 0x3230
movq %rax, -0x848(%rbp)
jmp 0x9e5f
movq -0x848(%rbp), %rdi
movl $0xa, %esi
callq 0x3310
jmp 0x9e72
jmp 0x9e74
leaq -0x670(%rbp), %rdi
xorl %esi, %esi
callq 0xb200
movq %rax, -0x690(%rbp)
jmp 0x9dbb
movl $0x0, -0x4(%rbp)
movl $0x1, -0x264(%rbp)
leaq -0x668(%rbp), %rdi
callq 0x3390
leaq -0x468(%rbp), %rdi
callq 0x3390
jmp 0x9ec7
leaq -0x468(%rbp), %rdi
callq 0x3390
jmp 0x9f09
leaq -0x260(%rbp), %rdi
callq 0x31d0
leaq -0xd0(%rbp), %rdi
callq 0x3150
leaq -0xa8(%rbp), %rdi
callq 0x3150
leaq -0x80(%rbp), %rdi
callq 0x3150
leaq -0x48(%rbp), %rdi
callq 0x3150
movl -0x4(%rbp), %eax
addq $0x850, %rsp            # imm = 0x850
popq %rbp
retq
leaq -0x260(%rbp), %rdi
callq 0x31d0
leaq -0xd0(%rbp), %rdi
callq 0x3150
leaq -0xa8(%rbp), %rdi
callq 0x3150
leaq -0x80(%rbp), %rdi
callq 0x3150
leaq -0x48(%rbp), %rdi
callq 0x3150
movq -0x58(%rbp), %rdi
callq 0x3430
nopl (%rax,%rax)