// File: /workspace/github_cpp_makefile_star2_O3/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 $0x98, %rsp
movq %rdi, 0x10(%rsp)
movl 0xb0(%rdi), %eax
cmpl %edx, %eax
cmovll %eax, %edx
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rsp)
movups %xmm0, 0x38(%rsp)
leaq 0x1a25f(%rip), %rax     # 0x68b50
movq %rax, 0x18(%rsp)
leaq 0x1a183(%rip), %rax     # 0x68a80
movq %rax, 0x68(%rsp)
movups %xmm0, 0x70(%rsp)
movups %xmm0, 0x88(%rsp)
testl %edx, %edx
jle 0x4ecbc
movq %rsi, %rbx
movq 0x10(%rsp), %rax
leaq 0x30(%rax), %rcx
movq %rcx, 0x58(%rsp)
addq $0x60, %rax
movq %rax, 0x50(%rsp)
movl %edx, %eax
movq %rax, 0x48(%rsp)
xorl %r14d, %r14d
movl $0x4, %r12d
leaq 0xf(%rsp), %r13
movq 0x10(%rsp), %rax
movq 0xa0(%rax), %r15
leaq (%r14,%r14,2), %rbp
shlq $0x4, %rbp
cmpb $0x0, 0x8(%r15,%rbp)
jne 0x4ea61
cmpq $0x0, 0x38(%rsp)
jne 0x4ea61
movq 0x10(%rsp), %rax
movq 0x38(%rax), %rsi
movq 0x50(%rax), %rdx
movq 0x18(%rsp), %rax
leaq 0x18(%rsp), %rdi
callq *0x10(%rax)
movq 0x38(%rsp), %rcx
movq %rcx, %rax
shrq %rax
cmpq $0x2, %rcx
jb 0x4e9ee
leaq -0x1(%rcx), %rdx
xorl %esi, %esi
movq 0x20(%rsp), %rdi
movb (%rdi,%rdx), %r8b
movb (%rdi,%rsi), %r9b
movl %r8d, %r10d
xorb $0x3, %r10b
cmpb $0x4, %r8b
movzbl %r10b, %r8d
cmovel %r12d, %r8d
movb %r8b, (%rdi,%rsi)
movl %r9d, %edi
xorb $0x3, %dil
cmpb $0x4, %r9b
movzbl %dil, %edi
cmovel %r12d, %edi
movq 0x20(%rsp), %r8
movb %dil, (%r8,%rdx)
incq %rsi
decq %rdx
cmpq %rsi, %rax
jne 0x4e9a3
testb $0x1, %cl
je 0x4ea06
movq 0x20(%rsp), %rcx
movb (%rcx,%rax), %dl
cmpb $0x4, %dl
je 0x4ea06
xorb $0x3, %dl
movb %dl, (%rcx,%rax)
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rsi
movq 0x80(%rax), %rdx
movq 0x68(%rsp), %rax
leaq 0x68(%rsp), %rdi
callq *0x10(%rax)
movq 0x88(%rsp), %rax
cmpq $0x2, %rax
jb 0x4ea61
movq %rax, %rcx
shrq %rcx
decq %rax
xorl %edx, %edx
movq 0x70(%rsp), %rsi
movb (%rsi,%rdx), %dil
movb (%rsi,%rax), %r8b
movb %r8b, (%rsi,%rdx)
movq 0x70(%rsp), %rsi
movb %dil, (%rsi,%rax)
incq %rdx
decq %rax
cmpq %rdx, %rcx
jne 0x4ea3c
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x1fb3f
movb $0x9, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x9560
addq %rbp, %r15
cmpb $0x0, 0x8(%r15)
sete %cl
addb %cl, %cl
addb $0x2b, %cl
movb %cl, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x9560
movb $0x9, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x9560
movl (%r15), %esi
movq %rax, %rdi
callq 0x92e0
movb $0x9, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x9560
movl 0x4(%r15), %esi
movq %rax, %rdi
callq 0x92e0
movb $0x9, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x9560
cmpb $0x0, 0x8(%r15)
movq 0x58(%rsp), %rsi
leaq 0x18(%rsp), %rcx
cmoveq %rcx, %rsi
movq %rax, %rdi
callq 0x1fb3f
movb $0x9, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x9560
cmpb $0x0, 0x8(%r15)
movq 0x50(%rsp), %rsi
leaq 0x68(%rsp), %rcx
cmoveq %rcx, %rsi
movq %rax, %rdi
callq 0x1fb3f
movb $0x9, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x9560
movl 0xc(%r15), %esi
movq %rax, %rdi
callq 0x92e0
movb $0x9, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x9560
movq %r14, 0x60(%rsp)
cmpq $0x0, 0x28(%r15)
je 0x4ec7c
xorl %r12d, %r12d
movq 0x18(%r15), %r14
movl (%r14,%r12,4), %esi
shrl $0x14, %esi
andl $0x3ff, %esi            # imm = 0x3FF
movq %rbx, %rdi
callq 0x92e0
movl (%r14,%r12,4), %eax
movl $0xf0000, %ecx          # imm = 0xF0000
andl %ecx, %eax
cmpl $0x20000, %eax          # imm = 0x20000
jne 0x4ebd0
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x7960(%rip), %rsi      # 0x5652b
callq 0x9560
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x440b(%rip), %rsi      # 0x52fea
callq 0x9560
movb (%r14,%r12,4), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x9560
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6e2e(%rip), %rsi      # 0x55a3c
callq 0x9560
movl (%r14,%r12,4), %eax
testl $0xff00, %eax           # imm = 0xFF00
je 0x4ec23
shrl $0x8, %eax
jmp 0x4ec37
shrl $0x14, %eax
andl $0x3ff, %eax            # imm = 0x3FF
movq 0x10(%rsp), %rcx
movq 0x38(%rcx), %rcx
movb (%rcx,%rax), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x9560
movq 0x28(%r15), %rax
leaq -0x1(%rax), %rcx
cmpq %rcx, %r12
jae 0x4ec70
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x786d(%rip), %rsi      # 0x564d4
callq 0x9560
movq 0x28(%r15), %rax
incq %r12
cmpq %rax, %r12
jb 0x4eb91
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x9480
movq 0x60(%rsp), %r14
movl $0x4, %r12d
movsbl %al, %esi
movq %rbx, %rdi
callq 0x9050
movq %rax, %rdi
callq 0x92f0
incq %r14
cmpq 0x48(%rsp), %r14
jne 0x4e946
leaq 0x68(%rsp), %rdi
callq 0x250d6
leaq 0x18(%rsp), %rdi
callq 0x250d6
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4ece4
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x250d6
leaq 0x18(%rsp), %rdi
callq 0x250d6
movq %rbx, %rdi
callq 0x9930