// File: Ahhgust[P]STRaitRazor/str8.cpp
// Function: printReports(_IO_FILE*, std::map<Report, HapCounter, CompareReport, std::allocator<std::pair<Report const, HapCounter>>>&, unsigned int, bool)
void
printReports(FILE *stream, map< Report, HapCounter, CompareReport> &hash, unsigned minCount, bool noRC) {


  //  vector< pair<Report, pair<unsigned, unsigned> > > vec(hash.begin(), hash.end() );

  vector< pair<Report, HapCounter > > vec(hash.begin(), hash.end() );
  sort( vec.begin(), vec.end() , sortKeyAndValue);


  vector< pair<Report, HapCounter > >::iterator it = vec.begin();

  unsigned i, j, stop, mod;
  int offset, period;
  string s;
  unsigned totalSkippedPositive = 0;
  unsigned totalSkippedNegative = 0;
  unsigned prevStrIndex = UINT_MAX;
  Report rep;
  
  if (opt.printHeader) {
    fprintf(stream, "Locus\tLength\tHaplotype\t");
    if (noRC) {
      fprintf(stream, "Count");
    } else {
      fprintf(stream, "ForwardCount\tReverseCount");
    }
    
    if (opt.useQuality) {
      if (noRC) 
        fprintf(stream, "\tForwardQsum");
      else
        fprintf(stream, "\tForwardQsum\tReverseQsum");
    }
    fprintf(stream, "\n");
  }

  
  for ( ; it != vec.end(); ++it) {

    rep = it->first;

    // print out the number of records that were below threshold.    
    // the outer-most sort is by locus, so this approach is correct
    if (rep.strIndex != prevStrIndex) {
      if (totalSkippedPositive + totalSkippedNegative >0) {

        fprintf(stream, "%s:0.0\t0 bases\tSumBelowThreshold",  s.c_str());
        if (noRC) 
          fprintf(stream, "\t\t%u\n",  totalSkippedPositive + totalSkippedNegative);
        else
          fprintf(stream, "\t%u\t%u\n",  totalSkippedPositive , totalSkippedNegative);
        
      }
      prevStrIndex = rep.strIndex;
      totalSkippedPositive = totalSkippedNegative = 0;
    }

    s = (*c)[rep.strIndex].locusName;

    if (it->second.first + it->second.second < minCount) {
      totalSkippedPositive += it->second.second;
      totalSkippedNegative += it->second.first;
      continue;
    }

    // compute the STR nomenclature
    if (opt.includeAnchors) {
      // adjust the nomenclature to account for the inclusion of the anchor sequences in the haplotype.
      period = ( (int)rep.hapLength- (int)(*c)[rep.strIndex].motifOffset - (int)(*c)[rep.strIndex].forwardLength - (int)(*c)[rep.strIndex].reverseLength )/ (int)(*c)[rep.strIndex].motifPeriod;
      offset = ( (int)rep.hapLength-(int)(*c)[rep.strIndex].motifOffset- (int)(*c)[rep.strIndex].forwardLength - (int)(*c)[rep.strIndex].reverseLength ) % (int)(*c)[rep.strIndex].motifPeriod;
    } else {
      period = ( (int)rep.hapLength- (int)(*c)[rep.strIndex].motifOffset)/ (int)(*c)[rep.strIndex].motifPeriod;
      offset = ( (int)rep.hapLength-(int)(*c)[rep.strIndex].motifOffset) % (int)(*c)[rep.strIndex].motifPeriod;
    }
    if (offset) {
      fprintf(stream, "%s:%i.%i\t%u bases\t",  s.c_str(), period, offset,
              rep.hapLength);
    } else {
      fprintf(stream, "%s:%i\t%u bases\t", s.c_str(), period, 
              rep.hapLength);
    }

    if (rep.nonstandardLetters==false) {
      stop = (rep.hapLength / (MAXWORD/2.0));
      mod = rep.hapLength % (MAXWORD/2);
      for (i=0; i < stop; ++i) 
        printBinaryWord(stream, rep.haplotype[i], MAXWORD/2);
      
      if (mod) 
        printBinaryWord(stream, rep.haplotype[i], mod);

    } else {
      fprintf(stream, "%s", (char*)rep.haplotype);
    }

      
    if (noRC)
      fprintf(stream, "\t\t%u", it->second.first + it->second.second );
    else 
      fprintf(stream, "\t%u\t%u", it->second.second, it->second.first );

    if (USE_QVALS) {
      
      if (noRC)
        fprintf(stream, "\t\t%f\n", it->second.fq + it->second.rq );
      else 
        fprintf(stream, "\t%f\t%f\n", it->second.rq, it->second.fq );
      
    } else {
      fprintf(stream, "\n");
    }
  }

  // grab the trailing values (if necessary)
  if (totalSkippedPositive + totalSkippedNegative >0) {
    
    fprintf(stream, "%s:0.0\t0 bases\tSumBelowThreshold",  s.c_str());
    if (noRC) 
      fprintf(stream, "\t\t%u\n",  totalSkippedPositive + totalSkippedNegative);
    else
      fprintf(stream, "\t%u\t%u\n",  totalSkippedPositive , totalSkippedNegative);
    
  }
  
  
  if (opt.verbose) {
    fprintf(stream, "\n\nBias Reporting\nMarkerName\tMissingRightanchor_Counts\tTotalMatches_Count\tRatio\tAvgLeftPos\tAvgRightPos\n");
    unsigned sum, sumt;
    unsigned long leftC, rightC;
    for (j=0; j < numStrs; ++j) {
      sumt=sum=0;
      leftC=rightC=0;
      for (i=0; i < (unsigned)opt.numThreads; ++i) {
        sum += biasCounts[i][j];
        sumt += totalCounts[i][j];
        leftC += leftFlankPosSum[i][j];
        rightC += rightFlankPosSum[i][j];
      }

      fprintf(stream,  "%s\t%u\t%u\t" , (*c)[j].locusName.c_str(), sum, sumt);
      if (sumt + sum) {
        printf("%.4f\t", sum/(double)(sumt+sum));
      } else {
        printf("NaN\t");
      }

      if (sumt) {
        fprintf(stream, "%.1f\t%.1f\n", leftC/(double)sumt, rightC/(double)sumt);
      } else {
        fprintf(stream, "NaN\tNaN\n");
      }
      

    }
    

  }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
andb $0x1, %al
movb %al, -0x15(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8660
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8690
movq %rax, -0x40(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x86c0
movq -0xf8(%rbp), %rcx
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x86e0
jmp 0x3d71
leaq -0x41(%rbp), %rdi
callq 0x8760
leaq -0x30(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x87d0
movq -0x100(%rbp), %rdi
movq %rax, -0x60(%rbp)
callq 0x8800
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
leaq -0x2ad(%rip), %rdx      # 0x3b00
callq 0x8780
jmp 0x3db4
leaq -0x30(%rbp), %rdi
callq 0x87d0
movq %rax, -0x70(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3380
movl $0x0, -0xac(%rbp)
movl $0x0, -0xb0(%rbp)
movl $0xffffffff, -0xb4(%rbp) # imm = 0xFFFFFFFF
testb $0x1, 0x184ef(%rip)     # 0x1c2e1
je 0x3eaa
movq -0x8(%rbp), %rdi
leaq 0x1026a(%rip), %rsi     # 0x1406d
movb $0x0, %al
callq 0x3390
testb $0x1, -0x15(%rbp)
je 0x3e4f
movq -0x8(%rbp), %rdi
leaq 0x1027e(%rip), %rsi     # 0x14099
movb $0x0, %al
callq 0x3390
jmp 0x3e61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x8760
jmp 0x4833
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x482a
movq -0x8(%rbp), %rdi
leaq 0x1022b(%rip), %rsi     # 0x14085
movb $0x0, %al
callq 0x3390
cmpb $0x0, 0x1847a(%rip)     # 0x1c2e2
je 0x3e98
testb $0x1, -0x15(%rbp)
je 0x3e84
movq -0x8(%rbp), %rdi
leaq 0x10224(%rip), %rsi     # 0x1409f
movb $0x0, %al
callq 0x3390
jmp 0x3e96
movq -0x8(%rbp), %rdi
leaq 0x1021d(%rip), %rsi     # 0x140ac
movb $0x0, %al
callq 0x3390
jmp 0x3e98
movq -0x8(%rbp), %rdi
leaq 0x10d98(%rip), %rsi     # 0x14c3b
movb $0x0, %al
callq 0x3390
jmp 0x3eac
leaq -0x30(%rbp), %rdi
callq 0x8800
movq %rax, -0xd8(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x8830
testb $0x1, %al
jne 0x3ed5
jmp 0x4548
leaq -0x70(%rbp), %rdi
callq 0x8870
movq (%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xc0(%rbp)
movl -0xd0(%rbp), %eax
cmpl -0xb4(%rbp), %eax
je 0x3fb6
movl -0xac(%rbp), %eax
addl -0xb0(%rbp), %eax
cmpl $0x0, %eax
jbe 0x3f96
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3100
movq -0x108(%rbp), %rdi
movq %rax, %rdx
leaq 0x1017c(%rip), %rsi     # 0x140c5
movb $0x0, %al
callq 0x3390
testb $0x1, -0x15(%rbp)
je 0x3f76
movq -0x8(%rbp), %rdi
movl -0xac(%rbp), %edx
addl -0xb0(%rbp), %edx
leaq 0x10179(%rip), %rsi     # 0x140e6
movb $0x0, %al
callq 0x3390
jmp 0x3f94
movq -0x8(%rbp), %rdi
movl -0xac(%rbp), %edx
movl -0xb0(%rbp), %ecx
leaq 0x1015f(%rip), %rsi     # 0x140ec
movb $0x0, %al
callq 0x3390
jmp 0x3f96
movl -0xd0(%rbp), %eax
movl %eax, -0xb4(%rbp)
movl $0x0, -0xb0(%rbp)
movl $0x0, -0xac(%rbp)
movq 0x6333cb(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x3040
jmp 0x3fdb
leaq -0x70(%rbp), %rdi
callq 0x8870
movl 0x18(%rax), %eax
movl %eax, -0x10c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8870
movq %rax, %rcx
movl -0x10c(%rbp), %eax
addl 0x1c(%rcx), %eax
cmpl -0x14(%rbp), %eax
jae 0x4059
leaq -0x70(%rbp), %rdi
callq 0x8870
movl 0x1c(%rax), %eax
addl -0xac(%rbp), %eax
movl %eax, -0xac(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8870
movl 0x18(%rax), %eax
addl -0xb0(%rbp), %eax
movl %eax, -0xb0(%rbp)
jmp 0x453a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x31b0
jmp 0x482a
testb $0x1, 0x18280(%rip)     # 0x1c2e0
je 0x41d9
movl -0xbc(%rbp), %eax
movl %eax, -0x12c(%rbp)
movq 0x63330f(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rcx
movl -0x12c(%rbp), %eax
movzwl 0xae(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x128(%rbp)
movq 0x6332e3(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rcx
movl -0x128(%rbp), %eax
subl 0xa0(%rcx), %eax
movl %eax, -0x124(%rbp)
movq 0x6332ba(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rcx
movl -0x124(%rbp), %eax
subl 0xa4(%rcx), %eax
movl %eax, -0x120(%rbp)
movq 0x633291(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rcx
movl -0x120(%rbp), %eax
movzwl 0xac(%rcx), %ecx
cltd
idivl %ecx
movl %eax, -0x88(%rbp)
movl -0xbc(%rbp), %eax
movl %eax, -0x11c(%rbp)
movq 0x633258(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rcx
movl -0x11c(%rbp), %eax
movzwl 0xae(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x118(%rbp)
movq 0x63322c(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rcx
movl -0x118(%rbp), %eax
subl 0xa0(%rcx), %eax
movl %eax, -0x114(%rbp)
movq 0x633203(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rcx
movl -0x114(%rbp), %eax
subl 0xa4(%rcx), %eax
movl %eax, -0x110(%rbp)
movq 0x6331da(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rcx
movl -0x110(%rbp), %eax
movzwl 0xac(%rcx), %ecx
cltd
idivl %ecx
movl %edx, -0x84(%rbp)
jmp 0x42a3
movl -0xbc(%rbp), %eax
movl %eax, -0x13c(%rbp)
movq 0x63319c(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rcx
movl -0x13c(%rbp), %eax
movzwl 0xae(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x138(%rbp)
movq 0x633170(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rcx
movl -0x138(%rbp), %eax
movzwl 0xac(%rcx), %ecx
cltd
idivl %ecx
movl %eax, -0x88(%rbp)
movl -0xbc(%rbp), %eax
movl %eax, -0x134(%rbp)
movq 0x633137(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rcx
movl -0x134(%rbp), %eax
movzwl 0xae(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x130(%rbp)
movq 0x63310b(%rip), %rdi    # 0x637388
movl -0xd0(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rcx
movl -0x130(%rbp), %eax
movzwl 0xac(%rcx), %ecx
cltd
idivl %ecx
movl %edx, -0x84(%rbp)
cmpl $0x0, -0x84(%rbp)
je 0x42f1
movq -0x8(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3100
movq -0x148(%rbp), %rdi
movq %rax, %rdx
movl -0x88(%rbp), %ecx
movl -0x84(%rbp), %r8d
movl -0xbc(%rbp), %r9d
leaq 0xfe0c(%rip), %rsi      # 0x140f4
movb $0x0, %al
callq 0x3390
jmp 0x432d
movq -0x8(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3100
movq -0x150(%rbp), %rdi
movq %rax, %rdx
movl -0x88(%rbp), %ecx
movl -0xbc(%rbp), %r8d
leaq 0xfde1(%rip), %rsi      # 0x14107
movb $0x0, %al
callq 0x3390
movb -0xc0(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x43ce
cvtsi2sdl -0xbc(%rbp), %xmm0
movsd 0xfcc7(%rip), %xmm1     # 0x14018
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, -0x7c(%rbp)
movl -0xbc(%rbp), %eax
movl $0x20, %ecx
cltd
idivl %ecx
movl %edx, -0x80(%rbp)
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jae 0x43a8
movq -0x8(%rbp), %rdi
movq -0xc8(%rbp), %rax
movl -0x74(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
movl $0x20, %edx
callq 0x110d0
jmp 0x439b
jmp 0x439d
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x4375
cmpl $0x0, -0x80(%rbp)
je 0x43cc
movq -0x8(%rbp), %rdi
movq -0xc8(%rbp), %rax
movl -0x74(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
movl -0x80(%rbp), %edx
callq 0x110d0
jmp 0x43ca
jmp 0x43cc
jmp 0x43e7
movq -0x8(%rbp), %rdi
movq -0xc8(%rbp), %rdx
leaq 0xfd37(%rip), %rsi      # 0x14117
movb $0x0, %al
callq 0x3390
testb $0x1, -0x15(%rbp)
je 0x4433
movq -0x8(%rbp), %rax
movq %rax, -0x158(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8870
movl 0x18(%rax), %eax
movl %eax, -0x15c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8870
movl -0x15c(%rbp), %edx
movq -0x158(%rbp), %rdi
addl 0x1c(%rax), %edx
leaq 0xfcf0(%rip), %rsi      # 0x1411a
movb $0x0, %al
callq 0x3390
jmp 0x4477
movq -0x8(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8870
movl 0x1c(%rax), %eax
movl %eax, -0x160(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8870
movq -0x168(%rbp), %rdi
movl -0x160(%rbp), %edx
movl 0x18(%rax), %ecx
leaq 0xfcaf(%rip), %rsi      # 0x1411f
movb $0x0, %al
callq 0x3390
cmpb $0x0, 0x632f02(%rip)    # 0x637380
je 0x4526
testb $0x1, -0x15(%rbp)
je 0x44d8
movq -0x8(%rbp), %rax
movq %rax, -0x170(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8870
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x178(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8870
movsd -0x178(%rbp), %xmm0
movq -0x170(%rbp), %rdi
addsd 0x28(%rax), %xmm0
leaq 0xfc57(%rip), %rsi      # 0x14126
movb $0x1, %al
callq 0x3390
jmp 0x4524
movq -0x8(%rbp), %rax
movq %rax, -0x188(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8870
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x180(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8870
movq -0x188(%rbp), %rdi
movsd -0x180(%rbp), %xmm0
movsd 0x20(%rax), %xmm1
leaq 0xfc0f(%rip), %rsi      # 0x1412c
movb $0x2, %al
callq 0x3390
jmp 0x4538
movq -0x8(%rbp), %rdi
leaq 0x1070a(%rip), %rsi     # 0x14c3b
movb $0x0, %al
callq 0x3390
jmp 0x453a
leaq -0x70(%rbp), %rdi
callq 0x88b0
jmp 0x3eac
movl -0xac(%rbp), %eax
addl -0xb0(%rbp), %eax
cmpl $0x0, %eax
jbe 0x45ce
movq -0x8(%rbp), %rax
movq %rax, -0x190(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3100
movq -0x190(%rbp), %rdi
movq %rax, %rdx
leaq 0xfb44(%rip), %rsi      # 0x140c5
movb $0x0, %al
callq 0x3390
testb $0x1, -0x15(%rbp)
je 0x45ae
movq -0x8(%rbp), %rdi
movl -0xac(%rbp), %edx
addl -0xb0(%rbp), %edx
leaq 0xfb41(%rip), %rsi      # 0x140e6
movb $0x0, %al
callq 0x3390
jmp 0x45cc
movq -0x8(%rbp), %rdi
movl -0xac(%rbp), %edx
movl -0xb0(%rbp), %ecx
leaq 0xfb27(%rip), %rsi      # 0x140ec
movb $0x0, %al
callq 0x3390
jmp 0x45ce
testb $0x1, 0x17d08(%rip)     # 0x1c2dd
je 0x480c
movq -0x8(%rbp), %rdi
leaq 0xfb4e(%rip), %rsi      # 0x14134
movb $0x0, %al
callq 0x3390
movl $0x0, -0x78(%rbp)
movl -0x78(%rbp), %eax
cmpl 0x632d93(%rip), %eax    # 0x637390
jae 0x480a
movl $0x0, -0xdc(%rbp)
movl $0x0, -0xe0(%rbp)
movq $0x0, -0xf0(%rbp)
movq $0x0, -0xe8(%rbp)
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
cmpl 0x17cbb(%rip), %eax     # 0x1c2f8
jae 0x46d7
movq 0x632d66(%rip), %rax    # 0x6373b0
movl -0x74(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x78(%rbp), %ecx
movl (%rax,%rcx,4), %eax
addl -0xdc(%rbp), %eax
movl %eax, -0xdc(%rbp)
movq 0x632d4e(%rip), %rax    # 0x6373b8
movl -0x74(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x78(%rbp), %ecx
movl (%rax,%rcx,4), %eax
addl -0xe0(%rbp), %eax
movl %eax, -0xe0(%rbp)
movq 0x632d36(%rip), %rax    # 0x6373c0
movl -0x74(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x78(%rbp), %ecx
movq (%rax,%rcx,8), %rax
addq -0xe8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq 0x632d1b(%rip), %rax    # 0x6373c8
movl -0x74(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x78(%rbp), %ecx
movq (%rax,%rcx,8), %rax
addq -0xf0(%rbp), %rax
movq %rax, -0xf0(%rbp)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x4634
movq -0x8(%rbp), %rax
movq %rax, -0x198(%rbp)
movq 0x632c9f(%rip), %rdi    # 0x637388
movl -0x78(%rbp), %eax
movl %eax, %esi
callq 0x8890
movq %rax, %rdi
callq 0x3100
movq -0x198(%rbp), %rdi
movq %rax, %rdx
movl -0xdc(%rbp), %ecx
movl -0xe0(%rbp), %r8d
leaq 0xfa82(%rip), %rsi      # 0x1419b
movb $0x0, %al
callq 0x3390
movl -0xe0(%rbp), %eax
addl -0xdc(%rbp), %eax
cmpl $0x0, %eax
je 0x4761
movl -0xdc(%rbp), %eax
movl %eax, %ecx
cvtsi2sd %rax, %xmm0
movl -0xe0(%rbp), %eax
addl %ecx, %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
leaq 0xfa4f(%rip), %rdi      # 0x141a5
movb $0x1, %al
callq 0x3050
jmp 0x475f
jmp 0x4773
leaq 0xfa43(%rip), %rdi      # 0x141ab
xorl %eax, %eax
callq 0x3050
jmp 0x4771
jmp 0x4773
cmpl $0x0, -0xe0(%rbp)
je 0x47e8
movq -0x8(%rbp), %rdi
movq -0xe8(%rbp), %xmm0
movaps 0xf8a1(%rip), %xmm4     # 0x14030
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
movapd 0xf8a5(%rip), %xmm3     # 0x14040
subpd %xmm3, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movl -0xe0(%rbp), %eax
cvtsi2sd %rax, %xmm2
divsd %xmm2, %xmm0
movq -0xf0(%rbp), %xmm1
punpckldq %xmm4, %xmm1    # xmm1 = xmm1[0],xmm4[0],xmm1[1],xmm4[1]
subpd %xmm3, %xmm1
movaps %xmm1, %xmm3
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm3, %xmm1
divsd %xmm2, %xmm1
leaq 0xf9d1(%rip), %rsi      # 0x141b0
movb $0x2, %al
callq 0x3390
jmp 0x47fa
movq -0x8(%rbp), %rdi
leaq 0xf9c8(%rip), %rsi      # 0x141bb
movb $0x0, %al
callq 0x3390
jmp 0x47fc
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x45f4
jmp 0x480c
leaq -0xa8(%rbp), %rdi
callq 0x31b0
leaq -0x30(%rbp), %rdi
callq 0x88d0
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x88d0
movq -0x50(%rbp), %rdi
callq 0x34a0
nopl (%rax)