// File: BenLangmead[P]bowtie/./ref_aligner.h
// Function: OneMMRefAligner::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>(qlen, 32);
				const int lhsShift = ((anchorBitPairs - 1) << 1);
				const uint32_t anchorCushion  = 32 - anchorBitPairs;
				// anchorOverhang = # read bases not included in the anchor
				const size_t anchorOverhang = (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;
				int nPos = -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 > 1) {
							// More than one 'N' in the anchor region; can't
							// possibly have a 1-mismatch hit anywhere
							assert_eq(r2.size(), ranges.size() - rangesInitSz);
							return;   // can't match if query has Ns
						}
						nPos = (int)i;
						// 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);
				}
				// 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 > 1) {
							assert_eq(r2.size(), ranges.size() - rangesInitSz);
							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;
				for(TIndexOffU 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 & 0xffffffff00000000llu) &&
					   (diff & 0x00000000ffffffffllu)) 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 > 1) 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]];
					uint32_t mmpos = 0xffffffff;
					int refc = -1;
					if(diffs > 1) {
						// Too many differences
						continue;
					} else if(diffs == 1 && nPos != -1) {
						// There was one difference, but there was also one N,
						// so we already know where the difference is
						mmpos = nPos;
						refc = "ACGT"[(int)ref[rir + nPos]];
					} else if(diffs == 1) {
						// Figure out which position mismatched
						mmpos = 31;
						if((diff & 0xffffffffllu) == 0) { diff >>= 32llu; mmpos -= 16; }
						assert_neq(0, diff);
						if((diff & 0xffffllu) == 0)     { diff >>= 16llu; mmpos -=  8; }
						assert_neq(0, diff);
						if((diff & 0xffllu) == 0)       { diff >>= 8llu;  mmpos -=  4; }
						assert_neq(0, diff);
						if((diff & 0xfllu) == 0)        { diff >>= 4llu;  mmpos -=  2; }
						assert_neq(0, diff);
						if((diff & 0x3llu) == 0)        { mmpos--; }
						assert_neq(0, diff);
						assert_geq(mmpos, 0);
						assert_lt(mmpos, 32);
						mmpos -= anchorCushion;
						refc = "ACGT"[(int)ref[rir + mmpos]];
					}
					// Now extend the anchor into a longer alignment
					bool foundHit = true;
					if(anchorOverhang > 0) {
						assert_leq(ri + anchorBitPairs + anchorOverhang, end);
						bool skipCandidate = false;
						for(size_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 > 1) {
									foundHit = false;
									break;
								} else {
									mmpos = (uint32_t)(32 + j);
									refc = "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, 1);
					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 == 1) {
						assert_neq(mmpos, 0xffffffff);
						assert_eq(mmpos, r2[r2i].mms[0]);
						assert_neq(-1, refc);
						assert_eq(refc, r2[r2i].refcs[0]);
						range.mms.push_back(mmpos);
						range.refcs.push_back(refc);
					}
					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 $0x170, %rsp            # imm = 0x170
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 0x6f793
xorl %eax, %eax
movl %eax, -0x160(%rbp)
jmp 0x6f79f
movl -0x38(%rbp), %eax
subl $0x20, %eax
movl %eax, -0x160(%rbp)
movl -0x160(%rbp), %eax
movl %eax, %eax
movq %rax, -0x58(%rbp)
movl 0x18(%rbp), %eax
subl -0x38(%rbp), %eax
subl 0x10(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl 0x10(%rbp), %eax
movl -0x5c(%rbp), %ecx
shrl %ecx
addl %ecx, %eax
movl %eax, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq $-0x1, -0x80(%rbp)
movb $0x0, -0x81(%rbp)
cmpl $0x20, -0x3c(%rbp)
jae 0x6f80f
movl $0x20, %ecx
subl -0x3c(%rbp), %ecx
shll %ecx
movq -0x80(%rbp), %rax
movl %ecx, %ecx
shrq %cl, %rax
movq %rax, -0x80(%rbp)
movb $0x1, -0x81(%rbp)
movl $0x0, -0x88(%rbp)
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 0x6f98a
movq -0x28(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0x4fea0
movsbl (%rax), %eax
movl %eax, -0xac(%rbp)
movq -0x20(%rbp), %rax
movl -0x60(%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 0x6f8f0
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 0x6f93b
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
cmpl $0x1, %eax
jle 0x6f912
jmp 0x7024e
movq -0xa8(%rbp), %rax
movl %eax, -0x8c(%rbp)
movl $0x0, -0xac(%rbp)
movq -0x78(%rbp), %rax
shlq $0x2, %rax
orq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x6f947
movq -0x78(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0x78(%rbp)
movq -0x68(%rbp), %rax
shlq $0x2, %rax
movslq -0xac(%rbp), %rcx
orq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x70(%rbp), %rax
shlq $0x2, %rax
movslq -0xb0(%rbp), %rcx
orq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x6f844
movl -0x3c(%rbp), %eax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movl -0x38(%rbp), %ecx
cmpq %rcx, %rax
jae 0x6f9ec
movq -0x28(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x4fea0
movsbl (%rax), %eax
cmpl $0x4, %eax
jne 0x6f9d6
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
cmpl $0x1, %eax
jle 0x6f9d4
jmp 0x7024e
jmp 0x6f9d6
jmp 0x6f9d8
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
jmp 0x6f994
movq -0x70(%rbp), %rax
movq %rax, -0xc8(%rbp)
movb $0x0, -0xc9(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0xd0(%rbp)
movl -0x60(%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 -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc(%rbp)
movl -0x60(%rbp), %eax
subl 0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe0(%rbp)
movl $0x1, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
movl -0x5c(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
ja 0x7024c
testb $0x1, -0xc9(%rbp)
je 0x6fb39
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 0x6fad5
movl $0x0, -0xe8(%rbp)
movl -0x3c(%rbp), %eax
movq %rax, -0x98(%rbp)
movq -0x70(%rbp), %rax
shlq $0x2, %rax
movslq -0xe8(%rbp), %rcx
orq %rcx, %rax
movq %rax, -0x70(%rbp)
testb $0x1, -0x81(%rbp)
je 0x6fb00
movq -0x80(%rbp), %rax
andq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x98(%rbp)
jbe 0x6fb21
movq -0x98(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x70238
movq -0x70(%rbp), %rax
xorq -0x68(%rbp), %rax
orq -0x78(%rbp), %rax
movq %rax, -0xf0(%rbp)
jmp 0x6fc01
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 0x6fb94
movl $0x0, -0xe8(%rbp)
movl -0x38(%rbp), %eax
movq %rax, -0xa0(%rbp)
cmpl $0x2, -0xe4(%rbp)
jb 0x6fbca
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 0x6fbeb
movq -0xa0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xa0(%rbp)
jmp 0x70238
movq -0xc8(%rbp), %rax
xorq -0x68(%rbp), %rax
orq -0x78(%rbp), %rax
movq %rax, -0xf0(%rbp)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
andq -0xf0(%rbp), %rax
cmpq $0x0, %rax
je 0x6fc34
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0xf0(%rbp), %rax
cmpq $0x0, %rax
je 0x6fc34
jmp 0x70238
testb $0x1, -0xc9(%rbp)
je 0x6fc4b
movl -0xdc(%rbp), %eax
movl %eax, -0x164(%rbp)
jmp 0x6fc57
movl -0xd0(%rbp), %eax
movl %eax, -0x164(%rbp)
movl -0x164(%rbp), %eax
movl %eax, -0xf4(%rbp)
testb $0x1, -0xc9(%rbp)
je 0x6fc7a
movl -0xe0(%rbp), %eax
movl %eax, -0x168(%rbp)
jmp 0x6fc86
movl -0xd4(%rbp), %eax
movl %eax, -0x168(%rbp)
movl -0x168(%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 0x3b1bc(%rip), %rax     # 0xaae70
movzbl (%rax,%rcx), %eax
movq -0x100(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x3b1a3(%rip), %rcx     # 0xaae70
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x104(%rbp)
cmpl $0x1, -0x104(%rbp)
jbe 0x6fce7
jmp 0x70238
movq -0x100(%rbp), %rax
movzbl 0x1(%rax), %eax
movslq %eax, %rcx
leaq 0x3b174(%rip), %rax     # 0xaae70
movzbl (%rax,%rcx), %eax
movq -0x100(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x3b15b(%rip), %rcx     # 0xaae70
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x100(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x3b140(%rip), %rcx     # 0xaae70
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x100(%rbp), %rcx
movzbl 0x4(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x3b125(%rip), %rcx     # 0xaae70
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x100(%rbp), %rcx
movzbl 0x5(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x3b10a(%rip), %rcx     # 0xaae70
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x100(%rbp), %rcx
movzbl 0x6(%rcx), %ecx
movslq %ecx, %rdx
leaq 0x3b0ef(%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
cmpl $0x1, -0x104(%rbp)
jbe 0x6fdb5
jmp 0x70238
cmpl $0x1, -0x104(%rbp)
jne 0x6fe02
cmpl $-0x1, -0x8c(%rbp)
je 0x6fe02
movl -0x8c(%rbp), %eax
movl %eax, -0x108(%rbp)
movq -0x20(%rbp), %rax
movl -0xf8(%rbp), %ecx
addl -0x8c(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x199cd(%rip), %rax     # 0x897c0
movsbl (%rax,%rcx), %eax
movl %eax, -0x10c(%rbp)
jmp 0x6ff48
cmpl $0x1, -0x104(%rbp)
jne 0x6ff46
movl $0x1f, -0x108(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0xf0(%rbp), %rax
cmpq $0x0, %rax
jne 0x6fe51
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 0x6fe85
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 0x6feb9
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 0x6feeb
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 0x6ff0b
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 0x19884(%rip), %rax     # 0x897c0
movsbl (%rax,%rcx), %eax
movl %eax, -0x10c(%rbp)
jmp 0x6ff48
jmp 0x6ff4a
movb $0x1, -0x10d(%rbp)
cmpq $0x0, -0x58(%rbp)
jbe 0x7008c
movb $0x0, -0x10e(%rbp)
movq $0x0, -0x118(%rbp)
movq -0x118(%rbp), %rax
cmpq -0x58(%rbp), %rax
jae 0x7007c
movq -0x20(%rbp), %rax
movl -0xf8(%rbp), %ecx
addl $0x20, %ecx
movl %ecx, %ecx
addq -0x118(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x11c(%rbp)
cmpl $0x4, -0x11c(%rbp)
jne 0x6ffe6
testb $0x1, -0xc9(%rbp)
je 0x6ffc9
movq -0x58(%rbp), %rax
subq -0x118(%rbp), %rax
subq $0x1, %rax
movq %rax, -0xa0(%rbp)
jmp 0x6ffda
movl -0x3c(%rbp), %eax
addq -0x118(%rbp), %rax
movq %rax, -0x98(%rbp)
movb $0x1, -0x10e(%rbp)
jmp 0x7007c
movq -0x28(%rbp), %rdi
movq -0x118(%rbp), %rsi
addq $0x20, %rsi
callq 0x4fea0
movsbl (%rax), %eax
cmpl -0x11c(%rbp), %eax
je 0x70063
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
cmpl $0x1, %eax
jbe 0x70022
movb $0x0, -0x10d(%rbp)
jmp 0x7007c
movq -0x118(%rbp), %rax
addq $0x20, %rax
movl %eax, -0x108(%rbp)
movq -0x20(%rbp), %rax
movl -0xf8(%rbp), %ecx
addl $0x20, %ecx
movl %ecx, %ecx
addq -0x118(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x19769(%rip), %rax     # 0x897c0
movsbl (%rax,%rcx), %eax
movl %eax, -0x10c(%rbp)
jmp 0x70063
jmp 0x70065
movq -0x118(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0x6ff6e
testb $0x1, -0x10e(%rbp)
je 0x7008a
jmp 0x70238
jmp 0x7008c
testb $0x1, -0x10d(%rbp)
jne 0x7009a
jmp 0x70238
cmpq $0x0, 0x30(%rbp)
je 0x7017c
leaq -0x130(%rbp), %rdi
callq 0x281e0
movl -0xf4(%rbp), %eax
cmpl 0x38(%rbp), %eax
jae 0x700eb
movq -0x18(%rbp), %rax
shlq $0x20, %rax
movl -0xf4(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x130(%rbp)
movq -0x18(%rbp), %rax
shlq $0x20, %rax
movl 0x38(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x128(%rbp)
jmp 0x70118
movq -0x18(%rbp), %rax
shlq $0x20, %rax
movl -0xf4(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x128(%rbp)
movq -0x18(%rbp), %rax
shlq $0x20, %rax
movl 0x38(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x130(%rbp)
movq 0x30(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x59ff0
movq %rax, -0x138(%rbp)
movq 0x30(%rbp), %rdi
callq 0x5a030
movq %rax, -0x140(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x59fc0
testb $0x1, %al
jne 0x70158
jmp 0x7015d
jmp 0x70238
movq 0x30(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x5a060
movq %rax, -0x150(%rbp)
movb %dl, -0x148(%rbp)
jmp 0x7017c
movq 0x20(%rbp), %rax
movq %rax, -0x170(%rbp)
movq 0x20(%rbp), %rdi
callq 0x5a130
movq -0x170(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
callq 0x5a0b0
movq 0x20(%rbp), %rdi
callq 0x5a150
movq %rax, -0x158(%rbp)
movl -0x104(%rbp), %ecx
movq -0x158(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0x104(%rbp), %ecx
movq -0x158(%rbp), %rax
movl %ecx, 0x10(%rax)
cmpl $0x1, -0x104(%rbp)
jne 0x70216
movq -0x158(%rbp), %rdi
addq $0x18, %rdi
leaq -0x108(%rbp), %rsi
callq 0x32160
movq -0x158(%rbp), %rdi
addq $0x38, %rdi
movl -0x10c(%rbp), %eax
movb %al, -0x159(%rbp)
leaq -0x159(%rbp), %rsi
callq 0x40fe0
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 0x70236
jmp 0x7024e
jmp 0x70238
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x6fa4a
jmp 0x7024e
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopw (%rax,%rax)