// File: BenLangmead[P]bowtie/./ref_aligner.h
// Function: TwoMMRefAligner::anchor64Find(unsigned int, unsigned long, unsigned char*, SDnaStringExpandable<25, 2> const&, SStringExpandable<char, 25, 2, 0> const&, unsigned int, unsigned int, EList<Range, 128>&, EList<unsigned int, 128>&, std::set<std::pair<unsigned long, unsigned long>, std::less<std::pair<unsigned long, unsigned long>>, std::allocator<std::pair<unsigned long, unsigned long>>>*, unsigned int, bool) const
virtual void anchor64Find(uint32_t numToFind,
							  size_t tidx,
							  uint8_t* ref,
							  const BTDnaString& qry,
							  const BTString& quals,
							  TIndexOffU begin,
							  TIndexOffU end,
							  TRangeVec& ranges,
							  EList<TIndexOffU>& results,
							  TSetPairs* pairs = NULL,
							  TIndexOffU aoff = OFF_MASK,
							  bool seedOnLeft = false) const
				{
					assert_gt(numToFind, 0);
					ASSERT_ONLY(const uint32_t rangesInitSz = (uint32_t)ranges.size());
					ASSERT_ONLY(uint32_t duplicates = 0);
					ASSERT_ONLY(uint32_t r2i = 0);
					const uint32_t qlen = (uint32_t)qry.length();
					assert_geq(end - begin, qlen); // caller should have checked this
					assert_gt(end, begin);
					assert_gt(qlen, 0);
#ifndef NDEBUG
					// Get results from the naive matcher for sanity-checking
					TRangeVec r2; EList<TIndexOffU> re2;
					naiveFind(numToFind, tidx, ref, qry, quals, begin, end, r2,
						  re2, pairs, aoff, seedOnLeft);
#endif
					const uint32_t anchorBitPairs = min<int>((int)qlen, 32);
					const int lhsShift = ((anchorBitPairs - 1) << 1);
					const uint32_t anchorCushion  = 32 - anchorBitPairs;
					// anchorOverhang = # read bases not included in the anchor
					const uint32_t anchorOverhang = (uint32_t)(qlen <= 32 ? 0 : (qlen - 32));
					const TIndexOffU lim = end - qlen - begin;
					const TIndexOffU halfway = begin + (lim >> 1);
					uint64_t anchor = 0llu;
					uint64_t buffw = 0llu;  // rotating ref sequence buffer
					// OR the 'diff' buffer with this so that we can always count
					// 'N's as mismatches
					uint64_t diffMask = 0llu;
					// Set up a mask that we'll apply to the two bufs every round
					// to discard bits that were rotated out of the anchor area
					uint64_t clearMask = 0xffffffffffffffffllu;
					bool useMask = false;
					if(anchorBitPairs < 32) {
						clearMask >>= ((32-anchorBitPairs) << 1);
						useMask = true;
					}
					int nsInAnchor = 0;
					uint32_t nPoss = 0;
					int nPos1 = -1;
					int nPos2 = -1;
					size_t skipLeftToRights = 0;
					size_t skipRightToLefts = 0;
					// Construct the 'anchor' 64-bit buffer so that it holds all of
					// the first 'anchorBitPairs' bit pairs of the query.
					for(size_t i = 0; i < anchorBitPairs; i++) {
						int c = (int)qry[i]; // next query character
						int r = (int)ref[halfway - begin + i]; // next reference character
						if(r & 4) {
							r = 0;
							// The right-to-left direction absorbs the candidate
							// alignment based at 'halfway'; so skipLeftToRights is
							// i, not i+1
							skipLeftToRights = max(skipLeftToRights, i);
							skipRightToLefts = max(skipRightToLefts, anchorBitPairs - i);
						}
						assert_leq(c, 4);
						assert_lt(r, 4);
						// Special case: query has an 'N'
						if(c == 4) {
							if(++nsInAnchor > 2) {
								// More than two 'N's in the anchor region; can't
								// possibly have a 2-mismatch hit anywhere
								return;   // can't match if query has Ns
							} else if(nsInAnchor == 2) {
								nPos2 = (int)i;
								nPoss++;
							} else {
								assert_eq(1, nsInAnchor);
								nPos1 = (int)i;
								nPoss++;
							}
							// Make it look like an 'A' in the anchor
							c = 0;
							diffMask = (diffMask << 2llu) | 1llu;
						} else {
							diffMask <<= 2llu;
						}
						anchor  = ((anchor  << 2llu) | c);
						buffw = ((buffw << 2llu) | r);
					}
					assert_leq(nPoss, 2);
					// Check whether read is disqualified by Ns outside of the anchor
					// region
					for(size_t i = anchorBitPairs; i < qlen; i++) {
						if((int)qry[i] == 4) {
							if(++nsInAnchor > 2) {
								return; // can't match if query has Ns
							}
						}
					}
					uint64_t bufbw = buffw;
					// We're moving the right-hand edge of the anchor along until
					// it's 'anchorOverhang' chars from the end of the target region.
					// Note that we're not making a 3'/5' distinction here; if we
					// were, we might need to make the 'anchorOverhang' adjustment on
					// the left end of the range rather than the right.
					bool hi = false;
					TIndexOffU riHi  = halfway;
					TIndexOffU rirHi = halfway - begin;
					TIndexOffU rirHiAnchor = rirHi + anchorBitPairs - 1;
					TIndexOffU riLo  = halfway + 1;
					TIndexOffU rirLo = halfway - begin + 1;
					TIndexOffU i;
					for(i = 1; i <= lim + 1; i++) {
						int r;       // new reference char
						uint64_t diff;
						assert_lt(skipLeftToRights, qlen);
						assert_leq(skipRightToLefts, qlen);
						if(hi) {
							hi = false;
							// Moving left-to-right
							riHi++;
							rirHi++;
							rirHiAnchor++;
							r = (int)ref[rirHiAnchor];
							if(r & 4) {
								r = 0;
								skipLeftToRights = anchorBitPairs;
							}
							assert_lt(r, 4);
							// Bring in new base pair at the least significant
							// position
							buffw = ((buffw << 2llu) | r);
							if(useMask) buffw &= clearMask;
							if(skipLeftToRights > 0) {
								skipLeftToRights--;
								continue;
							}
							diff = (buffw ^ anchor) | diffMask;
						} else {
							hi = true;
							// Moving right-to-left
							riLo--;
							rirLo--;
							r = (int)ref[rirLo];
							if(r & 4) {
								r = 0;
								skipRightToLefts = qlen;
							}
							assert_lt(r, 4);
							if(i >= 2) {
								bufbw >>= 2llu;
								// Bring in new base pair at the most significant
								// position
								bufbw |= ((uint64_t)r << lhsShift);
							}
							if(skipRightToLefts > 0) {
								skipRightToLefts--;
								continue;
							}
							diff = (bufbw ^ anchor) | diffMask;
						}
						if((diff & 0xfffff00000000000llu) &&
						   (diff & 0x00000ffffff00000llu) &&
						   (diff & 0x00000000000fffffllu)) continue;
						TIndexOffU ri  = hi ? riLo  : riHi;
						TIndexOffU rir = hi ? rirLo : rirHi;
						// Could use pop count
						uint8_t *diff8 = reinterpret_cast<uint8_t*>(&diff);
						// As a first cut, see if there are too many mismatches in
						// the first and last parts of the anchor
						uint32_t diffs = u8toMms[(int)diff8[0]] + u8toMms[(int)diff8[7]];
						if(diffs > 2) continue;
						diffs += u8toMms[(int)diff8[1]] +
							u8toMms[(int)diff8[2]] +
							u8toMms[(int)diff8[3]] +
							u8toMms[(int)diff8[4]] +
							u8toMms[(int)diff8[5]] +
							u8toMms[(int)diff8[6]];
						TIndexOffU mmpos1 = OFF_MASK;
						int refc1 = -1;
						TIndexOffU mmpos2 = OFF_MASK;
						int refc2 = -1;
						if(diffs > 2) {
							// Too many differences
							continue;
						} else if(nPoss > 1 && diffs == nPoss) {
							// There was one difference, but there was also one N,
							// so we already know where the difference is
							mmpos1 = nPos1;
							refc1 = "ACGT"[(int)ref[rir + nPos1]];
							if(nPoss == 2) {
								mmpos2 = nPos2;
								refc2 = "ACGT"[(int)ref[rir + nPos2]];
							}
						} else if(diffs > 0) {
							// Figure out which position mismatched
							uint64_t diff2 = diff;
							mmpos1 = 31;
							if((diff & 0xffffffffllu) == 0) { diff >>= 32llu; mmpos1 -= 16; }
							assert_neq(0, diff);
							if((diff & 0xffffllu) == 0)     { diff >>= 16llu; mmpos1 -=  8; }
							assert_neq(0, diff);
							if((diff & 0xffllu) == 0)       { diff >>= 8llu;  mmpos1 -=  4; }
							assert_neq(0, diff);
							if((diff & 0xfllu) == 0)        { diff >>= 4llu;  mmpos1 -=  2; }
							assert_neq(0, diff);
							if((diff & 0x3llu) == 0)        { mmpos1--; }
							assert_neq(0, diff);
							assert_geq(mmpos1, 0);
							assert_lt(mmpos1, 32);
							mmpos1 -= anchorCushion;
							refc1 = "ACGT"[(int)ref[rir + mmpos1]];
							if(diffs > 1) {
								// Figure out the second mismatched position
								ASSERT_ONLY(uint64_t origDiff2 = diff2);
								diff2 &= ~(0xc000000000000000llu >> (uint64_t)((mmpos1+anchorCushion) << 1));
								assert_neq(diff2, origDiff2);
								mmpos2 = 31;
								if((diff2 & 0xffffffffllu) == 0) { diff2 >>= 32llu; mmpos2 -= 16; }
								assert_neq(0, diff2);
								if((diff2 & 0xffffllu) == 0)     { diff2 >>= 16llu; mmpos2 -=  8; }
								assert_neq(0, diff2);
								if((diff2 & 0xffllu) == 0)       { diff2 >>= 8llu;  mmpos2 -=  4; }
								assert_neq(0, diff2);
								if((diff2 & 0xfllu) == 0)        { diff2 >>= 4llu;  mmpos2 -=  2; }
								assert_neq(0, diff2);
								if((diff2 & 0x3llu) == 0)        { mmpos2--; }
								assert_neq(0, diff2);
								assert_geq(mmpos2, 0);
								assert_lt(mmpos2, 32);
								mmpos2 -= anchorCushion;
								assert_neq(mmpos1, mmpos2);
								refc2 = "ACGT"[(int)ref[rir + mmpos2]];
								if(mmpos2 < mmpos1) {
									uint32_t mmtmp = mmpos1;
									mmpos1 = mmpos2;
									mmpos2 = mmtmp;
									int refctmp = refc1;
									refc1 = refc2;
									refc2 = refctmp;
								}
								assert_lt(mmpos1, mmpos2);
							}
						}
						// Now extend the anchor into a longer alignment
						bool foundHit = true;
						if(anchorOverhang > 0) {
							assert_leq(ri + anchorBitPairs + anchorOverhang, end);
							bool skipCandidate = false;
							for(uint32_t j = 0; j < anchorOverhang; j++) {
								int rc = (int)ref[rir + 32 + j];
								if(rc == 4) {
									// Oops, encountered an N in the reference in
									// the overhang portion of the candidate
									// alignment
									// (Note that we inverted hi earlier)
									if(hi) {
										// Right-to-left
										skipRightToLefts = anchorOverhang - j - 1;
									} else {
										// Left-to-right
										skipLeftToRights = anchorBitPairs + j;
									}
									skipCandidate = true; // Skip this candidate
									break;
								}
								if((int)qry[32 + j] != rc) {
									if(++diffs > 2) {
										foundHit = false;
										break;
									} else if(diffs == 2) {
										mmpos2 = 32 + j;
										refc2 = "ACGT"[(int)ref[rir + 32 + j]];
									} else {
										assert_eq(1, diffs);
										mmpos1 = 32 + j;
										refc1 = "ACGT"[(int)ref[rir + 32 + j]];
									}
								}
							}
							if(skipCandidate) continue;
						}
						if(!foundHit) continue;
						if(pairs != NULL) {
							TU64Pair p;
							if(ri < aoff) {
								// By convention, the upstream mate's
								// coordinates go in the 'first' field
								p.first  = ((uint64_t)tidx << 32) | (uint64_t)ri;
								p.second = ((uint64_t)tidx << 32) | (uint64_t)aoff;
							} else {
								p.second = ((uint64_t)tidx << 32) | (uint64_t)ri;
								p.first  = ((uint64_t)tidx << 32) | (uint64_t)aoff;
							}
							if(pairs->find(p) != pairs->end()) {
								// We already found this hit!  Continue.
								ASSERT_ONLY(duplicates++);
								ASSERT_ONLY(r2i++);
								continue;
							} else {
								// Record this hit
								pairs->insert(p);
							}
						}
						assert_leq(diffs, 2);
						assert_lt(r2i, r2.size());
						assert_eq(re2[r2i], ri);
						ranges.resize(ranges.size()+1);
						Range& range = ranges.back();
						assert_eq(diffs, r2[r2i].numMms);
						range.stratum = diffs;
						range.numMms = diffs;
						assert_eq(0, range.mms.size());
						assert_eq(0, range.refcs.size());
						if(diffs > 0) {
							assert_neq(mmpos1, OFF_MASK);
							assert_eq(mmpos1, r2[r2i].mms[0]);
							assert_neq(-1, refc1);
							assert_eq(refc1, r2[r2i].refcs[0]);
							range.mms.push_back(mmpos1);
							range.refcs.push_back(refc1);
							if(diffs > 1) {
								assert_neq(mmpos2, OFF_MASK);
								assert_eq(mmpos2, r2[r2i].mms[1]);
								assert_neq(-1, refc2);
								assert_eq(refc2, r2[r2i].refcs[1]);
								range.mms.push_back(mmpos2);
								range.refcs.push_back(refc2);
							}
						}
						ASSERT_ONLY(r2i++);
						results.push_back(ri);
						if(--numToFind == 0) return;
					}
					assert_leq(duplicates, r2.size());
					assert_geq(r2.size() - duplicates, ranges.size() - rangesInitSz);
					return; // no hit
				}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movb 0x40(%rbp), %al
movl 0x38(%rbp), %r10d
movq 0x30(%rbp), %r10
movq 0x28(%rbp), %r10
movq 0x20(%rbp), %r10
movl 0x18(%rbp), %r10d
movl 0x10(%rbp), %r10d
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
andb $0x1, %al
movb %al, -0x31(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2ef90
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x40(%rbp)
movl $0x20, -0x44(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x59f80
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
subl $0x1, %eax
shll %eax
movl %eax, -0x48(%rbp)
movl $0x20, %eax
subl -0x3c(%rbp), %eax
movl %eax, -0x4c(%rbp)
cmpl $0x20, -0x38(%rbp)
ja 0x746e3
xorl %eax, %eax
movl %eax, -0x178(%rbp)
jmp 0x746ef
movl -0x38(%rbp), %eax
subl $0x20, %eax
movl %eax, -0x178(%rbp)
movl -0x178(%rbp), %eax
movl %eax, -0x50(%rbp)
movl 0x18(%rbp), %eax
subl -0x38(%rbp), %eax
subl 0x10(%rbp), %eax
movl %eax, -0x54(%rbp)
movl 0x10(%rbp), %eax
movl -0x54(%rbp), %ecx
shrl %ecx
addl %ecx, %eax
movl %eax, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq $-0x1, -0x78(%rbp)
movb $0x0, -0x79(%rbp)
cmpl $0x20, -0x3c(%rbp)
jae 0x74756
movl $0x20, %ecx
subl -0x3c(%rbp), %ecx
shll %ecx
movq -0x78(%rbp), %rax
movl %ecx, %ecx
shrq %cl, %rax
movq %rax, -0x78(%rbp)
movb $0x1, -0x79(%rbp)
movl $0x0, -0x80(%rbp)
movl $0x0, -0x84(%rbp)
movl $0xffffffff, -0x88(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x8c(%rbp) # imm = 0xFFFFFFFF
movq $0x0, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movq $0x0, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movl -0x3c(%rbp), %ecx
cmpq %rcx, %rax
jae 0x74911
movq -0x28(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0x4fea0
movsbl (%rax), %eax
movl %eax, -0xac(%rbp)
movq -0x20(%rbp), %rax
movl -0x58(%rbp), %ecx
subl 0x10(%rbp), %ecx
movl %ecx, %ecx
addq -0xa8(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0xb0(%rbp)
movl -0xb0(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x74848
movl $0x0, -0xb0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x43520
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movl -0x3c(%rbp), %eax
subq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x43520
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
cmpl $0x4, -0xac(%rbp)
jne 0x748c2
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
cmpl $0x2, %eax
jle 0x74864
jmp 0x754a1
cmpl $0x2, -0x80(%rbp)
jne 0x74888
movq -0xa8(%rbp), %rax
movl %eax, -0x8c(%rbp)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x748a4
movq -0xa8(%rbp), %rax
movl %eax, -0x88(%rbp)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x748a6
movl $0x0, -0xac(%rbp)
movq -0x70(%rbp), %rax
shlq $0x2, %rax
orq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x748ce
movq -0x70(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rax
shlq $0x2, %rax
movslq -0xac(%rbp), %rcx
orq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
shlq $0x2, %rax
movslq -0xb0(%rbp), %rcx
orq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x7479c
movl -0x3c(%rbp), %eax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movl -0x38(%rbp), %ecx
cmpq %rcx, %rax
jae 0x7496d
movq -0x28(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x4fea0
movsbl (%rax), %eax
cmpl $0x4, %eax
jne 0x74957
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
cmpl $0x2, %eax
jle 0x74955
jmp 0x754a1
jmp 0x74957
jmp 0x74959
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
jmp 0x7491b
movq -0x68(%rbp), %rax
movq %rax, -0xc8(%rbp)
movb $0x0, -0xc9(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0xd0(%rbp)
movl -0x58(%rbp), %eax
subl 0x10(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
addl -0x3c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xd8(%rbp)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc(%rbp)
movl -0x58(%rbp), %eax
subl 0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe0(%rbp)
movl $0x1, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
movl -0x54(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
ja 0x7549f
testb $0x1, -0xc9(%rbp)
je 0x74ab7
movb $0x0, -0xc9(%rbp)
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
movq -0x20(%rbp), %rax
movl -0xd8(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0xe8(%rbp)
movl -0xe8(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x74a56
movl $0x0, -0xe8(%rbp)
movl -0x3c(%rbp), %eax
movq %rax, -0x98(%rbp)
movq -0x68(%rbp), %rax
shlq $0x2, %rax
movslq -0xe8(%rbp), %rcx
orq %rcx, %rax
movq %rax, -0x68(%rbp)
testb $0x1, -0x79(%rbp)
je 0x74a7e
movq -0x78(%rbp), %rax
andq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x98(%rbp)
jbe 0x74a9f
movq -0x98(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x7548b
movq -0x68(%rbp), %rax
xorq -0x60(%rbp), %rax
orq -0x70(%rbp), %rax
movq %rax, -0xf0(%rbp)
jmp 0x74b7f
movb $0x1, -0xc9(%rbp)
movl -0xdc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xdc(%rbp)
movl -0xe0(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xe0(%rbp)
movq -0x20(%rbp), %rax
movl -0xe0(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0xe8(%rbp)
movl -0xe8(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x74b12
movl $0x0, -0xe8(%rbp)
movl -0x38(%rbp), %eax
movq %rax, -0xa0(%rbp)
cmpl $0x2, -0xe4(%rbp)
jb 0x74b48
movq -0xc8(%rbp), %rax
shrq $0x2, %rax
movq %rax, -0xc8(%rbp)
movslq -0xe8(%rbp), %rax
movl -0x48(%rbp), %ecx
shlq %cl, %rax
orq -0xc8(%rbp), %rax
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0xa0(%rbp)
jbe 0x74b69
movq -0xa0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xa0(%rbp)
jmp 0x7548b
movq -0xc8(%rbp), %rax
xorq -0x60(%rbp), %rax
orq -0x70(%rbp), %rax
movq %rax, -0xf0(%rbp)
movabsq $-0x100000000000, %rax  # imm = 0xFFFFF00000000000
andq -0xf0(%rbp), %rax
cmpq $0x0, %rax
je 0x74bc5
movabsq $0xffffff00000, %rax    # imm = 0xFFFFFF00000
andq -0xf0(%rbp), %rax
cmpq $0x0, %rax
je 0x74bc5
movq -0xf0(%rbp), %rax
andq $0xfffff, %rax          # imm = 0xFFFFF
cmpq $0x0, %rax
je 0x74bc5
jmp 0x7548b
testb $0x1, -0xc9(%rbp)
je 0x74bdc
movl -0xdc(%rbp), %eax
movl %eax, -0x17c(%rbp)
jmp 0x74be8
movl -0xd0(%rbp), %eax
movl %eax, -0x17c(%rbp)
movl -0x17c(%rbp), %eax
movl %eax, -0xf4(%rbp)
testb $0x1, -0xc9(%rbp)
je 0x74c0b
movl -0xe0(%rbp), %eax
movl %eax, -0x180(%rbp)
jmp 0x74c17
movl -0xd4(%rbp), %eax
movl %eax, -0x180(%rbp)
movl -0x180(%rbp), %eax
movl %eax, -0xf8(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movzbl (%rax), %eax
movslq %eax, %rcx
leaq 0x3622b(%rip), %rax     # 0xaae70
movzbl (%rax,%rcx), %eax
movq -0x100(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x36212(%rip), %rcx     # 0xaae70
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x104(%rbp)
cmpl $0x2, -0x104(%rbp)
jbe 0x74c78
jmp 0x7548b
movq -0x100(%rbp), %rax
movzbl 0x1(%rax), %eax
movslq %eax, %rcx
leaq 0x361e3(%rip), %rax     # 0xaae70
movzbl (%rax,%rcx), %eax
movq -0x100(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x361ca(%rip), %rcx     # 0xaae70
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x100(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x361af(%rip), %rcx     # 0xaae70
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x100(%rbp), %rcx
movzbl 0x4(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x36194(%rip), %rcx     # 0xaae70
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x100(%rbp), %rcx
movzbl 0x5(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x36179(%rip), %rcx     # 0xaae70
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x100(%rbp), %rcx
movzbl 0x6(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x3615e(%rip), %rcx     # 0xaae70
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
addl -0x104(%rbp), %eax
movl %eax, -0x104(%rbp)
movl $0xffffffff, -0x108(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x10c(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x110(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x114(%rbp) # imm = 0xFFFFFFFF
cmpl $0x2, -0x104(%rbp)
jbe 0x74d5a
jmp 0x7548b
cmpl $0x1, -0x84(%rbp)
jbe 0x74def
movl -0x104(%rbp), %eax
cmpl -0x84(%rbp), %eax
jne 0x74def
movl -0x88(%rbp), %eax
movl %eax, -0x108(%rbp)
movq -0x20(%rbp), %rax
movl -0xf8(%rbp), %ecx
addl -0x88(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x14a1f(%rip), %rax     # 0x897c0
movsbl (%rax,%rcx), %eax
movl %eax, -0x10c(%rbp)
cmpl $0x2, -0x84(%rbp)
jne 0x74dea
movl -0x8c(%rbp), %eax
movl %eax, -0x110(%rbp)
movq -0x20(%rbp), %rax
movl -0xf8(%rbp), %ecx
addl -0x8c(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x149e0(%rip), %rax     # 0x897c0
movsbl (%rax,%rcx), %eax
movl %eax, -0x114(%rbp)
jmp 0x7510f
cmpl $0x0, -0x104(%rbp)
jbe 0x7510d
movq -0xf0(%rbp), %rax
movq %rax, -0x120(%rbp)
movl $0x1f, -0x108(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0xf0(%rbp), %rax
cmpq $0x0, %rax
jne 0x74e4c
movq -0xf0(%rbp), %rax
shrq $0x20, %rax
movq %rax, -0xf0(%rbp)
movl -0x108(%rbp), %eax
subl $0x10, %eax
movl %eax, -0x108(%rbp)
movq -0xf0(%rbp), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq $0x0, %rax
jne 0x74e80
movq -0xf0(%rbp), %rax
shrq $0x10, %rax
movq %rax, -0xf0(%rbp)
movl -0x108(%rbp), %eax
subl $0x8, %eax
movl %eax, -0x108(%rbp)
movq -0xf0(%rbp), %rax
andq $0xff, %rax
cmpq $0x0, %rax
jne 0x74eb4
movq -0xf0(%rbp), %rax
shrq $0x8, %rax
movq %rax, -0xf0(%rbp)
movl -0x108(%rbp), %eax
subl $0x4, %eax
movl %eax, -0x108(%rbp)
movq -0xf0(%rbp), %rax
andq $0xf, %rax
cmpq $0x0, %rax
jne 0x74ee6
movq -0xf0(%rbp), %rax
shrq $0x4, %rax
movq %rax, -0xf0(%rbp)
movl -0x108(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x108(%rbp)
movq -0xf0(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x74f06
movl -0x108(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x108(%rbp)
movl -0x4c(%rbp), %ecx
movl -0x108(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x108(%rbp)
movq -0x20(%rbp), %rax
movl -0xf8(%rbp), %ecx
addl -0x108(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x14889(%rip), %rax     # 0x897c0
movsbl (%rax,%rcx), %eax
movl %eax, -0x10c(%rbp)
cmpl $0x1, -0x104(%rbp)
jbe 0x7510b
movl -0x108(%rbp), %eax
addl -0x4c(%rbp), %eax
shll %eax
movl %eax, %eax
movl %eax, %ecx
movabsq $-0x4000000000000000, %rax # imm = 0xC000000000000000
shrq %cl, %rax
xorq $-0x1, %rax
andq -0x120(%rbp), %rax
movq %rax, -0x120(%rbp)
movl $0x1f, -0x110(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0x120(%rbp), %rax
cmpq $0x0, %rax
jne 0x74fbe
movq -0x120(%rbp), %rax
shrq $0x20, %rax
movq %rax, -0x120(%rbp)
movl -0x110(%rbp), %eax
subl $0x10, %eax
movl %eax, -0x110(%rbp)
movq -0x120(%rbp), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq $0x0, %rax
jne 0x74ff2
movq -0x120(%rbp), %rax
shrq $0x10, %rax
movq %rax, -0x120(%rbp)
movl -0x110(%rbp), %eax
subl $0x8, %eax
movl %eax, -0x110(%rbp)
movq -0x120(%rbp), %rax
andq $0xff, %rax
cmpq $0x0, %rax
jne 0x75026
movq -0x120(%rbp), %rax
shrq $0x8, %rax
movq %rax, -0x120(%rbp)
movl -0x110(%rbp), %eax
subl $0x4, %eax
movl %eax, -0x110(%rbp)
movq -0x120(%rbp), %rax
andq $0xf, %rax
cmpq $0x0, %rax
jne 0x75058
movq -0x120(%rbp), %rax
shrq $0x4, %rax
movq %rax, -0x120(%rbp)
movl -0x110(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x110(%rbp)
movq -0x120(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x75078
movl -0x110(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x110(%rbp)
movl -0x4c(%rbp), %ecx
movl -0x110(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x110(%rbp)
movq -0x20(%rbp), %rax
movl -0xf8(%rbp), %ecx
addl -0x110(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x14717(%rip), %rax     # 0x897c0
movsbl (%rax,%rcx), %eax
movl %eax, -0x114(%rbp)
movl -0x110(%rbp), %eax
cmpl -0x108(%rbp), %eax
jae 0x75109
movl -0x108(%rbp), %eax
movl %eax, -0x124(%rbp)
movl -0x110(%rbp), %eax
movl %eax, -0x108(%rbp)
movl -0x124(%rbp), %eax
movl %eax, -0x110(%rbp)
movl -0x10c(%rbp), %eax
movl %eax, -0x128(%rbp)
movl -0x114(%rbp), %eax
movl %eax, -0x10c(%rbp)
movl -0x128(%rbp), %eax
movl %eax, -0x114(%rbp)
jmp 0x7510b
jmp 0x7510d
jmp 0x7510f
jmp 0x75111
movb $0x1, -0x129(%rbp)
cmpl $0x0, -0x50(%rbp)
jbe 0x7529a
movb $0x0, -0x12a(%rbp)
movl $0x0, -0x130(%rbp)
movl -0x130(%rbp), %eax
cmpl -0x50(%rbp), %eax
jae 0x7528a
movq -0x20(%rbp), %rax
movl -0xf8(%rbp), %ecx
addl $0x20, %ecx
addl -0x130(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x134(%rbp)
cmpl $0x4, -0x134(%rbp)
jne 0x751a8
testb $0x1, -0xc9(%rbp)
je 0x7518a
movl -0x50(%rbp), %eax
subl -0x130(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
movq %rax, -0xa0(%rbp)
jmp 0x7519c
movl -0x3c(%rbp), %eax
addl -0x130(%rbp), %eax
movl %eax, %eax
movq %rax, -0x98(%rbp)
movb $0x1, -0x12a(%rbp)
jmp 0x7528a
movq -0x28(%rbp), %rdi
movl -0x130(%rbp), %eax
addl $0x20, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x4fea0
movsbl (%rax), %eax
cmpl -0x134(%rbp), %eax
je 0x75274
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
cmpl $0x2, %eax
jbe 0x751ed
movb $0x0, -0x129(%rbp)
jmp 0x7528a
cmpl $0x2, -0x104(%rbp)
jne 0x75234
movl -0x130(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x110(%rbp)
movq -0x20(%rbp), %rax
movl -0xf8(%rbp), %ecx
addl $0x20, %ecx
addl -0x130(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x14598(%rip), %rax     # 0x897c0
movsbl (%rax,%rcx), %eax
movl %eax, -0x114(%rbp)
jmp 0x75270
movl -0x130(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x108(%rbp)
movq -0x20(%rbp), %rax
movl -0xf8(%rbp), %ecx
addl $0x20, %ecx
addl -0x130(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x1455a(%rip), %rax     # 0x897c0
movsbl (%rax,%rcx), %eax
movl %eax, -0x10c(%rbp)
jmp 0x75272
jmp 0x75274
jmp 0x75276
movl -0x130(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x130(%rbp)
jmp 0x75133
testb $0x1, -0x12a(%rbp)
je 0x75298
jmp 0x7548b
jmp 0x7529a
testb $0x1, -0x129(%rbp)
jne 0x752a8
jmp 0x7548b
cmpq $0x0, 0x30(%rbp)
je 0x7538a
leaq -0x148(%rbp), %rdi
callq 0x281e0
movl -0xf4(%rbp), %eax
cmpl 0x38(%rbp), %eax
jae 0x752f9
movq -0x18(%rbp), %rax
shlq $0x20, %rax
movl -0xf4(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x148(%rbp)
movq -0x18(%rbp), %rax
shlq $0x20, %rax
movl 0x38(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x140(%rbp)
jmp 0x75326
movq -0x18(%rbp), %rax
shlq $0x20, %rax
movl -0xf4(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x140(%rbp)
movq -0x18(%rbp), %rax
shlq $0x20, %rax
movl 0x38(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x148(%rbp)
movq 0x30(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x59ff0
movq %rax, -0x150(%rbp)
movq 0x30(%rbp), %rdi
callq 0x5a030
movq %rax, -0x158(%rbp)
leaq -0x150(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x59fc0
testb $0x1, %al
jne 0x75366
jmp 0x7536b
jmp 0x7548b
movq 0x30(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x5a060
movq %rax, -0x168(%rbp)
movb %dl, -0x160(%rbp)
jmp 0x7538a
movq 0x20(%rbp), %rax
movq %rax, -0x188(%rbp)
movq 0x20(%rbp), %rdi
callq 0x5a130
movq -0x188(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
callq 0x5a0b0
movq 0x20(%rbp), %rdi
callq 0x5a150
movq %rax, -0x170(%rbp)
movl -0x104(%rbp), %ecx
movq -0x170(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0x104(%rbp), %ecx
movq -0x170(%rbp), %rax
movl %ecx, 0x10(%rax)
cmpl $0x0, -0x104(%rbp)
jbe 0x75469
movq -0x170(%rbp), %rdi
addq $0x18, %rdi
leaq -0x108(%rbp), %rsi
callq 0x32160
movq -0x170(%rbp), %rdi
addq $0x38, %rdi
movl -0x10c(%rbp), %eax
movb %al, -0x171(%rbp)
leaq -0x171(%rbp), %rsi
callq 0x40fe0
cmpl $0x1, -0x104(%rbp)
jbe 0x75467
movq -0x170(%rbp), %rdi
addq $0x18, %rdi
leaq -0x110(%rbp), %rsi
callq 0x32160
movq -0x170(%rbp), %rdi
addq $0x38, %rdi
movl -0x114(%rbp), %eax
movb %al, -0x172(%rbp)
leaq -0x172(%rbp), %rsi
callq 0x40fe0
jmp 0x75469
movq 0x28(%rbp), %rdi
leaq -0xf4(%rbp), %rsi
callq 0x32160
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
jne 0x75489
jmp 0x754a1
jmp 0x7548b
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x749cb
jmp 0x754a1
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopw (%rax,%rax)