// File: Altius[P]hotspot2/src/hotspot2_part2.cpp
// Function: main
int main(int argc, char* argv[])
{
  // Option defaults
  long double fdr_threshold = 1.00;
  int write_pvals = 0;
  int print_help = 0;
  int print_version = 0;
  string infilename = "";
  string infilePvals = "";
  string infileChromNames = "";
  string outfilename = "";
  int numEntries = 0;

  // Long-opt definitions
  static struct option long_options[] = {
    { "fdr_threshold", required_argument, 0, 'f' },
    { "num_entries", required_argument, 0, 'n' },
    { "write_pvals", no_argument, &write_pvals, 1 },
    { "input", required_argument, 0, 'i' },
    { "infileChromNames", required_argument, 0, 'c' },
    { "infilePvalData", required_argument, 0, 'p' },
    { "output", required_argument, 0, 'o' },
    { "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, "f:n:c:p:i:o:hvV", long_options, NULL)) != -1)
    {
      switch (c)
        {
        case 'f':
          ss << optarg;
          ss >> fdr_threshold;
          break;
        case 'n':
          numEntries = atoi(optarg);
          break;
        case 'i':
          infilename = optarg;
          break;
        case 'c':
          infileChromNames = optarg;
          break;
        case 'p':
          infilePvals = optarg;
          break;
	case 'o':
          outfilename = optarg;
          break;
        case 'h':
          print_help = 1;
          break;
        case 'v':
        case 'V':
          print_version = 1;
          break;
        // no short option needed for --write_pvals
        case 0:
          // long option received, do nothing
          break;
        default:
          print_help = 1;
        }
    }

  if (!print_help && !print_version && infileChromNames.empty())
    {
      cerr << "Error:  Required file containing mapping from integers to chromosome names was not supplied."
	   << endl << endl;
      print_help = 1;
    }
  
  if (!print_help && !print_version && infilePvals.empty())
    {
      cerr << "Error:  Required file containing scaled -log10(P) values and their occurrence counts was not supplied."
	   << endl << endl;
      print_help = 1;
    }
 
  // Print usage and exit if necessary
  if (print_help)
    {
      cerr << "Usage:  " << argv[0] << " [options] < in.PvalueData.txt > out.FDR.bed\n"
           << "\n"
           << "Options: \n"
           << "  -n, --num_entries=INT          The number of lines of input (required for optimization)\n"
           << "  -p, --inputPvalData=FILE       A file of scaled -log10(P) values and their occurrence counts\n"
	   << "  -c, --inputChromNames=FILE     A file containing the mapping from integers to chromosome names\n"
           << "  --write_pvals                  Output P-values in column 6 (P-values are not output by default)\n"
           << "  -f, --fdr_threshold=THRESHOLD  Do not output sites with FDR > THRESHOLD (1.00)\n"
           << "  -i, --input=FILE               A file to read input from (STDIN)\n"
           << "  -o, --output=FILE              A file to write output to (STDOUT)\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 .bed5 file with FDR in field 5\n"
           << "\tor, if --write_pvals is specified, a .bed6 file with P-values appended in field 6\n"
           << " input (via \"-i FILE\" or piped in from stdin) consists of many rows of values in 4 columns.\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;
        }
    }

  ifstream ifsChromNames(infileChromNames.c_str()), ifsPvals(infilePvals.c_str());
  if (!ifsChromNames)
    {
      cerr << "Error:  Unable to open file \"" << infileChromNames << "\" for read." << endl;
      return 1;
    }
  if (!ifsPvals)
    {
      cerr << "Error:  Unable to open file \"" << infilePvals << "\" for read." << endl;
      return 1;
    }

  map<int, string*> IntToChromNameMap;
  if (!buildIntToChromNameMap(ifsChromNames, IntToChromNameMap))
    return -1;

  vector<pair<int, long double> > PvalToFDRmapping;
  if (!buildFDRmapping(ifsPvals, PvalToFDRmapping))
    return -1;

  if (!parseAndProcessInput(IntToChromNameMap, PvalToFDRmapping, numEntries, fdr_threshold, write_pvals ? true : false))
    return -1;

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x890, %rsp            # imm = 0x890
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
fld1
fstpt -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x6e0(%rbp)
callq 0x2390
movq -0x6e0(%rbp), %rdx
leaq 0x76e3(%rip), %rsi      # 0xb334
leaq -0x50(%rbp), %rdi
callq 0x4f80
jmp 0x3c5c
leaq -0x51(%rbp), %rdi
callq 0x2250
leaq -0x89(%rbp), %rdi
movq %rdi, -0x6e8(%rbp)
callq 0x2390
movq -0x6e8(%rbp), %rdx
leaq 0x76ae(%rip), %rsi      # 0xb334
leaq -0x88(%rbp), %rdi
callq 0x4f80
jmp 0x3c94
leaq -0x89(%rbp), %rdi
callq 0x2250
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x6f0(%rbp)
callq 0x2390
movq -0x6f0(%rbp), %rdx
leaq 0x7673(%rip), %rsi      # 0xb334
leaq -0xb0(%rbp), %rdi
callq 0x4f80
jmp 0x3ccf
leaq -0xb1(%rbp), %rdi
callq 0x2250
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x6f8(%rbp)
callq 0x2390
movq -0x6f8(%rbp), %rdx
leaq 0x7638(%rip), %rsi      # 0xb334
leaq -0xd8(%rbp), %rdi
callq 0x4f80
jmp 0x3d0a
leaq -0xd9(%rbp), %rdi
callq 0x2250
movl $0x0, -0xe0(%rbp)
cmpb $0x0, 0xd649(%rip)      # 0x11370
jne 0x3efd
leaq 0xd63c(%rip), %rdi      # 0x11370
callq 0x23b0
cmpl $0x0, %eax
je 0x3efd
leaq 0x75ec(%rip), %rax      # 0xb335
movq %rax, 0xd4e0(%rip)      # 0x11230
movl $0x1, 0xd4de(%rip)      # 0x11238
movq $0x0, 0xd4db(%rip) # 0x11240
movl $0x66, 0xd4d9(%rip)     # 0x11248
leaq 0x75cd(%rip), %rax      # 0xb343
movq %rax, 0xd4d3(%rip)      # 0x11250
movl $0x1, 0xd4d1(%rip)      # 0x11258
movq $0x0, 0xd4ce(%rip) # 0x11260
movl $0x6e, 0xd4cc(%rip)     # 0x11268
leaq 0x75ac(%rip), %rax      # 0xb34f
movq %rax, 0xd4c6(%rip)      # 0x11270
movl $0x0, 0xd4c4(%rip)      # 0x11278
leaq -0x24(%rbp), %rax
movq %rax, 0xd4c1(%rip)      # 0x11280
movl $0x1, 0xd4bf(%rip)      # 0x11288
leaq 0x758b(%rip), %rax      # 0xb35b
movq %rax, 0xd4b9(%rip)      # 0x11290
movl $0x1, 0xd4b7(%rip)      # 0x11298
movq $0x0, 0xd4b4(%rip) # 0x112a0
movl $0x69, 0xd4b2(%rip)     # 0x112a8
leaq 0x7564(%rip), %rax      # 0xb361
movq %rax, 0xd4ac(%rip)      # 0x112b0
movl $0x1, 0xd4aa(%rip)      # 0x112b8
movq $0x0, 0xd4a7(%rip) # 0x112c0
movl $0x63, 0xd4a5(%rip)     # 0x112c8
leaq 0x7548(%rip), %rax      # 0xb372
movq %rax, 0xd49f(%rip)      # 0x112d0
movl $0x1, 0xd49d(%rip)      # 0x112d8
movq $0x0, 0xd49a(%rip) # 0x112e0
movl $0x70, 0xd498(%rip)     # 0x112e8
leaq 0x752a(%rip), %rax      # 0xb381
movq %rax, 0xd492(%rip)      # 0x112f0
movl $0x1, 0xd490(%rip)      # 0x112f8
movq $0x0, 0xd48d(%rip) # 0x11300
movl $0x6f, 0xd48b(%rip)     # 0x11308
leaq 0x7504(%rip), %rax      # 0xb388
movq %rax, 0xd485(%rip)      # 0x11310
movl $0x0, 0xd483(%rip)      # 0x11318
leaq -0x28(%rbp), %rax
movq %rax, 0xd480(%rip)      # 0x11320
movl $0x1, 0xd47e(%rip)      # 0x11328
leaq 0x74dc(%rip), %rax      # 0xb38d
movq %rax, 0xd478(%rip)      # 0x11330
movl $0x0, 0xd476(%rip)      # 0x11338
leaq -0x2c(%rbp), %rax
movq %rax, 0xd473(%rip)      # 0x11340
movl $0x1, 0xd471(%rip)      # 0x11348
leaq 0xd352(%rip), %rdi      # 0x11230
addq $0x120, %rdi            # imm = 0x120
xorl %esi, %esi
movl $0x20, %edx
callq 0x2110
leaq 0xd478(%rip), %rdi      # 0x11370
callq 0x2130
leaq -0x270(%rbp), %rdi
callq 0x2160
jmp 0x3f0b
jmp 0x3f0d
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x747a(%rip), %rdx      # 0xb395
leaq 0xd30e(%rip), %rcx      # 0x11230
xorl %eax, %eax
movl %eax, %r8d
callq 0x2340
movb %al, -0xe1(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x4152
movsbl -0xe1(%rbp), %eax
movl %eax, -0x6fc(%rbp)
testl %eax, %eax
je 0x4144
jmp 0x3f55
movl -0x6fc(%rbp), %eax
subl $0x56, %eax
je 0x413b
jmp 0x3f66
movl -0x6fc(%rbp), %eax
subl $0x63, %eax
je 0x40e4
jmp 0x3f77
movl -0x6fc(%rbp), %eax
subl $0x66, %eax
je 0x4073
jmp 0x3f88
movl -0x6fc(%rbp), %eax
subl $0x68, %eax
je 0x4132
jmp 0x3f99
movl -0x6fc(%rbp), %eax
subl $0x69, %eax
je 0x40cd
jmp 0x3faa
movl -0x6fc(%rbp), %eax
subl $0x6e, %eax
je 0x40b3
jmp 0x3fbb
movl -0x6fc(%rbp), %eax
subl $0x6f, %eax
je 0x4118
jmp 0x3fcc
movl -0x6fc(%rbp), %eax
subl $0x70, %eax
je 0x40fe
jmp 0x3fdd
movl -0x6fc(%rbp), %eax
subl $0x76, %eax
je 0x413b
jmp 0x4146
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x2250
jmp 0x4ae1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x89(%rbp), %rdi
callq 0x2250
jmp 0x4ad8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xb1(%rbp), %rdi
callq 0x2250
jmp 0x4acc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xd9(%rbp), %rdi
callq 0x2250
jmp 0x4ac0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x4ab4
leaq -0x260(%rbp), %rdi
movq 0xcf2f(%rip), %rax      # 0x10fb0
movq (%rax), %rsi
callq 0x21e0
jmp 0x408b
leaq -0x270(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x2060
jmp 0x409d
jmp 0x414d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x4aa8
movq 0xcef6(%rip), %rax      # 0x10fb0
movq (%rax), %rdi
callq 0x2300
movl %eax, -0xe0(%rbp)
jmp 0x414d
movq 0xcedc(%rip), %rax      # 0x10fb0
movq (%rax), %rsi
leaq -0x50(%rbp), %rdi
callq 0x22c0
jmp 0x40e2
jmp 0x414d
movq 0xcec5(%rip), %rax      # 0x10fb0
movq (%rax), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x22c0
jmp 0x40fc
jmp 0x414d
movq 0xceab(%rip), %rax      # 0x10fb0
movq (%rax), %rsi
leaq -0x88(%rbp), %rdi
callq 0x22c0
jmp 0x4116
jmp 0x414d
movq 0xce91(%rip), %rax      # 0x10fb0
movq (%rax), %rsi
leaq -0xd8(%rbp), %rdi
callq 0x22c0
jmp 0x4130
jmp 0x414d
movl $0x1, -0x28(%rbp)
jmp 0x414d
movl $0x1, -0x2c(%rbp)
jmp 0x414d
jmp 0x414d
movl $0x1, -0x28(%rbp)
jmp 0x3f0d
cmpl $0x0, -0x28(%rbp)
jne 0x41c4
cmpl $0x0, -0x2c(%rbp)
jne 0x41c4
leaq -0xb0(%rbp), %rdi
callq 0x2350
testb $0x1, %al
jne 0x4170
jmp 0x41c4
movq 0xce79(%rip), %rdi      # 0x10ff0
leaq 0x7227(%rip), %rsi      # 0xb3a5
callq 0x21e0
movq %rax, -0x708(%rbp)
jmp 0x418c
movq -0x708(%rbp), %rdi
movq 0xce0e(%rip), %rsi      # 0x10fa8
callq 0x2220
movq %rax, -0x710(%rbp)
jmp 0x41a8
movq -0x710(%rbp), %rdi
movq 0xcdf2(%rip), %rsi      # 0x10fa8
callq 0x2220
jmp 0x41bd
movl $0x1, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x4236
cmpl $0x0, -0x2c(%rbp)
jne 0x4236
leaq -0x88(%rbp), %rdi
callq 0x2350
testb $0x1, %al
jne 0x41e2
jmp 0x4236
movq 0xce07(%rip), %rdi      # 0x10ff0
leaq 0x7212(%rip), %rsi      # 0xb402
callq 0x21e0
movq %rax, -0x718(%rbp)
jmp 0x41fe
movq -0x718(%rbp), %rdi
movq 0xcd9c(%rip), %rsi      # 0x10fa8
callq 0x2220
movq %rax, -0x720(%rbp)
jmp 0x421a
movq -0x720(%rbp), %rdi
movq 0xcd80(%rip), %rsi      # 0x10fa8
callq 0x2220
jmp 0x422f
movl $0x1, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x447f
movq 0xcda9(%rip), %rdi      # 0x10ff0
leaq 0x721b(%rip), %rsi      # 0xb469
callq 0x21e0
movq %rax, -0x728(%rbp)
jmp 0x425c
movq -0x728(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x21e0
movq %rax, -0x730(%rbp)
jmp 0x4278
movq -0x730(%rbp), %rdi
leaq 0x71ec(%rip), %rsi      # 0xb472
callq 0x21e0
movq %rax, -0x738(%rbp)
jmp 0x4294
movq -0x738(%rbp), %rdi
leaq 0x7207(%rip), %rsi      # 0xb4a9
callq 0x21e0
movq %rax, -0x740(%rbp)
jmp 0x42b0
movq -0x740(%rbp), %rdi
leaq 0x71e2(%rip), %rsi      # 0xb4a0
callq 0x21e0
movq %rax, -0x748(%rbp)
jmp 0x42cc
movq -0x748(%rbp), %rdi
leaq 0x71d1(%rip), %rsi      # 0xb4ab
callq 0x21e0
movq %rax, -0x750(%rbp)
jmp 0x42e8
movq -0x750(%rbp), %rdi
leaq 0x7210(%rip), %rsi      # 0xb506
callq 0x21e0
movq %rax, -0x758(%rbp)
jmp 0x4304
movq -0x758(%rbp), %rdi
leaq 0x7254(%rip), %rsi      # 0xb566
callq 0x21e0
movq %rax, -0x760(%rbp)
jmp 0x4320
movq -0x760(%rbp), %rdi
leaq 0x729a(%rip), %rsi      # 0xb5c8
callq 0x21e0
movq %rax, -0x768(%rbp)
jmp 0x433c
movq -0x768(%rbp), %rdi
leaq 0x72e1(%rip), %rsi      # 0xb62b
callq 0x21e0
movq %rax, -0x770(%rbp)
jmp 0x4358
movq -0x770(%rbp), %rdi
leaq 0x7317(%rip), %rsi      # 0xb67d
callq 0x21e0
movq %rax, -0x778(%rbp)
jmp 0x4374
movq -0x778(%rbp), %rdi
leaq 0x733f(%rip), %rsi      # 0xb6c1
callq 0x21e0
movq %rax, -0x780(%rbp)
jmp 0x4390
movq -0x780(%rbp), %rdi
leaq 0x7368(%rip), %rsi      # 0xb706
callq 0x21e0
movq %rax, -0x788(%rbp)
jmp 0x43ac
movq -0x788(%rbp), %rdi
leaq 0x7395(%rip), %rsi      # 0xb74f
callq 0x21e0
movq %rax, -0x790(%rbp)
jmp 0x43c8
movq -0x790(%rbp), %rdi
leaq 0x70d3(%rip), %rsi      # 0xb4a9
callq 0x21e0
movq %rax, -0x798(%rbp)
jmp 0x43e4
movq -0x798(%rbp), %rdi
leaq 0x7399(%rip), %rsi      # 0xb78b
callq 0x21e0
movq %rax, -0x7a0(%rbp)
jmp 0x4400
movq -0x7a0(%rbp), %rdi
leaq 0x73c0(%rip), %rsi      # 0xb7ce
callq 0x21e0
movq %rax, -0x7a8(%rbp)
jmp 0x441c
movq -0x7a8(%rbp), %rdi
leaq 0x73f8(%rip), %rsi      # 0xb822
callq 0x21e0
movq %rax, -0x7b0(%rbp)
jmp 0x4438
movq -0x7b0(%rbp), %rdi
movq 0xcb62(%rip), %rsi      # 0x10fa8
callq 0x2220
movq %rax, -0x7b8(%rbp)
jmp 0x4454
movq -0x7b8(%rbp), %rdi
movq 0xcb46(%rip), %rsi      # 0x10fa8
callq 0x2220
jmp 0x4469
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x274(%rbp)
jmp 0x4a63
cmpl $0x0, -0x2c(%rbp)
je 0x453a
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq 0xcb31(%rip), %rdi      # 0x10fc8
callq 0x21e0
movq %rax, -0x7c0(%rbp)
jmp 0x44a5
movq -0x7c0(%rbp), %rdi
leaq 0x73cc(%rip), %rsi      # 0xb87f
callq 0x21e0
movq %rax, -0x7c8(%rbp)
jmp 0x44c1
movq -0x7c8(%rbp), %rdi
movl $0x2, %esi
callq 0x2370
movq %rax, -0x7d0(%rbp)
jmp 0x44db
movq -0x7d0(%rbp), %rdi
movl $0x2e, %esi
callq 0x2290
movq %rax, -0x7d8(%rbp)
jmp 0x44f5
movq -0x7d8(%rbp), %rdi
movl $0x1, %esi
callq 0x2370
movq %rax, -0x7e0(%rbp)
jmp 0x450f
movq -0x7e0(%rbp), %rdi
movq 0xca8b(%rip), %rsi      # 0x10fa8
callq 0x2220
jmp 0x4524
movl $0x0, -0x4(%rbp)
movl $0x1, -0x274(%rbp)
jmp 0x4a63
xorl %edi, %edi
callq 0x20d0
jmp 0x4543
leaq -0x50(%rbp), %rdi
callq 0x2350
testb $0x1, %al
jne 0x4615
leaq 0x732e(%rip), %rsi      # 0xb889
leaq -0x50(%rbp), %rdi
callq 0x5570
movb %al, -0x7e1(%rbp)
jmp 0x456c
movb -0x7e1(%rbp), %al
testb $0x1, %al
jne 0x457b
jmp 0x4615
leaq -0x50(%rbp), %rdi
callq 0x20c0
movq %rax, %rdi
movq 0xca32(%rip), %rax      # 0x10fc0
movq (%rax), %rdx
leaq 0x72f3(%rip), %rsi      # 0xb88b
callq 0x2240
movq %rax, -0x7f0(%rbp)
jmp 0x45a6
movq -0x7f0(%rbp), %rax
cmpq $0x0, %rax
jne 0x4613
movq 0xca36(%rip), %rdi      # 0x10ff0
leaq 0x72cc(%rip), %rsi      # 0xb88d
callq 0x21e0
movq %rax, -0x7f8(%rbp)
jmp 0x45cf
movq -0x7f8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x21d0
movq %rax, -0x800(%rbp)
jmp 0x45e8
movq -0x800(%rbp), %rdi
movq 0xc9b2(%rip), %rsi      # 0x10fa8
callq 0x2220
jmp 0x45fd
movl $0x1, -0x4(%rbp)
movl $0x1, -0x274(%rbp)
jmp 0x4a63
jmp 0x4615
leaq -0xd8(%rbp), %rdi
callq 0x2350
testb $0x1, %al
jne 0x470f
leaq 0x7259(%rip), %rsi      # 0xb889
leaq -0xd8(%rbp), %rdi
callq 0x5570
movb %al, -0x801(%rbp)
jmp 0x4644
movb -0x801(%rbp), %al
testb $0x1, %al
jne 0x4653
jmp 0x470f
leaq -0xd8(%rbp), %rdi
callq 0x20c0
movq %rax, %rdi
movq 0xc92f(%rip), %rax      # 0x10f98
movq (%rax), %rdx
leaq 0x723b(%rip), %rsi      # 0xb8ae
callq 0x2240
movq %rax, -0x810(%rbp)
jmp 0x4681
movq -0x810(%rbp), %rax
cmpq $0x0, %rax
jne 0x470d
movq 0xc95b(%rip), %rdi      # 0x10ff0
leaq 0x7214(%rip), %rsi      # 0xb8b0
callq 0x21e0
movq %rax, -0x818(%rbp)
jmp 0x46aa
movq -0x818(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x21d0
movq %rax, -0x820(%rbp)
jmp 0x46c6
movq -0x820(%rbp), %rdi
leaq 0x71fe(%rip), %rsi      # 0xb8d2
callq 0x21e0
movq %rax, -0x828(%rbp)
jmp 0x46e2
movq -0x828(%rbp), %rdi
movq 0xc8b8(%rip), %rsi      # 0x10fa8
callq 0x2220
jmp 0x46f7
movl $0x1, -0x4(%rbp)
movl $0x1, -0x274(%rbp)
jmp 0x4a63
jmp 0x470f
leaq -0xb0(%rbp), %rdi
callq 0x20c0
movq %rax, %rsi
leaq -0x480(%rbp), %rdi
movl $0x8, %edx
callq 0x23c0
jmp 0x4731
leaq -0x88(%rbp), %rdi
callq 0x20c0
movq %rax, %rsi
leaq -0x688(%rbp), %rdi
movl $0x8, %edx
callq 0x23c0
jmp 0x4753
movq -0x480(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x480(%rbp,%rax), %rdi
callq 0x20f0
movb %al, -0x829(%rbp)
jmp 0x4773
movb -0x829(%rbp), %al
testb $0x1, %al
jne 0x4782
jmp 0x4823
movq 0xc867(%rip), %rdi      # 0x10ff0
leaq 0x714f(%rip), %rsi      # 0xb8df
callq 0x21e0
movq %rax, -0x838(%rbp)
jmp 0x479e
movq -0x838(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x21d0
movq %rax, -0x840(%rbp)
jmp 0x47ba
movq -0x840(%rbp), %rdi
leaq 0x7135(%rip), %rsi      # 0xb8fd
callq 0x21e0
movq %rax, -0x848(%rbp)
jmp 0x47d6
movq -0x848(%rbp), %rdi
movq 0xc7c4(%rip), %rsi      # 0x10fa8
callq 0x2220
jmp 0x47eb
movl $0x1, -0x4(%rbp)
movl $0x1, -0x274(%rbp)
jmp 0x4a2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x4a55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x4a49
movq -0x688(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x688(%rbp,%rax), %rdi
callq 0x20f0
movb %al, -0x849(%rbp)
jmp 0x4843
movb -0x849(%rbp), %al
testb $0x1, %al
jne 0x484f
jmp 0x48ce
movq 0xc79a(%rip), %rdi      # 0x10ff0
leaq 0x7082(%rip), %rsi      # 0xb8df
callq 0x21e0
movq %rax, -0x858(%rbp)
jmp 0x486b
movq -0x858(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x21d0
movq %rax, -0x860(%rbp)
jmp 0x4887
movq -0x860(%rbp), %rdi
leaq 0x7068(%rip), %rsi      # 0xb8fd
callq 0x21e0
movq %rax, -0x868(%rbp)
jmp 0x48a3
movq -0x868(%rbp), %rdi
movq 0xc6f7(%rip), %rsi      # 0x10fa8
callq 0x2220
jmp 0x48b8
movl $0x1, -0x4(%rbp)
movl $0x1, -0x274(%rbp)
jmp 0x4a2f
leaq -0x6b8(%rbp), %rdi
movq %rdi, -0x878(%rbp)
callq 0x55a0
movq -0x878(%rbp), %rsi
leaq -0x480(%rbp), %rdi
callq 0x2d10
movb %al, -0x869(%rbp)
jmp 0x48fc
movb -0x869(%rbp), %al
testb $0x1, %al
jne 0x492f
jmp 0x4908
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x274(%rbp)
jmp 0x4a13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x4a21
leaq -0x6d0(%rbp), %rdi
movq %rdi, -0x888(%rbp)
callq 0x55c0
movq -0x888(%rbp), %rsi
leaq -0x688(%rbp), %rdi
callq 0x25a0
movb %al, -0x879(%rbp)
jmp 0x495d
movb -0x879(%rbp), %al
testb $0x1, %al
jne 0x499c
jmp 0x4969
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x274(%rbp)
jmp 0x4a07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x6d0(%rbp), %rdi
callq 0x55e0
jmp 0x4a21
movl -0x24(%rbp), %eax
testl %eax, %eax
setne -0x6d1(%rbp)
leaq -0x6b8(%rbp), %rdi
leaq -0x6d0(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
leaq -0x20(%rbp), %rcx
leaq -0x6d1(%rbp), %r8
callq 0x3050
movb %al, -0x889(%rbp)
jmp 0x49d5
movb -0x889(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x49e3
jmp 0x49f6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x274(%rbp)
jmp 0x4a07
movl $0x0, -0x4(%rbp)
movl $0x1, -0x274(%rbp)
leaq -0x6d0(%rbp), %rdi
callq 0x55e0
leaq -0x6b8(%rbp), %rdi
callq 0x5640
jmp 0x4a2f
leaq -0x6b8(%rbp), %rdi
callq 0x5640
jmp 0x4a49
leaq -0x688(%rbp), %rdi
callq 0x2050
leaq -0x480(%rbp), %rdi
callq 0x2050
jmp 0x4a63
leaq -0x688(%rbp), %rdi
callq 0x2050
leaq -0x480(%rbp), %rdi
callq 0x2050
jmp 0x4aa8
leaq -0x270(%rbp), %rdi
callq 0x2180
leaq -0xd8(%rbp), %rdi
callq 0x2120
leaq -0xb0(%rbp), %rdi
callq 0x2120
leaq -0x88(%rbp), %rdi
callq 0x2120
leaq -0x50(%rbp), %rdi
callq 0x2120
movl -0x4(%rbp), %eax
addq $0x890, %rsp            # imm = 0x890
popq %rbp
retq
leaq -0x270(%rbp), %rdi
callq 0x2180
leaq -0xd8(%rbp), %rdi
callq 0x2120
leaq -0xb0(%rbp), %rdi
callq 0x2120
leaq -0x88(%rbp), %rdi
callq 0x2120
leaq -0x50(%rbp), %rdi
callq 0x2120
movq -0x60(%rbp), %rdi
callq 0x2380
nopw (%rax,%rax)