// File: BenLangmead[P]bowtie/./hit.h
// Function: HitSinkPerThread::finishRead(PatternSourcePerThread&, bool, bool)
virtual uint32_t finishRead(PatternSourcePerThread& p, bool report, bool dump) {
		uint32_t ret = finishReadImpl();
		_bestRemainingStratum = 0;
		if(!report) {
			_bufferedHits.clear();
			return 0;
		}
		bool maxed = (ret > _max);
		bool unal = (ret == 0);
		if(dump && (unal || maxed)) {
			// Either no reportable hits were found or the number of
			// reportable hits exceeded the -m limit specified by the
			// user
			assert(ret == 0 || ret > _max);
			if(maxed) _sink.dumpMaxed(p);
			else      _sink.dumpUnal(p);
		}
		ret = 0;
		if(maxed) {
			// Report that the read maxed-out; useful for chaining output
			if(dump) _sink.reportMaxed(_bufferedHits, threadId_, p);
			_bufferedHits.clear();
		} else if(unal) {
			// Report that the read failed to align; useful for chaining output
			if(dump) _sink.reportUnaligned(threadId_, p);
		} else {
			// Flush buffered hits
			assert_gt(_bufferedHits.size(), 0);
			if(_bufferedHits.size() > _n) {
				_bufferedHits.resize(_n);
			}
			int mapq = defaultMapq_;
			int xms = (int)(_bufferedHits.size());
			const bool paired = p.bufa().mate > 0;
			if(paired) {
				xms /= 2;
			}
			_sink.reportHits(NULL, &_bufferedHits, 0, _bufferedHits.size(),
			                 threadId_, mapq, xms, true, p);
			_sink.dumpAlign(p);
			ret = (uint32_t)_bufferedHits.size();
			_bufferedHits.clear();
		}
		assert_eq(0, _bufferedHits.size());
		return ret;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x68, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
andb $0x1, %cl
movb %cl, -0x21(%rbp)
andb $0x1, %al
movb %al, -0x22(%rbp)
movq -0x18(%rbp), %rdi
movq %rdi, -0x40(%rbp)
movq (%rdi), %rax
callq *0x18(%rax)
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, -0x28(%rbp)
movl $0x0, 0x10(%rax)
testb $0x1, -0x21(%rbp)
jne 0x36efd
movq -0x40(%rbp), %rdi
addq $0x40, %rdi
callq 0x37540
movl $0x0, -0xc(%rbp)
jmp 0x370c6
movq -0x40(%rbp), %rcx
movl -0x28(%rbp), %eax
cmpl 0x64(%rcx), %eax
seta %al
andb $0x1, %al
movb %al, -0x29(%rbp)
cmpl $0x0, -0x28(%rbp)
sete %al
andb $0x1, %al
movb %al, -0x2a(%rbp)
testb $0x1, -0x22(%rbp)
je 0x36f59
testb $0x1, -0x2a(%rbp)
jne 0x36f2d
testb $0x1, -0x29(%rbp)
je 0x36f59
testb $0x1, -0x29(%rbp)
je 0x36f46
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x37560
jmp 0x36f57
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x37a00
jmp 0x36f59
movl $0x0, -0x28(%rbp)
testb $0x1, -0x29(%rbp)
je 0x36f9b
testb $0x1, -0x22(%rbp)
je 0x36f89
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
movq %rax, %rsi
addq $0x40, %rsi
movq 0x70(%rax), %rdx
movq -0x20(%rbp), %rcx
movq (%rdi), %rax
callq *0x20(%rax)
movq -0x40(%rbp), %rdi
addq $0x40, %rdi
callq 0x37540
jmp 0x370c0
testb $0x1, -0x2a(%rbp)
je 0x36fc2
testb $0x1, -0x22(%rbp)
je 0x36fbd
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x70(%rax), %rsi
movq -0x20(%rbp), %rdx
movq (%rdi), %rax
callq *0x28(%rax)
jmp 0x370be
movq -0x40(%rbp), %rdi
addq $0x40, %rdi
callq 0x37e60
movq -0x40(%rbp), %rcx
movl 0x68(%rcx), %ecx
cmpq %rcx, %rax
jbe 0x36ff0
movq -0x40(%rbp), %rax
movq %rax, %rdi
addq $0x40, %rdi
movl 0x68(%rax), %eax
movl %eax, %esi
callq 0x37e80
movq -0x40(%rbp), %rdi
movl 0x6c(%rdi), %eax
movl %eax, -0x30(%rbp)
addq $0x40, %rdi
callq 0x37e60
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rdi
callq 0x37f00
cmpl $0x0, 0x188(%rax)
setg %al
andb $0x1, %al
movb %al, -0x35(%rbp)
testb $0x1, -0x35(%rbp)
je 0x37032
movl -0x34(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x34(%rbp)
movq -0x40(%rbp), %rdi
movq 0x8(%rdi), %rax
movq %rax, -0x50(%rbp)
movq %rdi, %rax
addq $0x40, %rax
movq %rax, -0x48(%rbp)
addq $0x40, %rdi
callq 0x37e60
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq %rax, %r8
movq -0x40(%rbp), %rax
movq 0x70(%rax), %r9
movl -0x30(%rbp), %ebx
movl -0x34(%rbp), %r11d
movq -0x20(%rbp), %r10
movq (%rdi), %rax
xorl %ecx, %ecx
movq %rcx, %rsi
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movq %r10, 0x18(%rsp)
callq *0x18(%rax)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x37f20
movq -0x40(%rbp), %rdi
addq $0x40, %rdi
callq 0x37e60
movq -0x40(%rbp), %rdi
movl %eax, -0x28(%rbp)
addq $0x40, %rdi
callq 0x37540
jmp 0x370c0
movl -0x28(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x68, %rsp
popq %rbx
popq %rbp
retq