// File: zeeev[P]DASVC/bamtools/src/toolkit/bamtools_stats.cpp
// Function: BamTools::StatsTool::StatsToolPrivate::PrintStats()
void StatsTool::StatsToolPrivate::PrintStats(void) {
  
    cout << endl;
    cout << "**********************************************" << endl;
    cout << "Stats for BAM file(s): " << endl;
    cout << "**********************************************" << endl;
    cout << endl;
    cout << "Total reads:       " << m_numReads << endl;
    cout << "Mapped reads:      " << m_numMapped << "\t(" << ((float)m_numMapped/m_numReads)*100 << "%)" << endl;
    cout << "Forward strand:    " << m_numForwardStrand << "\t(" << ((float)m_numForwardStrand/m_numReads)*100 << "%)" << endl;
    cout << "Reverse strand:    " << m_numReverseStrand << "\t(" << ((float)m_numReverseStrand/m_numReads)*100 << "%)" << endl;
    cout << "Failed QC:         " << m_numFailedQC << "\t(" << ((float)m_numFailedQC/m_numReads)*100 << "%)" << endl;
    cout << "Duplicates:        " << m_numDuplicates << "\t(" << ((float)m_numDuplicates/m_numReads)*100 << "%)" << endl;
    cout << "Paired-end reads:  " << m_numPaired << "\t(" << ((float)m_numPaired/m_numReads)*100 << "%)" << endl;
    
    if ( m_numPaired != 0 ) {
        cout << "'Proper-pairs':    " << m_numProperPair << "\t(" << ((float)m_numProperPair/m_numPaired)*100 << "%)" << endl;
        cout << "Both pairs mapped: " << m_numBothMatesMapped << "\t(" << ((float)m_numBothMatesMapped/m_numPaired)*100 << "%)" << endl;
        cout << "Read 1:            " << m_numFirstMate << endl;
        cout << "Read 2:            " << m_numSecondMate << endl;
        cout << "Singletons:        " << m_numSingletons << "\t(" << ((float)m_numSingletons/m_numPaired)*100 << "%)" << endl;
    }
    
    if ( m_settings->IsShowingInsertSizeSummary ) {
      
        double avgInsertSize = 0.0;
        if ( !m_insertSizes.empty() ) {
            avgInsertSize = ( accumulate(m_insertSizes.begin(), m_insertSizes.end(), 0.0) / (double)m_insertSizes.size() );
            cout << "Average insert size (absolute value): " << avgInsertSize << endl;
        }
        
        double medianInsertSize = 0.0;
        if ( CalculateMedian(m_insertSizes, medianInsertSize) )
            cout << "Median insert size (absolute value): " << medianInsertSize << endl;
    }
    cout << endl;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x5de35(%rip), %rdi     # 0x164f98
movq %rdi, 0x58(%rsp)
movq 0x5de01(%rip), %rsi     # 0x164f70
movq %rsi, 0x50(%rsp)
callq 0x86770
movq 0x58(%rsp), %rdi
leaq 0x2c3cb(%rip), %rsi     # 0x133550
movq %rsi, 0x38(%rsp)
callq 0x86700
movq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x86770
movq 0x58(%rsp), %rdi
leaq 0x2c3d7(%rip), %rsi     # 0x13357f
callq 0x86700
movq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x86770
movq 0x38(%rsp), %rsi
movq 0x58(%rsp), %rdi
callq 0x86700
movq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x86770
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdi
callq 0x86770
movq 0x58(%rsp), %rdi
leaq 0x2c3a6(%rip), %rsi     # 0x133597
callq 0x86700
movq %rax, %rdi
movq 0x68(%rsp), %rax
movl 0x8(%rax), %esi
callq 0x869c0
movq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x86770
movq 0x58(%rsp), %rdi
leaq 0x2c38c(%rip), %rsi     # 0x1335ab
callq 0x86700
movq %rax, %rdi
movq 0x68(%rsp), %rax
movl 0x14(%rax), %esi
callq 0x869c0
movq %rax, %rdi
leaq 0x2c381(%rip), %rsi     # 0x1335bf
movq %rsi, 0x60(%rsp)
callq 0x86700
movq 0x68(%rsp), %rcx
movq %rax, %rdi
movl 0x8(%rcx), %eax
movl 0x14(%rcx), %ecx
cvtsi2ss %rcx, %xmm0
cvtsi2ss %rax, %xmm1
divss %xmm1, %xmm0
movss 0x2c2bc(%rip), %xmm1    # 0x133528
movss %xmm1, 0x44(%rsp)
mulss %xmm1, %xmm0
callq 0x86570
movq %rax, %rdi
leaq 0x2c33d(%rip), %rsi     # 0x1335c2
movq %rsi, 0x48(%rsp)
callq 0x86700
movq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x86770
movq 0x58(%rsp), %rdi
leaq 0x2c31d(%rip), %rsi     # 0x1335c5
callq 0x86700
movq %rax, %rdi
movq 0x68(%rsp), %rax
movl 0x1c(%rax), %esi
callq 0x869c0
movq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x86700
movss 0x44(%rsp), %xmm1
movq 0x68(%rsp), %rcx
movq %rax, %rdi
movl 0x8(%rcx), %eax
movl 0x1c(%rcx), %ecx
cvtsi2ss %rcx, %xmm0
cvtsi2ss %rax, %xmm2
divss %xmm2, %xmm0
mulss %xmm1, %xmm0
callq 0x86570
movq 0x48(%rsp), %rsi
movq %rax, %rdi
callq 0x86700
movq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x86770
movq 0x58(%rsp), %rdi
leaq 0x2c2be(%rip), %rsi     # 0x1335d9
callq 0x86700
movq %rax, %rdi
movq 0x68(%rsp), %rax
movl 0x20(%rax), %esi
callq 0x869c0
movq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x86700
movss 0x44(%rsp), %xmm1
movq 0x68(%rsp), %rcx
movq %rax, %rdi
movl 0x8(%rcx), %eax
movl 0x20(%rcx), %ecx
cvtsi2ss %rcx, %xmm0
cvtsi2ss %rax, %xmm2
divss %xmm2, %xmm0
mulss %xmm1, %xmm0
callq 0x86570
movq 0x48(%rsp), %rsi
movq %rax, %rdi
callq 0x86700
movq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x86770
movq 0x58(%rsp), %rdi
leaq 0x2c25f(%rip), %rsi     # 0x1335ed
callq 0x86700
movq %rax, %rdi
movq 0x68(%rsp), %rax
movl 0x30(%rax), %esi
callq 0x869c0
movq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x86700
movss 0x44(%rsp), %xmm1
movq 0x68(%rsp), %rcx
movq %rax, %rdi
movl 0x8(%rcx), %eax
movl 0x30(%rcx), %ecx
cvtsi2ss %rcx, %xmm0
cvtsi2ss %rax, %xmm2
divss %xmm2, %xmm0
mulss %xmm1, %xmm0
callq 0x86570
movq 0x48(%rsp), %rsi
movq %rax, %rdi
callq 0x86700
movq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x86770
movq 0x58(%rsp), %rdi
leaq 0x2c200(%rip), %rsi     # 0x133601
callq 0x86700
movq %rax, %rdi
movq 0x68(%rsp), %rax
movl 0x34(%rax), %esi
callq 0x869c0
movq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x86700
movss 0x44(%rsp), %xmm1
movq 0x68(%rsp), %rcx
movq %rax, %rdi
movl 0x8(%rcx), %eax
movl 0x34(%rcx), %ecx
cvtsi2ss %rcx, %xmm0
cvtsi2ss %rax, %xmm2
divss %xmm2, %xmm0
mulss %xmm1, %xmm0
callq 0x86570
movq 0x48(%rsp), %rsi
movq %rax, %rdi
callq 0x86700
movq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x86770
movq 0x58(%rsp), %rdi
leaq 0x2c1a1(%rip), %rsi     # 0x133615
callq 0x86700
movq %rax, %rdi
movq 0x68(%rsp), %rax
movl 0xc(%rax), %esi
callq 0x869c0
movq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x86700
movq 0x68(%rsp), %rcx
movq %rax, %rdi
movl 0x8(%rcx), %eax
movl 0xc(%rcx), %ecx
cvtsi2ss %rcx, %xmm0
cvtsi2ss %rax, %xmm1
divss %xmm1, %xmm0
movss 0x2c06e(%rip), %xmm1    # 0x133528
mulss %xmm1, %xmm0
callq 0x86570
movq %rax, %rdi
leaq 0x2c0f5(%rip), %rsi     # 0x1335c2
callq 0x86700
movq %rax, %rdi
movq 0x5da94(%rip), %rsi     # 0x164f70
callq 0x86770
movq 0x68(%rsp), %rax
cmpl $0x0, 0xc(%rax)
je 0x1076cf
movq 0x5daa1(%rip), %rdi     # 0x164f98
movq %rdi, 0x28(%rsp)
leaq 0x2c126(%rip), %rsi     # 0x133629
callq 0x86700
movq %rax, %rdi
movq 0x68(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x869c0
movq %rax, %rdi
leaq 0x2c09d(%rip), %rsi     # 0x1335bf
movq %rsi, 0x30(%rsp)
callq 0x86700
movq 0x68(%rsp), %rcx
movq %rax, %rdi
movl 0xc(%rcx), %eax
movl 0x10(%rcx), %ecx
cvtsi2ss %rcx, %xmm0
cvtsi2ss %rax, %xmm1
divss %xmm1, %xmm0
movss 0x2bfd8(%rip), %xmm1    # 0x133528
movss %xmm1, 0x14(%rsp)
mulss %xmm1, %xmm0
callq 0x86570
movq %rax, %rdi
leaq 0x2c059(%rip), %rsi     # 0x1335c2
movq %rsi, 0x18(%rsp)
callq 0x86700
movq %rax, %rdi
movq 0x5d9f3(%rip), %rsi     # 0x164f70
movq %rsi, 0x20(%rsp)
callq 0x86770
movq 0x28(%rsp), %rdi
leaq 0x2c0aa(%rip), %rsi     # 0x13363d
callq 0x86700
movq %rax, %rdi
movq 0x68(%rsp), %rax
movl 0x18(%rax), %esi
callq 0x869c0
movq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x86700
movss 0x14(%rsp), %xmm1
movq 0x68(%rsp), %rcx
movq %rax, %rdi
movl 0xc(%rcx), %eax
movl 0x18(%rcx), %ecx
cvtsi2ss %rcx, %xmm0
cvtsi2ss %rax, %xmm2
divss %xmm2, %xmm0
mulss %xmm1, %xmm0
callq 0x86570
movq 0x18(%rsp), %rsi
movq %rax, %rdi
callq 0x86700
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x86770
movq 0x28(%rsp), %rdi
leaq 0x2c04b(%rip), %rsi     # 0x133651
callq 0x86700
movq %rax, %rdi
movq 0x68(%rsp), %rax
movl 0x24(%rax), %esi
callq 0x869c0
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x86770
movq 0x28(%rsp), %rdi
leaq 0x2c031(%rip), %rsi     # 0x133665
callq 0x86700
movq %rax, %rdi
movq 0x68(%rsp), %rax
movl 0x28(%rax), %esi
callq 0x869c0
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x86770
movq 0x28(%rsp), %rdi
leaq 0x2c017(%rip), %rsi     # 0x133679
callq 0x86700
movq %rax, %rdi
movq 0x68(%rsp), %rax
movl 0x2c(%rax), %esi
callq 0x869c0
movq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x86700
movq 0x68(%rsp), %rcx
movq %rax, %rdi
movl 0xc(%rcx), %eax
movl 0x2c(%rcx), %ecx
cvtsi2ss %rcx, %xmm0
cvtsi2ss %rax, %xmm1
divss %xmm1, %xmm0
movss 0x2be80(%rip), %xmm1    # 0x133528
mulss %xmm1, %xmm0
callq 0x86570
movq %rax, %rdi
leaq 0x2bf07(%rip), %rsi     # 0x1335c2
callq 0x86700
movq %rax, %rdi
movq 0x5d8a6(%rip), %rsi     # 0x164f70
callq 0x86770
movq 0x68(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x2(%rax)
je 0x107813
movq 0x68(%rsp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, 0x88(%rsp)
addq $0x38, %rdi
callq 0xcf350
testb $0x1, %al
jne 0x1077bc
movq 0x68(%rsp), %rdi
addq $0x38, %rdi
movq %rdi, (%rsp)
callq 0xcf300
movq (%rsp), %rdi
movq %rax, 0x80(%rsp)
callq 0xcf230
movq %rax, 0x78(%rsp)
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rsi
xorps %xmm0, %xmm0
callq 0x108a80
movq (%rsp), %rdi
movsd %xmm0, 0x8(%rsp)
callq 0xcf3a0
movsd 0x8(%rsp), %xmm0
movq %rax, %xmm1
movaps 0x2bdcf(%rip), %xmm2    # 0x133530
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x2bdd3(%rip), %xmm2    # 0x133540
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0x5d808(%rip), %rdi     # 0x164f98
leaq 0x2bef6(%rip), %rsi     # 0x13368d
callq 0x86700
movq %rax, %rdi
movsd 0x88(%rsp), %xmm0
callq 0x86eb0
movq %rax, %rdi
movq 0x5d7b9(%rip), %rsi     # 0x164f70
callq 0x86770
movq 0x68(%rsp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, 0x70(%rsp)
movq %rdi, %rsi
addq $0x38, %rsi
leaq 0x70(%rsp), %rdx
callq 0x106fa0
testb $0x1, %al
jne 0x1077e1
jmp 0x107811
movq 0x5d7b0(%rip), %rdi     # 0x164f98
leaq 0x2bec5(%rip), %rsi     # 0x1336b4
callq 0x86700
movq %rax, %rdi
movsd 0x70(%rsp), %xmm0
callq 0x86eb0
movq %rax, %rdi
movq 0x5d764(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x107813
movq 0x5d77e(%rip), %rdi     # 0x164f98
movq 0x5d74f(%rip), %rsi     # 0x164f70
callq 0x86770
addq $0x98, %rsp
retq
nop