// File: /workspace/github_cpp_makefile_star2_O1/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::DocArray::readRules(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
void
DocArray::readRules(const std::string& name_prefix, bool print)
{
  std::vector<pair_type> occurrences; // (block_id, rule_id)
  std::vector<usint> docs;
  SuccinctVector::Encoder rb_encoder(RULE_BLOCK_SIZE);
  SuccinctVector::Encoder rb_encoder_rle(RULE_BLOCK_SIZE);
  usint files = 0, current_rule = this->getNumberOfDocuments();
  usint total_rules = 0, total_occs = 0, total_size = 0, total_runs = 0;


  // Parse the individual files containing rules / bicliques.
  while(true)
  {
    std::ostringstream fn;
    fn << name_prefix << "-biclique-it-" << files << ".txt";
    std::ifstream input(fn.str().c_str(), std::ios_base::binary);
    if(!input) { break; }

    std::vector<std::string> rows;
    readRows(input, rows, true);
    input.close();

    bool invalid_blocks = false, nonoccurring_rules = false, invalid_docs = false, empty_rules = false;
    usint curr_rules = 0, curr_occs = 0, curr_size = 0, curr_runs = 0;
    for(std::vector<std::string>::iterator siter = rows.begin(); siter != rows.end(); ++siter)
    {
      std::vector<usint> before, after;
      parseLine(*siter, before, '-', after);

      // Block ids.
      bool occurs = false;
      for(std::vector<usint>::iterator iter = before.begin(); iter != before.end(); ++iter)
      {
        if(this->nodeIsBlock(*iter))
        {
          occurrences.push_back(pair_type(this->nodeToBlock(*iter), current_rule));
          curr_occs++; occurs = true;
        }
        else { invalid_blocks = true; }
      }
      if(!occurs) { nonoccurring_rules = true; }
      curr_rules++; current_rule++;

      // Document ids.
      rb_encoder.addBit(total_size + curr_size);
      rb_encoder_rle.addBit(docs.size());
      occurs = false;
      usint prev_doc = WORD_MAX - 1, run_length = 0;
      for(std::vector<usint>::iterator iter = after.begin(); iter != after.end(); ++iter)
      {
        if(this->nodeIsDoc(*iter))
        {
          usint doc_id = this->nodeToDoc(*iter);
          if(doc_id == prev_doc + 1) { run_length++; prev_doc++; }
          else
          {
            if(run_length > 0) { docs.push_back(run_length); }
            docs.push_back(doc_id); run_length = 1; curr_runs++;
            prev_doc = doc_id;
          }
          curr_size++; occurs = true;
        }
        else { invalid_docs = true; }
      }
      if(!occurs)
      {
        docs.push_back(this->getNumberOfDocuments());
        curr_size++; curr_runs++; empty_rules = true;
      }
      else { docs.push_back(run_length); }
    }

    if(print)
    {
      std::cout << "File " << files << ": "
        << curr_rules << " rules, "
        << curr_occs << " occurrences, "
        << curr_size << " document ids in "
        << curr_runs << " runs" << std::endl;
      if(invalid_blocks)     { std::cout << "There were invalid block ids." << std::endl; }
      if(nonoccurring_rules) { std::cout << "There were non-occurring rules." << std::endl; }
      if(invalid_docs)       { std::cout << "There were invalid document ids." << std::endl; }
      if(empty_rules)        { std::cout << "There were empty rules." << std::endl; }
      std::cout << std::endl;
    }
    files++;
    total_rules += curr_rules; total_occs += curr_occs; total_size += curr_size; total_runs += curr_runs;
  }


  // Parse the singleton file and the remaining part of the graph.
  usint total_singletons = 0, temp = 0;

  std::ostringstream ffn;
  ffn << name_prefix << "-it-" << (files - 1);
  std::string remainder_name = ffn.str();
  temp = parseSingletonFile(remainder_name, *this, occurrences, print);
  if(temp > 0) { total_singletons += temp; files++; }

  std::string singleton_name = name_prefix + ".singletons";
  temp = parseSingletonFile(singleton_name, *this, occurrences, print);
  if(temp > 0) { total_singletons += temp; files++; }


  // Build the structures.
  if(total_size < docs.size())
  {
    this->uses_rle = false;
    this->rule_borders = new SuccinctVector(rb_encoder, total_size);
    WriteBuffer rbuf(total_size, length(this->getNumberOfDocuments()));
    bool need_run_length = false; usint prev = 0;
    for(std::vector<usint>::iterator iter = docs.begin(); iter != docs.end(); ++iter)
    {
      if(!need_run_length)
      {
        prev = *iter;
        rbuf.writeItem(*iter);
        need_run_length = (*iter != this->getNumberOfDocuments());
      }
      else
      {
        for(usint i = 1; i < *iter; i++) { rbuf.writeItem(prev + i); }
        need_run_length = false;
      }
    }
    this->rules = rbuf.getReadBuffer();
  }
  else
  {
    this->uses_rle = true;
    this->rule_borders = new SuccinctVector(rb_encoder_rle, docs.size());
    WriteBuffer rbuf(docs.size(), length(this->getNumberOfDocuments()));
    for(std::vector<usint>::iterator iter = docs.begin(); iter != docs.end(); ++iter)
    {
      rbuf.writeItem(*iter);
    }
    this->rules = rbuf.getReadBuffer();
  }

  parallelSort(occurrences.begin(), occurrences.end());
  usint real_occs = occurrences.size();
  for(usint i = 0, looking_for = 0; i < occurrences.size(); i++)
  {
    while(looking_for < occurrences[i].first) { real_occs++; looking_for++; }
    looking_for = occurrences[i].first + 1;
  }
  real_occs += this->getNumberOfNodes() - 1 - occurrences.rbegin()->first;

  SuccinctVector::Encoder bb_encoder(BLOCK_BLOCK_SIZE);
  WriteBuffer bbuf(real_occs, length(this->maxInteger()));
  usint pos = 0;
  for(usint i = 0, looking_for = 0; i < occurrences.size(); i++)
  {
    while(looking_for < occurrences[i].first)
    {
      bb_encoder.addBit(pos);
      bbuf.writeItem(this->maxInteger()); pos++;
      looking_for++;
    }
    if(i == 0 || occurrences[i].first != occurrences[i - 1].first)
    {
      bb_encoder.addBit(pos);
      looking_for++;
    }
    bbuf.writeItem(occurrences[i].second); pos++;
  }
  for(usint i = occurrences.rbegin()->first + 1; i < this->getNumberOfNodes(); i++)
  {
    bb_encoder.addBit(pos);
    bbuf.writeItem(this->maxInteger()); pos++;
  }
  this->block_borders = new SuccinctVector(bb_encoder, real_occs);
  this->blocks = bbuf.getReadBuffer();

  if(print)
  {
    std::cout << files << " files: "
      << total_rules << " rules, "
      << total_occs << " occurrences, "
      << total_size << " document ids in "
      << total_runs << " runs, "
      << total_singletons << " singletons, "
      << (real_occs - total_occs - total_singletons) << " complete blocks" << std::endl;
    if(this->usesRLE()) { std::cout << "Using run-length encoded rules." << std::endl; }
    std::cout << std::endl;
  }
  this->has_grammar = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x568, %rsp            # imm = 0x568
movl %edx, 0x78(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
xorl %eax, %eax
movq %rax, 0x90(%rsp)
movq %rax, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
leaq 0x2f0(%rsp), %rdi
movl $0x20, %esi
movl $0x100000, %edx         # imm = 0x100000
callq 0x1acfa
leaq 0x280(%rsp), %rdi
movl $0x20, %esi
movl $0x100000, %edx         # imm = 0x100000
callq 0x1acfa
movq (%rbx), %rax
movl 0x820(%rax), %eax
movl %eax, 0x8(%rsp)
leaq 0x108(%rsp), %r15
xorl %r12d, %r12d
movl $0x0, 0x9c(%rsp)
movl $0x0, 0x74(%rsp)
xorl %r13d, %r13d
movl $0x0, 0x98(%rsp)
movq %r14, 0xf0(%rsp)
movq %r15, %rdi
callq 0x3310
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x32b0
movq %rax, %r15
movl $0xd, %edx
movq %rax, %rdi
leaq 0xbee3(%rip), %rsi      # 0x1e9e3
callq 0x32b0
movl %r12d, %ebp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x3180
movl $0x4, %edx
movq %rax, %rdi
leaq 0xbecf(%rip), %rsi      # 0x1e9f1
callq 0x32b0
leaq 0x30(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x33c0
movq 0x30(%rsp), %rsi
leaq 0x360(%rsp), %rdi
movl $0x4, %edx
callq 0x3480
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x12b6c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x360(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x380(%rsp,%rax), %eax
movl %eax, 0xec(%rsp)
testb $0x5, %al
jne 0x131ba
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x360(%rsp), %r14
movq %r14, %rdi
leaq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0x1badf
movq %r14, %rdi
callq 0x3080
movq %rbp, 0x100(%rsp)
movq %r12, 0xe0(%rsp)
movq 0x30(%rsp), %r15
cmpq 0x38(%rsp), %r15
je 0x12ed2
movl $0x0, 0x68(%rsp)
xorl %r12d, %r12d
movl $0x0, 0x4(%rsp)
movl $0x0, 0x58(%rsp)
movl $0x0, 0x7c(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x5c(%rsp)
xorl %ebp, %ebp
movq %r13, 0xf8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xc0(%rsp)
xorl %eax, %eax
movq %rax, 0xd0(%rsp)
movq %rax, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movq %r15, %rdi
leaq 0xc0(%rsp), %rsi
movl $0x2d, %edx
leaq 0xa0(%rsp), %rcx
callq 0x124f7
movq 0xc0(%rsp), %r13
cmpq 0xc8(%rsp), %r13
je 0x12ce7
xorl %eax, %eax
movl (%r13), %edx
movq (%rbx), %rcx
movl 0x820(%rcx), %ecx
cmpl %edx, %ecx
jae 0x12c94
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdi
movl 0x4(%rsi), %esi
addl %ecx, %esi
addl 0x4(%rdi), %esi
cmpl %edx, %esi
jae 0x12c99
movb $0x1, %bpl
jmp 0x12cc3
notl %ecx
addl (%r13), %ecx
movl %ecx, 0x60(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x64(%rsp)
leaq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xda22
incl 0x4(%rsp)
movb $0x1, %al
addq $0x4, %r13
cmpq 0xc8(%rsp), %r13
jne 0x12c6f
movl 0x5c(%rsp), %r13d
movzbl %r13b, %r13d
testb $0x1, %al
movl $0x1, %eax
cmovel %eax, %r13d
jmp 0x12cea
movb $0x1, %r13b
movq 0xf8(%rsp), %rax
leal (%r12,%rax), %esi
leaq 0x2f0(%rsp), %rdi
callq 0x1adc4
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
shrq $0x2, %rsi
leaq 0x280(%rsp), %rdi
callq 0x1adc4
movl %r13d, 0x5c(%rsp)
movl $0x0, 0x60(%rsp)
movq 0xa0(%rsp), %r13
cmpq 0xa8(%rsp), %r13
je 0x12e00
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
xorl %ecx, %ecx
movl (%r13), %edx
testl %edx, %edx
je 0x12d5b
movq (%rbx), %rsi
cmpl %edx, 0x820(%rsi)
jae 0x12d63
movb $0x1, %r14b
jmp 0x12dec
movl (%r13), %edx
decl %edx
movl %edx, 0xc(%rsp)
incl %eax
movl 0x60(%rsp), %ecx
cmpl %eax, %edx
jne 0x12d7f
incl %ecx
movl %ecx, 0x60(%rsp)
jmp 0x12de7
testl %ecx, %ecx
je 0x12dab
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x12d9c
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x12dab
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0xbd24
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x12dc8
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x12dd7
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0xbd24
movl $0x1, 0x60(%rsp)
incl 0x68(%rsp)
movl 0xc(%rsp), %eax
incl %r12d
movb $0x1, %cl
addq $0x4, %r13
cmpq 0xa8(%rsp), %r13
jne 0x12d48
jmp 0x12e02
xorl %ecx, %ecx
testb $0x1, %cl
movq 0xf8(%rsp), %r13
je 0x12e2c
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x12e52
movl 0x60(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x12e7f
movq (%rbx), %rax
movl 0x820(%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x12e63
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x12e72
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0xbd24
jmp 0x12e7f
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0xfc62
incl %r12d
incl 0x68(%rsp)
movb $0x1, %al
movl %eax, 0x7c(%rsp)
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x12e9c
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x12eb9
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
incl 0x58(%rsp)
incl 0x8(%rsp)
addq $0x20, %r15
cmpq 0x38(%rsp), %r15
jne 0x12c19
jmp 0x12f02
xorl %ebp, %ebp
movl $0x0, 0x5c(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x7c(%rsp)
movl $0x0, 0x58(%rsp)
movl $0x0, 0x4(%rsp)
xorl %r12d, %r12d
movl $0x0, 0x68(%rsp)
cmpb $0x0, 0x78(%rsp)
je 0x13176
movl $0x5, %edx
movq 0x150b7(%rip), %rdi     # 0x27fd0
leaq 0xbad6(%rip), %rsi      # 0x1e9f6
callq 0x32b0
movq 0x150a4(%rip), %rdi     # 0x27fd0
movq 0x100(%rsp), %rsi
callq 0x3180
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
leaq 0xb2cb(%rip), %rsi      # 0x1e216
callq 0x32b0
movl 0x58(%rsp), %esi
movq %r15, %rdi
callq 0x3180
movq %rax, %r15
movl $0x8, %edx
movq %rax, %rdi
leaq 0xba8e(%rip), %rsi      # 0x1e9fc
callq 0x32b0
movl 0x4(%rsp), %esi
movq %r15, %rdi
callq 0x3180
movq %rax, %r15
movl $0xe, %edx
movq %rax, %rdi
leaq 0xba74(%rip), %rsi      # 0x1ea05
callq 0x32b0
movl %r12d, %esi
movq %r15, %rdi
callq 0x3180
movq %rax, %r15
movl $0x11, %edx
movq %rax, %rdi
leaq 0xba61(%rip), %rsi      # 0x1ea14
callq 0x32b0
movl 0x68(%rsp), %esi
movq %r15, %rdi
callq 0x3180
movq %rax, %r15
movl $0x5, %edx
movq %rax, %rdi
leaq 0xba50(%rip), %rsi      # 0x1ea26
callq 0x32b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
testb $0x1, %bpl
je 0x13052
movl $0x1d, %edx
movq 0x14fbc(%rip), %rdi     # 0x27fd0
leaq 0xb989(%rip), %rsi      # 0x1e9a4
callq 0x32b0
movq 0x14fa9(%rip), %rcx     # 0x27fd0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq 0x14f8b(%rip), %rdi     # 0x27fd0
callq 0x3040
movq %rax, %rdi
callq 0x3190
testb $0x1, 0x5c(%rsp)
je 0x130a3
movl $0x1f, %edx
movq 0x14f6b(%rip), %rdi     # 0x27fd0
leaq 0xb9c0(%rip), %rsi      # 0x1ea2c
callq 0x32b0
movq 0x14f58(%rip), %rcx     # 0x27fd0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq 0x14f3a(%rip), %rdi     # 0x27fd0
callq 0x3040
movq %rax, %rdi
callq 0x3190
testb $0x1, %r14b
je 0x130f3
movl $0x20, %edx
movq 0x14f1b(%rip), %rdi     # 0x27fd0
leaq 0xb906(%rip), %rsi      # 0x1e9c2
callq 0x32b0
movq 0x14f08(%rip), %rcx     # 0x27fd0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq 0x14eea(%rip), %rdi     # 0x27fd0
callq 0x3040
movq %rax, %rdi
callq 0x3190
testb $0x1, 0x7c(%rsp)
je 0x13144
movl $0x17, %edx
movq 0x14eca(%rip), %rdi     # 0x27fd0
leaq 0xb93f(%rip), %rsi      # 0x1ea4c
callq 0x32b0
movq 0x14eb7(%rip), %rcx     # 0x27fd0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq 0x14e99(%rip), %rdi     # 0x27fd0
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq 0x14e85(%rip), %rcx     # 0x27fd0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq 0x14e67(%rip), %rdi     # 0x27fd0
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq 0xe0(%rsp), %r14
incl %r14d
movl 0x58(%rsp), %eax
addl %eax, 0x9c(%rsp)
movl 0x4(%rsp), %eax
addl %eax, 0x74(%rsp)
addl %r13d, %r12d
movl 0x68(%rsp), %eax
addl %eax, 0x98(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x14482
movl %r12d, %r13d
movq %r14, %r12
movq 0xf0(%rsp), %r14
leaq 0x360(%rsp), %rdi
callq 0x3090
leaq 0x108(%rsp), %r15
movq %r15, %rdi
movq 0x14def(%rip), %rsi     # 0x27fc8
callq 0x3140
leaq 0x178(%rsp), %rdi
callq 0x30d0
testb $0x5, 0xec(%rsp)
je 0x12ad7
leaq 0x360(%rsp), %rdi
callq 0x3310
movq (%r14), %rsi
movq 0x8(%r14), %rdx
leaq 0x360(%rsp), %rdi
callq 0x32b0
movq %rax, %r14
leaq 0xb7c8(%rip), %rsi      # 0x1e9ec
movl $0x4, %edx
movq %rax, %rdi
callq 0x32b0
leal -0x1(%r12), %esi
movq %r14, %rdi
callq 0x3180
leaq 0x368(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0x33c0
movzbl 0x78(%rsp), %ebp
leaq 0xc0(%rsp), %rdi
leaq 0x80(%rsp), %rdx
movq %rbx, %rsi
movl %ebp, %ecx
callq 0x1265d
movq 0xf0(%rsp), %rcx
movl %eax, 0x4(%rsp)
cmpl $0x1, %eax
sbbl $-0x1, %r12d
leaq 0xb0(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
addq %rsi, %rdx
leaq 0xa0(%rsp), %rdi
callq 0x6574
leaq 0xafec(%rip), %rsi      # 0x1e29b
leaq 0xa0(%rsp), %rdi
callq 0x34a0
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rdx
movq %rbx, %rsi
movl %ebp, %ecx
callq 0x1265d
movl %eax, 0x8(%rsp)
cmpl $0x1, 0x8(%rsp)
sbbl $-0x1, %r12d
movl %r13d, %eax
movq 0x18(%rsp), %r15
subq 0x10(%rsp), %r15
sarq $0x2, %r15
movq %rax, 0x68(%rsp)
cmpq %rax, %r15
jbe 0x134cf
movb $0x0, 0x4a(%rbx)
movl $0x48, %edi
callq 0x3260
movq %rax, %r15
leaq 0x2f0(%rsp), %rsi
movq %rax, %rdi
movl %r13d, %edx
callq 0x1a43e
movq %r15, 0x28(%rbx)
movq (%rbx), %rax
movl 0x820(%rax), %eax
bsrl %eax, %edx
xorl $-0x20, %edx
addl $0x21, %edx
testl %eax, %eax
cmovel %eax, %edx
leaq 0x108(%rsp), %rdi
movl %r13d, %esi
callq 0x16d92
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdi
cmpq %rdi, %rsi
je 0x134bd
movq 0x108(%rsp), %r8
movq (%rbx), %r9
xorl %r10d, %r10d
xorl %eax, %eax
movl (%rsi), %r11d
testb $0x1, %al
je 0x13426
cmpl $0x2, %r11d
jb 0x1341c
movl $0x1, %r11d
movq 0x108(%rsp), %r14
leal (%r10,%r11), %ebp
movl 0x114(%rsp), %ecx
movl 0x124(%rsp), %edx
movl %ecx, %eax
subl %edx, %eax
jb 0x133e0
movl %ebp, %r15d
movl %eax, %ecx
shrl %cl, %r15d
negb %dl
movl %edx, %ecx
shll %cl, %r15d
shrl %cl, %r15d
movl 0x120(%rsp), %ecx
orl %r15d, (%r14,%rcx,4)
incl 0x120(%rsp)
movl $0x20, 0x124(%rsp)
movl %eax, %ecx
testl %ecx, %ecx
je 0x13409
movl 0x120(%rsp), %edx
movl 0x124(%rsp), %eax
subl %ecx, %eax
negb %cl
shll %cl, %ebp
shrl %cl, %ebp
movl %eax, %ecx
shll %cl, %ebp
movl %eax, 0x124(%rsp)
orl %ebp, (%r14,%rdx,4)
incl 0x128(%rsp)
incl %r11d
cmpl (%rsi), %r11d
jb 0x13397
xorl %eax, %eax
movl %r10d, %r11d
jmp 0x134ad
movl 0x114(%rsp), %ecx
movl 0x124(%rsp), %edx
movl %ecx, %eax
subl %edx, %eax
jb 0x1346b
movl %r11d, %r10d
movl %eax, %ecx
shrl %cl, %r10d
negb %dl
movl %edx, %ecx
shll %cl, %r10d
shrl %cl, %r10d
movl 0x120(%rsp), %ecx
orl %r10d, (%r8,%rcx,4)
incl 0x120(%rsp)
movl $0x20, 0x124(%rsp)
movl %eax, %ecx
testl %ecx, %ecx
je 0x1349a
movl 0x120(%rsp), %edx
movl 0x124(%rsp), %eax
subl %ecx, %eax
negb %cl
movl %r11d, %r10d
shll %cl, %r10d
shrl %cl, %r10d
movl %eax, %ecx
shll %cl, %r10d
movl %eax, 0x124(%rsp)
orl %r10d, (%r8,%rdx,4)
incl 0x128(%rsp)
movl (%rsi), %eax
cmpl 0x820(%r9), %eax
setne %al
addq $0x4, %rsi
movl %r11d, %r10d
cmpq %rdi, %rsi
jne 0x13374
leaq 0x108(%rsp), %rdi
callq 0x16e56
jmp 0x135d9
movb $0x1, 0x4a(%rbx)
movl $0x48, %edi
callq 0x3260
movq %rax, %r13
leaq 0x280(%rsp), %rsi
movq %rax, %rdi
movl %r15d, %edx
callq 0x1a43e
movq %r13, 0x28(%rbx)
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
shrq $0x2, %rsi
movq (%rbx), %rax
movl 0x820(%rax), %eax
bsrl %eax, %edx
xorl $-0x20, %edx
addl $0x21, %edx
testl %eax, %eax
cmovel %eax, %edx
leaq 0x108(%rsp), %rdi
callq 0x16d92
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdi
cmpq %rdi, %rsi
je 0x135cc
movq 0x108(%rsp), %r8
movl (%rsi), %r9d
movl 0x114(%rsp), %ecx
movl 0x124(%rsp), %edx
movl %ecx, %eax
subl %edx, %eax
jb 0x1358c
movl %r9d, %r10d
movl %eax, %ecx
shrl %cl, %r10d
negb %dl
movl %edx, %ecx
shll %cl, %r10d
shrl %cl, %r10d
movl 0x120(%rsp), %ecx
orl %r10d, (%r8,%rcx,4)
incl 0x120(%rsp)
movl $0x20, 0x124(%rsp)
movl %eax, %ecx
testl %ecx, %ecx
je 0x135b8
movl 0x120(%rsp), %edx
movl 0x124(%rsp), %eax
subl %ecx, %eax
negb %cl
shll %cl, %r9d
shrl %cl, %r9d
movl %eax, %ecx
shll %cl, %r9d
movl %eax, 0x124(%rsp)
orl %r9d, (%r8,%rdx,4)
incl 0x128(%rsp)
addq $0x4, %rsi
cmpq %rdi, %rsi
jne 0x13544
leaq 0x108(%rsp), %rdi
callq 0x16e56
movq %rax, 0x30(%rbx)
leaq 0x108(%rsp), %rdi
callq 0x16e42
movq 0x80(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0xd9a5
movq 0x80(%rsp), %rcx
movq 0x88(%rsp), %rax
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rcx, %rax
je 0x13651
xorl %edi, %edi
movl $0x1, %esi
movl %edx, %r8d
movl -0x8(%rcx,%rsi,8), %r9d
leal (%r8,%r9), %r15d
subl %edi, %r15d
cmpl %r9d, %edi
cmovael %r8d, %r15d
incl %r9d
movl %esi, %r10d
incq %rsi
movl %r9d, %edi
movl %r15d, %r8d
cmpq %r10, %rdx
ja 0x13628
jmp 0x13654
movl %edx, %r15d
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
movl -0x8(%rax), %ebp
addl 0x4(%rcx), %r15d
addl 0x4(%rdx), %r15d
leaq 0x108(%rsp), %rdi
movl $0x20, %esi
movl $0x100000, %edx         # imm = 0x100000
callq 0x1acfa
notl %ebp
addl %ebp, %r15d
movq (%rbx), %rax
movq 0x28(%rbx), %rcx
movl 0x4(%rcx), %ecx
addl 0x820(%rax), %ecx
bsrl %ecx, %edx
xorl $-0x20, %edx
addl $0x21, %edx
testl %ecx, %ecx
cmovel %ecx, %edx
leaq 0x30(%rsp), %rdi
movl %r15d, %esi
callq 0x16d92
movq %r12, 0xe0(%rsp)
movq 0x88(%rsp), %rax
cmpq 0x80(%rsp), %rax
je 0x13826
xorl %r12d, %r12d
leaq 0x108(%rsp), %rbp
xorl %r14d, %r14d
xorl %r13d, %r13d
movq 0x80(%rsp), %rax
movl (%rax,%r12,8), %ecx
cmpl %ecx, %r14d
jae 0x13776
movq %rbp, %rdi
movl %r13d, %esi
callq 0x1adc4
movq (%rbx), %rax
movq 0x28(%rbx), %rcx
movl 0x4(%rcx), %esi
addl 0x820(%rax), %esi
movl 0x3c(%rsp), %ecx
movl 0x4c(%rsp), %edx
movl %ecx, %eax
subl %edx, %eax
jb 0x13743
movl %esi, %edi
movl %eax, %ecx
shrl %cl, %edi
negb %dl
movl %edx, %ecx
shll %cl, %edi
shrl %cl, %edi
movq 0x30(%rsp), %rcx
movl 0x48(%rsp), %edx
orl %edi, (%rcx,%rdx,4)
incl 0x48(%rsp)
movl $0x20, 0x4c(%rsp)
movl %eax, %ecx
testl %ecx, %ecx
je 0x13767
movl 0x4c(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x4c(%rsp)
negb %cl
shll %cl, %esi
shrl %cl, %esi
movl %eax, %ecx
shll %cl, %esi
movq 0x30(%rsp), %rax
movl 0x48(%rsp), %ecx
orl %esi, (%rax,%rcx,4)
incl 0x50(%rsp)
incl %r13d
incl %r14d
jmp 0x136dd
testl %r12d, %r12d
je 0x13785
leal -0x1(%r12), %edx
cmpl (%rax,%rdx,8), %ecx
je 0x13793
movq %rbp, %rdi
movl %r13d, %esi
callq 0x1adc4
incl %r14d
movq 0x80(%rsp), %rax
movl 0x4(%rax,%r12,8), %esi
movl 0x3c(%rsp), %ecx
movl 0x4c(%rsp), %edx
movl %ecx, %eax
subl %edx, %eax
jb 0x137d6
movl %esi, %edi
movl %eax, %ecx
shrl %cl, %edi
negb %dl
movl %edx, %ecx
shll %cl, %edi
shrl %cl, %edi
movq 0x30(%rsp), %rcx
movl 0x48(%rsp), %edx
orl %edi, (%rcx,%rdx,4)
incl 0x48(%rsp)
movl $0x20, 0x4c(%rsp)
movl %eax, %ecx
testl %ecx, %ecx
je 0x137fa
movl 0x4c(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x4c(%rsp)
negb %cl
shll %cl, %esi
shrl %cl, %esi
movl %eax, %ecx
shll %cl, %esi
movq 0x30(%rsp), %rax
movl 0x48(%rsp), %ecx
orl %esi, (%rax,%rcx,4)
incl 0x50(%rsp)
incl %r13d
incl %r12d
movq 0x88(%rsp), %rax
movq %rax, %rcx
subq 0x80(%rsp), %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
ja 0x136dd
jmp 0x13829
xorl %r13d, %r13d
movl -0x8(%rax), %r14d
incl %r14d
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
movl 0x4(%rcx), %ecx
addl 0x4(%rax), %ecx
cmpl %ecx, %r14d
movq 0xe0(%rsp), %r12
jae 0x138ed
leaq 0x108(%rsp), %rbp
movq %rbp, %rdi
movl %r13d, %esi
callq 0x1adc4
movq (%rbx), %rax
movq 0x28(%rbx), %rcx
movl 0x4(%rcx), %esi
addl 0x820(%rax), %esi
movl 0x3c(%rsp), %ecx
movl 0x4c(%rsp), %edx
movl %ecx, %eax
subl %edx, %eax
jb 0x138a8
movl %esi, %edi
movl %eax, %ecx
shrl %cl, %edi
negb %dl
movl %edx, %ecx
shll %cl, %edi
shrl %cl, %edi
movq 0x30(%rsp), %rcx
movl 0x48(%rsp), %edx
orl %edi, (%rcx,%rdx,4)
incl 0x48(%rsp)
movl $0x20, 0x4c(%rsp)
movl %eax, %ecx
testl %ecx, %ecx
je 0x138cc
movl 0x4c(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x4c(%rsp)
negb %cl
shll %cl, %esi
shrl %cl, %esi
movl %eax, %ecx
shll %cl, %esi
movq 0x30(%rsp), %rax
movl 0x48(%rsp), %ecx
orl %esi, (%rax,%rcx,4)
incl 0x50(%rsp)
incl %r13d
incl %r14d
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
movl 0x4(%rcx), %ecx
addl 0x4(%rax), %ecx
cmpl %ecx, %r14d
jb 0x13857
movl $0x48, %edi
callq 0x3260
movq %rax, %r13
leaq 0x108(%rsp), %rsi
movq %rax, %rdi
movl %r15d, %edx
callq 0x1a43e
movq %r13, 0x38(%rbx)
leaq 0x30(%rsp), %rdi
callq 0x16e56
movq %rax, 0x40(%rbx)
cmpb $0x0, 0x78(%rsp)
je 0x13ad9
movl %r12d, %esi
movq 0x1469c(%rip), %r13     # 0x27fd0
movq %r13, %rdi
callq 0x3180
movq %rax, %rbp
leaq 0xb11e(%rip), %rsi      # 0x1ea64
movl $0x8, %edx
movq %rax, %rdi
callq 0x32b0
movl 0x9c(%rsp), %esi
movq %rbp, %rdi
callq 0x3180
movq %rax, %rbp
leaq 0xb090(%rip), %rsi      # 0x1e9fc
movl $0x8, %edx
movq %rax, %rdi
callq 0x32b0
movl 0x74(%rsp), %esi
movq %rbp, %rdi
callq 0x3180
movq %rax, %rbp
leaq 0xb076(%rip), %rsi      # 0x1ea05
movl $0xe, %edx
movq %rax, %rdi
callq 0x32b0
movq %rbp, %rdi
movq 0x68(%rsp), %rsi
callq 0x3180
movq %rax, %r12
leaq 0xb061(%rip), %rsi      # 0x1ea14
movl $0x11, %edx
movq %rax, %rdi
callq 0x32b0
movl 0x98(%rsp), %esi
movq %r12, %rdi
callq 0x3180
movq %rax, %r12
leaq 0xb094(%rip), %rsi      # 0x1ea6d
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movl 0x8(%rsp), %eax
addl 0x4(%rsp), %eax
movl %eax, %ebp
movl %eax, %esi
movq %r12, %rdi
callq 0x3180
movq %rax, %r12
leaq 0xb071(%rip), %rsi      # 0x1ea75
movl $0xd, %edx
movq %rax, %rdi
callq 0x32b0
addl 0x74(%rsp), %ebp
subl %ebp, %r15d
movq %r12, %rdi
movq %r15, %rsi
callq 0x3180
movq %rax, %r14
leaq 0xb056(%rip), %rsi      # 0x1ea83
movl $0x10, %edx
movq %rax, %rdi
callq 0x32b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
cmpb $0x1, 0x4a(%rbx)
jne 0x13aad
movq 0x14562(%rip), %r14     # 0x27fd0
leaq 0xb01f(%rip), %rsi      # 0x1ea94
movl $0x1f, %edx
movq %r14, %rdi
callq 0x32b0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq 0x14530(%rip), %rdi     # 0x27fd0
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq (%r13), %rax
addq -0x18(%rax), %r13
movq %r13, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq 0x14504(%rip), %rdi     # 0x27fd0
callq 0x3040
movq %rax, %rdi
callq 0x3190
movb $0x1, 0x49(%rbx)
leaq 0x30(%rsp), %rdi
callq 0x16e42
leaq 0x108(%rsp), %rdi
callq 0x1ad02
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x13b19
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x3270
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13b3a
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x14487(%rip), %rsi     # 0x27fc8
leaq 0x360(%rsp), %rdi
callq 0x3140
leaq 0x3d0(%rsp), %rdi
callq 0x30d0
leaq 0x280(%rsp), %rdi
callq 0x1ad02
leaq 0x2f0(%rsp), %rdi
callq 0x1ad02
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x13b8c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x13ba9
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
addq $0x568, %rsp            # imm = 0x568
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13bbd
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x16e42
jmp 0x13cb7
jmp 0x13c37
jmp 0x13c37
movq %rax, %rbx
movl $0x48, %esi
movq %r13, %rdi
jmp 0x13bee
movq %rax, %rbx
movl $0x48, %esi
movq %r15, %rdi
callq 0x3270
jmp 0x13cb7
movq %rax, %rbx
movl $0x48, %esi
movq %r13, %rdi
callq 0x3270
jmp 0x13ca0
movq %rax, %rbx
jmp 0x13caa
jmp 0x13c37
jmp 0x13c37
jmp 0x13c1b
movq %rax, %rbx
jmp 0x13cdc
jmp 0x13c3c
jmp 0x13c4c
movq %rax, %rbx
jmp 0x13da1
movq %rax, %rbx
jmp 0x13dae
movq %rax, %rbx
jmp 0x13cb7
movq %rax, %rbx
jmp 0x13cfd
jmp 0x13c9d
jmp 0x13c9d
jmp 0x13c9d
jmp 0x13c90
movq %rax, %rbx
jmp 0x13d94
jmp 0x13c88
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x13d73
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3270
jmp 0x13d73
jmp 0x13d1f
jmp 0x13d1f
movq %rax, %rbx
jmp 0x13d73
movq %rax, %rbx
jmp 0x13d5c
jmp 0x13d1f
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x16e42
leaq 0x108(%rsp), %rdi
callq 0x1ad02
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x13cdc
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x3270
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13cfd
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x142c4(%rip), %rsi     # 0x27fc8
leaq 0x360(%rsp), %rdi
callq 0x3140
leaq 0x3d0(%rsp), %rdi
jmp 0x13d8f
jmp 0x13d1f
jmp 0x13d1f
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x13d3f
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x13d5c
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
leaq 0x30(%rsp), %rdi
callq 0x14482
leaq 0x360(%rsp), %rdi
callq 0x3090
movq 0x1424e(%rip), %rsi     # 0x27fc8
leaq 0x108(%rsp), %rdi
callq 0x3140
leaq 0x178(%rsp), %rdi
callq 0x30d0
leaq 0x280(%rsp), %rdi
callq 0x1ad02
leaq 0x2f0(%rsp), %rdi
callq 0x1ad02
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x13dc5
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x13de2
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq %rbx, %rdi
callq 0x3460