// File: /workspace/github_cpp_makefile_star2_O2/BenLangmead[P]bowtie/./ebwt.h
// Function: EbwtSearchParams::reportHit(SDnaStringExpandable<25, 2> const&, SStringExpandable<char, 25, 2, 0>*, SStringExpandable<char, 25, 2, 0>*, bool, EList<unsigned int, 128> const&, EList<unsigned char, 128> const&, unsigned long, std::pair<unsigned int, unsigned int>, std::pair<unsigned int, unsigned int>, bool, unsigned short, std::pair<unsigned int, unsigned int>, unsigned int, unsigned int, int, unsigned short, unsigned int, unsigned int, unsigned int, unsigned char) const
bool reportHit(const BTDnaString& query, // read sequence
	               BTString* quals, // read quality values
	               BTString* name,  // read name
	               bool ebwtFw,         // whether index is forward (true) or mirror (false)
	               const EList<TIndexOffU>& mmui32, // mismatch list
	               const EList<uint8_t>& refcs,  // reference characters
	               size_t numMms,      // # mismatches
	               UPair h,          // ref coords
	               UPair mh,         // mate's ref coords
	               bool mfw,           // mate's orientation
	               uint16_t mlen,      // mate length
	               UPair a,          // arrow pair
	               uint32_t tlen,      // length of text
	               uint32_t qlen,      // length of query
	               int stratum,        // alignment stratum
	               uint16_t cost,      // cost of alignment
	               uint32_t oms,       // approx. # other valid alignments
	               uint32_t patid,
	               uint32_t seed,
	               uint8_t mate) const
	{
#ifndef NDEBUG
		// Check that no two elements of the mms array are the same
		for(size_t i = 0; i < numMms; i++) {
			for(size_t j = i+1; j < numMms; j++) {
				assert_neq(mmui32[i], mmui32[j]);
			}
		}
#endif
		// If ebwtFw is true, then 'query' and 'quals' are reversed
		// If _fw is false, then 'query' and 'quals' are reverse complemented
		assert(quals != NULL);
		assert(name != NULL);
		assert_eq(mmui32.size(), refcs.size());
		assert_leq(numMms, mmui32.size());
		assert_gt(qlen, 0);
		Hit hit;
		hit.stratum = stratum;
		hit.cost = cost;
		hit.patSeq = query;
		hit.quals = *quals;
		if(!ebwtFw) {
			// Re-reverse the pattern and the quals back to how they
			// appeared in the read file
			hit.patSeq.reverse();
			hit.quals.reverse();
		}
		// Turn the mmui32 and refcs arrays into the mm FixedBitset and
		// the refc vector
		hit.refcs.resize(qlen);
		hit.refcs.fillZero();
		for(size_t i = 0; i < numMms; i++) {
			if (ebwtFw != _fw) {
				// The 3' end is on the left but the mm vector encodes
				// mismatches w/r/t the 5' end, so we flip
				uint32_t off = qlen - mmui32[i] - 1;
				hit.mms.set(off);
				hit.refcs[off] = refcs[i];
			} else {
				hit.mms.set(mmui32[i]);
				hit.refcs[mmui32[i]] = refcs[i];
			}
		}
		// Check the hit against the original text, if it's available
		if(_texts.size() > 0) {
			assert_lt(h.first, _texts.size());
			FixedBitset<1024> diffs;
			// This type of check assumes that only mismatches are
			// possible.  If indels are possible, then we either need
			// the caller to provide information about indel locations,
			// or we need to extend this to a more complicated check.
			assert_leq(h.second + qlen, _texts[h.first].length());
			for(size_t i = 0; i < qlen; i++) {
				assert_neq(4, (int)_texts[h.first][h.second + i]);
				// Forward pattern appears at h
				if((int)hit.patSeq[i] != (int)_texts[h.first][h.second + i]) {
					uint32_t qoff = (uint32_t)i;
					// if ebwtFw != _fw the 3' end is on on the
					// left end of the pattern, but the diff vector
					// should encode mismatches w/r/t the 5' end,
					// so we flip
					if (_fw) diffs.set(qoff);
					else     diffs.set(qlen - qoff - 1);
				}
			}
			if(diffs != hit.mms) {
				// Oops, mismatches were not where we expected them;
				// print a diagnostic message before asserting
				cerr << "Expected " << hit.mms.str() << " mismatches, got " << diffs.str() << endl;
				cerr << "  Pat:  " << hit.patSeq << endl;
				cerr << "  Tseg: ";
				for(size_t i = 0; i < qlen; i++) {
					cerr << _texts[h.first][h.second + i];
				}
				cerr << endl;
				cerr << "  mmui32: ";
				for(size_t i = 0; i < numMms; i++) {
					cerr << mmui32[i] << " ";
				}
				cerr << endl;
				cerr << "  FW: " << _fw << endl;
				cerr << "  Ebwt FW: " << ebwtFw << endl;
			}
			if(diffs != hit.mms) assert(false);
		}
		hit.h = h;
		hit.patId = ((patid == 0xffffffff) ? _patid : patid);
		hit.patName = *name;
		hit.mh = mh;
		hit.fw = _fw;
		hit.mfw = mfw;
		hit.mlen = mlen;
		hit.oms = oms;
		hit.mate = mate;
		hit.seed = seed;
		assert(hit.repOk());
		return sink().reportHit(hit, stratum);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %r9, 0x18(%rsp)
movl %r8d, 0xc(%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, (%rsp)
movl 0x318(%rsp), %r12d
movzwl 0x320(%rsp), %ebp
xorps %xmm0, %xmm0
leaq 0xb8(%rsp), %r14
movaps %xmm0, -0x48(%r14)
leaq 0x382ab(%rip), %rax     # 0x60aa0
movq %rax, -0x30(%r14)
movaps %xmm0, -0x28(%r14)
movups %xmm0, -0x10(%r14)
movaps %xmm0, 0x8(%r14)
movups %xmm0, 0x20(%r14)
leaq 0x3835c(%rip), %rcx     # 0x60b70
movq %rcx, (%r14)
movq %rax, 0x30(%r14)
leaq 0x108(%rsp), %r13
movaps %xmm0, -0x18(%r13)
andl $0x0, 0xa0(%r13)
movl $0x9c, %edx
movq %r13, %rdi
xorl %esi, %esi
callq 0x9270
orl $-0x1, 0xa4(%r13)
andq $0x0, 0xa8(%r13)
movl $0x80, %eax
movq %rax, 0xb0(%r13)
andq $0x0, 0xb8(%r13)
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
movq %rcx, 0xc0(%r13)
andq $0x0, 0xc8(%r13)
movq %rax, 0xd0(%r13)
andq $0x0, 0xd8(%r13)
movb %r12b, 0xe8(%r13)
movl %ebp, 0xec(%r13)
movq 0x8(%r15), %rsi
movq 0x20(%r15), %rdx
movq %r14, %rdi
callq 0x1d94a
leaq 0xe8(%rsp), %r15
movq 0x8(%rbx), %rsi
movq 0x20(%rbx), %rdx
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
cmpb $0x0, 0xc(%rsp)
jne 0x288de
leaq 0xb8(%rsp), %rdi
callq 0x28d4a
movq %r15, %rdi
callq 0x28d4a
movl 0x310(%rsp), %ebp
leaq 0x1a8(%rsp), %rdi
movl %ebp, %r15d
movq %r15, %rsi
callq 0x28d84
movq 0x2e0(%rsp), %rcx
movq 0x2d0(%rsp), %rbx
movq 0x2e8(%rsp), %rax
shrq $0x20, %rcx
movq %rcx, 0x10(%rsp)
shrq $0x20, %rax
movq %rax, 0x20(%rsp)
leaq 0x88(%rsp), %rax
movq 0x128(%rax), %rdi
movq 0x138(%rax), %rdx
xorl %r12d, %r12d
xorl %esi, %esi
callq 0x9270
movq 0x18(%rsp), %r14
cmpq %r12, 0x2d8(%rsp)
je 0x289b1
movq 0x8(%r14), %rax
movl (%rax,%r12,4), %r13d
movl 0xc(%rsp), %eax
movq (%rsp), %rcx
cmpb %al, 0x14(%rcx)
jne 0x28980
leaq 0x118(%rsp), %rdi
movl %r13d, %esi
callq 0x28dc6
movq 0x8(%r14), %rax
movl (%rax,%r12,4), %r13d
jmp 0x28996
notl %r13d
addl %ebp, %r13d
leaq 0x118(%rsp), %rdi
movl %r13d, %esi
callq 0x28dc6
movq 0x8(%rbx), %rax
movb (%rax,%r12), %al
movl %r13d, %ecx
movq 0x1b0(%rsp), %rdx
movb %al, (%rdx,%rcx)
incq %r12
jmp 0x28947
movq (%rsp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x28c26
leaq 0x20c(%rsp), %r14
xorl %r13d, %r13d
movl $0x8c, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x9270
movq 0x2e0(%rsp), %rax
movl %eax, %ebx
movq %r15, %r12
negq %r12
decl %ebp
shlq $0x5, %rbx
movq %r12, %rax
addq %r13, %rax
je 0x28a42
movq 0xc0(%rsp), %rax
movb (%rax,%r13), %al
movq (%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x8(%rcx), %rcx
movq 0x8(%rcx,%rbx), %rcx
addq 0x10(%rsp), %rcx
cmpb (%r13,%rcx), %al
je 0x28a3b
movq (%rsp), %rax
cmpb $0x0, 0x14(%rax)
movl %ebp, %esi
cmovnel %r13d, %esi
movq %r14, %rdi
callq 0x28dc6
incq %r13
decl %ebp
jmp 0x289f4
leaq 0x20c(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x28de4
testb %al, %al
je 0x28c11
movq 0x3958a(%rip), %rdi     # 0x61ff0
leaq 0x220ea(%rip), %rsi     # 0x4ab57
callq 0x94e0
movq %rax, %r13
leaq 0x50(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x28e06
leaq 0x50(%rsp), %rsi
movq %r13, %rdi
callq 0x9460
leaq 0x220c6(%rip), %rsi     # 0x4ab61
movq %rax, %rdi
callq 0x94e0
movq %rax, %r13
leaq 0x30(%rsp), %rdi
leaq 0x20c(%rsp), %rsi
callq 0x28e06
leaq 0x30(%rsp), %rsi
movq %r13, %rdi
callq 0x9460
movq %rax, %rdi
callq 0x9210
leaq 0x30(%rsp), %rdi
callq 0x9a68
leaq 0x50(%rsp), %rdi
callq 0x9a68
movq 0x39508(%rip), %rdi     # 0x61ff0
leaq 0x22084(%rip), %rsi     # 0x4ab73
callq 0x94e0
movq %rax, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x1970d
movq %rax, %rdi
callq 0x9210
movq 0x394dd(%rip), %rdi     # 0x61ff0
leaq 0x22062(%rip), %rsi     # 0x4ab7c
callq 0x94e0
movq 0x394ca(%rip), %r13     # 0x61ff0
movq 0x10(%rsp), %r12
subq $0x1, %r15
jb 0x28b54
movq (%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax,%rbx), %rax
movsbl (%rax,%r12), %esi
movq %r13, %rdi
callq 0x95a0
incq %r12
jmp 0x28b2b
movq 0x39495(%rip), %rdi     # 0x61ff0
callq 0x9210
movq 0x39489(%rip), %rdi     # 0x61ff0
leaq 0x22017(%rip), %rsi     # 0x4ab85
callq 0x94e0
xorl %ebx, %ebx
movq 0x39474(%rip), %r15     # 0x61ff0
leaq 0x22285(%rip), %r13     # 0x4ae08
movq 0x18(%rsp), %r12
cmpq %rbx, 0x2d8(%rsp)
je 0x28bb2
movq 0x8(%r12), %rax
movl (%rax,%rbx,4), %esi
movq %r15, %rdi
callq 0x9310
movq %rax, %rdi
movq %r13, %rsi
callq 0x94e0
incq %rbx
jmp 0x28b88
movq 0x39437(%rip), %rdi     # 0x61ff0
callq 0x9210
movq 0x3942b(%rip), %rdi     # 0x61ff0
leaq 0x21fc4(%rip), %rsi     # 0x4ab90
callq 0x94e0
movq (%rsp), %rcx
movzbl 0x14(%rcx), %esi
movq %rax, %rdi
callq 0x9870
movq %rax, %rdi
callq 0x9210
movq 0x39400(%rip), %rdi     # 0x61ff0
leaq 0x21fa0(%rip), %rsi     # 0x4ab97
callq 0x94e0
movzbl 0xc(%rsp), %esi
movq %rax, %rdi
callq 0x9870
movq %rax, %rdi
callq 0x9210
leaq 0x20c(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x28de4
movq 0x2e0(%rsp), %rax
movl %eax, 0x70(%rsp)
movq 0x10(%rsp), %rax
movl %eax, 0x74(%rsp)
movl 0x330(%rsp), %eax
cmpl $-0x1, %eax
jne 0x28c4e
movq (%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x80(%rsp)
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
movq 0x88(%rsp), %rax
leaq 0x88(%rsp), %rdi
callq *0x10(%rax)
leaq 0x70(%rsp), %rsi
movq 0x2e8(%rsp), %rax
movl %eax, 0x8(%rsi)
movq 0x20(%rsp), %rax
movl %eax, 0xc(%rsi)
movq (%rsp), %rcx
movb 0x14(%rcx), %al
movb %al, 0x17c(%rsi)
movb 0x2f0(%rsp), %al
movb %al, 0x17d(%rsi)
movzwl 0x2f8(%rsp), %eax
movw %ax, 0x17e(%rsi)
movl 0x328(%rsp), %eax
movl %eax, 0x178(%rsi)
movb 0x340(%rsp), %al
movb %al, 0x188(%rsi)
movl 0x338(%rsp), %eax
movl %eax, 0x18c(%rsi)
movq (%rcx), %rdi
movq (%rdi), %rax
movl 0x318(%rsp), %edx
callq *0x28(%rax)
movl %eax, %ebx
leaq 0x70(%rsp), %rdi
callq 0x1e700
movl %ebx, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x28d20
jmp 0x28d35
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x9a68
jmp 0x28d23
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x9a68
jmp 0x28d38
jmp 0x28d35
jmp 0x28d35
jmp 0x28d35
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x1e700
movq %rbx, %rdi
callq 0x9950