// File: /workspace/github_cpp_makefile_star2_O3/Ahhgust[P]STRaitRazor/str8.cpp
// Function: processDNA_Trie(int, unsigned int*, unsigned char*)
void
processDNA_Trie(int id, unsigned *matchIds, unsigned char *matchTypes) {


  int a;
  vector< vector<unsigned> > fpMatches( numStrs, vector<unsigned>(10) ); // forwardflank, positive strand
  vector< vector<unsigned> > rpMatches( numStrs, vector<unsigned>(10) ); // reverse flank, positive strand 
  vector< vector<unsigned> > frMatches( numStrs, vector<unsigned>(10) ); // ditto for negative strand
  vector< vector<unsigned> > rrMatches( numStrs, vector<unsigned>(10) );

  vector<unsigned > lastHitRecord( numStrs, RECSINMEM ); // the index (a in below loop) that yielded a valid hit for a paritcular locus
  vector<unsigned char > validMotif(numStrs, 0); // whether or not there's a valid motif found for a particular STR
  // valid means after a forwardflank or reverseflank_rc (the flanks may not be paired)

  for (a=id ; a < RECSINMEM; a += opt.numThreads) {
    const char *dna = records[a].c_str(); // ascii representation of DNA string
    const char *qvals = qrecords[a].c_str(); // quality scores baby!
    
    unsigned dnalen = records[a].length();


    //    if ((unsigned)a >= LASTREC) // creates a race condition!
    //      break;


    if ((int)dnalen < minFrag)
      continue;    



    bool gotOne=false;
    unsigned stop = dnalen - minLen + 1;
    for (unsigned j=0; j < stop; ++j, ++dna) {
      // this finds demonstrably wrong sequences (less than 'A' or greater than 'T' in the ascii table)
      if (*dna < 65 || *dna > 84) {
        cerr << "Oops! I'm detecting an illegal character in the DNA string. The character is " << *dna << endl <<
          "And the record is " << dna << endl;
        exit(EXIT_FAILURE);
      }


      // if we dont' have a single match (forward or reverse complement of reverse
      // and there isn't enough sequence to get the smallest possible fragment out, then we're done
      if (! gotOne &&
          dnalen - j < (unsigned)minFrag)
        break;

      unsigned numMatches = trie->findPrefixMatch((char*)(dna), maxLen, matchIds, matchTypes);
      
      for (unsigned n = 0; n < numMatches; ++n) {
        unsigned strIndex = matchIds[n];
        unsigned char orientation = matchTypes[n];


#if DEBUG
        //	if (orientation < MOTIF) 
        cerr << "Read offset: " << j << " read # " << 
          a << " Str index " << strIndex << " Orientation " << (unsigned)orientation << endl;
#endif

        if (lastHitRecord[ strIndex ] != (unsigned) a &&
            orientation < MOTIF) { // clear out the vectors for this STR; it's the first time we've seen this marker (in this read)
          fpMatches[strIndex].clear();
          rpMatches[strIndex].clear();
          frMatches[strIndex].clear();
          rrMatches[strIndex].clear();
          validMotif[strIndex]=0; // no valid motifs found
          lastHitRecord[strIndex ] = a;
        }



        if (orientation == MOTIF || orientation == MOTIF_RC) { // common case
          
          if (lastHitRecord[ strIndex ] == (unsigned) a &&  ! validMotif[strIndex]) {  // we have at least one flank found for this locus for this read
            // motifs! (currently the strand is ignored, as per the previous str8razor

            
            // we have at least one (valid) forward flank
            // and not enough reverse flanks
            if (fpMatches[strIndex].size() > 0 && 
                rpMatches[strIndex].size() < (*c)[strIndex].reverseCount) {
              validMotif[strIndex]=1;
              // match is on the negative strand
            } else if (rrMatches[strIndex].size() > 0 && 
                       frMatches[strIndex].size() < (*c)[strIndex].forwardCount) {
              validMotif[strIndex]=1;
	    }

	  }
          // record where the flanks were found, and in which orientation
        } else if (orientation==FORWARDFLANK) {
          
          if (! frMatches[strIndex].empty() &&
              frMatches[strIndex].back()  >= j - (*c)[strIndex].forwardLength) {
	    
            continue; // overlap!
          }

          
          
          fpMatches[ strIndex ].push_back(j + (*c)[strIndex].forwardLength); // the index of the first base of the intervening haplotype
          gotOne=true; 
          
        } else if (orientation == REVERSEFLANK) {
          
          // check to see if this reverse flank that we have is a substring (or overlaps) the forward flank (sadly, this happens. thank you Y chromosome!)
          // if so, let's skip it
          if ( ! fpMatches[strIndex].empty() && 
               fpMatches[strIndex].back()  >= j) {
            continue;
          }
          
          rpMatches[ strIndex ].push_back(j);
          // if specified, stop the search when we find the first STR that appears correct
          if (opt.shortCircuit && 
              rpMatches[ strIndex ].size() == (*c)[strIndex].reverseCount &&
              fpMatches[ strIndex ].size() == (*c)[strIndex].forwardCount)
            break;
          
        } else if (orientation == FORWARDFLANK_RC) {
          
          // and again, but on the negative strand;
          // the 2nd flank overlaps the first flank; let's assume that the second match in the overlap is wrong.
          if (! rrMatches[strIndex].empty() &&
              rrMatches[strIndex].back()  >= j) {
            continue;
          }

          frMatches[ strIndex ].push_back(j);
          if (opt.shortCircuit && 
              rrMatches[ strIndex ].size() == (*c)[strIndex].reverseCount &&
              frMatches[ strIndex ].size() == (*c)[strIndex].forwardCount)
            break;
          
          
        } else if (orientation == REVERSEFLANK_RC) {


          if (! frMatches[strIndex].empty() &&
              frMatches[strIndex].back()  >= j - (*c)[strIndex].reverseLength) {
	    
            continue; // overlap!
          }


          rrMatches[ strIndex ].push_back(j + (*c)[strIndex].reverseLength); // the index of the first base of the intervening haplotype
          gotOne=true; 
          
          // haven't found a valid motif for this STR yet
        } 
        
      }
    } // done reading read
    dna = records[a].c_str(); // reset the pointer
    
    
    if (gotOne) { // is there at least one record
      for (unsigned i = 0; i < numStrs; ++i) {

        if (lastHitRecord[i]== (unsigned) a 
            && validMotif[i]
            ) { // this STR was found for this read
          // positive strand match

          if (fpMatches[i].size() == (*c)[i].forwardCount) {
            if (rpMatches[i].size() == (*c)[i].reverseCount ) {
              // ensure that if it matches once on the positive strand, it doesn't also match on the negative strand (that both if statements below cannot be true)
              if ( rrMatches[i].size() != (*c)[i].reverseCount  ||
                   frMatches[i].size() != (*c)[i].forwardCount ) {
                
#if DEBUG
                cerr << c->at(i).locusName << " STR on forward strand " << i << " fpsize " << fpMatches[i].size() <<
                  " rpsize " << rpMatches[i].size() << endl;
#endif
	      
                if (fpMatches[i].back()  < rpMatches[i].front()) {
                  if (opt.includeAnchors) 
                    makeRecord(dna, qvals, fpMatches[i].front() - (*c)[i].forwardLength, rpMatches[i].back() + (*c)[i].reverseLength, FORWARDFLANK, i, id);
                  else
                    makeRecord(dna, qvals, fpMatches[i].front(), rpMatches[i].back(), FORWARDFLANK, i, id);
                }
                
              }
              
            } else if (opt.verbose && rpMatches[i].size() < (*c)[i].reverseCount ) { // not enough matches for the second anchor
              ++biasCounts[id][i];
            }
            // negative strand match
          }
          if ( rrMatches[i].size() == (*c)[i].reverseCount) {
            if ( frMatches[i].size() == (*c)[i].forwardCount ) {
              
#if DEBUG
              cerr << c->at(i).locusName << " STR on reverse strand " << i << " fpsize " << fpMatches[i].size() <<
                " rpsize " << rpMatches[i].size() << endl;
#endif
              
              if (rrMatches[i].back() < frMatches[i].front() ) {
                if (opt.includeAnchors)
                  makeRecord(dna, qvals, rrMatches[i].front() - (*c)[i].reverseLength , frMatches[i].back()+(*c)[i].forwardLength, REVERSEFLANK, i, id);
                else
                  makeRecord(dna, qvals, rrMatches[i].front(), frMatches[i].back(), REVERSEFLANK, i, id);	      
              }
              
            } else if (opt.verbose && frMatches[i].size() < (*c)[i].forwardCount ) {
              ++biasCounts[id][i]; 
            }
            
          }
        }
      }//for
    } // gotone
  }
  
  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, 0x1c(%rsp)
movl 0x625a51(%rip), %r15d   # 0x62a380
movl $0x28, %edi
callq 0x32c0
leaq 0x90(%rsp), %rdx
movq %rax, (%rdx)
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, 0x10(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movq %rcx, 0x8(%rdx)
leaq 0xd8(%rsp), %rdi
leaq 0x30(%rsp), %rcx
movq %r15, %rsi
callq 0x6dc0
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x4997
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
movl 0x6259e2(%rip), %r15d   # 0x62a380
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movl $0x28, %edi
callq 0x32c0
leaq 0x30(%rsp), %rdx
movq %rax, (%rdx)
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, 0x10(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movq %rcx, 0x8(%rdx)
leaq 0x90(%rsp), %rdi
leaq 0x50(%rsp), %rcx
movq %r15, %rsi
callq 0x6dc0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4a0e
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
movl 0x62596b(%rip), %r15d   # 0x62a380
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movl $0x28, %edi
callq 0x32c0
leaq 0x50(%rsp), %rdx
movq %rax, (%rdx)
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, 0x10(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movq %rcx, 0x8(%rdx)
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rcx
movq %r15, %rsi
callq 0x6dc0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x4a82
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
movl 0x6258f7(%rip), %r15d   # 0x62a380
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movl $0x28, %edi
callq 0x32c0
leaq 0x70(%rsp), %rdx
movq %rax, (%rdx)
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, 0x10(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movq %rcx, 0x8(%rdx)
leaq 0x50(%rsp), %rdi
leaq 0xb0(%rsp), %rcx
movq %r15, %rsi
callq 0x6dc0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x4aff
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
movl 0x62587b(%rip), %esi    # 0x62a380
leaq 0xb0(%rsp), %rdx
movl $0xc350, (%rdx)         # imm = 0xC350
leaq 0x70(%rsp), %rdi
leaq 0x14(%rsp), %rcx
callq 0x6e58
movl 0x625858(%rip), %esi    # 0x62a380
leaq 0x14(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0xb0(%rsp), %rdi
leaq 0x18(%rsp), %rcx
callq 0x6fd4
cmpl $0xc34f, 0x1c(%rsp)     # imm = 0xC34F
jg 0x52bf
movl 0x1c(%rsp), %r12d
movslq %r12d, %rax
movq %rax, 0xc8(%rsp)
movq %rbx, 0x20(%rsp)
movq 0x624f94(%rip), %rax    # 0x629b00
movslq %r12d, %rdx
shlq $0x5, %rdx
movl 0x8(%rax,%rdx), %esi
cmpl %esi, 0x625807(%rip)    # 0x62a384
jg 0x52ab
addq %rdx, %rax
movq 0x624f7b(%rip), %rcx    # 0x629b08
movq %rdx, 0xf0(%rsp)
movq (%rcx,%rdx), %rcx
movq %rcx, 0xd0(%rsp)
movq (%rax), %r15
movq %rsi, 0xf8(%rsp)
leal 0x1(%rsi), %eax
movl $0x0, 0x14(%rsp)
subl 0x6257cb(%rip), %eax    # 0x62a388
movl %eax, 0xac(%rsp)
je 0x52ab
xorl %eax, %eax
movl $0x0, 0x28(%rsp)
movb (%r15), %cl
addb $-0x55, %cl
cmpb $-0x15, %cl
jbe 0x5336
testb $0x1, 0x28(%rsp)
jne 0x4c00
movq 0xf8(%rsp), %rcx
subl %eax, %ecx
cmpl 0x62578a(%rip), %ecx    # 0x62a384
jb 0x5087
movq 0x625789(%rip), %rdi    # 0x62a390
movl 0x62577f(%rip), %edx    # 0x62a38c
movq %r15, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x9844
movq %r15, 0x100(%rsp)
testl %eax, %eax
je 0x5065
movl %eax, %r13d
xorl %r15d, %r15d
movl (%r14,%r15,4), %ebp
movb (%rbx,%r15), %al
movq 0x70(%rsp), %rcx
movl (%rcx,%rbp,4), %ecx
cmpl %r12d, %ecx
setne %dl
cmpb $0x4, %al
setb %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x4ce3
movq 0xd8(%rsp), %rdx
leaq (,%rbp,2), %rcx
addq %rbp, %rcx
movq (%rdx,%rcx,8), %rsi
cmpq %rsi, 0x8(%rdx,%rcx,8)
je 0x4c80
leaq (%rdx,%rcx,8), %rdx
movq %rsi, 0x8(%rdx)
movq 0x90(%rsp), %rsi
movq (%rsi,%rcx,8), %rdx
cmpq %rdx, 0x8(%rsi,%rcx,8)
je 0x4c9b
leaq (%rsi,%rcx,8), %rsi
movq %rdx, 0x8(%rsi)
movq 0x30(%rsp), %rsi
movq (%rsi,%rcx,8), %rdx
cmpq %rdx, 0x8(%rsi,%rcx,8)
je 0x4cb3
leaq (%rsi,%rcx,8), %rsi
movq %rdx, 0x8(%rsi)
movq 0x50(%rsp), %rsi
movq (%rsi,%rcx,8), %rdx
cmpq %rdx, 0x8(%rsi,%rcx,8)
je 0x4ccb
leaq (%rsi,%rcx,8), %rcx
movq %rdx, 0x8(%rcx)
movq 0xb0(%rsp), %rcx
movb $0x0, (%rcx,%rbp)
movq 0x70(%rsp), %rcx
movl %r12d, (%rcx,%rbp,4)
movl %r12d, %ecx
movl %eax, %edx
andb $-0x2, %dl
cmpb $0x4, %dl
jne 0x4dae
cmpl %r12d, %ecx
jne 0x5059
movq 0xb0(%rsp), %rax
cmpb $0x0, (%rax,%rbp)
jne 0x5059
movq 0xd8(%rsp), %rdx
leaq (,%rbp,2), %rcx
addq %rbp, %rcx
movq 0x8(%rdx,%rcx,8), %rsi
cmpq (%rdx,%rcx,8), %rsi
je 0x4d5d
movq 0x90(%rsp), %rdx
movq 0x8(%rdx,%rcx,8), %rsi
subq (%rdx,%rcx,8), %rsi
sarq $0x2, %rsi
movq 0x625632(%rip), %rdx    # 0x62a378
movq (%rdx), %rdx
imulq $0xb8, %rbp, %rdi
movzwl 0xb2(%rdx,%rdi), %edx
cmpq %rdx, %rsi
jb 0x4da5
movq 0x50(%rsp), %rdx
movq 0x8(%rdx,%rcx,8), %rsi
cmpq (%rdx,%rcx,8), %rsi
je 0x5059
movq 0x30(%rsp), %rdx
movq 0x8(%rdx,%rcx,8), %rsi
subq (%rdx,%rcx,8), %rsi
sarq $0x2, %rsi
movq 0x6255ee(%rip), %rcx    # 0x62a378
movq (%rcx), %rcx
imulq $0xb8, %rbp, %rdx
movzwl 0xb0(%rcx,%rdx), %ecx
cmpq %rcx, %rsi
jae 0x5059
movb $0x1, (%rax,%rbp)
jmp 0x5059
movzbl %al, %eax
cmpl $0x3, %eax
ja 0x5059
movl %eax, %eax
leaq 0x62cd(%rip), %rcx      # 0xb090
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x30(%rsp), %rdi
leaq (,%rbp,2), %rax
addq %rbp, %rax
movq 0x8(%rdi,%rax,8), %rsi
movl 0x14(%rsp), %ecx
movq 0x62558c(%rip), %rdx    # 0x62a378
movq (%rdx), %rdx
cmpq %rsi, (%rdi,%rax,8)
je 0x4f46
imulq $0xb8, %rbp, %rdi
movl 0xa0(%rdx,%rdi), %edx
movl %ecx, %edi
subl %edx, %edi
cmpl %edi, -0x4(%rsi)
jb 0x4f54
jmp 0x5059
movq 0x30(%rsp), %rdi
leaq (,%rbp,2), %rax
addq %rbp, %rax
movq 0x8(%rdi,%rax,8), %rsi
movl 0x14(%rsp), %ecx
movq 0x62553f(%rip), %rdx    # 0x62a378
movq (%rdx), %rdx
cmpq %rsi, (%rdi,%rax,8)
je 0x4f10
imulq $0xb8, %rbp, %rdi
movl 0xa4(%rdx,%rdi), %edx
movl %ecx, %edi
subl %edx, %edi
cmpl %edi, -0x4(%rsi)
jb 0x4f1e
jmp 0x5059
movq 0xd8(%rsp), %rcx
leaq (,%rbp,2), %rbx
addq %rbp, %rbx
movq 0x8(%rcx,%rbx,8), %rax
cmpq %rax, (%rcx,%rbx,8)
je 0x4e91
movl -0x4(%rax), %eax
cmpl 0x14(%rsp), %eax
jae 0x5042
movq 0x90(%rsp), %rax
leaq (%rax,%rbx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x4f83
movl 0x14(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x4f8d
movq 0x50(%rsp), %rcx
leaq (,%rbp,2), %rbx
addq %rbp, %rbx
movq 0x8(%rcx,%rbx,8), %rax
cmpq %rax, (%rcx,%rbx,8)
je 0x4ee6
movl -0x4(%rax), %eax
cmpl 0x14(%rsp), %eax
jae 0x5042
movq 0x30(%rsp), %rax
leaq (%rax,%rbx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x4fd7
movl 0x14(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x4fe1
imulq $0xb8, %rbp, %rsi
movl 0xa4(%rdx,%rsi), %edx
movq 0x50(%rsp), %rsi
leaq (%rsi,%rax,8), %rdi
addl %ecx, %edx
movl %edx, 0x18(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
jne 0x4f74
leaq 0x18(%rsp), %rdx
callq 0x8400
jmp 0x5053
imulq $0xb8, %rbp, %rsi
movl 0xa0(%rdx,%rsi), %edx
movq 0xd8(%rsp), %rsi
leaq (%rsi,%rax,8), %rdi
addl %ecx, %edx
movl %edx, 0x18(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x5049
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x5053
leaq 0x14(%rsp), %rdx
callq 0x8520
cmpb $0x1, 0xa338(%rip)      # 0xf2cc
jne 0x5042
movq 0x90(%rsp), %rax
movq 0x8(%rax,%rbx,8), %rdx
subq (%rax,%rbx,8), %rdx
sarq $0x2, %rdx
movq 0x6253c2(%rip), %rax    # 0x62a378
movq (%rax), %rax
imulq $0xb8, %rbp, %rcx
movzwl 0xb2(%rax,%rcx), %esi
cmpq %rsi, %rdx
jne 0x5042
movq 0xd8(%rsp), %rdx
jmp 0x501f
leaq 0x14(%rsp), %rdx
callq 0x8520
cmpb $0x1, 0xa2e4(%rip)      # 0xf2cc
jne 0x5042
movq 0x50(%rsp), %rax
movq 0x8(%rax,%rbx,8), %rdx
subq (%rax,%rbx,8), %rdx
sarq $0x2, %rdx
movq 0x625375(%rip), %rax    # 0x62a378
movq (%rax), %rax
imulq $0xb8, %rbp, %rcx
movzwl 0xb2(%rax,%rcx), %esi
cmpq %rsi, %rdx
jne 0x5042
movq 0x30(%rsp), %rdx
movq 0x8(%rdx,%rbx,8), %rsi
subq (%rdx,%rbx,8), %rsi
addq %rcx, %rax
sarq $0x2, %rsi
movzwl 0xb0(%rax), %eax
cmpq %rax, %rsi
movq 0x20(%rsp), %rbx
jne 0x5059
jmp 0x5065
movq 0x20(%rsp), %rbx
jmp 0x5059
leaq 0x18(%rsp), %rdx
callq 0x8400
movb $0x1, %al
movl %eax, 0x28(%rsp)
incq %r15
cmpq %r15, %r13
jne 0x4c31
movl 0x14(%rsp), %eax
incl %eax
movl %eax, 0x14(%rsp)
movq 0x100(%rsp), %r15
incq %r15
cmpl 0xac(%rsp), %eax
jb 0x4bd4
testb $0x1, 0x28(%rsp)
movq 0xf0(%rsp), %rcx
je 0x52ab
cmpl $0x0, 0x6252df(%rip)    # 0x62a380
je 0x52ab
movq 0x624a52(%rip), %rax    # 0x629b00
movq (%rax,%rcx), %rax
movq %rax, 0x28(%rsp)
movl $0xb2, %r15d
xorl %ebp, %ebp
xorl %r13d, %r13d
movq 0x70(%rsp), %rax
cmpl %r12d, (%rax,%r13,4)
jne 0x528e
movq 0xb0(%rsp), %rax
cmpb $0x0, (%rax,%r13)
je 0x528e
movq 0xd8(%rsp), %rcx
movq (%rcx,%rbp), %rax
movq 0x8(%rcx,%rbp), %rdx
movq %rdx, %rdi
subq %rax, %rdi
movq %rdi, %rsi
sarq $0x2, %rsi
movq 0x62526f(%rip), %rcx    # 0x62a378
movq (%rcx), %rcx
movzwl -0x2(%rcx,%r15), %r8d
cmpq %r8, %rsi
jne 0x51d1
movq 0x90(%rsp), %rsi
movq (%rsi,%rbp), %r8
movq 0x8(%rsi,%rbp), %rsi
movq %rsi, %r9
subq %r8, %r9
movq %r9, %r10
sarq $0x2, %r10
movzwl (%rcx,%r15), %r11d
cmpq %r11, %r10
jne 0x518b
movq 0x50(%rsp), %r10
movq 0x8(%r10,%rbp), %r11
subq (%r10,%rbp), %r11
cmpq %r9, %r11
jne 0x5169
movq 0x30(%rsp), %r9
movq 0x8(%r9,%rbp), %r10
subq (%r9,%rbp), %r10
cmpq %rdi, %r10
je 0x51d1
movl -0x4(%rdx), %edx
cmpl (%r8), %edx
jae 0x51d1
movl (%rax), %edx
cmpb $0x1, 0xa156(%rip)      # 0xf2d0
jne 0x51af
subl -0x12(%rcx,%r15), %edx
movl -0xe(%rcx,%r15), %ecx
addl -0x4(%rsi), %ecx
jmp 0x51b2
jae 0x51d1
cmpb $0x0, 0xa139(%rip)      # 0xf2cd
je 0x51d1
movq 0x625203(%rip), %rax    # 0x62a3a0
movq 0xc8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
incl (%rax,%r13,4)
jmp 0x51d1
movl -0x4(%rsi), %ecx
movl 0x1c(%rsp), %eax
movl %eax, (%rsp)
movq 0x28(%rsp), %rdi
movq 0xd0(%rsp), %rsi
xorl %r8d, %r8d
movl %r13d, %r9d
callq 0x44f0
movq 0x50(%rsp), %rcx
movq (%rcx,%rbp), %rax
movq 0x8(%rcx,%rbp), %rdx
movq %rdx, %rsi
subq %rax, %rsi
sarq $0x2, %rsi
movq 0x625188(%rip), %rcx    # 0x62a378
movq (%rcx), %rcx
movzwl (%rcx,%r15), %edi
cmpq %rdi, %rsi
jne 0x528e
movq 0x30(%rsp), %rsi
movq (%rsi,%rbp), %rdi
movq 0x8(%rsi,%rbp), %rsi
movq %rsi, %r8
subq %rdi, %r8
sarq $0x2, %r8
movzwl -0x2(%rcx,%r15), %r9d
cmpq %r9, %r8
jne 0x5245
movl -0x4(%rdx), %edx
cmpl (%rdi), %edx
jae 0x528e
movl (%rax), %edx
cmpb $0x1, 0xa09c(%rip)      # 0xf2d0
jne 0x5269
subl -0xe(%rcx,%r15), %edx
movl -0x12(%rcx,%r15), %ecx
addl -0x4(%rsi), %ecx
jmp 0x526c
jae 0x528e
cmpb $0x0, 0xa07f(%rip)      # 0xf2cd
je 0x528e
movq 0x625149(%rip), %rax    # 0x62a3a0
movq 0xc8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
incl (%rax,%r13,4)
jmp 0x528e
movl -0x4(%rsi), %ecx
movl 0x1c(%rsp), %eax
movl %eax, (%rsp)
movq 0x28(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movl $0x3, %r8d
movl %r13d, %r9d
callq 0x44f0
incq %r13
movl 0x6250e9(%rip), %eax    # 0x62a380
addq $0x18, %rbp
addq $0xb8, %r15
cmpq %rax, %r13
jb 0x50c2
addl 0xa036(%rip), %r12d     # 0xf2e8
cmpl $0xc350, %r12d          # imm = 0xC350
jl 0x4b65
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x52dc
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x52f6
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
leaq 0x50(%rsp), %rdi
callq 0x7034
leaq 0x30(%rsp), %rdi
callq 0x7034
leaq 0x90(%rsp), %rdi
callq 0x7034
leaq 0xd8(%rsp), %rdi
callq 0x7034
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9cb3(%rip), %rdi      # 0xeff0
leaq 0x5f25(%rip), %rsi      # 0xb269
movl $0x4d, %edx
callq 0x3310
movb (%r15), %al
leaq 0x18(%rsp), %rsi
movb %al, (%rsi)
movq 0x9c91(%rip), %rdi      # 0xeff0
movl $0x1, %edx
callq 0x3310
movq %rax, %rdi
callq 0x3140
movq %rax, %rbx
leaq 0x5f3c(%rip), %rsi      # 0xb2b7
movl $0x12, %edx
movq %rax, %rdi
callq 0x3310
movq %r15, %rdi
callq 0x3130
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3310
movq %rbx, %rdi
callq 0x3140
movl $0x1, %edi
callq 0x3340
movq %rax, %rbx
jmp 0x5499
movq %rax, %rbx
jmp 0x54b3
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x54bd
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
jmp 0x54bd
movq %rax, %rbx
jmp 0x54bd
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x54c7
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
jmp 0x54c7
movq %rax, %rbx
jmp 0x54c7
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x54d4
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
jmp 0x54d4
movq %rax, %rbx
jmp 0x54d4
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x54e1
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
jmp 0x54e1
movq %rax, %rbx
jmp 0x54e1
jmp 0x5479
jmp 0x5479
jmp 0x5479
jmp 0x5479
jmp 0x5479
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x5499
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x54b3
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x32d0
leaq 0x50(%rsp), %rdi
callq 0x7034
leaq 0x30(%rsp), %rdi
callq 0x7034
leaq 0x90(%rsp), %rdi
callq 0x7034
leaq 0xd8(%rsp), %rdi
callq 0x7034
movq %rbx, %rdi
callq 0x3480