// File: /workspace/github_cpp_makefile_star2_O1/adamnovak[P]rlcsa/rlcsa_test.cpp
// Function: main
int main(int argc, char** argv)
{
  std::cout << "RLCSA test" << std::endl;
  std::cout << std::endl;

  bool adaptive = false, direct = false, locate = false, pizza = false, count_steps = false;
  bool use_sa = false;
  bool listing = false, rle = false;
  usint ignore = 0, generate = 0;
  bool ignore_tab = false;
  bool write = false, write_patterns = false, sort_patterns = false;
  char* base_name = 0;
  char* patterns_name = 0;
  #ifdef MULTITHREAD_SUPPORT
  sint threads = 1;
  #endif
  for(int i = 1; i < argc; i++)
  {
    if(argv[i][0] == '-')
    {
      switch(argv[i][1])
      {
        case 'a':
          adaptive = true; break;
        case 'd':
          direct = true; break;
        case 'g':
          generate = atoi(argv[i] + 2); break;
        case 'i':
          if(argv[i][2] == 't') { ignore = 1; ignore_tab = true; }
          else                  { ignore = atoi(argv[i] + 2); }
          break;
        case 'l':
          locate = true; break;
        case 'L':
          listing = true; break;
        case 'o':
          sort_patterns = true; break;
        case 'p':
          pizza = true; break;
        case 'r':
          rle = true; break;
        case 'S':
          use_sa = true; break;
        case 's':
          count_steps = true; break;
        case 'W':
          write_patterns = true; break;
        case 'w':
          write = true; break;
        default:
          std::cout << "Invalid option: " << argv[i] << std::endl << std::endl;
          printUsage();
          return 1;
      }
    }
    else if(base_name == 0)
    {
      base_name = argv[i];
    }
    else if(patterns_name == 0)
    {
      patterns_name = argv[i];
    }
    #ifdef MULTITHREAD_SUPPORT
    else
    {
      threads = std::min(MAX_THREADS, std::max(atoi(argv[i]), 1));
    }
    #endif
  }
  if(base_name == 0) { printUsage(); return 2; }

  std::cout << "Options:";
  if(generate > 0) { std::cout << " generate=" << generate; }
  if(ignore_tab) { std::cout << " ignore=tab"; }
  else if(ignore > 0) { std::cout << " ignore=" << ignore; }
  if(use_sa) { adaptive = direct = count_steps = listing = false; }
  if(listing)
  {
    locate = adaptive = count_steps = write = false;
    std::cout << " listing";
    if(direct || rle)
    {
      std::cout << "(";
      if(direct)      { std::cout << " direct"; }
      if(rle)         { std::cout << " rle"; }
      if(count_steps) { std::cout << " steps"; write = false; }
      std::cout << " )";
    }
  }
  else if(locate)
  {
    rle = sort_patterns = false;
    std::cout << " locate";
    if(adaptive || direct || count_steps)
    {
      std::cout << "(";
      if(adaptive)    { std::cout << " adaptive"; direct = true; }
      if(direct)      { std::cout << " direct"; }
      if(count_steps) { std::cout << " steps"; write = false; }
      std::cout << " )";
    }
  }
  else { adaptive = direct = count_steps = write = rle = sort_patterns = false; }
  if(sort_patterns) { std::cout << " sort_patterns"; }
  if(pizza) { std::cout << " pizza"; }
  if(use_sa) { std::cout << " sa"; }
  if(write_patterns) { std::cout << " write_patterns"; }
  if(write) { std::cout << " write"; }
  std::cout << std::endl;
  std::cout << "Base name: " << base_name << std::endl;
  if(patterns_name != 0) { std::cout << "Patterns: " << patterns_name << std::endl; }
  #ifdef MULTITHREAD_SUPPORT
  std::cout << "Threads: " << threads << std::endl; 
  #endif
  std::cout << std::endl;


  const RLCSA* rlcsa = (use_sa ? 0 : new RLCSA(base_name, false));
  const SuffixArray* sa = (use_sa ? new SuffixArray(base_name, false) : 0);
  usint size = 0, text_size = 0;
  if(use_sa)
  {
    if(!sa->isOk())
    {
      delete rlcsa; rlcsa = 0;
      delete sa; sa = 0;
      return 3;
    }
    sa->reportSize(true);
    size = sa->getSize();
    text_size = size;
  }
  else
  {
    if(!rlcsa->isOk())
    {
      delete rlcsa; rlcsa = 0;
      delete sa; sa = 0;
      return 3;
    }
    rlcsa->printInfo();
    rlcsa->reportSize(true);
    size = rlcsa->getSize();
    text_size = rlcsa->getTextSize();
  }
  if(patterns_name == 0)
  {
    delete rlcsa; rlcsa = 0;
    delete sa; sa = 0;
    return 0;
  }

  AdaptiveSamples* adaptive_samples = 0;
  if(adaptive)
  {
    adaptive_samples = new AdaptiveSamples(*rlcsa, base_name);
    adaptive_samples->report();
    if(!adaptive_samples->isOk())
    {
      delete rlcsa; rlcsa = 0;
      delete sa; sa = 0;
      delete adaptive_samples; adaptive_samples = 0;
      return 4;
    }
  }

  DocArray* docarray = 0;
  if(listing)
  {
    if(direct)
    {
      docarray = new DocArray(*rlcsa);
    }
    else
    {
      docarray = new DocArray(*rlcsa, base_name);
      docarray->reportSize(true);
      if(!docarray->isOk() || !docarray->hasGrammar())
      {
        delete rlcsa; rlcsa = 0;
        delete sa; sa = 0;
        delete adaptive_samples; adaptive_samples = 0;
        delete docarray; docarray = 0;
        return 5;
      }
    }
  }

  std::ifstream pattern_file(patterns_name, std::ios_base::binary);
  if(!pattern_file)
  {
    std::cerr << "Error opening pattern file!" << std::endl;
    delete rlcsa; rlcsa = 0;
    delete sa; sa = 0;
    delete adaptive_samples; adaptive_samples = 0;
    return 6;
  }
  std::vector<std::string> rows;
  if(!pizza) { readRows(pattern_file, rows, true); }
  else       { readPizzaChili(pattern_file, rows); }
  pattern_file.close();
  if(rows.size() == 0)
  {
    std::cerr << "No patterns found!" << std::endl;
    delete rlcsa; rlcsa = 0;
    delete sa; sa = 0;
    delete adaptive_samples; adaptive_samples = 0;
    return 7;
  }
  std::vector<Pattern> patterns;
  createPatterns(rows, patterns, ignore_tab, ignore);
  rows.clear();


  // Generate random patterns according to weights.
  if(generate > 0)
  {
    DeltaEncoder encoder(2 * sizeof(usint));
    usint sum = 0;
    for(std::vector<Pattern>::iterator iter = patterns.begin(); iter != patterns.end(); ++iter)
    {
      encoder.addBit(sum);
      sum += iter->weight;
    }
    encoder.flush();
    DeltaVector vector(encoder, sum);

    std::vector<Pattern> new_patterns; new_patterns.reserve(generate);
    DeltaVector::Iterator viter(vector);
    srand(0xDEADBEEF);  // FIXME random seed
    for(usint i = 0; i < generate; i++)
    {
      usint tmp = viter.rank(rand() % sum);
      new_patterns.push_back(patterns[tmp - 1]);
    }
    patterns.clear();
    patterns.assign(new_patterns.begin(), new_patterns.end());
    new_patterns.clear();
    std::cout << "Generated " << patterns.size() << " patterns." << std::endl;
    std::cout << std::endl;
  }

  // Prepare weights for writing the number of occurrences.
  weight_type* totals = 0;
  if(write)
  {
    totals = new weight_type[text_size];
    for(usint i = 0; i < text_size; i++) { totals[i] = 0; }
  }


  // Actual work.
  #ifdef MULTITHREAD_SUPPORT
  omp_set_num_threads(threads);
  #endif
  double start = readTimer();

  #pragma omp parallel for schedule(dynamic, 1)
  for(usint i = 0; i < patterns.size(); i++)
  {
    patterns[i].range = (use_sa ? sa->count(patterns[i].pattern) : rlcsa->count(patterns[i].pattern));

    if(locate && patterns[i].found())
    {
      usint* matches = 0;
      uint* sa_matches = 0;
      if(adaptive)    { matches = adaptive_samples->locate(patterns[i].range, count_steps); }
      else if(use_sa) { sa_matches = sa->locate(patterns[i].range); }
      else            { matches = rlcsa->locate(patterns[i].range, direct, count_steps); }
      if(count_steps)
      {
        patterns[i].steps = 0;
        for(usint j = 0; j < patterns[i].occ(); j++)
        {
          patterns[i].steps += matches[j];
        }
      }

      if(write)
      {
        #pragma omp critical
        {
          if(use_sa) { for(usint j = 0; j < patterns[i].occ(); j++) { totals[sa_matches[j]] += patterns[i].weight; } }
          else       { for(usint j = 0; j < patterns[i].occ(); j++) { totals[matches[j]] += patterns[i].weight; } }
        }
      }
      delete[] sa_matches; sa_matches = 0;
      delete[] matches; matches = 0;
    }
    if(listing && patterns[i].found())
    {
      if(rle)
      {
        std::vector<pair_type>* docs =
          (direct ? docarray->directListingRLE(patterns[i].range)
                  : docarray->listDocumentsRLE(patterns[i].range));
        if(docs != 0)
        {
          patterns[i].docc = 0;
          for(std::vector<pair_type>::iterator iter = docs->begin(); iter != docs->end(); ++iter)
          {
            patterns[i].docc += length(*iter);
          }
        }
        delete docs;
      }
      else
      {
        std::vector<usint>* docs =
          (direct ? docarray->directListing(patterns[i].range)
                  : docarray->listDocuments(patterns[i].range));
        if(docs != 0)
        {
          patterns[i].docc = docs->size();
          delete docs; docs = 0;
        }
      }
    }
  }

  double seconds = readTimer() - start;
  double megabytes = totalSize(patterns) / (double)MEGABYTE;


  // Report.
  std::cout << "Patterns:      " << patterns.size() << " (" << (patterns.size() / seconds) << " / sec)" << std::endl;
  std::cout << "Total size:    " << megabytes << " MB";
  if(!locate)
  {
    std::cout << " (" << (megabytes / seconds) << " MB/s)";
  }
  std::cout << std::endl;

  usint total_occ = totalOcc(patterns), total_steps = totalSteps(patterns);
  std::cout << "Found:         " << totalFound(patterns) << std::endl;
  std::cout << "Occurrences:   " << total_occ;
  if(locate)
  {
    std::cout << " (" << (total_occ / seconds) << " / sec)";
    if(count_steps)
    {
      std::cout << std::endl
                << "Locate steps:  " << total_steps << " (" << (total_steps / (double)total_occ) << " / occurrence)";
    }
  }
  std::cout << std::endl;
  if(listing)
  {
    usint total_docc = totalDocc(patterns);
    std::cout << "Documents:     " << total_docc << " (" << (total_docc / seconds) << " / sec)" << std::endl;
  }
  std::cout << "Time:          " << seconds << " seconds" << std::endl;
  std::cout << std::endl;


  // Write.
  if(write)
  {
    std::string output_name(patterns_name); output_name += ".found";
    std::ofstream output(output_name.c_str(), std::ios_base::binary);
    if(!output)
    {
      std::cerr << "Cannot open output file (" << output_name << ")!" << std::endl;
    }
    else
    {
      output.write((char*)totals, text_size * sizeof(weight_type));
      output.close();
    }

    weight_type max_weight = 0, total_weight = 0;
    for(usint i = 0; i < size; i++) 
    {
      max_weight = std::max(max_weight, totals[i]);
      total_weight += totals[i];
    }
    std::cout << "Weights:       " << max_weight << " (max), " 
              << (((double)total_weight) / size) << " (average)" << std::endl;
    std::cout << std::endl;
  }

  if(write_patterns)
  {
    printPatterns(patterns, std::string(patterns_name) + ".selected");
    printPatterns(patterns, std::string(patterns_name) + ".found", true);
  }
  if(sort_patterns)
  {
    sequentialSort(patterns.begin(), patterns.end(), pod_comparator);
    printPatterns(patterns, std::string(patterns_name) + ".sorted", true);
  }

  // Cleanup.

  if(adaptive) { adaptive_samples->report(); }
  delete rlcsa; rlcsa = 0;
  delete sa; sa = 0;
  delete adaptive_samples; adaptive_samples = 0;
  delete docarray; docarray = 0;
  delete[] totals; totals = 0;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5e8, %rsp            # imm = 0x5E8
movq %rsi, %r14
movl %edi, %ebx
movq 0x27bd7(%rip), %r15     # 0x2cfd0
leaq 0x1cd8a(%rip), %rsi     # 0x2218a
movl $0xa, %edx
movq %r15, %rdi
callq 0x32e0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3270
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3270
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
cmpl $0x2, %ebx
setge %r12b
jl 0x567b
movl %ebx, %ebp
movl $0x1, %r8d
subq %rbp, %r8
movq $0x0, 0x38(%rsp)
movl $0x2, %r15d
leaq 0x1cbb7(%rip), %rdx     # 0x22040
movq $0x0, 0x8(%rsp)
movq $0x0, 0x68(%rsp)
movq $0x0, 0x78(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, (%rsp)
movq $0x0, 0x88(%rsp)
movq $0x0, 0x60(%rsp)
movl $0x0, 0x70(%rsp)
movl $0x0, 0x14(%rsp)
movq $0x0, 0x98(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0xa0(%rsp)
movq $0x0, 0x80(%rsp)
xorl %ecx, %ecx
movq $0x0, 0x58(%rsp)
movq -0x8(%r14,%r15,8), %rdi
cmpb $0x2d, (%rdi)
jne 0x5543
movzbl 0x1(%rdi), %eax
cmpl $0x60, %eax
jle 0x557a
addl $-0x61, %eax
cmpl $0x16, %eax
ja 0x60b6
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movb $0x1, %al
movq %rax, 0x38(%rsp)
jmp 0x555e
testq %rcx, %rcx
je 0x555b
movq 0x58(%rsp), %rax
testq %rax, %rax
cmoveq %rdi, %rax
movq %rax, 0x58(%rsp)
jmp 0x555e
movq %rdi, %rcx
cmpq %rbp, %r15
setb %r12b
leaq (%r8,%r15), %rax
incq %rax
incq %r15
cmpq $0x2, %rax
jne 0x5512
jmp 0x5706
cmpl $0x4c, %eax
je 0x5637
cmpl $0x53, %eax
je 0x5646
cmpl $0x57, %eax
jne 0x60b6
movb $0x1, %al
movq %rax, 0xa0(%rsp)
jmp 0x555e
movb $0x1, %al
movq %rax, 0x80(%rsp)
jmp 0x555e
movb $0x1, %al
movq %rax, 0x78(%rsp)
jmp 0x555e
movb $0x1, %al
movq %rax, 0x60(%rsp)
jmp 0x555e
cmpb $0x74, 0x2(%rdi)
jne 0x5651
movl $0x1, 0x70(%rsp)
movb $0x1, %al
movq %rax, 0x98(%rsp)
jmp 0x555e
movb $0x1, %al
movq %rax, 0x68(%rsp)
jmp 0x555e
movb $0x1, %al
movq %rax, 0x40(%rsp)
jmp 0x555e
movb $0x1, %al
movq %rax, 0x8(%rsp)
jmp 0x555e
addq $0x2, %rdi
movq %rcx, %r12
movq %r14, %rbx
movq %rdx, %r14
movq %r8, %r13
callq 0x33e0
movq %r13, %r8
movq %r14, %rdx
movq %rbx, %r14
movq %r12, %rcx
movl %eax, 0x14(%rsp)
jmp 0x555e
movb $0x1, %al
movq %rax, 0x50(%rsp)
jmp 0x555e
movb $0x1, %al
movq %rax, 0x88(%rsp)
jmp 0x555e
movb $0x1, %al
movq %rax, (%rsp)
jmp 0x555e
addq $0x2, %rdi
movq %rcx, %r12
movq %r14, %r13
movq %rdx, %r14
movq %r8, %rbx
callq 0x33e0
movq %rbx, %r8
movq %r14, %rdx
movq %r13, %r14
movq %r12, %rcx
movl %eax, 0x70(%rsp)
jmp 0x555e
xorl %ebp, %ebp
xorl %ecx, %ecx
movq $0x0, 0x80(%rsp)
movq $0x0, 0xa0(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x98(%rsp)
xorl %r13d, %r13d
movl $0x0, 0x70(%rsp)
movq $0x0, 0x60(%rsp)
movq $0x0, 0x88(%rsp)
movq $0x0, (%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0x78(%rsp)
movq $0x0, 0x68(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x38(%rsp)
xorl %r15d, %r15d
jmp 0x5713
xorl %r15d, %r15d
movq 0x58(%rsp), %rbp
movl 0x14(%rsp), %r13d
testb $0x1, %r12b
jne 0x7189
testq %rcx, %rcx
je 0x5794
movq %rcx, %r12
movq 0x278a4(%rip), %r14     # 0x2cfd0
leaq 0x1ca73(%rip), %rsi     # 0x221a6
movl $0x8, %edx
movq %r14, %rdi
callq 0x32e0
testl %r13d, %r13d
je 0x576b
movq 0x27884(%rip), %r15     # 0x2cfd0
leaq 0x1ca5c(%rip), %rsi     # 0x221af
movl $0xa, %edx
movq %r15, %rdi
callq 0x32e0
movl %r13d, %esi
movq %r15, %rdi
callq 0x31a0
testb $0x1, 0x98(%rsp)
movq 0x50(%rsp), %rbx
je 0x57a4
movq 0x2784f(%rip), %rdi     # 0x2cfd0
leaq 0x1ca32(%rip), %rsi     # 0x221ba
movl $0xb, %edx
callq 0x32e0
jmp 0x57d2
callq 0x7400
movl $0x2, %r15d
jmp 0x7189
cmpl $0x0, 0x70(%rsp)
je 0x57d2
movq 0x2781e(%rip), %r15     # 0x2cfd0
leaq 0x1ca0d(%rip), %rsi     # 0x221c6
movl $0x8, %edx
movq %r15, %rdi
callq 0x32e0
movl 0x70(%rsp), %esi
movq %r15, %rdi
callq 0x31a0
testb $0x1, (%rsp)
je 0x57f8
movq $0x0, 0x88(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x8(%rsp)
movq $0x0, 0x38(%rsp)
testb $0x1, 0x88(%rsp)
je 0x5854
movq 0x277c7(%rip), %rdi     # 0x2cfd0
leaq 0x1c9bf(%rip), %rsi     # 0x221cf
movl $0x8, %edx
callq 0x32e0
testb $0x1, 0x8(%rsp)
je 0x58b8
movq 0x277a4(%rip), %r15     # 0x2cfd0
leaq 0x1d610(%rip), %rsi     # 0x22e43
movl $0x1, %edx
movq %r15, %rdi
callq 0x32e0
leaq 0x1c991(%rip), %rsi     # 0x221d8
movl $0x7, %edx
movq %r15, %rdi
jmp 0x58d6
testb $0x1, 0x68(%rsp)
je 0x591c
movq 0x2776a(%rip), %rdi     # 0x2cfd0
leaq 0x1c982(%rip), %rsi     # 0x221ef
movl $0x7, %edx
callq 0x32e0
testb $0x1, 0x38(%rsp)
je 0x594a
movq 0x27747(%rip), %r15     # 0x2cfd0
leaq 0x1d5b3(%rip), %rsi     # 0x22e43
movl $0x1, %edx
movq %r15, %rdi
callq 0x32e0
leaq 0x1c953(%rip), %rsi     # 0x221f7
movl $0x9, %edx
movq %r15, %rdi
callq 0x32e0
movb $0x1, %al
jmp 0x5977
testb $0x1, 0x60(%rsp)
je 0x59cc
movq 0x27706(%rip), %rdi     # 0x2cfd0
leaq 0x1d572(%rip), %rsi     # 0x22e43
movl $0x1, %edx
callq 0x32e0
testb $0x1, 0x60(%rsp)
je 0x58fa
movq 0x276e7(%rip), %rdi     # 0x2cfd0
leaq 0x1c8f0(%rip), %rsi     # 0x221e0
movl $0x4, %edx
callq 0x32e0
movq $0x0, 0x40(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x68(%rsp)
movq $0x0, 0x38(%rsp)
jmp 0x5a00
movq $0x0, 0x80(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x60(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x8(%rsp)
jmp 0x59e0
testb $0x1, 0x8(%rsp)
jne 0x595a
testb $0x1, %bl
je 0x61ee
movq 0x2766f(%rip), %rdi     # 0x2cfd0
leaq 0x1d4db(%rip), %rsi     # 0x22e43
movl $0x1, %edx
callq 0x32e0
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
testb $0x1, %al
je 0x5998
movq 0x27649(%rip), %rdi     # 0x2cfd0
leaq 0x1c84a(%rip), %rsi     # 0x221d8
movl $0x7, %edx
callq 0x32e0
testb $0x1, %bl
je 0x59eb
movq 0x2762c(%rip), %rdi     # 0x2cfd0
leaq 0x1c83a(%rip), %rsi     # 0x221e5
movl $0x6, %edx
callq 0x32e0
movq $0x0, 0x80(%rsp)
movq $0x0, 0x40(%rsp)
jmp 0x59f7
movq $0x0, 0x40(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x68(%rsp)
movq $0x0, 0x38(%rsp)
jmp 0x5a18
movq $0x0, 0x80(%rsp)
movq $0x0, 0x60(%rsp)
movq 0x275c9(%rip), %rdi     # 0x2cfd0
leaq 0x1c7de(%rip), %rsi     # 0x221ec
movl $0x2, %edx
callq 0x32e0
testb $0x1, 0x80(%rsp)
je 0x5a3a
movq 0x275a7(%rip), %rdi     # 0x2cfd0
leaq 0x1c7d1(%rip), %rsi     # 0x22201
movl $0xe, %edx
callq 0x32e0
testb $0x1, 0x78(%rsp)
je 0x5a59
movq 0x27588(%rip), %rdi     # 0x2cfd0
leaq 0x1c7c1(%rip), %rsi     # 0x22210
movl $0x6, %edx
callq 0x32e0
testb $0x1, (%rsp)
je 0x5a77
movq 0x2756a(%rip), %rdi     # 0x2cfd0
leaq 0x1c7aa(%rip), %rsi     # 0x22217
movl $0x3, %edx
callq 0x32e0
testb $0x1, 0xa0(%rsp)
je 0x5a99
movq 0x27548(%rip), %rdi     # 0x2cfd0
leaq 0x1c78c(%rip), %rsi     # 0x2221b
movl $0xf, %edx
callq 0x32e0
movq %rbx, 0x50(%rsp)
testb $0x1, 0x40(%rsp)
je 0x5abd
movq 0x27524(%rip), %rdi     # 0x2cfd0
leaq 0x1c778(%rip), %rsi     # 0x2222b
movl $0x6, %edx
callq 0x32e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3270
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
leaq 0x1c747(%rip), %rsi     # 0x22232
movl $0xb, %edx
movq %r14, %rdi
callq 0x32e0
movq %r12, %rdi
callq 0x3110
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x32e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3270
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
testq %rbp, %rbp
je 0x5b8b
leaq 0x1c6fd(%rip), %rsi     # 0x2223e
movl $0xa, %edx
movq %r14, %rdi
callq 0x32e0
movq %rbp, %rdi
callq 0x3110
movq %r14, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x32e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3270
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3270
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
testb $0x1, (%rsp)
je 0x5bbd
xorl %r15d, %r15d
jmp 0x5bf4
movl $0x830, %edi            # imm = 0x830
callq 0x3290
movq %rax, %r15
leaq 0x178(%rsp), %rdi
leaq 0x97(%rsp), %rdx
movq %r12, %rsi
callq 0x7b82
leaq 0x178(%rsp), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x97c4
testb $0x1, (%rsp)
je 0x5c38
movl $0x30, %edi
callq 0x3290
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
leaq 0x96(%rsp), %rdx
movq %r12, %rsi
movq %rax, 0x18(%rsp)
callq 0x7b82
leaq 0x158(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x12d48
jmp 0x5c62
leaq 0x188(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5c59
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x32a0
movq $0x0, 0x18(%rsp)
testb $0x1, (%rsp)
je 0x5cb6
leaq 0x168(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5c89
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x18(%rsp), %rbx
cmpb $0x0, (%rbx)
je 0x5dcf
movl %r13d, 0x14(%rsp)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1391c
movl 0x28(%rbx), %r14d
subl 0x2c(%rbx), %r14d
movl %r14d, %r13d
jmp 0x5ce8
cmpb $0x0, (%r15)
je 0x5e0e
movl %r13d, 0x14(%rsp)
movq %r15, %rdi
callq 0xcd3c
movq %r15, %rdi
movl $0x1, %esi
callq 0xca94
movl 0x4(%r15), %r14d
movq 0x828(%r15), %rax
movl (%rax), %r13d
testq %rbp, %rbp
je 0x5e2b
testb $0x1, 0x38(%rsp)
je 0x5e70
movl $0x60, %edi
callq 0x3290
movq %rax, %rbx
leaq 0x3e0(%rsp), %rdi
leaq 0x1e0(%rsp), %rdx
movq %r12, %rsi
movq %rax, 0x48(%rsp)
callq 0x7b82
leaq 0x3e0(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x13b50
leaq 0x3f0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5d5a
movq 0x3f0(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x141e8
cmpb $0x0, 0x58(%rbx)
jne 0x5e79
testq %r15, %r15
je 0x5d8b
movq %r15, %rdi
callq 0xacac
movl $0x830, %esi            # imm = 0x830
movq %r15, %rdi
callq 0x32a0
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
je 0x5daa
movq %rbx, %rdi
callq 0x13264
movl $0x30, %esi
movq %rbx, %rdi
callq 0x32a0
movq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x140c0
movl $0x60, %esi
movq %rbx, %rdi
callq 0x32a0
movl $0x4, %r15d
jmp 0x7189
testq %r15, %r15
je 0x5de9
movq %r15, %rdi
callq 0xacac
movl $0x830, %esi            # imm = 0x830
movq %r15, %rdi
callq 0x32a0
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x13264
movl $0x30, %esi
movq %rbx, %rdi
callq 0x32a0
movl $0x3, %r15d
jmp 0x7189
movq %r15, %rdi
callq 0xacac
movl $0x830, %esi            # imm = 0x830
movq %r15, %rdi
callq 0x32a0
movl $0x3, %r15d
jmp 0x5e48
testq %r15, %r15
je 0x5e45
movq %r15, %rdi
callq 0xacac
movl $0x830, %esi            # imm = 0x830
movq %r15, %rdi
callq 0x32a0
xorl %r15d, %r15d
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
je 0x7189
movq %rbx, %rdi
callq 0x13264
movl $0x30, %esi
movq %rbx, %rdi
callq 0x32a0
jmp 0x7189
movq $0x0, 0x48(%rsp)
movl %r13d, 0x90(%rsp)
movl %r14d, 0xac(%rsp)
testb $0x1, 0x88(%rsp)
je 0x5eb8
movl $0x50, %edi
callq 0x3290
movq %rax, %r13
testb $0x1, 0x8(%rsp)
je 0x5fd3
movq %r13, %rdi
movq %r15, %rsi
callq 0x15726
jmp 0x5ebb
xorl %r13d, %r13d
leaq 0x3e0(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
movl $0x4, %edx
callq 0x34d0
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x400(%rsp,%rax)
je 0x5f95
movq 0x27101(%rip), %rbx     # 0x2cff0
leaq 0x1c353(%rip), %rsi     # 0x22249
movl $0x1b, %edx
movq %rbx, %rdi
callq 0x32e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3270
movsbl %al, %esi
movq 0x270cf(%rip), %rdi     # 0x2cff0
callq 0x3040
movq %rax, %rdi
callq 0x31b0
testq %r15, %r15
je 0x5f48
movq %r15, %rdi
callq 0xacac
movl $0x830, %esi            # imm = 0x830
movq %r15, %rdi
callq 0x32a0
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
je 0x5f67
movq %rbx, %rdi
callq 0x13264
movl $0x30, %esi
movq %rbx, %rdi
callq 0x32a0
movl $0x6, %r15d
movq 0x48(%rsp), %rbx
testq %rbx, %rbx
je 0x717c
movq %rbx, %rdi
callq 0x140c0
movl $0x60, %esi
movq %rbx, %rdi
callq 0x32a0
jmp 0x717c
xorpd %xmm0, %xmm0
movapd %xmm0, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
testb $0x1, 0x78(%rsp)
je 0x6103
leaq 0x3e0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x1fcb1
jmp 0x611d
leaq 0x3e0(%rsp), %rdi
leaq 0x1e0(%rsp), %rdx
movq %r12, %rsi
callq 0x7b82
leaq 0x3e0(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
movl $0x1, %ecx
callq 0x15e20
leaq 0x3f0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6024
movq 0x3f0(%rsp), %rsi
incq %rsi
callq 0x32a0
movq %r13, %rdi
movl $0x1, %esi
callq 0x17d4e
cmpb $0x1, 0x48(%r13)
jne 0x6043
cmpb $0x0, 0x49(%r13)
jne 0x5ebb
movq %r15, %rdi
callq 0xacac
movl $0x830, %esi            # imm = 0x830
movq %r15, %rdi
callq 0x32a0
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
je 0x6077
movq %rbx, %rdi
callq 0x13264
movl $0x30, %esi
movq %rbx, %rdi
callq 0x32a0
movq 0x48(%rsp), %rbx
testq %rbx, %rbx
je 0x6096
movq %rbx, %rdi
callq 0x140c0
movl $0x60, %esi
movq %rbx, %rdi
callq 0x32a0
movq %r13, %rdi
callq 0x16138
movl $0x50, %esi
movq %r13, %rdi
callq 0x32a0
movl $0x5, %r15d
jmp 0x7189
movq %rcx, 0x18(%rsp)
movq 0x26f0e(%rip), %rbx     # 0x2cfd0
leaq 0x1c0cc(%rip), %rsi     # 0x22195
movl $0x10, %edx
movq %rbx, %rdi
callq 0x32e0
movq -0x8(%r14,%r15,8), %r14
testq %r14, %r14
je 0x6293
movq %r14, %rdi
callq 0x3110
movq 0x26edd(%rip), %rdi     # 0x2cfd0
movq %r14, %rsi
movq %rax, %rdx
callq 0x32e0
jmp 0x62aa
leaq 0x3e0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
movl $0x1, %edx
callq 0x1fbdf
leaq 0x3e0(%rsp), %rdi
callq 0x3080
movq 0xb8(%rsp), %rax
cmpq 0xb0(%rsp), %rax
je 0x6208
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %rsi
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movzbl 0x98(%rsp), %edx
andl $0x1, %edx
leaq 0xb0(%rsp), %rdi
movl 0x70(%rsp), %ecx
callq 0x7842
leaq 0xb0(%rsp), %rdi
movq (%rdi), %rsi
callq 0x8118
cmpl $0x0, 0x14(%rsp)
movq %r13, 0x78(%rsp)
movl 0x90(%rsp), %ebx
je 0x64a7
leaq 0xd0(%rsp), %rdi
movl $0x8, %esi
movl $0x100000, %edx         # imm = 0x100000
callq 0x1ce26
movq 0x20(%rsp), %rbx
cmpq 0x28(%rsp), %rbx
movl 0x14(%rsp), %r13d
je 0x631a
xorl %r12d, %r12d
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
movl %r12d, %esi
callq 0x1cea2
addl 0x20(%rbx), %r12d
addq $0x38, %rbx
cmpq 0x28(%rsp), %rbx
jne 0x61cf
jmp 0x631d
movq $0x0, 0x80(%rsp)
movq $0x0, 0x60(%rsp)
jmp 0x5a18
movq 0x26de1(%rip), %rdi     # 0x2cff0
leaq 0x1c04f(%rip), %rsi     # 0x22265
movl $0x12, %edx
callq 0x32e0
movq 0x26dc9(%rip), %rdi     # 0x2cff0
callq 0x3120
testq %r15, %r15
je 0x6246
movq %r15, %rdi
callq 0xacac
movl $0x830, %esi            # imm = 0x830
movq %r15, %rdi
callq 0x32a0
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
je 0x6265
movq %rbx, %rdi
callq 0x13264
movl $0x30, %esi
movq %rbx, %rdi
callq 0x32a0
movl $0x7, %r15d
movq 0x48(%rsp), %rbx
testq %rbx, %rbx
je 0x716f
movq %rbx, %rdi
callq 0x140c0
movl $0x60, %esi
movq %rbx, %rdi
callq 0x32a0
jmp 0x716f
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x3450
movq 0x58(%rsp), %rbp
movl 0x14(%rsp), %r13d
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3270
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3270
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
callq 0x7400
movl $0x1, %r15d
movq 0x18(%rsp), %rcx
jmp 0x5713
xorl %r12d, %r12d
leaq 0xd0(%rsp), %rdi
callq 0x1ced6
leaq 0x198(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movl %r12d, %edx
callq 0x1c52c
xorpd %xmm0, %xmm0
leaq 0x140(%rsp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl %r13d, %esi
callq 0x7bdc
leaq 0x1e0(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0x1c544
movl $0xdeadbeef, %edi       # imm = 0xDEADBEEF
callq 0x3260
cmpl $0x1, %r13d
adcl $0x0, %r13d
movl %r13d, %ebx
leaq 0x1e0(%rsp), %r13
leaq 0x140(%rsp), %r14
callq 0x30a0
xorl %edx, %edx
divl %r12d
movq %r13, %rdi
movl %edx, %esi
xorl %edx, %edx
callq 0x1c550
decl %eax
imulq $0x38, %rax, %rsi
addq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x7ce6
decl %ebx
jne 0x639c
leaq 0x20(%rsp), %r14
movq (%r14), %rsi
movq %r14, %rdi
callq 0x8406
movq 0x140(%rsp), %rsi
movq 0x148(%rsp), %rdx
movq %r14, %rdi
callq 0x8458
leaq 0x140(%rsp), %rdi
movq (%rdi), %rsi
callq 0x8406
movq 0x26bc8(%rip), %rdi     # 0x2cfd0
leaq 0x1be69(%rip), %rsi     # 0x22278
movl $0xa, %edx
callq 0x32e0
movq 0x28(%rsp), %rsi
subq 0x20(%rsp), %rsi
sarq $0x3, %rsi
movabsq $0x6db6db6db6db6db7, %rax # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rsi
movq 0x26b94(%rip), %rdi     # 0x2cfd0
callq 0x31a0
movq %rax, %r14
leaq 0x1bfdd(%rip), %rsi     # 0x22428
movl $0xa, %edx
movq %rax, %rdi
callq 0x32e0
movq %r14, %rdi
callq 0x3120
movq 0x26b69(%rip), %rdi     # 0x2cfd0
callq 0x3120
leaq 0x1e0(%rsp), %rdi
callq 0x1c54a
leaq 0x140(%rsp), %rdi
callq 0x7d42
leaq 0x198(%rsp), %rdi
callq 0x1c532
leaq 0xd0(%rsp), %rdi
callq 0x1ce30
movl 0x90(%rsp), %ebx
movq %rbp, 0x58(%rsp)
testb $0x1, 0x40(%rsp)
je 0x64dd
movl %ebx, %r14d
leaq (,%r14,4), %rdi
callq 0x3030
movq %rax, %rbp
testl %ebx, %ebx
je 0x64df
shlq $0x2, %r14
movq %rbp, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3170
jmp 0x64df
xorl %ebp, %ebp
movq 0x50(%rsp), %r12
callq 0x1fecb
movsd %xmm0, 0x70(%rsp)
movq 0x20(%rsp), %rsi
cmpq %rsi, 0x28(%rsp)
je 0x6797
xorl %r14d, %r14d
movzbl %r12b, %eax
andl $0x1, %eax
movl %eax, 0x50(%rsp)
imulq $0x38, %r14, %rbx
addq %rbx, %rsi
testb $0x1, (%rsp)
je 0x6526
movq 0x18(%rsp), %rdi
callq 0x13532
jmp 0x652e
movq %r15, %rdi
callq 0xb18e
movq 0x20(%rsp), %rcx
movq %rax, 0x24(%rcx,%rbx)
testb $0x1, 0x68(%rsp)
je 0x6682
leaq (%rcx,%rbx), %rax
addq $0x24, %rax
movq (%rax), %rsi
movq %rsi, %rax
shrq $0x20, %rax
cmpl %eax, %esi
ja 0x6682
testb $0x1, 0x38(%rsp)
je 0x6574
movq 0x48(%rsp), %rdi
movl 0x50(%rsp), %edx
callq 0x14926
jmp 0x659d
testb $0x1, (%rsp)
je 0x6589
movq 0x18(%rsp), %rdi
callq 0x1373e
xorl %r13d, %r13d
jmp 0x65a2
movzbl 0x8(%rsp), %edx
andl $0x1, %edx
movq %r15, %rdi
movl 0x50(%rsp), %ecx
callq 0xb4b2
movq %rax, %r13
xorl %eax, %eax
testb $0x1, %r12b
je 0x65f1
movq 0x20(%rsp), %rcx
movl $0x0, 0x2c(%rcx,%rbx)
movq 0x24(%rcx,%rbx), %rdx
movq %rdx, %rsi
shrq $0x20, %rsi
subl %edx, %esi
cmpl $-0x1, %esi
je 0x65f1
addq %rbx, %rcx
movl 0x2c(%rcx), %edx
xorl %esi, %esi
addl (%r13,%rsi,4), %edx
movl %edx, 0x2c(%rcx)
incq %rsi
movq 0x24(%rcx), %rdi
movq %rdi, %r8
shrq $0x20, %r8
subl %edi, %r8d
incl %r8d
cmpq %r8, %rsi
jb 0x65d0
testb $0x1, 0x40(%rsp)
je 0x6668
movq 0x20(%rsp), %rcx
movq 0x24(%rcx,%rbx), %rsi
addq %rbx, %rcx
movq %rsi, %rdx
shrq $0x20, %rdx
subl %esi, %edx
testb $0x1, (%rsp)
je 0x663e
cmpl $-0x1, %edx
je 0x6668
xorl %edx, %edx
movl 0x20(%rcx), %esi
movl (%rax,%rdx,4), %edi
addl %esi, (%rbp,%rdi,4)
incq %rdx
movq 0x24(%rcx), %rsi
movq %rsi, %rdi
shrq $0x20, %rdi
subl %esi, %edi
incl %edi
cmpq %rdi, %rdx
jb 0x661b
jmp 0x6668
cmpl $-0x1, %edx
je 0x6668
xorl %edx, %edx
movl 0x20(%rcx), %esi
movl (%r13,%rdx,4), %edi
addl %esi, (%rbp,%rdi,4)
incq %rdx
movq 0x24(%rcx), %rsi
movq %rsi, %rdi
shrq $0x20, %rdi
subl %esi, %edi
incl %edi
cmpq %rdi, %rdx
jb 0x6645
testq %rax, %rax
je 0x6675
movq %rax, %rdi
callq 0x3330
testq %r13, %r13
je 0x6682
movq %r13, %rdi
callq 0x3330
testb $0x1, 0x88(%rsp)
je 0x676c
movq 0x20(%rsp), %rax
movq 0x24(%rax,%rbx), %rsi
movq %rsi, %rax
shrq $0x20, %rax
cmpl %eax, %esi
ja 0x676c
testb $0x1, 0x60(%rsp)
je 0x66c3
testb $0x1, 0x8(%rsp)
movq 0x78(%rsp), %rdi
je 0x66d6
callq 0x180f8
jmp 0x66db
testb $0x1, 0x8(%rsp)
movq 0x78(%rsp), %rdi
je 0x6729
callq 0x18098
jmp 0x672e
callq 0x18064
movq %rax, %r13
testq %rax, %rax
je 0x676c
movq 0x20(%rsp), %rcx
movl $0x0, 0x30(%rcx,%rbx)
movq (%r13), %rdi
movq 0x8(%r13), %rax
cmpq %rax, %rdi
je 0x674e
addq %rbx, %rcx
addq $0x30, %rcx
movl (%rcx), %edx
movq %rdi, %rsi
movq (%rsi), %r8
subl %r8d, %edx
shrq $0x20, %r8
addl %r8d, %edx
incl %edx
movl %edx, (%rcx)
addq $0x8, %rsi
cmpq %rax, %rsi
jne 0x670d
jmp 0x674e
callq 0x18018
movq %rax, %r13
testq %rax, %rax
je 0x676c
movq (%r13), %rdi
movq 0x8(%r13), %rax
subq %rdi, %rax
shrq $0x2, %rax
movq 0x20(%rsp), %rcx
movl %eax, 0x30(%rcx,%rbx)
testq %rdi, %rdi
je 0x675f
movq 0x10(%r13), %rsi
subq %rdi, %rsi
callq 0x32a0
movl $0x18, %esi
movq %r13, %rdi
callq 0x32a0
incl %r14d
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rax
subq %rsi, %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rax
cmpq %r14, %rax
ja 0x650d
callq 0x1fecb
movsd %xmm0, (%rsp)
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq %rcx, %rax
movq 0x78(%rsp), %r13
xorpd %xmm0, %xmm0
je 0x6805
movsd 0x1b84f(%rip), %xmm1    # 0x22010
movapd 0x1b857(%rip), %xmm2    # 0x22020
movsd 0x8(%rax), %xmm3
unpcklps %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
subpd %xmm2, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
addsd %xmm4, %xmm0
addq $0x38, %rax
cmpq %rcx, %rax
jne 0x67c9
cvttsd2si %xmm0, %rax
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x1b82b(%rip), %xmm0    # 0x22030
movsd %xmm0, 0x8(%rsp)
movq 0x267be(%rip), %rdi     # 0x2cfd0
leaq 0x1ba6a(%rip), %rsi     # 0x22283
movl $0xf, %edx
callq 0x32e0
movq 0x28(%rsp), %rsi
subq 0x20(%rsp), %rsi
sarq $0x3, %rsi
movabsq $0x6db6db6db6db6db7, %rax # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rsi
movq 0x2678a(%rip), %rdi     # 0x2cfd0
callq 0x31a0
movq %rax, %r14
leaq 0x1c5ed(%rip), %rsi     # 0x22e42
movl $0x2, %edx
movq %rax, %rdi
callq 0x32e0
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
movsd (%rsp), %xmm2
subsd 0x70(%rsp), %xmm2
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rax
movq %rax, %xmm1
punpckldq 0x1b77a(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1b782(%rip), %xmm1    # 0x22020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movsd %xmm2, (%rsp)
divsd %xmm2, %xmm0
movq %r14, %rdi
callq 0x3410
movq %rax, %r14
leaq 0x1b9ce(%rip), %rsi     # 0x22293
movl $0x7, %edx
movq %rax, %rdi
callq 0x32e0
movq %r14, %rdi
callq 0x3120
movq 0x266ef(%rip), %rdi     # 0x2cfd0
leaq 0x1b9b3(%rip), %rsi     # 0x2229b
movl $0xf, %edx
callq 0x32e0
movq 0x266d7(%rip), %rdi     # 0x2cfd0
movsd 0x8(%rsp), %xmm0
callq 0x3410
leaq 0x1b9a0(%rip), %rsi     # 0x222ab
movl $0x3, %edx
movq %rax, %rdi
callq 0x32e0
testb $0x1, 0x68(%rsp)
jne 0x6962
movq 0x266aa(%rip), %rdi     # 0x2cfd0
leaq 0x1c515(%rip), %rsi     # 0x22e42
movl $0x2, %edx
callq 0x32e0
movsd 0x8(%rsp), %xmm0
divsd (%rsp), %xmm0
movq 0x26687(%rip), %rdi     # 0x2cfd0
callq 0x3410
leaq 0x1b95a(%rip), %rsi     # 0x222af
movl $0x6, %edx
movq %rax, %rdi
callq 0x32e0
movq 0x26667(%rip), %rdi     # 0x2cfd0
callq 0x3120
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
xorl %ebx, %ebx
movl $0x0, %r14d
cmpq %rcx, %rax
je 0x69b5
xorpd %xmm0, %xmm0
movq %rax, %rdx
movq 0x24(%rdx), %rsi
movq %rsi, %rdi
shrq $0x20, %rdi
subl %esi, %edi
incl %edi
xorps %xmm1, %xmm1
cvtsi2sd %rdi, %xmm1
addsd %xmm1, %xmm0
addq $0x38, %rdx
cmpq %rcx, %rdx
jne 0x698c
cvttsd2si %xmm0, %r14
cmpq %rcx, %rax
je 0x69db
xorpd %xmm0, %xmm0
movl 0x2c(%rax), %edx
xorps %xmm1, %xmm1
cvtsi2sd %rdx, %xmm1
addsd %xmm1, %xmm0
addq $0x38, %rax
cmpq %rcx, %rax
jne 0x69be
cvttsd2si %xmm0, %rbx
movq 0x265ee(%rip), %rdi     # 0x2cfd0
leaq 0x1b8cd(%rip), %rsi     # 0x222b6
movl $0xf, %edx
callq 0x32e0
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq %rcx, %rax
je 0x6a3b
xorpd %xmm0, %xmm0
movsd 0x1b62a(%rip), %xmm1    # 0x22038
movq 0x24(%rax), %rdx
movq %rdx, %rsi
shrq $0x20, %rsi
movapd %xmm0, %xmm2
addsd %xmm1, %xmm2
cmpl %esi, %edx
ja 0x6a29
movapd %xmm2, %xmm0
addq $0x38, %rax
cmpq %rcx, %rax
jne 0x6a0e
cvttsd2si %xmm0, %rax
movl %eax, %esi
jmp 0x6a3d
xorl %esi, %esi
movq 0x2658c(%rip), %rdi     # 0x2cfd0
callq 0x31a0
movq %rax, %rdi
callq 0x3120
movq 0x26578(%rip), %rdi     # 0x2cfd0
leaq 0x1b867(%rip), %rsi     # 0x222c6
movl $0xf, %edx
callq 0x32e0
movl %r14d, %r14d
movq 0x2655d(%rip), %rdi     # 0x2cfd0
movq %r14, %rsi
callq 0x31a0
testb $0x1, 0x68(%rsp)
je 0x6b49
movq 0x26543(%rip), %rdi     # 0x2cfd0
leaq 0x1c3ae(%rip), %rsi     # 0x22e42
movl $0x2, %edx
callq 0x32e0
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
movsd %xmm0, 0x8(%rsp)
divsd (%rsp), %xmm0
movq 0x26518(%rip), %rdi     # 0x2cfd0
callq 0x3410
leaq 0x1b7cf(%rip), %rsi     # 0x22293
movl $0x7, %edx
movq %rax, %rdi
callq 0x32e0
testb $0x1, %r12b
je 0x6b49
movq 0x264f2(%rip), %rdi     # 0x2cfd0
callq 0x3120
movq %rax, %r12
leaq 0x1b7e9(%rip), %rsi     # 0x222d6
movl $0xf, %edx
movq %rax, %rdi
callq 0x32e0
movl %ebx, %r14d
movq %r12, %rdi
movq %r14, %rsi
callq 0x31a0
movq %rax, %r12
leaq 0x1c330(%rip), %rsi     # 0x22e42
movl $0x2, %edx
movq %rax, %rdi
callq 0x32e0
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd 0x8(%rsp), %xmm0
movq %r12, %rdi
callq 0x3410
leaq 0x1b7aa(%rip), %rsi     # 0x222e6
movl $0xe, %edx
movq %rax, %rdi
callq 0x32e0
movq 0x26480(%rip), %rdi     # 0x2cfd0
callq 0x3120
testb $0x1, 0x88(%rsp)
je 0x6c0c
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq %rcx, %rax
je 0x6b95
xorpd %xmm0, %xmm0
movl 0x30(%rax), %edx
xorps %xmm1, %xmm1
cvtsi2sd %rdx, %xmm1
addsd %xmm1, %xmm0
addq $0x38, %rax
cmpq %rcx, %rax
jne 0x6b76
cvttsd2si %xmm0, %rbx
jmp 0x6b97
xorl %ebx, %ebx
movq 0x26432(%rip), %rdi     # 0x2cfd0
leaq 0x1b750(%rip), %rsi     # 0x222f5
movl $0xf, %edx
callq 0x32e0
movl %ebx, %r14d
movq 0x26417(%rip), %rdi     # 0x2cfd0
movq %r14, %rsi
callq 0x31a0
movq %rax, %r12
leaq 0x1c277(%rip), %rsi     # 0x22e42
movl $0x2, %edx
movq %rax, %rdi
callq 0x32e0
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd (%rsp), %xmm0
movq %r12, %rdi
callq 0x3410
movq %rax, %r14
leaq 0x1b69c(%rip), %rsi     # 0x22293
movl $0x7, %edx
movq %rax, %rdi
callq 0x32e0
movq %r14, %rdi
callq 0x3120
movq 0x263bd(%rip), %rdi     # 0x2cfd0
leaq 0x1b6eb(%rip), %rsi     # 0x22305
movl $0xf, %edx
callq 0x32e0
movq 0x263a5(%rip), %rdi     # 0x2cfd0
movsd (%rsp), %xmm0
callq 0x3410
movq %rax, %r14
leaq 0x1b6d6(%rip), %rsi     # 0x22315
movl $0x8, %edx
movq %rax, %rdi
callq 0x32e0
movq %r14, %rdi
callq 0x3120
movq 0x26375(%rip), %rdi     # 0x2cfd0
callq 0x3120
testb $0x1, 0x40(%rsp)
je 0x6e31
leaq 0xd0(%rsp), %rdi
leaq 0x1e0(%rsp), %rdx
movq 0x58(%rsp), %rsi
callq 0x7b82
leaq 0x1b692(%rip), %rsi     # 0x2231e
leaq 0xd0(%rsp), %rdi
callq 0x34f0
movq 0xd0(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
movl $0x4, %edx
callq 0x32d0
movq 0x1e0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x200(%rsp,%rax)
je 0x6d1e
movq 0x26320(%rip), %rdi     # 0x2cff0
leaq 0x1b64e(%rip), %rsi     # 0x22325
movl $0x19, %edx
callq 0x32e0
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
movq 0x262f8(%rip), %rdi     # 0x2cff0
callq 0x32e0
movq %rax, %r14
leaq 0x1b638(%rip), %rsi     # 0x2233f
movl $0x2, %edx
movq %rax, %rdi
callq 0x32e0
movq %r14, %rdi
callq 0x3120
jmp 0x6d46
movl 0x90(%rsp), %edx
shlq $0x2, %rdx
leaq 0x1e0(%rsp), %rdi
movq %rbp, %rsi
callq 0x3350
leaq 0x1e0(%rsp), %rdi
callq 0x3380
xorl %r12d, %r12d
movl 0xac(%rsp), %eax
movl %eax, %ebx
testl %eax, %eax
je 0x6d7b
xorl %ecx, %ecx
xorl %eax, %eax
movl (%rbp,%rcx,4), %edx
cmpl %edx, %eax
cmovbel %edx, %eax
addl %edx, %r12d
incq %rcx
cmpq %rcx, %rbx
jne 0x6d5a
movl %r12d, %ecx
movl %eax, %r12d
cvtsi2sd %rcx, %xmm0
jmp 0x6d7f
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movq 0x26245(%rip), %rdi     # 0x2cfd0
leaq 0x1b5b0(%rip), %rsi     # 0x22342
movl $0xf, %edx
callq 0x32e0
movq 0x2622d(%rip), %rdi     # 0x2cfd0
movq %r12, %rsi
callq 0x31a0
movq %rax, %r14
leaq 0x1b59d(%rip), %rsi     # 0x22352
movl $0x8, %edx
movq %rax, %rdi
callq 0x32e0
cvtsi2sd %rbx, %xmm1
movsd (%rsp), %xmm0
divsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x3410
movq %rax, %r14
leaq 0x1b579(%rip), %rsi     # 0x2235b
movl $0xa, %edx
movq %rax, %rdi
callq 0x32e0
movq %r14, %rdi
callq 0x3120
movq 0x261d2(%rip), %rdi     # 0x2cfd0
callq 0x3120
leaq 0x1e0(%rsp), %rdi
callq 0x33a0
leaq 0xe0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e31
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x32a0
testb $0x1, 0xa0(%rsp)
je 0x6fdb
leaq 0xd0(%rsp), %rdi
leaq 0x198(%rsp), %rdx
movq 0x58(%rsp), %rsi
callq 0x7b82
leaq 0x1b506(%rip), %rsi     # 0x22366
leaq 0xd0(%rsp), %rdi
callq 0x34f0
leaq 0x1f0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6e9d
movq %rdx, 0x1e0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1f0(%rsp)
jmp 0x6ea6
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x1e0(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20(%rsp), %rdi
xorl %edx, %edx
callq 0x7a0d
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x6eee
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0xe0(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x6f10
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0xd0(%rsp), %rdi
leaq 0x198(%rsp), %rdx
movq 0x58(%rsp), %rsi
callq 0x7b82
leaq 0x1b3ed(%rip), %rsi     # 0x2231e
leaq 0xd0(%rsp), %rdi
callq 0x34f0
movq %r14, 0x1e0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6f6a
movq %rdx, 0x1e0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1f0(%rsp)
jmp 0x6f73
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x1e0(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20(%rsp), %rdi
movl $0x1, %edx
callq 0x7a0d
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x6fbe
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0xd0(%rsp), %rdi
cmpq %r12, %rdi
je 0x6fdb
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x32a0
testb $0x1, 0x80(%rsp)
je 0x70d2
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x2651e(%rip), %rdx     # 0x2d518
callq 0x7d9d
leaq 0xd0(%rsp), %rdi
leaq 0x198(%rsp), %rdx
movq 0x58(%rsp), %rsi
callq 0x7b82
leaq 0x1b350(%rip), %rsi     # 0x22370
leaq 0xd0(%rsp), %rdi
callq 0x34f0
leaq 0x1f0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x705d
movq %rdx, 0x1e0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1f0(%rsp)
jmp 0x7066
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x1e0(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20(%rsp), %rdi
movl $0x1, %edx
callq 0x7a0d
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x70b1
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x32a0
leaq 0xe0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x70d2
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x32a0
testb $0x1, 0x38(%rsp)
je 0x70e3
movq 0x48(%rsp), %rdi
callq 0x141e8
testq %r15, %r15
je 0x70fd
movq %r15, %rdi
callq 0xacac
movl $0x830, %esi            # imm = 0x830
movq %r15, %rdi
callq 0x32a0
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
je 0x711c
movq %rbx, %rdi
callq 0x13264
movl $0x30, %esi
movq %rbx, %rdi
callq 0x32a0
movq 0x48(%rsp), %rbx
testq %rbx, %rbx
je 0x713b
movq %rbx, %rdi
callq 0x140c0
movl $0x60, %esi
movq %rbx, %rdi
callq 0x32a0
testq %r13, %r13
je 0x7155
movq %r13, %rdi
callq 0x16138
movl $0x50, %esi
movq %r13, %rdi
callq 0x32a0
testq %rbp, %rbp
je 0x7162
movq %rbp, %rdi
callq 0x3330
leaq 0x20(%rsp), %rdi
callq 0x7d42
xorl %r15d, %r15d
leaq 0xb0(%rsp), %rdi
callq 0x7dea
leaq 0x3e0(%rsp), %rdi
callq 0x3090
movl %r15d, %eax
addq $0x5e8, %rsp            # imm = 0x5E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x71e7
jmp 0x7219
movq %rax, %rbx
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x71cc
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x71cc
jmp 0x7398
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r12, %rdi
jne 0x72c1
jmp 0x73d4
jmp 0x7398
movq %rax, %rbx
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x72ac
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x72ac
jmp 0x7219
jmp 0x7398
jmp 0x7219
movq %rax, %rbx
jmp 0x72ac
jmp 0x7398
jmp 0x7398
jmp 0x722d
movq %rax, %rbx
jmp 0x73ad
jmp 0x7391
jmp 0x7391
jmp 0x7398
jmp 0x7398
jmp 0x7398
jmp 0x7398
movq %rax, %rbx
leaq 0x3f0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x727e
movq 0x3f0(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x727e
jmp 0x727b
movq %rax, %rbx
movl $0x50, %esi
movq %r13, %rdi
jmp 0x7388
jmp 0x729c
jmp 0x7398
jmp 0x7398
jmp 0x7398
movq %rax, %rbx
leaq 0x1e0(%rsp), %rdi
callq 0x33a0
leaq 0xe0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73d4
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x73d4
movq %rax, %rbx
leaq 0x3f0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72ff
movq 0x3f0(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x72ff
movq %rax, %rbx
movl $0x60, %esi
movq 0x48(%rsp), %rdi
jmp 0x7388
jmp 0x739d
movq %rax, %rbx
jmp 0x73de
jmp 0x7398
movq %rax, %rbx
jmp 0x73eb
movq %rax, %rbx
leaq 0x168(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x734b
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x734b
movq %rax, %rbx
movl $0x30, %esi
movq 0x18(%rsp), %rdi
jmp 0x7388
movq %rax, %rbx
leaq 0x188(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7380
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0x7380
movq %rax, %rbx
movl $0x830, %esi            # imm = 0x830
movq %r15, %rdi
callq 0x32a0
jmp 0x73f8
jmp 0x7398
movq %rax, %rbx
jmp 0x73c7
jmp 0x7398
movq %rax, %rbx
jmp 0x73d4
movq %rax, %rbx
leaq 0x1e0(%rsp), %rdi
callq 0x1c54a
leaq 0x140(%rsp), %rdi
callq 0x7d42
leaq 0x198(%rsp), %rdi
callq 0x1c532
leaq 0xd0(%rsp), %rdi
callq 0x1ce30
leaq 0x20(%rsp), %rdi
callq 0x7d42
leaq 0xb0(%rsp), %rdi
callq 0x7dea
leaq 0x3e0(%rsp), %rdi
callq 0x3090
movq %rbx, %rdi
callq 0x34b0