// File: adamnovak[P]rlcsa/document_graph.cpp
// Function: main
int
main(int argc, char** argv)
{
  std::cout << "Document graph extractor" << std::endl;
  if(argc < 2)
  {
    std::cout << "Usage:" << std::endl;
    std::cout << "document_graph basename block_size storing_factor" << std::endl;
    std::cout << "  to build the document graph and sparse suffix tree" << std::endl;
    std::cout << "document_graph basename prefix" << std::endl;
    std::cout << "  to compress the grammar and build the index" << std::endl;
    std::cout << "document_graph basename" << std::endl;
    std::cout << "  to test the document array" << std::endl;
    return 1;
  }
  std::cout << std::endl;

  std::string base_name = argv[1];
  std::cout << "Base name: " << base_name << std::endl;

  // Load the index.
  if(argc == 2)
  {
    std::cout << std::endl;
    return testDocarray(base_name);
  }

  // Load the index and compress
  if(argc == 3)
  {
    std::string prefix = argv[2];
    std::cout << "Prefix: " << prefix << std::endl;
    std::cout << std::endl;
    return buildIndex(base_name, prefix);
  }

  usint block_size = atoi(argv[2]);
  std::cout << "Block size: " << block_size << std::endl;
  usint storing_factor = atoi(argv[3]);
  std::cout << "Storing factor: " << storing_factor << std::endl;
  std::cout << std::endl;

  RLCSA rlcsa(argv[1]);
  if(!rlcsa.isOk() || !rlcsa.supportsLocate())
  {
    std::cerr << "Error: Locate is not supported!" << std::endl;
    return 2;
  }
  rlcsa.printInfo();
  rlcsa.reportSize(true);
  if(block_size == 0 || storing_factor == 0) { return 0; }


  double start = readTimer();

  // Get the suffix array from RLCSA.
  usint size = rlcsa.getSize();
  uint docs = rlcsa.getNumberOfSequences();
  usint* documents = new usint[size];
  #pragma omp parallel for schedule(static)
  for(usint i = 0; i < size; i += MEGABYTE)
  {
    rlcsa.locate(pair_type(i, std::min(i + MEGABYTE, size - 1)), documents + i);
  }
  double locate = readTimer();
  std::cout << "Locate: " << (locate - start) << " seconds" << std::endl;

  // Get the LCP array.
  uint* lcp = new uint[size + 1]; lcp[size] = 0;
/*  #ifdef MULTITHREAD_SUPPORT
  usint threads = omp_get_max_threads();
  PLCPVector* plcpvec = rlcsa.buildPLCP(16, threads);
  std::cout << "Total: " << plcpvec->getNumberOfItems() << " / " << plcpvec->getSize() << std::endl;
  PLCPVector::Iterator* iters[threads];
  for(usint i = 0; i < threads; i++) { iters[i] = new PLCPVector::Iterator(*plcpvec); }
  #pragma omp parallel for schedule(static, MEGABYTE)
  for(usint i = 0; i < size; i++)
  {
    lcp[i] = iters[omp_get_thread_num()]->select(documents[i]) - 2 * documents[i];
  }
  for(usint i = 0; i < threads; i++) { delete iters[i]; iters[i] = 0; }
  #else*/
  PLCPVector* plcpvec = rlcsa.buildPLCP(16);
  PLCPVector::Iterator iter(*plcpvec);
  for(usint i = 0; i < size; i++)
  {
    lcp[i] = iter.select(documents[i]) - 2 * documents[i];
  }
//  #endif
  delete plcpvec;
  double lcparray = readTimer();
  std::cout << "LCP: " << (lcparray - locate) << " seconds" << std::endl;

  // Convert SA to document array.
  #pragma omp parallel for schedule(static)
  for(usint i = 0; i < size; i += MEGABYTE)
  {
    rlcsa.getSequenceForPosition(documents + i, std::min(MEGABYTE, size - i));
  }
  // Change document array to be 1-based.
  #pragma omp parallel for schedule(static, MEGABYTE)
  for(usint i = 0; i < size; i++) { documents[i]++; }
  double find = readTimer();
  std::cout << "Documents: " << (find - lcparray) << " seconds" << std::endl;

  // Build a truncated suffix tree.
  // A node with at most block_size suffixes should not have any children.
  std::stack<STNode*> nodestack; nodestack.push(new STNode(0, pair_type(0, 0)));
  STNode* prev = 0; STNode* root = 0;
  for(usint i = 1; i <= size; i++)
  {
    usint left = i - 1;
    while(lcp[i] < nodestack.top()->string_depth)
    {
      nodestack.top()->range.second = i - 1;
      prev = nodestack.top(); nodestack.pop();
      if(length(prev->range) <= block_size) { prev->deleteChildren(); }
      root = prev;  // Last processed node.
      left = prev->range.first;
      if(lcp[i] <= nodestack.top()->string_depth) { nodestack.top()->addChild(prev); prev = 0; }
    }
    if(lcp[i] > nodestack.top()->string_depth)
    {
      STNode* curr = new STNode(lcp[i], pair_type(left, left));
      if(prev != 0) { curr->addChild(prev); prev = 0; }
      nodestack.push(curr);
    }
  }
  while(root->parent != 0) { root = root->parent; }  // Find the actual root.
  root->range.second = size - 1; root->containsAllDocuments();
  delete[] lcp; lcp = 0;
  uint st_nodes = 0, leaf_nodes = 0;
  root->addLeaves();
  root->verifyTree();
  root->determineSize(st_nodes, leaf_nodes);
  double st = readTimer();
  std::cout << "Suffix tree: " << (st - find) << " seconds" << std::endl;
  std::cout << "Total " << size << " positions, " << docs << " documents" << std::endl;
  std::cout << "Truncated suffix tree has " << st_nodes << " nodes" << std::endl;
  std::cout << std::endl;


  // Start processing.
  uint tree_leaves = 0, tree_nodes = leaf_nodes, graph_nodes = 0, edges = 0;
  std::string graph_name = base_name + ".graph";
  std::ofstream output(graph_name.c_str(), std::ios_base::binary);
  if(!output)
  {
    std::cerr << "Error: Cannot open output file " << graph_name << "!" << std::endl;
    delete[] documents;
    return 3;
  }
  std::string singleton_name = base_name + ".singletons";
  std::ofstream singletons(singleton_name.c_str(), std::ios_base::binary);
  if(!singletons)
  {
    std::cerr << "Error: Cannot open output file " << singleton_name << "!" << std::endl;
    delete[] documents;
    output.close();
    return 3;
  }
  output.write((char*)&tree_nodes, sizeof(tree_nodes)); // Placeholder for nodes/subsets.
  output.write((char*)&edges, sizeof(edges)); // Placeholder for edges.

  // For each suffix tree node, produce the corresponding subset if necessary.
  double sets = readTimer();
  while(!nodestack.empty()) { nodestack.pop(); }
  for(prev = root; prev != 0; prev = prev->child) { nodestack.push(prev); }
  while(nodestack.top() != root)
  {
    STNode* curr = nodestack.top(); nodestack.pop();
    for(STNode* temp = curr->sibling; temp != 0; temp = temp->child) { nodestack.push(temp); }
    if(curr->contains_all)
    {
      curr->id = tree_nodes; tree_nodes++;
      continue;
    }

    curr->computeStoredDocuments(documents);
    if(curr->docs->size() >= docs) { curr->containsAllDocuments(); }

    if(curr->child == 0 || curr->contains_all || curr->stored_documents > storing_factor * curr->docs->size())
    {
      curr->storeThisSet();
      int curr_node = -1 * docs;
      if(curr->child == 0) { curr->id = tree_leaves; tree_leaves++; curr_node -= tree_leaves; }
      else                 { curr->id = tree_nodes; tree_nodes++; curr_node -= tree_nodes; }
      if(!(curr->contains_all))
      {
        // Store singletons in a separate file. The presence of singletons greatly slows down the
        // search for bicliques.
        if(curr->docs->size() == 1)
        {
          singletons << (-curr_node) << ": " << curr->docs->at(0) << std::endl;
        }
        else
        {
          output.write((char*)&curr_node, sizeof(curr_node));
          for(std::vector<uint>::iterator iter = curr->docs->begin(); iter != curr->docs->end(); ++iter)
          {
            uint temp = *iter;
            output.write((char*)&temp, sizeof(temp));
          }
          graph_nodes++;
          edges += curr->docs->size();
        }
      }
    }
    else
    {
      curr->remove();
      delete curr;
    }
  }
  root->id = tree_nodes; tree_nodes++;
  double block_stop = readTimer();
  std::cout << "Blocks: " << (block_stop - sets) << " seconds" << std::endl;
  std::cout << std::endl;

  // Write the number of nodes & edges.
  output.seekp(0, std::ios::beg);
  output.write((char*)&graph_nodes, sizeof(graph_nodes));
  output.write((char*)&edges, sizeof(edges));
  std::cout << "Graph has " << graph_nodes << " nodes, " << edges << " edges" << std::endl;
  std::cout << std::endl;
  output.close();
  singletons.close();
  delete[] documents;

  // Write the tree structure.
  DocArray docarray(root, rlcsa);
  if(docarray.isOk())
  {
    std::cout << "Final tree has " << docarray.getNumberOfNodes() << " nodes, " << tree_leaves << " leaves" << std::endl;
    std::cout << std::endl;
    docarray.reportSize(true);
    docarray.writeTo(base_name);
  }

  delete root;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1290, %rsp           # imm = 0x1290
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x40d00(%rip), %rdi     # 0x45fd0
leaq 0x2edd3(%rip), %rsi     # 0x340aa
callq 0x32c0
movq %rax, %rdi
movq 0x40cca(%rip), %rsi     # 0x45fb0
callq 0x3330
cmpl $0x2, -0x8(%rbp)
jge 0x53ef
movq 0x40cd4(%rip), %rdi     # 0x45fd0
leaq 0x2edc0(%rip), %rsi     # 0x340c3
callq 0x32c0
movq %rax, %rdi
movq 0x40c9e(%rip), %rsi     # 0x45fb0
callq 0x3330
movq 0x40cb2(%rip), %rdi     # 0x45fd0
leaq 0x2eda5(%rip), %rsi     # 0x340ca
callq 0x32c0
movq %rax, %rdi
movq 0x40c7c(%rip), %rsi     # 0x45fb0
callq 0x3330
movq 0x40c90(%rip), %rdi     # 0x45fd0
leaq 0x2edb5(%rip), %rsi     # 0x340fc
callq 0x32c0
movq %rax, %rdi
movq 0x40c5a(%rip), %rsi     # 0x45fb0
callq 0x3330
movq 0x40c6e(%rip), %rdi     # 0x45fd0
leaq 0x2edc8(%rip), %rsi     # 0x34131
callq 0x32c0
movq %rax, %rdi
movq 0x40c38(%rip), %rsi     # 0x45fb0
callq 0x3330
movq 0x40c4c(%rip), %rdi     # 0x45fd0
leaq 0x2edc5(%rip), %rsi     # 0x34150
callq 0x32c0
movq %rax, %rdi
movq 0x40c16(%rip), %rsi     # 0x45fb0
callq 0x3330
movq 0x40c2a(%rip), %rdi     # 0x45fd0
leaq 0x2edd1(%rip), %rsi     # 0x3417e
callq 0x32c0
movq %rax, %rdi
movq 0x40bf4(%rip), %rsi     # 0x45fb0
callq 0x3330
movq 0x40c08(%rip), %rdi     # 0x45fd0
leaq 0x2edc7(%rip), %rsi     # 0x34196
callq 0x32c0
movq %rax, %rdi
movq 0x40bd2(%rip), %rsi     # 0x45fb0
callq 0x3330
movl $0x1, -0x4(%rbp)
jmp 0x6efd
movq 0x40bda(%rip), %rdi     # 0x45fd0
movq 0x40bb3(%rip), %rsi     # 0x45fb0
callq 0x3330
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xf50(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0xf48(%rbp)
callq 0x3580
movq -0xf50(%rbp), %rsi
movq -0xf48(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x7260
jmp 0x543a
leaq -0x31(%rbp), %rdi
callq 0x3350
movq 0x40b86(%rip), %rdi     # 0x45fd0
leaq 0x2ed62(%rip), %rsi     # 0x341b3
callq 0x32c0
movq %rax, -0xf58(%rbp)
jmp 0x545f
movq -0xf58(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3290
movq %rax, -0xf60(%rbp)
jmp 0x5478
movq -0xf60(%rbp), %rdi
movq 0x40b2a(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x548d
cmpl $0x2, -0x8(%rbp)
jne 0x54f9
movq 0x40b36(%rip), %rdi     # 0x45fd0
movq 0x40b0f(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x54a8
leaq -0x30(%rbp), %rdi
callq 0x6f20
movl %eax, -0xf64(%rbp)
jmp 0x54b9
movl -0xf64(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x6ee7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x3350
jmp 0x6f09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6ef2
cmpl $0x3, -0x8(%rbp)
jne 0x560a
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xf78(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0xf70(%rbp)
callq 0x3580
movq -0xf78(%rbp), %rsi
movq -0xf70(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x7260
jmp 0x553b
leaq -0x69(%rbp), %rdi
callq 0x3350
movq 0x40a85(%rip), %rdi     # 0x45fd0
leaq 0x2ec6d(%rip), %rsi     # 0x341bf
callq 0x32c0
movq %rax, -0xf80(%rbp)
jmp 0x5560
movq -0xf80(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3290
movq %rax, -0xf88(%rbp)
jmp 0x5579
movq -0xf88(%rbp), %rdi
movq 0x40a29(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x558e
movq 0x40a3b(%rip), %rdi     # 0x45fd0
movq 0x40a14(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x55a3
leaq -0x30(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x7090
movl %eax, -0xf8c(%rbp)
jmp 0x55b8
movl -0xf8c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3638
jmp 0x6ee7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x3350
jmp 0x6ef2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3638
jmp 0x6ef2
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x34f0
movl %eax, -0x70(%rbp)
movq 0x409af(%rip), %rdi     # 0x45fd0
leaq 0x2eba0(%rip), %rsi     # 0x341c8
callq 0x32c0
movq %rax, -0xf98(%rbp)
jmp 0x5636
movq -0xf98(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x3420
movq %rax, -0xfa0(%rbp)
jmp 0x564e
movq -0xfa0(%rbp), %rdi
movq 0x40954(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x5663
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x34f0
movl %eax, -0x74(%rbp)
movq 0x40956(%rip), %rdi     # 0x45fd0
leaq 0x2eb54(%rip), %rsi     # 0x341d5
callq 0x32c0
movq %rax, -0xfa8(%rbp)
jmp 0x568f
movq -0xfa8(%rbp), %rdi
movl -0x74(%rbp), %esi
callq 0x3420
movq %rax, -0xfb0(%rbp)
jmp 0x56a7
movq -0xfb0(%rbp), %rdi
movq 0x408fb(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x56bc
movq 0x4090d(%rip), %rdi     # 0x45fd0
movq 0x408e6(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x56d1
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xfc0(%rbp)
leaq -0x8c9(%rbp), %rdi
movq %rdi, -0xfb8(%rbp)
callq 0x3580
movq -0xfc0(%rbp), %rsi
movq -0xfb8(%rbp), %rdx
leaq -0x8c8(%rbp), %rdi
callq 0x7260
jmp 0x570f
leaq -0x8a8(%rbp), %rdi
leaq -0x8c8(%rbp), %rsi
xorl %edx, %edx
callq 0x9470
jmp 0x5726
leaq -0x8c8(%rbp), %rdi
callq 0x3638
leaq -0x8c9(%rbp), %rdi
callq 0x3350
leaq -0x8a8(%rbp), %rdi
callq 0x7530
movb %al, -0xfc1(%rbp)
jmp 0x5752
movb -0xfc1(%rbp), %al
testb $0x1, %al
jne 0x575e
jmp 0x5782
leaq -0x8a8(%rbp), %rdi
callq 0x7550
movb %al, -0xfc2(%rbp)
jmp 0x5772
movb -0xfc2(%rbp), %al
testb $0x1, %al
jne 0x580e
jmp 0x5782
movq 0x40867(%rip), %rdi     # 0x45ff0
leaq 0x2ea56(%rip), %rsi     # 0x341e6
callq 0x32c0
movq %rax, -0xfd0(%rbp)
jmp 0x579e
movq -0xfd0(%rbp), %rdi
movq 0x40804(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x57b3
movl $0x2, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x6ecb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x57ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x8c8(%rbp), %rdi
callq 0x3638
leaq -0x8c9(%rbp), %rdi
callq 0x3350
jmp 0x6ef2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6ed9
leaq -0x8a8(%rbp), %rdi
callq 0xe450
jmp 0x581c
leaq -0x8a8(%rbp), %rdi
movl $0x1, %esi
callq 0xe1e0
jmp 0x582f
cmpl $0x0, -0x70(%rbp)
je 0x583b
cmpl $0x0, -0x74(%rbp)
jne 0x584e
movl $0x0, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x6ecb
callq 0x2f600
movsd %xmm0, -0xfd8(%rbp)
jmp 0x585d
movsd -0xfd8(%rbp), %xmm0
movsd %xmm0, -0x8d8(%rbp)
leaq -0x8a8(%rbp), %rdi
callq 0x7570
movl %eax, -0xfdc(%rbp)
jmp 0x5881
movl -0xfdc(%rbp), %eax
movl %eax, -0x8dc(%rbp)
leaq -0x8a8(%rbp), %rdi
callq 0x7590
movl %eax, -0xfe0(%rbp)
jmp 0x58a1
movl -0xfe0(%rbp), %eax
movl %eax, -0x8e0(%rbp)
movl -0x8dc(%rbp), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x3030
movq %rax, -0xfe8(%rbp)
jmp 0x58c7
movq -0xfe8(%rbp), %rax
movq %rax, -0x8e8(%rbp)
movl $0x0, -0x8ec(%rbp)
movl -0x8ec(%rbp), %eax
cmpl -0x8dc(%rbp), %eax
jae 0x598c
movl -0x8ec(%rbp), %eax
addl $0x100000, %eax         # imm = 0x100000
movl %eax, -0x8f8(%rbp)
movl -0x8dc(%rbp), %eax
decl %eax
movl %eax, -0x8fc(%rbp)
leaq -0x8f8(%rbp), %rdi
leaq -0x8fc(%rbp), %rsi
callq 0x75b0
movq %rax, -0xff0(%rbp)
jmp 0x592c
movq -0xff0(%rbp), %rdx
leaq -0x8f4(%rbp), %rdi
leaq -0x8ec(%rbp), %rsi
callq 0x75f0
jmp 0x5948
movq -0x8e8(%rbp), %rax
movl -0x8ec(%rbp), %ecx
leaq (%rax,%rcx,4), %rdx
movq -0x8f4(%rbp), %rsi
leaq -0x8a8(%rbp), %rdi
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0xc680
jmp 0x5974
jmp 0x5976
movl -0x8ec(%rbp), %eax
addl $0x100000, %eax         # imm = 0x100000
movl %eax, -0x8ec(%rbp)
jmp 0x58df
callq 0x2f600
movsd %xmm0, -0xff8(%rbp)
jmp 0x599b
movsd -0xff8(%rbp), %xmm0
movsd %xmm0, -0x908(%rbp)
movq 0x4061e(%rip), %rdi     # 0x45fd0
leaq 0x2e84d(%rip), %rsi     # 0x34206
callq 0x32c0
movq %rax, -0x1000(%rbp)
jmp 0x59c7
movq -0x1000(%rbp), %rdi
movsd -0x908(%rbp), %xmm0
movsd -0x8d8(%rbp), %xmm1
subsd %xmm1, %xmm0
callq 0x35b0
movq %rax, -0x1008(%rbp)
jmp 0x59f0
movq -0x1008(%rbp), %rdi
leaq 0x2e811(%rip), %rsi     # 0x3420f
callq 0x32c0
movq %rax, -0x1010(%rbp)
jmp 0x5a0c
movq -0x1010(%rbp), %rdi
movq 0x40596(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x5a21
movl -0x8dc(%rbp), %eax
incl %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x3030
movq %rax, -0x1018(%rbp)
jmp 0x5a3d
movq -0x1018(%rbp), %rax
movq %rax, -0x910(%rbp)
movq -0x910(%rbp), %rax
movl -0x8dc(%rbp), %ecx
movl $0x0, (%rax,%rcx,4)
leaq -0x8a8(%rbp), %rdi
movl $0x10, %esi
callq 0xe5e0
movq %rax, -0x1020(%rbp)
jmp 0x5a79
movq -0x1020(%rbp), %rax
movq %rax, -0x918(%rbp)
movq -0x918(%rbp), %rsi
leaq -0x990(%rbp), %rdi
callq 0x2b490
jmp 0x5a9c
movl $0x0, -0x994(%rbp)
movl -0x994(%rbp), %eax
cmpl -0x8dc(%rbp), %eax
jae 0x5b24
movq -0x8e8(%rbp), %rax
movl -0x994(%rbp), %ecx
movl (%rax,%rcx,4), %esi
leaq -0x990(%rbp), %rdi
callq 0x2b690
movl %eax, -0x1024(%rbp)
jmp 0x5ad8
movl -0x1024(%rbp), %edx
movq -0x8e8(%rbp), %rax
movl -0x994(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shll %eax
subl %eax, %edx
movq -0x910(%rbp), %rax
movl -0x994(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x994(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x994(%rbp)
jmp 0x5aa6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6ebd
movq -0x918(%rbp), %rax
movq %rax, -0x1030(%rbp)
cmpq $0x0, %rax
je 0x5b55
movq -0x1030(%rbp), %rdi
callq 0x2b440
movq -0x1030(%rbp), %rdi
movl $0x48, %esi
callq 0x32f0
callq 0x2f600
movsd %xmm0, -0x1038(%rbp)
jmp 0x5b64
movsd -0x1038(%rbp), %xmm0
movsd %xmm0, -0x9a0(%rbp)
movq 0x40455(%rip), %rdi     # 0x45fd0
leaq 0x2e696(%rip), %rsi     # 0x34218
callq 0x32c0
movq %rax, -0x1040(%rbp)
jmp 0x5b90
movq -0x1040(%rbp), %rdi
movsd -0x9a0(%rbp), %xmm0
movsd -0x908(%rbp), %xmm1
subsd %xmm1, %xmm0
callq 0x35b0
movq %rax, -0x1048(%rbp)
jmp 0x5bb9
movq -0x1048(%rbp), %rdi
leaq 0x2e648(%rip), %rsi     # 0x3420f
callq 0x32c0
movq %rax, -0x1050(%rbp)
jmp 0x5bd5
movq -0x1050(%rbp), %rdi
movq 0x403cd(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x5bea
movl $0x0, -0x9a4(%rbp)
movl -0x9a4(%rbp), %eax
cmpl -0x8dc(%rbp), %eax
jae 0x5c7e
movq -0x8e8(%rbp), %rax
movl -0x9a4(%rbp), %ecx
movl %ecx, %edx
movl %edx, %ecx
leaq (%rax,%rdx,4), %rax
movq %rax, -0x1060(%rbp)
movl -0x8dc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x9a8(%rbp)
leaq 0x2e759(%rip), %rdi     # 0x3438c
leaq -0x9a8(%rbp), %rsi
callq 0x75b0
movq %rax, -0x1058(%rbp)
jmp 0x5c48
movq -0x1060(%rbp), %rsi
movq -0x1058(%rbp), %rax
movl (%rax), %edx
leaq -0x8a8(%rbp), %rdi
callq 0xd9e0
jmp 0x5c66
jmp 0x5c68
movl -0x9a4(%rbp), %eax
addl $0x100000, %eax         # imm = 0x100000
movl %eax, -0x9a4(%rbp)
jmp 0x5bf4
movl $0x0, -0x9ac(%rbp)
movl -0x9ac(%rbp), %eax
cmpl -0x8dc(%rbp), %eax
jae 0x5cbd
movq -0x8e8(%rbp), %rax
movl -0x9ac(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x9ac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9ac(%rbp)
jmp 0x5c88
callq 0x2f600
movsd %xmm0, -0x1068(%rbp)
jmp 0x5ccc
movsd -0x1068(%rbp), %xmm0
movsd %xmm0, -0x9b8(%rbp)
movq 0x402ed(%rip), %rdi     # 0x45fd0
leaq 0x2e534(%rip), %rsi     # 0x3421e
callq 0x32c0
movq %rax, -0x1070(%rbp)
jmp 0x5cf8
movq -0x1070(%rbp), %rdi
movsd -0x9b8(%rbp), %xmm0
movsd -0x9a0(%rbp), %xmm1
subsd %xmm1, %xmm0
callq 0x35b0
movq %rax, -0x1078(%rbp)
jmp 0x5d21
movq -0x1078(%rbp), %rdi
leaq 0x2e4e0(%rip), %rsi     # 0x3420f
callq 0x32c0
movq %rax, -0x1080(%rbp)
jmp 0x5d3d
movq -0x1080(%rbp), %rdi
movq 0x40265(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x5d52
leaq -0xa08(%rbp), %rdi
callq 0x7620
jmp 0x5d60
movl $0x48, %edi
callq 0x32e0
movq %rax, -0x1088(%rbp)
jmp 0x5d73
movl $0x0, -0xa1c(%rbp)
movl $0x0, -0xa20(%rbp)
leaq -0xa18(%rbp), %rdi
leaq -0xa1c(%rbp), %rsi
leaq -0xa20(%rbp), %rdx
callq 0x7680
jmp 0x5da3
movq -0x1088(%rbp), %rdi
movq -0xa18(%rbp), %rdx
xorl %esi, %esi
callq 0x1ef50
jmp 0x5dba
movq -0x1088(%rbp), %rax
movq %rax, -0xa10(%rbp)
leaq -0xa08(%rbp), %rdi
leaq -0xa10(%rbp), %rsi
callq 0x7650
jmp 0x5ddd
movq $0x0, -0xa28(%rbp)
movq $0x0, -0xa30(%rbp)
movl $0x1, -0xa34(%rbp)
movl -0xa34(%rbp), %eax
cmpl -0x8dc(%rbp), %eax
ja 0x6101
movl -0xa34(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xa38(%rbp)
movq -0x910(%rbp), %rax
movl -0xa34(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1094(%rbp)
leaq -0xa08(%rbp), %rdi
callq 0x76b0
movq %rax, -0x1090(%rbp)
jmp 0x5e49
movl -0x1094(%rbp), %eax
movq -0x1090(%rbp), %rcx
movq (%rcx), %rcx
cmpl (%rcx), %eax
jae 0x5fd9
movl -0xa34(%rbp), %eax
decl %eax
movl %eax, -0x10a4(%rbp)
leaq -0xa08(%rbp), %rdi
callq 0x76b0
movq %rax, -0x10a0(%rbp)
jmp 0x5e84
movl -0x10a4(%rbp), %ecx
movq -0x10a0(%rbp), %rax
movq (%rax), %rax
movl %ecx, 0x8(%rax)
leaq -0xa08(%rbp), %rdi
callq 0x76b0
movq %rax, -0x10b0(%rbp)
jmp 0x5eac
movq -0x10b0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa28(%rbp)
leaq -0xa08(%rbp), %rdi
callq 0x76d0
jmp 0x5ecb
movq -0xa28(%rbp), %rax
movq 0x4(%rax), %rax
movq %rax, -0xa40(%rbp)
movq -0xa40(%rbp), %rdi
callq 0x76f0
movl %eax, -0x10b4(%rbp)
jmp 0x5ef1
movl -0x10b4(%rbp), %eax
cmpl -0x70(%rbp), %eax
ja 0x5f3f
movq -0xa28(%rbp), %rdi
callq 0x1f130
jmp 0x5f0a
jmp 0x5f3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6eb1
movq -0x1088(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x48, %esi
callq 0x32f0
jmp 0x6eb1
movq -0xa28(%rbp), %rax
movq %rax, -0xa30(%rbp)
movq -0xa28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0xa38(%rbp)
movq -0x910(%rbp), %rax
movl -0xa34(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10c4(%rbp)
leaq -0xa08(%rbp), %rdi
callq 0x76b0
movq %rax, -0x10c0(%rbp)
jmp 0x5f88
movl -0x10c4(%rbp), %eax
movq -0x10c0(%rbp), %rcx
movq (%rcx), %rcx
cmpl (%rcx), %eax
ja 0x5fd4
leaq -0xa08(%rbp), %rdi
callq 0x76b0
movq %rax, -0x10d0(%rbp)
jmp 0x5fb1
movq -0x10d0(%rbp), %rax
movq (%rax), %rdi
movq -0xa28(%rbp), %rsi
callq 0x1f090
jmp 0x5fc9
movq $0x0, -0xa28(%rbp)
jmp 0x5e1e
movq -0x910(%rbp), %rax
movl -0xa34(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10dc(%rbp)
leaq -0xa08(%rbp), %rdi
callq 0x76b0
movq %rax, -0x10d8(%rbp)
jmp 0x6004
movl -0x10dc(%rbp), %eax
movq -0x10d8(%rbp), %rcx
movq (%rcx), %rcx
cmpl (%rcx), %eax
jbe 0x60eb
movl $0x48, %edi
callq 0x32e0
movq %rax, -0x10e8(%rbp)
jmp 0x602f
movq -0x910(%rbp), %rax
movl -0xa34(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10ec(%rbp)
leaq -0xa50(%rbp), %rdi
leaq -0xa38(%rbp), %rdx
movq %rdx, %rsi
callq 0x7710
jmp 0x605d
movl -0x10ec(%rbp), %esi
movq -0x10e8(%rbp), %rdi
movq -0xa50(%rbp), %rdx
callq 0x1ef50
jmp 0x6078
movq -0x10e8(%rbp), %rax
movq %rax, -0xa48(%rbp)
cmpq $0x0, -0xa28(%rbp)
je 0x60d4
movq -0xa48(%rbp), %rdi
movq -0xa28(%rbp), %rsi
callq 0x1f090
jmp 0x60a5
movq $0x0, -0xa28(%rbp)
jmp 0x60d4
movq -0x10e8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x48, %esi
callq 0x32f0
jmp 0x6eb1
leaq -0xa08(%rbp), %rdi
leaq -0xa48(%rbp), %rsi
callq 0x7740
jmp 0x60e9
jmp 0x60eb
jmp 0x60ed
movl -0xa34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa34(%rbp)
jmp 0x5dfd
jmp 0x6103
movq -0xa30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x6125
movq -0xa30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa30(%rbp)
jmp 0x6103
movl -0x8dc(%rbp), %ecx
decl %ecx
movq -0xa30(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0xa30(%rbp), %rdi
callq 0x1fa50
jmp 0x6145
movq -0x910(%rbp), %rax
movq %rax, -0x10f8(%rbp)
cmpq $0x0, %rax
je 0x6165
movq -0x10f8(%rbp), %rdi
callq 0x3400
movq $0x0, -0x910(%rbp)
movl $0x0, -0xa54(%rbp)
movl $0x0, -0xa58(%rbp)
movq -0xa30(%rbp), %rdi
callq 0x1f180
jmp 0x6192
movq -0xa30(%rbp), %rdi
callq 0x1f320
jmp 0x61a0
movq -0xa30(%rbp), %rdi
leaq -0xa54(%rbp), %rsi
leaq -0xa58(%rbp), %rdx
callq 0x1f7a0
jmp 0x61bc
callq 0x2f600
movsd %xmm0, -0x1100(%rbp)
jmp 0x61cb
movsd -0x1100(%rbp), %xmm0
movsd %xmm0, -0xa60(%rbp)
movq 0x3fdee(%rip), %rdi     # 0x45fd0
leaq 0x2e041(%rip), %rsi     # 0x3422a
callq 0x32c0
movq %rax, -0x1108(%rbp)
jmp 0x61f7
movq -0x1108(%rbp), %rdi
movsd -0xa60(%rbp), %xmm0
movsd -0x9b8(%rbp), %xmm1
subsd %xmm1, %xmm0
callq 0x35b0
movq %rax, -0x1110(%rbp)
jmp 0x6220
movq -0x1110(%rbp), %rdi
leaq 0x2dfe1(%rip), %rsi     # 0x3420f
callq 0x32c0
movq %rax, -0x1118(%rbp)
jmp 0x623c
movq -0x1118(%rbp), %rdi
movq 0x3fd66(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x6251
movq 0x3fd78(%rip), %rdi     # 0x45fd0
leaq 0x2dfd9(%rip), %rsi     # 0x34238
callq 0x32c0
movq %rax, -0x1120(%rbp)
jmp 0x626d
movq -0x1120(%rbp), %rdi
movl -0x8dc(%rbp), %esi
callq 0x3420
movq %rax, -0x1128(%rbp)
jmp 0x6288
movq -0x1128(%rbp), %rdi
leaq 0x2dfa9(%rip), %rsi     # 0x3423f
callq 0x32c0
movq %rax, -0x1130(%rbp)
jmp 0x62a4
movq -0x1130(%rbp), %rdi
movl -0x8e0(%rbp), %esi
callq 0x3420
movq %rax, -0x1138(%rbp)
jmp 0x62bf
movq -0x1138(%rbp), %rdi
leaq 0x2df7f(%rip), %rsi     # 0x3424c
callq 0x32c0
movq %rax, -0x1140(%rbp)
jmp 0x62db
movq -0x1140(%rbp), %rdi
movq 0x3fcc7(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x62f0
movq 0x3fcd9(%rip), %rdi     # 0x45fd0
leaq 0x2df59(%rip), %rsi     # 0x34257
callq 0x32c0
movq %rax, -0x1148(%rbp)
jmp 0x630c
movq -0x1148(%rbp), %rdi
movl -0xa54(%rbp), %esi
callq 0x3420
movq %rax, -0x1150(%rbp)
jmp 0x6327
movq -0x1150(%rbp), %rdi
leaq 0x2df3d(%rip), %rsi     # 0x34272
callq 0x32c0
movq %rax, -0x1158(%rbp)
jmp 0x6343
movq -0x1158(%rbp), %rdi
movq 0x3fc5f(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x6358
movq 0x3fc71(%rip), %rdi     # 0x45fd0
movq 0x3fc4a(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x636d
movl $0x0, -0xa64(%rbp)
movl -0xa58(%rbp), %eax
movl %eax, -0xa68(%rbp)
movl $0x0, -0xa6c(%rbp)
movl $0x0, -0xa70(%rbp)
leaq 0x2dedb(%rip), %rdx     # 0x34279
leaq -0xa90(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x7770
jmp 0x63b0
leaq -0xa90(%rbp), %rdi
callq 0x3130
movq %rax, %rsi
leaq -0xc90(%rbp), %rdi
movl $0x4, %edx
callq 0x3360
jmp 0x63d2
movq -0xc90(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0xc90(%rbp,%rax), %rdi
callq 0x3160
movb %al, -0x1159(%rbp)
jmp 0x63f2
movb -0x1159(%rbp), %al
testb $0x1, %al
jne 0x6401
jmp 0x64bf
movq 0x3fbe8(%rip), %rdi     # 0x45ff0
leaq 0x2de71(%rip), %rsi     # 0x34280
callq 0x32c0
movq %rax, -0x1168(%rbp)
jmp 0x641d
movq -0x1168(%rbp), %rdi
leaq -0xa90(%rbp), %rsi
callq 0x3290
movq %rax, -0x1170(%rbp)
jmp 0x6439
movq -0x1170(%rbp), %rdi
leaq 0x2e449(%rip), %rsi     # 0x34890
callq 0x32c0
movq %rax, -0x1178(%rbp)
jmp 0x6455
movq -0x1178(%rbp), %rdi
movq 0x3fb4d(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x646a
movq -0x8e8(%rbp), %rax
movq %rax, -0x1180(%rbp)
cmpq $0x0, %rax
je 0x648a
movq -0x1180(%rbp), %rdi
callq 0x3400
movl $0x3, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x6e67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6ea5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6e99
leaq 0x2ddda(%rip), %rdx     # 0x342a0
leaq -0xcb0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x7770
jmp 0x64d8
leaq -0xcb0(%rbp), %rdi
callq 0x3130
movq %rax, %rsi
leaq -0xeb0(%rbp), %rdi
movl $0x4, %edx
callq 0x3360
jmp 0x64fa
movq -0xeb0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0xeb0(%rbp,%rax), %rdi
callq 0x3160
movb %al, -0x1181(%rbp)
jmp 0x651a
movb -0x1181(%rbp), %al
testb $0x1, %al
jne 0x6529
jmp 0x65f5
movq 0x3fac0(%rip), %rdi     # 0x45ff0
leaq 0x2dd49(%rip), %rsi     # 0x34280
callq 0x32c0
movq %rax, -0x1190(%rbp)
jmp 0x6545
movq -0x1190(%rbp), %rdi
leaq -0xcb0(%rbp), %rsi
callq 0x3290
movq %rax, -0x1198(%rbp)
jmp 0x6561
movq -0x1198(%rbp), %rdi
leaq 0x2e321(%rip), %rsi     # 0x34890
callq 0x32c0
movq %rax, -0x11a0(%rbp)
jmp 0x657d
movq -0x11a0(%rbp), %rdi
movq 0x3fa25(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x6592
movq -0x8e8(%rbp), %rax
movq %rax, -0x11a8(%rbp)
cmpq $0x0, %rax
je 0x65b2
movq -0x11a8(%rbp), %rdi
callq 0x3400
leaq -0xc90(%rbp), %rdi
callq 0x3460
jmp 0x65c0
movl $0x3, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x6e33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6e59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6e4d
leaq -0xc90(%rbp), %rdi
leaq -0xa68(%rbp), %rsi
movl $0x4, %edx
callq 0x3410
jmp 0x660f
leaq -0xc90(%rbp), %rdi
leaq -0xa70(%rbp), %rsi
movl $0x4, %edx
callq 0x3410
jmp 0x6629
callq 0x2f600
movsd %xmm0, -0x11b0(%rbp)
jmp 0x6638
movsd -0x11b0(%rbp), %xmm0
movsd %xmm0, -0xeb8(%rbp)
leaq -0xa08(%rbp), %rdi
callq 0x77f0
movb %al, -0x11b1(%rbp)
jmp 0x665c
movb -0x11b1(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x666a
jmp 0x667a
leaq -0xa08(%rbp), %rdi
callq 0x76d0
jmp 0x6678
jmp 0x6648
movq -0xa30(%rbp), %rax
movq %rax, -0xa28(%rbp)
cmpq $0x0, -0xa28(%rbp)
je 0x66bd
leaq -0xa08(%rbp), %rdi
leaq -0xa28(%rbp), %rsi
callq 0x7740
jmp 0x66a7
jmp 0x66a9
movq -0xa28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xa28(%rbp)
jmp 0x6688
jmp 0x66bf
leaq -0xa08(%rbp), %rdi
callq 0x76b0
movq %rax, -0x11c0(%rbp)
jmp 0x66d4
movq -0x11c0(%rbp), %rax
movq (%rax), %rax
cmpq -0xa30(%rbp), %rax
je 0x6aa2
leaq -0xa08(%rbp), %rdi
callq 0x76b0
movq %rax, -0x11c8(%rbp)
jmp 0x6700
movq -0x11c8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xec0(%rbp)
leaq -0xa08(%rbp), %rdi
callq 0x76d0
jmp 0x671f
movq -0xec0(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xec8(%rbp)
cmpq $0x0, -0xec8(%rbp)
je 0x6766
leaq -0xa08(%rbp), %rdi
leaq -0xec8(%rbp), %rsi
callq 0x7740
jmp 0x6750
jmp 0x6752
movq -0xec8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xec8(%rbp)
jmp 0x6731
movq -0xec0(%rbp), %rax
testb $0x1, 0x38(%rax)
je 0x6797
movl -0xa68(%rbp), %ecx
movq -0xec0(%rbp), %rax
movl %ecx, 0x34(%rax)
movl -0xa68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa68(%rbp)
jmp 0x66bf
movq -0xec0(%rbp), %rdi
movq -0x8e8(%rbp), %rsi
callq 0x1f820
jmp 0x67ac
movq -0xec0(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x7810
movl -0x8e0(%rbp), %ecx
cmpq %rcx, %rax
jb 0x67d7
movq -0xec0(%rbp), %rdi
callq 0x1fa50
jmp 0x67d5
jmp 0x67d7
movq -0xec0(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x683b
movq -0xec0(%rbp), %rax
testb $0x1, 0x38(%rax)
jne 0x683b
movq -0xec0(%rbp), %rax
movl 0x30(%rax), %eax
movq %rax, -0x11d0(%rbp)
movl -0x74(%rbp), %eax
movq %rax, -0x11d8(%rbp)
movq -0xec0(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x7810
movq -0x11d8(%rbp), %rcx
movq %rax, %rdx
movq -0x11d0(%rbp), %rax
imulq %rdx, %rcx
cmpq %rcx, %rax
jbe 0x6a5c
movq -0xec0(%rbp), %rdi
callq 0x1fae0
jmp 0x6849
imull $0xffffffff, -0x8e0(%rbp), %eax # imm = 0xFFFFFFFF
movl %eax, -0xecc(%rbp)
movq -0xec0(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x689c
movl -0xa64(%rbp), %ecx
movq -0xec0(%rbp), %rax
movl %ecx, 0x34(%rax)
movl -0xa64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa64(%rbp)
movl -0xa64(%rbp), %ecx
movl -0xecc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xecc(%rbp)
jmp 0x68cf
movl -0xa68(%rbp), %ecx
movq -0xec0(%rbp), %rax
movl %ecx, 0x34(%rax)
movl -0xa68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa68(%rbp)
movl -0xa68(%rbp), %ecx
movl -0xecc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xecc(%rbp)
movq -0xec0(%rbp), %rax
testb $0x1, 0x38(%rax)
jne 0x6a5a
movq -0xec0(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x7810
cmpq $0x1, %rax
jne 0x6988
movl -0xecc(%rbp), %esi
negl %esi
leaq -0xeb0(%rbp), %rdi
callq 0x3550
movq %rax, -0x11e0(%rbp)
jmp 0x6917
movq -0x11e0(%rbp), %rdi
leaq 0x2d8f6(%rip), %rsi     # 0x3421b
callq 0x32c0
movq %rax, -0x11e8(%rbp)
jmp 0x6933
movq -0xec0(%rbp), %rax
movq 0x40(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7830
movq %rax, -0x11f0(%rbp)
jmp 0x6950
movq -0x11e8(%rbp), %rdi
movq -0x11f0(%rbp), %rax
movl (%rax), %esi
callq 0x3420
movq %rax, -0x11f8(%rbp)
jmp 0x696e
movq -0x11f8(%rbp), %rdi
movq 0x3f634(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x6983
jmp 0x6a58
leaq -0xc90(%rbp), %rdi
leaq -0xecc(%rbp), %rsi
movl $0x4, %edx
callq 0x3410
jmp 0x69a2
movq -0xec0(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x7870
movq %rax, -0xed8(%rbp)
movq -0xec0(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x78e0
movq %rax, -0xee0(%rbp)
leaq -0xed8(%rbp), %rdi
leaq -0xee0(%rbp), %rsi
callq 0x78a0
testb $0x1, %al
jne 0x69e9
jmp 0x6a27
leaq -0xed8(%rbp), %rdi
callq 0x7910
movl (%rax), %eax
movl %eax, -0xee4(%rbp)
leaq -0xc90(%rbp), %rdi
leaq -0xee4(%rbp), %rsi
movl $0x4, %edx
callq 0x3410
jmp 0x6a17
jmp 0x6a19
leaq -0xed8(%rbp), %rdi
callq 0x7930
jmp 0x69b9
movl -0xa6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa6c(%rbp)
movq -0xec0(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x7810
movq %rax, %rcx
movl -0xa70(%rbp), %eax
addq %rcx, %rax
movl %eax, -0xa70(%rbp)
jmp 0x6a5a
jmp 0x6a9d
movq -0xec0(%rbp), %rdi
callq 0x1f690
jmp 0x6a6a
movq -0xec0(%rbp), %rax
movq %rax, -0x1200(%rbp)
cmpq $0x0, %rax
je 0x6a9b
movq -0x1200(%rbp), %rdi
callq 0x1efb0
movq -0x1200(%rbp), %rdi
movl $0x48, %esi
callq 0x32f0
jmp 0x6a9d
jmp 0x66bf
movl -0xa68(%rbp), %ecx
movq -0xa30(%rbp), %rax
movl %ecx, 0x34(%rax)
movl -0xa68(%rbp), %eax
incl %eax
movl %eax, -0xa68(%rbp)
callq 0x2f600
movsd %xmm0, -0x1208(%rbp)
jmp 0x6acf
movsd -0x1208(%rbp), %xmm0
movsd %xmm0, -0xef0(%rbp)
movq 0x3f4ea(%rip), %rdi     # 0x45fd0
leaq 0x2d7bf(%rip), %rsi     # 0x342ac
callq 0x32c0
movq %rax, -0x1210(%rbp)
jmp 0x6afb
movq -0x1210(%rbp), %rdi
movsd -0xef0(%rbp), %xmm0
movsd -0xeb8(%rbp), %xmm1
subsd %xmm1, %xmm0
callq 0x35b0
movq %rax, -0x1218(%rbp)
jmp 0x6b24
movq -0x1218(%rbp), %rdi
leaq 0x2d6dd(%rip), %rsi     # 0x3420f
callq 0x32c0
movq %rax, -0x1220(%rbp)
jmp 0x6b40
movq -0x1220(%rbp), %rdi
movq 0x3f462(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x6b55
movq 0x3f474(%rip), %rdi     # 0x45fd0
movq 0x3f44d(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x6b6a
xorl %edx, %edx
movl %edx, %esi
leaq -0xc90(%rbp), %rdi
callq 0x32d0
jmp 0x6b7c
leaq -0xc90(%rbp), %rdi
leaq -0xa6c(%rbp), %rsi
movl $0x4, %edx
callq 0x3410
jmp 0x6b96
leaq -0xc90(%rbp), %rdi
leaq -0xa70(%rbp), %rsi
movl $0x4, %edx
callq 0x3410
jmp 0x6bb0
movq 0x3f419(%rip), %rdi     # 0x45fd0
leaq 0x2d6f7(%rip), %rsi     # 0x342b5
callq 0x32c0
movq %rax, -0x1228(%rbp)
jmp 0x6bcc
movq -0x1228(%rbp), %rdi
movl -0xa6c(%rbp), %esi
callq 0x3420
movq %rax, -0x1230(%rbp)
jmp 0x6be7
movq -0x1230(%rbp), %rdi
leaq 0x2d6cb(%rip), %rsi     # 0x342c0
callq 0x32c0
movq %rax, -0x1238(%rbp)
jmp 0x6c03
movq -0x1238(%rbp), %rdi
movl -0xa70(%rbp), %esi
callq 0x3420
movq %rax, -0x1240(%rbp)
jmp 0x6c1e
movq -0x1240(%rbp), %rdi
leaq 0x2d69d(%rip), %rsi     # 0x342c9
callq 0x32c0
movq %rax, -0x1248(%rbp)
jmp 0x6c3a
movq -0x1248(%rbp), %rdi
movq 0x3f368(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x6c4f
movq 0x3f37a(%rip), %rdi     # 0x45fd0
movq 0x3f353(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x6c64
leaq -0xc90(%rbp), %rdi
callq 0x3460
jmp 0x6c72
leaq -0xeb0(%rbp), %rdi
callq 0x3460
jmp 0x6c80
movq -0x8e8(%rbp), %rax
movq %rax, -0x1250(%rbp)
cmpq $0x0, %rax
je 0x6ca0
movq -0x1250(%rbp), %rdi
callq 0x3400
movq -0xa30(%rbp), %rsi
leaq -0xf40(%rbp), %rdi
leaq -0x8a8(%rbp), %rdx
callq 0x1fde0
jmp 0x6cbc
leaq -0xf40(%rbp), %rdi
callq 0x7950
movb %al, -0x1251(%rbp)
jmp 0x6cd0
movb -0x1251(%rbp), %al
testb $0x1, %al
jne 0x6cdf
jmp 0x6de8
movq 0x3f2ea(%rip), %rdi     # 0x45fd0
leaq 0x2d5e3(%rip), %rsi     # 0x342d0
callq 0x32c0
movq %rax, -0x1260(%rbp)
jmp 0x6cfb
leaq -0xf40(%rbp), %rdi
callq 0x7970
movl %eax, -0x1264(%rbp)
jmp 0x6d0f
movl -0x1264(%rbp), %esi
movq -0x1260(%rbp), %rdi
callq 0x3420
movq %rax, -0x1270(%rbp)
jmp 0x6d2a
movq -0x1270(%rbp), %rdi
leaq 0x2d588(%rip), %rsi     # 0x342c0
callq 0x32c0
movq %rax, -0x1278(%rbp)
jmp 0x6d46
movq -0x1278(%rbp), %rdi
movl -0xa64(%rbp), %esi
callq 0x3420
movq %rax, -0x1280(%rbp)
jmp 0x6d61
movq -0x1280(%rbp), %rdi
leaq 0x2d571(%rip), %rsi     # 0x342e0
callq 0x32c0
movq %rax, -0x1288(%rbp)
jmp 0x6d7d
movq -0x1288(%rbp), %rdi
movq 0x3f225(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x6d92
movq 0x3f237(%rip), %rdi     # 0x45fd0
movq 0x3f210(%rip), %rsi     # 0x45fb0
callq 0x3330
jmp 0x6da7
leaq -0xf40(%rbp), %rdi
movl $0x1, %esi
callq 0x22e80
jmp 0x6dba
leaq -0xf40(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x22bb0
jmp 0x6dcc
jmp 0x6de8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xf40(%rbp), %rdi
callq 0x20b70
jmp 0x6e4d
movq -0xa30(%rbp), %rax
movq %rax, -0x1290(%rbp)
cmpq $0x0, %rax
je 0x6e19
movq -0x1290(%rbp), %rdi
callq 0x1efb0
movq -0x1290(%rbp), %rdi
movl $0x48, %esi
callq 0x32f0
movl $0x0, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
leaq -0xf40(%rbp), %rdi
callq 0x20b70
leaq -0xeb0(%rbp), %rdi
callq 0x3480
leaq -0xcb0(%rbp), %rdi
callq 0x3638
jmp 0x6e67
leaq -0xeb0(%rbp), %rdi
callq 0x3480
leaq -0xcb0(%rbp), %rdi
callq 0x3638
jmp 0x6e99
leaq -0xc90(%rbp), %rdi
callq 0x3480
leaq -0xa90(%rbp), %rdi
callq 0x3638
leaq -0xa08(%rbp), %rdi
callq 0x79b0
leaq -0x990(%rbp), %rdi
callq 0x2b4c0
jmp 0x6ecb
leaq -0xc90(%rbp), %rdi
callq 0x3480
leaq -0xa90(%rbp), %rdi
callq 0x3638
leaq -0xa08(%rbp), %rdi
callq 0x79b0
leaq -0x990(%rbp), %rdi
callq 0x2b4c0
jmp 0x6ed9
leaq -0x8a8(%rbp), %rdi
callq 0xb5f0
jmp 0x6ee7
leaq -0x8a8(%rbp), %rdi
callq 0xb5f0
jmp 0x6ef2
leaq -0x30(%rbp), %rdi
callq 0x3638
jmp 0x6efd
leaq -0x30(%rbp), %rdi
callq 0x3638
jmp 0x6f09
movl -0x4(%rbp), %eax
addq $0x1290, %rsp           # imm = 0x1290
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3570
nopw %cs:(%rax,%rax)