// File: /workspace/github_cpp_makefile_star2_O2/BenLangmead[P]bowtie/hit_set.cpp
// Function: HitSet::reportUpTo(std::ostream&, int)
void HitSet::reportUpTo(ostream& os, int khits) {
	khits = min(khits, (int)size());
	BTDnaString seqrc;
	BTString qualr;
	for(int i = 0; i < khits; i++) {
		const HitSetEnt& h = ents[i];
		if(!h.fw && seqrc.empty()) {
			// Lazily initialize seqrc and qualr
			seqrc = seq;
			reverseComplementInPlace(seqrc);
			assert_eq(seqrc.length(), seq.length());
			qualr = qual;
			reverseInPlace(qualr);
			assert_eq(qualr.length(), qual.length());
		}
		os << name << '\t'
		   << (h.fw ? '+' : '-') << '\t'
		   << h.h.first << '\t'
		   << h.h.second << '\t'
		   << (h.fw ? seq : seqrc) << '\t'
		   << (h.fw ? qual : qualr) << '\t'
		   << h.oms << '\t';
		for(size_t i = 0; i < h.edits.size(); i++) {
			const Edit& e = h.edits[i];
			os << e.pos;
			if(e.type == EDIT_TYPE_SNP) os << "S";
			os << ":" << (char)e.chr << ">" << (e.qchr != 0 ? (char)e.qchr : (char)seq[e.pos]);
			if(i < h.edits.size()-1) os << ",";
		}
		os << endl;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movl 0xb0(%rdi), %eax
cmpl %edx, %eax
cmovll %eax, %edx
xorps %xmm0, %xmm0
leaq 0x28(%rsp), %rcx
movups %xmm0, 0x8(%rcx)
movups %xmm0, 0x20(%rcx)
leaq 0x1c956(%rip), %rax     # 0x60b70
movq %rax, (%rcx)
leaq 0x1c87c(%rip), %rax     # 0x60aa0
leaq 0x58(%rsp), %rcx
movq %rax, (%rcx)
movups %xmm0, 0x8(%rcx)
movups %xmm0, 0x20(%rcx)
leaq 0x30(%rdi), %rax
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
testl %edx, %edx
cmovlel %r12d, %edx
movq %rdx, 0x18(%rsp)
movq %rdi, (%rsp)
leaq 0x60(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0x3cf6(%rip), %r13      # 0x47f55
leaq 0x6741(%rip), %rbx      # 0x4a9a7
cmpq 0x18(%rsp), %r12
je 0x44526
movq (%rsp), %rax
movq 0xa0(%rax), %r15
imulq $0x30, %r12, %rbp
cmpb $0x0, 0x8(%r15,%rbp)
jne 0x4437e
cmpq $0x0, 0x48(%rsp)
jne 0x4437e
movq (%rsp), %rax
movq 0x38(%rax), %rsi
movq 0x50(%rax), %rdx
movq 0x28(%rsp), %rax
leaq 0x28(%rsp), %rdi
callq *0x10(%rax)
movq 0x48(%rsp), %rcx
movq %rcx, %rax
shrq %rax
leaq -0x1(%rcx), %rdx
xorl %esi, %esi
cmpq %rsi, %rax
je 0x44313
movq 0x30(%rsp), %rdi
movb (%rdi,%rdx), %r8b
movl %r8d, %r9d
xorb $0x3, %r9b
cmpb $0x4, %r8b
movzbl %r9b, %r8d
pushq $0x4
popq %r10
cmovel %r10d, %r8d
movb (%rdi,%rsi), %r9b
movb %r8b, (%rdi,%rsi)
movl %r9d, %edi
xorb $0x3, %dil
cmpb $0x4, %r9b
movzbl %dil, %edi
cmovel %r10d, %edi
movq 0x30(%rsp), %r8
movb %dil, (%r8,%rdx)
incq %rsi
decq %rdx
jmp 0x442c2
testb $0x1, %cl
je 0x4432b
movq 0x30(%rsp), %rcx
movb (%rcx,%rax), %dl
cmpb $0x4, %dl
je 0x4432b
xorb $0x3, %dl
movb %dl, (%rcx,%rax)
movq (%rsp), %rax
movq 0x68(%rax), %rsi
movq 0x80(%rax), %rdx
movq 0x58(%rsp), %rax
leaq 0x58(%rsp), %rdi
callq *0x10(%rax)
movq 0x78(%rsp), %rax
movq %rax, %rcx
shrq %rcx
decq %rax
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x4437e
movq 0x60(%rsp), %rsi
movb (%rsi,%rdx), %dil
movb (%rsi,%rax), %r8b
movb %r8b, (%rsi,%rdx)
movq 0x60(%rsp), %rsi
movb %dil, (%rsi,%rax)
incq %rdx
decq %rax
jmp 0x44357
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x1970d
movq %rax, %rdi
pushq $0x9
popq %rsi
callq 0x95a0
addq %rbp, %r15
xorl %ecx, %ecx
cmpb $0x0, 0x8(%r15)
sete %cl
leal 0x2b(,%rcx,2), %esi
movq %rax, %rdi
callq 0x95a0
movq %rax, %rdi
pushq $0x9
popq %rsi
callq 0x95a0
movl (%r15), %esi
movq %rax, %rdi
callq 0x9310
movq %rax, %rdi
pushq $0x9
popq %rsi
callq 0x95a0
movl 0x4(%r15), %esi
movq %rax, %rdi
callq 0x9310
movq %rax, %rdi
pushq $0x9
popq %rsi
callq 0x95a0
cmpb $0x0, 0x8(%r15)
movq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rcx
cmoveq %rcx, %rsi
movq %rax, %rdi
callq 0x1970d
movq %rax, %rdi
pushq $0x9
popq %rsi
callq 0x95a0
cmpb $0x0, 0x8(%r15)
movq 0x8(%rsp), %rsi
leaq 0x58(%rsp), %rcx
cmoveq %rcx, %rsi
movq %rax, %rdi
callq 0x1970d
movq %rax, %rdi
pushq $0x9
popq %rsi
callq 0x95a0
movl 0xc(%r15), %esi
movq %rax, %rdi
callq 0x9310
movq %rax, %rdi
pushq $0x9
popq %rsi
callq 0x95a0
movq %r12, 0x20(%rsp)
xorl %r12d, %r12d
cmpq 0x28(%r15), %r12
jae 0x44511
movq 0x18(%r15), %rbp
movl (%rbp,%r12,4), %esi
shrl $0x14, %esi
andl $0x3ff, %esi            # imm = 0x3FF
movq %r14, %rdi
callq 0x9310
movl (%rbp,%r12,4), %eax
movl $0xf0000, %ecx          # imm = 0xF0000
andl %ecx, %eax
cmpl $0x20000, %eax          # imm = 0x20000
jne 0x4449a
movq %r14, %rdi
leaq 0x7001(%rip), %rsi      # 0x4b496
callq 0x94e0
movq %r14, %rdi
movq %r13, %rsi
callq 0x94e0
movsbl (%rbp,%r12,4), %esi
movq %rax, %rdi
callq 0x95a0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x94e0
movl (%rbp,%r12,4), %ecx
testw $0xff00, %cx            # imm = 0xFF00
je 0x444cf
shrl $0x8, %ecx
jmp 0x444e3
shrl $0x14, %ecx
andl $0x3ff, %ecx            # imm = 0x3FF
movq (%rsp), %rdx
movq 0x38(%rdx), %rdx
movb (%rdx,%rcx), %cl
movsbl %cl, %esi
movq %rax, %rdi
callq 0x95a0
movq 0x28(%r15), %rax
decq %rax
cmpq %rax, %r12
jae 0x44509
movq %r14, %rdi
leaq 0x6f3b(%rip), %rsi      # 0x4b43f
callq 0x94e0
incq %r12
jmp 0x44454
movq %r14, %rdi
callq 0x9210
movq 0x20(%rsp), %r12
incq %r12
jmp 0x44266
leaq 0x58(%rsp), %rdi
callq 0x1d8f6
leaq 0x28(%rsp), %rdi
callq 0x1d8f6
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4454e
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x1d8f6
leaq 0x28(%rsp), %rdi
callq 0x1d8f6
movq %rbx, %rdi
callq 0x9950