// File: /workspace/github_cpp_makefile_star2_O1/BenLangmead[P]bowtie/./ebwt_search_backtrack.h
// Function: EbwtRangeSource::advanceBranch(int, unsigned short, PathManager&)
virtual void
	advanceBranch(int until, uint16_t minCost, PathManager& pm) {
		assert(curEbwt_ != NULL);

		// Let this->foundRange = false; we'll set it to true iff this call
		// to advance yielded a new valid-alignment range.
		this->foundRange = false;

		// Can't have already exceeded weighted hamming distance threshold
		assert_gt(qry_->length(), 0);
		assert_leq(qlen_, qry_->length());
		assert_geq(qual_->length(), qry_->length());
		assert(!pm.empty());

		do {
			assert(pm.repOk());
			// Get the highest-priority branch according to the priority
			// queue in 'pm'
			Branch* br = pm.front();
			// Shouldn't be curtailed or exhausted
			assert(!br->exhausted_);
			assert(!br->curtailed_);
			assert_gt(br->depth3_, 0);
			assert_leq(br->ham_, qualLim_);
			if(verbose_) {
				br->print(*qry_, *qual_, minCost, cout, (halfAndHalf_>0), partial_, fw_, ebwt_->fw());
				if(!br->edits_.empty()) {
					cout << "Edit: ";
					for(size_t i = 0; i < br->edits_.size(); i++) {
						Edit e = br->edits_.get(i);
						cout << (curEbwt_->fw() ? (qlen_ - e.pos - 1) : e.pos)
							 << (char)e.chr;
						if(i < br->edits_.size()-1) cout << " ";
					}
					cout << endl;
				}

			}
			assert(br->repOk((uint32_t)qlen_));

			ASSERT_ONLY(int stratum = br->cost_ >> 14); // shift the stratum over
			assert_lt(stratum, 4);
			// Not necessarily true with rounding
			uint32_t depth = br->tipDepth();

			const Ebwt& ebwt = *ebwt_;

			if(halfAndHalf_ > 0) assert_gt(depth3_, depth5_);

			bool reportedPartial = false;
			bool invalidExact = false;
			bool empty = false;
			bool hit = false;
			uint16_t cost = br->cost_;
			uint32_t cur = 0;
			uint32_t nedits = 0;

			if(halfAndHalf_ && !hhCheckTop(br, depth, 0)) {
				// Stop extending this branch because it violates a half-
				// and-half constraint
				if(metrics_ != NULL) metrics_->curBacktracks_++;
				pm.curtail(br, (uint32_t)qlen_, depth3_, qualOrder_);
				goto bail;
			}

			cur = (uint32_t)(qlen_ - depth - 1); // current offset into qry_
			if(depth < qlen_) {
				// Determine whether ranges at this location are candidates
				// for backtracking
				int c = (int)(*qry_)[cur]; // get char at this position
				int nextc = -1;
				if(cur < qlen_-1) nextc = (int)(*qry_)[cur+1];
				assert_leq(c, 4);
				// If any uncalled base's penalty is still under
				// the ceiling, then this position is an alternative
				uint8_t q[4] = {'!', '!', '!', '!'};
				uint8_t bestq;
				// get unrounded penalties at this position
				bestq = q[0] = q[1] = q[2] = q[3] =
					mmPenalty(maqPenalty_, qualAt(cur));

				// The current query position is a legit alternative if it a) is
				// not in the unrevisitable region, and b) its selection would
				// not necessarily cause the quality ceiling (if one exists) to
				// be exceeded
				bool curIsAlternative = (depth >= br->depth0_) &&
				                        (br->ham_ + bestq <= qualLim_);
				ASSERT_ONLY(TIndexOffU obot = br->bot_);
				TIndexOffU otop = br->top_;

				// If c is 'N', then it's a mismatch
				if(c == 4 && depth > 0) {
					// Force the 'else if(curIsAlternative)' or 'else'
					// branches below
					br->top_ = br->bot_ = 1;
				} else if(c == 4) {
					// We'll take the 'if(br->top == 0 && br->bot == 0)'
					// branch below
					assert_eq(0, br->top_);
					assert_eq(0, br->bot_);
				}

				// Get the range state for the current position
				RangeState *rs = br->rangeState();
				assert(rs != NULL);
				// Calculate the ranges for this position
				if(br->top_ == 0 && br->bot_ == 0) {
					// Calculate first quartet of ranges using the _fchr[]
					// array
								  rs->tops[0] = ebwt._fchr[0];
					rs->bots[0] = rs->tops[1] = ebwt._fchr[1];
					rs->bots[1] = rs->tops[2] = ebwt._fchr[2];
					rs->bots[2] = rs->tops[3] = ebwt._fchr[3];
					rs->bots[3]               = ebwt._fchr[4];
					ASSERT_ONLY(int r =)
					br->installRanges(c, nextc, qualLim_ - br->ham_, q);
					assert(r < 4 || c == 4);
					// Update top and bot
					if(c < 4) {
						br->top_ = rs->tops[c];
						br->bot_ = rs->bots[c];
					}
				} else if(curIsAlternative && (br->bot_ > br->top_ || c == 4)) {
					// Calculate next quartet of ranges.  We hope that the
					// appropriate cache lines are prefetched.
					assert(br->ltop_.valid());
								  rs->tops[0] =
					rs->bots[0] = rs->tops[1] =
					rs->bots[1] = rs->tops[2] =
					rs->bots[2] = rs->tops[3] =
					rs->bots[3]               = 0;
					if(br->lbot_.valid()) {
						if(metrics_ != NULL) metrics_->curBwtOps_++;
						ebwt.mapLFEx(br->ltop_, br->lbot_, (TIndexOffU*)rs->tops, (TIndexOffU*)rs->bots);
					} else {
#ifndef NDEBUG
						TIndexOffU tmptops[] = {0, 0, 0, 0};
						TIndexOffU tmpbots[] = {0, 0, 0, 0};
						SideLocus ltop, lbot;
						ltop.initFromRow(otop, ebwt_->_eh, ebwt_->_ebwt);
						lbot.initFromRow(obot, ebwt_->_eh, ebwt_->_ebwt);
						ebwt.mapLFEx(ltop, lbot, tmptops, tmpbots);
#endif
						if(metrics_ != NULL) metrics_->curBwtOps_++;
						int cc = ebwt.mapLF1((TIndexOffU&)otop, br->ltop_);
						br->top_ = otop;
						assert(cc == -1 || (cc >= 0 && cc < 4));
						if(cc >= 0) {
							assert_lt(cc, 4);
							rs->tops[cc] = br->top_;
							rs->bots[cc] = (br->top_ + 1);
						}
#ifndef NDEBUG
						for(int i = 0; i < 4; i++) {
							assert_eq(tmpbots[i] - tmptops[i],
							          rs->bots[i] - rs->tops[i]);
						}
#endif
					}
					ASSERT_ONLY(int r =)
					br->installRanges(c, nextc, qualLim_ - br->ham_, q);
					assert(r < 4 || c == 4);
					// Update top and bot
					if(c < 4) {
						br->top_ = rs->tops[c];
						br->bot_ = rs->bots[c];
					} else {
						br->top_ = br->bot_ = 1;
					}
				} else if(br->bot_ > br->top_) {
					// This read position is not a legitimate backtracking
					// alternative.  No need to do the bookkeeping for the
					// entire quartet, just do c.  We hope that the
					// appropriate cache lines are prefetched before now;
					// otherwise, we're about to take an expensive cache
					// miss.
					assert(br->ltop_.valid());
					rs->eliminated_ = true; // eliminate all alternatives leaving this node
					assert(br->eliminated(br->len_));
					if(c < 4) {
						if(br->top_ + 1 == br->bot_) {
							if(metrics_ != NULL) metrics_->curBwtOps_++;
							br->bot_ = br->top_ = ebwt.mapLF1(br->top_, br->ltop_, c);
							if(br->bot_ != OFF_MASK) br->bot_++;
						} else {
							if(metrics_ != NULL) metrics_->curBwtOps_++;
							br->top_ = ebwt.mapLF(br->ltop_, c);
							assert(br->lbot_.valid());
							if(metrics_ != NULL) metrics_->curBwtOps_++;
							br->bot_ = ebwt.mapLF(br->lbot_, c);
						}
					}
				} else {
					rs->eliminated_ = true;
				}
				assert(rs->repOk());
				// br->top_ and br->bot_ now contain the next top and bot
			} else {
				// The continuation had already processed the whole read
				assert_eq(qlen_, depth);
				cur = 0;
			}
			empty = (br->top_ == br->bot_);
			hit = (cur == 0 && !empty);

			// Check whether we've obtained an exact alignment when
			// we've been instructed not to report exact alignments
			nedits = (uint32_t)br->edits_.size();
			invalidExact = (hit && nedits == 0 && !reportExacts_);
			assert_leq(br->ham_, qualLim_);

			// Set this to true if the only way to make legal progress
			// is via one or more additional backtracks.
			if(halfAndHalf_ && !hhCheck(br, depth, empty)) {
				// This alignment doesn't satisfy the half-and-half
				// requirements; reject it
				if(metrics_ != NULL) metrics_->curBacktracks_++;
				pm.curtail(br, (uint32_t)qlen_, depth3_, qualOrder_);
				goto bail;
			}

			if(hit &&            // there is a range to report
			   !invalidExact &&  // not disqualified by no-exact-hits setting
			   !reportedPartial) // not an already-reported partial alignment
			{
				if(verbose_) {
					if(partial_) {
						cout << " Partial alignment:" << endl;
					} else {
						cout << " Final alignment:" << endl;
					}
					br->len_++;
					br->print((*qry_), (*qual_), minCost, cout, halfAndHalf_ > 0, partial_, fw_, ebwt_->fw());
					br->len_--;
					cout << endl;
				}
				assert_gt(br->bot_, br->top_);
				assert_leq(br->ham_, qualLim_);
				assert_leq((uint32_t)(br->cost_ & ~0xc000), qualLim_);
				if(metrics_ != NULL) metrics_->setReadHasRange();
				curRange_.top     = br->top_;
				curRange_.bot     = br->bot_;
				curRange_.cost    = br->cost_;
				curRange_.stratum = (br->cost_ >> 14);
				curRange_.numMms  = nedits;
				curRange_.fw      = fw_;
				curRange_.mms.clear();
				curRange_.refcs.clear();
				for(size_t i = 0; i < nedits; i++) {
					curRange_.mms.push_back((uint32_t)(qlen_ - br->edits_.get(i).pos - 1));
					curRange_.refcs.push_back((char)br->edits_.get(i).chr);
				}
				addPartialEdits();
				curRange_.ebwt    = ebwt_;
				this->foundRange  = true;
	#ifndef NDEBUG
				TIndexOff top2 = (TIndexOff)br->top_;
				top2++; // ensure it's not 0
				if(ebwt_->fw()) top2 = -top2;
				assert(allTops_.find(top2) == allTops_.end());
				allTops_.insert(top2);
	#endif
				assert(curRange_.repOk());
				// Must curtail because we've consumed the whole pattern
				if(metrics_ != NULL) metrics_->curBacktracks_++;
				pm.curtail(br, (uint32_t)qlen_, depth3_, qualOrder_);
			} else if(empty || cur == 0) {
				// The branch couldn't be extended further
				if(metrics_ != NULL) metrics_->curBacktracks_++;
				pm.curtail(br, (uint32_t)qlen_, depth3_, qualOrder_);
			} else {
				// Extend the branch by one position; no change to its cost
				// so there's no need to reconsider where it lies in the
				// priority queue
				assert_neq(0, cur);
				br->extend();
			}
		bail:
			// Make sure the front element of the priority queue is
			// extendable (i.e. not curtailed) and then prep it.
			if(!pm.splitAndPrep(rand_, (uint32_t)qlen_, qualLim_, depth3_,
			                    qualOrder_,
			                    ebwt_->_eh, ebwt_->_ebwt, ebwt_->_fw))
			{
				pm.reset(0);
				assert(pm.empty());
			}
			if(pm.empty()) {
				// No more branches
				break;
			}
			assert(!pm.front()->curtailed_);
			assert(!pm.front()->exhausted_);

			if(until == ADV_COST_CHANGES && pm.front()->cost_ != cost) break;
			else if(until == ADV_STEP) break;

		} while(!this->foundRange);
		if(!pm.empty()) {
			assert(!pm.front()->curtailed_);
			assert(!pm.front()->exhausted_);
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %rbx
movq %rdi, %r14
movb $0x0, 0x9(%rdi)
leaq 0xd0(%rdi), %rax
movq %rax, 0x50(%rsp)
leaq 0xf0(%rdi), %rax
movq %rax, 0x48(%rsp)
leaq 0xa0(%rdi), %rax
movq %rax, 0x40(%rsp)
movzwl %dx, %eax
movl %eax, 0x30(%rsp)
movq 0x40616(%rip), %r15     # 0x6afb0
movq %rcx, 0x20(%rsp)
movl %esi, 0x38(%rsp)
movq %rbx, %rdi
callq 0x2c8de
movq %rax, %rbp
cmpb $0x1, 0xb4(%r14)
jne 0x2ab1a
movq 0x18(%r14), %rsi
movq 0x58(%r14), %rdx
xorl %r9d, %r9d
cmpl $0x0, 0x90(%r14)
setg %r9b
movzbl 0x94(%r14), %eax
movzbl 0x70(%r14), %r10d
movq 0x68(%r14), %rcx
movzbl 0x10(%rcx), %r11d
subq $0x8, %rsp
movq %rbp, %rdi
movl 0x38(%rsp), %ecx
movq %r15, %r8
pushq %r11
pushq %r10
pushq %rax
callq 0x2cd0e
addq $0x20, %rsp
cmpq $0x0, 0x50(%rbp)
je 0x2ab1a
movl $0x6, %edx
movq %r15, %rdi
leaq 0x2bf65(%rip), %rsi     # 0x56984
callq 0x9560
cmpq $0x0, 0x50(%rbp)
je 0x2aae7
leaq 0x58(%rbp), %r15
movq $-0x58, %r12
xorl %r13d, %r13d
cmpq $0x5, %r13
ja 0x2aa49
leaq (%r15,%r13,4), %rax
jmp 0x2aa64
cmpq $0x15, %r13
ja 0x2aa5d
movq 0x70(%rbp), %rax
leaq (%rax,%r13,4), %rax
addq $-0x18, %rax
jmp 0x2aa64
movq 0x78(%rbp), %rax
addq %r12, %rax
movl (%rax), %ebx
movq 0x10(%r14), %rax
cmpb $0x1, 0x10(%rax)
jne 0x2aa85
movl %ebx, %eax
notl %eax
shrl $0x14, %eax
orl $0xfffffc00, %eax       # imm = 0xFFFFFC00
movslq %eax, %rsi
addq 0x50(%r14), %rsi
jmp 0x2aa90
movl %ebx, %esi
shrl $0x14, %esi
andl $0x3ff, %esi            # imm = 0x3FF
movq 0x40519(%rip), %rdi     # 0x6afb0
callq 0x92e0
movb %bl, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0xf(%rsp), %rsi
callq 0x9560
movq 0x50(%rbp), %rax
decq %rax
cmpq %rax, %r13
jae 0x2aad6
movl $0x1, %edx
movq 0x404e6(%rip), %rdi     # 0x6afb0
leaq 0x2c2ec(%rip), %rsi     # 0x56dbd
callq 0x9560
incq %r13
addq $0x4, %r12
cmpq 0x50(%rbp), %r13
jb 0x2aa3d
movq 0x404c2(%rip), %r15     # 0x6afb0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r15, %rdi
callq 0x9050
movq %rax, %rdi
callq 0x92f0
movq 0x20(%rsp), %rbx
movzwl 0xe(%rbp), %eax
movzwl 0x10(%rbp), %r12d
addw 0xc(%rbp), %ax
movzwl %ax, %r8d
movq 0x68(%r14), %rdi
movl 0x90(%r14), %ecx
testl %ecx, %ecx
je 0x2ab52
movl 0x50(%rbp), %edx
cmpl %r8d, 0x98(%r14)
jne 0x2abea
testl %edx, %edx
je 0x2ac06
movw %r12w, 0xc(%rsp)
movq 0x50(%r14), %rcx
movl %r8d, %edx
movb $0x1, %sil
cmpq %rdx, %rcx
jbe 0x2affd
movl %edx, %r13d
notl %r13d
addl %ecx, %r13d
movq 0x18(%r14), %rsi
movq 0x8(%rsi), %rsi
leaq -0x1(%rcx), %r9
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
cmpq %r9, %r13
jae 0x2ab92
subl %edx, %ecx
movsbl (%rsi,%rcx), %r10d
movsbl (%rsi,%r13), %r15d
movl $0x21212121, 0x1c(%rsp) # imm = 0x21212121
movq 0x58(%r14), %rcx
movq 0x8(%rcx), %rcx
movb (%rcx,%r13), %cl
leal -0x21(%rcx), %edx
cmpb $0x21, %cl
movzbl %dl, %ecx
movl $0x0, %edx
cmovbl %edx, %ecx
cmpb $0x1, 0x84(%r14)
jne 0x2abd3
movzbl %cl, %ecx
leaq 0x42f30(%rip), %rdx     # 0x6db00
movb (%rdx,%rcx), %cl
movzbl %cl, %ecx
imull $0x1010101, %ecx, %edx  # imm = 0x1010101
movl %edx, 0x1c(%rsp)
cmpw 0x4(%rbp), %ax
jae 0x2ac37
xorl %ecx, %ecx
jmp 0x2ac47
cmpl %r8d, 0x9c(%r14)
sete %sil
cmpl %edx, %ecx
seta %cl
andb %sil, %cl
cmpb $0x1, %cl
jne 0x2ab52
movq 0x180(%r14), %rax
testq %rax, %rax
je 0x2ac14
incl (%rax)
movl 0x50(%r14), %edx
movl 0x9c(%r14), %ecx
movzbl 0x85(%r14), %r8d
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2d42e
jmp 0x2b334
movzwl 0x12(%rbp), %eax
addl %ecx, %eax
cmpl 0x88(%r14), %eax
setbe %cl
movslq %r15d, %rbx
movl 0x24(%rbp), %eax
testl %r8d, %r8d
je 0x2ac65
cmpb $0x4, %bl
jne 0x2ac65
movabsq $0x100000001, %rdx      # imm = 0x100000001
movq %rdx, 0x24(%rbp)
movzwl 0xe(%rbp), %edx
leaq (%rdx,%rdx,2), %r12
shll $0x4, %r12d
addq 0x18(%rbp), %r12
movl 0x24(%rbp), %edx
testl %edx, %edx
jne 0x2ac86
cmpl $0x0, 0x28(%rbp)
je 0x2adc7
testb %cl, %cl
je 0x2ac9c
cmpb $0x4, %bl
je 0x2ad34
cmpl %edx, 0x28(%rbp)
ja 0x2ad34
cmpl %edx, 0x28(%rbp)
movb $0x1, 0x28(%r12)
jbe 0x2aff6
cmpb $0x3, %r15b
jg 0x2aff6
movl 0x24(%rbp), %eax
incl %eax
cmpl 0x28(%rbp), %eax
jne 0x2ad8a
movq 0x180(%r14), %rax
testq %rax, %rax
je 0x2acd2
incl 0x4(%rax)
movl 0x2c(%rbp), %eax
addq 0xb8(%rdi), %rax
movswq 0x38(%rbp), %rcx
movzbl (%rcx,%rax), %edx
movb 0x3a(%rbp), %cl
addb %cl, %cl
shrl %cl, %edx
andl $0x3, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %r15d, %edx
jne 0x2af72
movl 0x24(%rbp), %ecx
cmpl %ecx, 0x68(%rdi)
je 0x2af72
leaq 0x2c(%rbp), %rsi
cmpb $0x1, 0x36(%rbp)
jne 0x2af3b
movl %r8d, %ebx
cmpb $0x0, 0x17d(%rdi)
je 0x2af67
movl %r15d, %edx
callq 0x1d6b6
jmp 0x2af6f
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12)
movups %xmm0, (%r12)
cmpb $-0x1, 0x4a(%rbp)
movl %r8d, 0x2c(%rsp)
je 0x2ae65
movq %rbx, 0x10(%rsp)
movl %r10d, %ebx
movq 0x180(%r14), %rax
testq %rax, %rax
je 0x2ad68
incl 0x4(%rax)
leaq 0x10(%r12), %r8
leaq 0x3c(%rbp), %rdx
leaq 0x2c(%rbp), %rsi
movq %r12, %rcx
callq 0x2d5c4
movl %ebx, %r10d
movq 0x10(%rsp), %rbx
jmp 0x2afad
movq 0x180(%r14), %rax
testq %rax, %rax
je 0x2ad99
incl 0x4(%rax)
leaq 0x2c(%rbp), %rsi
cmpb $0x1, 0x36(%rbp)
jne 0x2aed1
movl %r8d, %ebx
cmpb $0x0, 0x17d(%rdi)
je 0x2aee1
movq %rdi, %r12
movl %r15d, %edx
callq 0x1d6b6
jmp 0x2aeec
movq 0x90(%rdi), %rax
movl (%rax), %eax
movl %eax, (%r12)
movq 0x90(%rdi), %rax
movl 0x4(%rax), %eax
movl %eax, 0x4(%r12)
movl %eax, 0x10(%r12)
movq 0x90(%rdi), %rax
movl 0x8(%rax), %eax
movl %eax, 0x8(%r12)
movl %eax, 0x14(%r12)
movq 0x90(%rdi), %rax
movl 0xc(%rax), %eax
movl %eax, 0xc(%r12)
movl %eax, 0x18(%r12)
movq 0x90(%rdi), %rax
movl 0x10(%rax), %eax
movl %eax, 0x1c(%r12)
movl 0x88(%r14), %ecx
movzwl 0x12(%rbp), %eax
subl %eax, %ecx
movq %rbp, %rdi
movl %r15d, %esi
movl %r10d, %edx
movq %rbx, %r15
movl %r8d, %ebx
leaq 0x1c(%rsp), %r8
callq 0x2d4ee
movl %ebx, %r8d
movq %r15, %rcx
cmpb $0x3, %cl
jg 0x2aff6
movl (%r12,%rcx,4), %eax
movl %eax, 0x24(%rbp)
movl 0x10(%r12,%rcx,4), %eax
jmp 0x2af7f
movq 0x180(%r14), %rcx
testq %rcx, %rcx
je 0x2ae74
incl 0x4(%rcx)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl 0x68(%rdi), %eax
je 0x2af96
movl 0x2c(%rbp), %eax
addq 0xb8(%rdi), %rax
movswq 0x38(%rbp), %rcx
movzbl (%rcx,%rax), %eax
movb 0x3a(%rbp), %cl
addb %cl, %cl
shrl %cl, %eax
leaq 0x2c(%rbp), %rsi
andl $0x3, %eax
cmpb $0x1, 0x36(%rbp)
movl %eax, 0x8(%rsp)
jne 0x2af48
movl %r10d, 0x10(%rsp)
cmpb $0x0, 0x17d(%rdi)
je 0x2af84
movl 0x8(%rsp), %edx
callq 0x1d6b6
jmp 0x2af8d
movl %r8d, %ebx
movq %rdi, %r12
movl %r15d, %edx
callq 0x1d872
jmp 0x2aeec
movq %rdi, %r12
movl %r15d, %edx
callq 0x1d4e6
movl %eax, 0x24(%rbp)
movq 0x180(%r14), %rax
testq %rax, %rax
je 0x2aefe
incl 0x4(%rax)
leaq 0x3c(%rbp), %rsi
cmpb $0x1, 0x46(%rbp)
movq %r12, %rdi
jne 0x2af1e
cmpb $0x0, 0x17d(%rdi)
je 0x2af28
movl %r15d, %edx
callq 0x1d6b6
jmp 0x2af30
movl %r15d, %edx
callq 0x1d872
jmp 0x2af30
movl %r15d, %edx
callq 0x1d4e6
movl %eax, 0x28(%rbp)
movl %ebx, %r8d
jmp 0x2aff6
movl %r15d, %edx
movl %r8d, %ebx
callq 0x1d872
jmp 0x2af6f
movl 0x8(%rsp), %edx
movq %rbx, 0x10(%rsp)
movl %r10d, %ebx
callq 0x1d872
movl 0x8(%rsp), %ecx
movl %ebx, %r10d
movq 0x10(%rsp), %rbx
jmp 0x2af96
movl %r15d, %edx
callq 0x1d4e6
movl %ebx, %r8d
movl %eax, 0x24(%rbp)
movl %eax, 0x28(%rbp)
cmpl $-0x1, %eax
je 0x2aff6
incl %eax
movl %eax, 0x28(%rbp)
jmp 0x2aff6
movl 0x8(%rsp), %edx
callq 0x1d4e6
movl 0x8(%rsp), %ecx
movl 0x10(%rsp), %r10d
movl %eax, 0x24(%rbp)
testl %ecx, %ecx
js 0x2afad
movl %ecx, %ecx
movl %eax, (%r12,%rcx,4)
movl 0x24(%rbp), %eax
incl %eax
movl %eax, 0x10(%r12,%rcx,4)
movl 0x88(%r14), %ecx
movzwl 0x12(%rbp), %eax
subl %eax, %ecx
movq %rbp, %rdi
movl %r15d, %esi
movl %r10d, %edx
leaq 0x1c(%rsp), %r8
callq 0x2d4ee
cmpb $0x3, %bl
jg 0x2afe3
movl (%r12,%rbx,4), %eax
movl %eax, 0x24(%rbp)
movl 0x10(%r12,%rbx,4), %eax
movl %eax, 0x28(%rbp)
jmp 0x2aff1
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x24(%rbp)
movl 0x2c(%rsp), %r8d
testq %r13, %r13
sete %sil
movl 0x24(%rbp), %r15d
movl 0x28(%rbp), %edi
cmpl %edi, %r15d
setne %r12b
movq 0x50(%rbp), %rax
movq %rax, 0x10(%rsp)
testl %eax, %eax
sete %bl
movb 0x8c(%r14), %r13b
cmpl $0x0, 0x90(%r14)
je 0x2b05a
xorl %ecx, %ecx
cmpl %edi, %r15d
sete %cl
movl %edi, 0x34(%rsp)
movq %r14, %rdi
movb %sil, 0x8(%rsp)
movq %rbp, %rsi
movl %r8d, %edx
callq 0x2da3c
movl 0x34(%rsp), %edi
movb 0x8(%rsp), %sil
testb %al, %al
je 0x2b0ea
andb %sil, %r12b
xorb $0x1, %r13b
andb %r13b, %bl
andb %r12b, %bl
notb %r12b
orb %bl, %r12b
testb $0x1, %r12b
je 0x2b0ba
cmpl %edi, %r15d
setne %al
notb %sil
testb %al, %sil
movzwl 0xc(%rsp), %r12d
jne 0x2b0f6
movq 0x180(%r14), %rax
testq %rax, %rax
movq 0x20(%rsp), %rbx
je 0x2b09a
incl (%rax)
movl 0x50(%r14), %edx
movl 0x9c(%r14), %ecx
movzbl 0x85(%r14), %r8d
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2d42e
jmp 0x2b106
cmpb $0x1, 0xb4(%r14)
jne 0x2b1c5
cmpb $0x1, 0x94(%r14)
movq 0x3fed9(%rip), %rbx     # 0x6afb0
jne 0x2b112
movl $0x13, %edx
movq %rbx, %rdi
leaq 0x2b8a3(%rip), %rsi     # 0x5698b
jmp 0x2b121
movq 0x180(%r14), %rax
jmp 0x2b2fd
movb $0x0, 0x84(%rbp)
incw 0xe(%rbp)
movq 0x20(%rsp), %rbx
movq 0x3fea3(%rip), %r15     # 0x6afb0
jmp 0x2b334
movl $0x11, %edx
movq %rbx, %rdi
leaq 0x2b87e(%rip), %rsi     # 0x5699f
callq 0x9560
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %rbx, %rdi
callq 0x9050
movq %rax, %rdi
callq 0x92f0
incw 0xe(%rbp)
movq 0x18(%r14), %rsi
movq 0x58(%r14), %rdx
xorl %r9d, %r9d
cmpl $0x0, 0x90(%r14)
setg %r9b
movzbl 0x94(%r14), %eax
movzbl 0x70(%r14), %r10d
movq 0x68(%r14), %rcx
movzbl 0x10(%rcx), %r11d
subq $0x8, %rsp
movq %rbp, %rdi
movl 0x38(%rsp), %ecx
movq %rbx, %r8
pushq %r11
pushq %r10
pushq %rax
callq 0x2cd0e
addq $0x20, %rsp
decw 0xe(%rbp)
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %rbx, %rdi
callq 0x9050
movq %rax, %rdi
callq 0x92f0
movq 0x180(%r14), %rax
testq %rax, %rax
je 0x2b1d5
movb $0x1, 0xb(%rax)
movq 0x10(%rsp), %rcx
movl %ecx, %r15d
movl 0x24(%rbp), %eax
movl %eax, 0xb8(%r14)
movl 0x28(%rbp), %eax
movl %eax, 0xbc(%r14)
movzwl 0x10(%rbp), %eax
movw %ax, 0xc0(%r14)
movzwl 0x10(%rbp), %eax
shrl $0xe, %eax
movl %eax, 0xc4(%r14)
movl %ecx, 0xc8(%r14)
movb 0x70(%r14), %al
movb %al, 0xcc(%r14)
xorl %eax, %eax
movq %rax, 0xe8(%r14)
movq %rax, 0x108(%r14)
testq %r15, %r15
je 0x2b2de
movq %rbp, %r12
addq $0x58, %r12
movq $-0x58, %r13
xorl %ebx, %ebx
cmpq $0x5, %rbx
ja 0x2b252
leaq (%r12,%rbx,4), %rax
jmp 0x2b26d
cmpq $0x15, %rbx
ja 0x2b266
movq 0x70(%rbp), %rax
leaq (%rax,%rbx,4), %rax
addq $-0x18, %rax
jmp 0x2b26d
movq 0x78(%rbp), %rax
addq %r13, %rax
movq 0x50(%r14), %rcx
movl (%rax), %eax
notl %eax
shrl $0x14, %eax
orl $0xfffffc00, %eax       # imm = 0xFFFFFC00
addl %eax, %ecx
movl %ecx, 0x3c(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x3c(%rsp), %rsi
callq 0x22e84
cmpq $0x5, %rbx
ja 0x2b29e
leaq (%r12,%rbx,4), %rax
jmp 0x2b2b9
cmpq $0x15, %rbx
ja 0x2b2b2
movq 0x70(%rbp), %rax
leaq (%rax,%rbx,4), %rax
addq $-0x18, %rax
jmp 0x2b2b9
movq 0x78(%rbp), %rax
addq %r13, %rax
movb (%rax), %al
movb %al, 0xe(%rsp)
movq 0x48(%rsp), %rdi
leaq 0xe(%rsp), %rsi
callq 0x2b9ac
incq %rbx
addq $0x4, %r13
cmpq %rbx, %r15
jne 0x2b246
movq %r14, %rdi
callq 0x2b6ce
movq 0x68(%r14), %rcx
movq 0x180(%r14), %rax
movq %rcx, 0x110(%r14)
movb $0x1, 0x9(%r14)
testq %rax, %rax
je 0x2b304
incl (%rax)
movl 0x50(%r14), %edx
movl 0x9c(%r14), %ecx
movzbl 0x85(%r14), %r8d
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2d42e
movq 0x3fc82(%rip), %r15     # 0x6afb0
movzwl 0xc(%rsp), %r12d
movl 0x50(%r14), %edx
movl 0x88(%r14), %ecx
movl 0x9c(%r14), %r8d
movzbl 0x85(%r14), %r9d
movq 0x68(%r14), %rax
leaq 0xf8(%rax), %r10
movzbl 0x10(%rax), %r11d
subq $0x8, %rsp
movq %rbx, %rdi
movq 0x48(%rsp), %rsi
pushq %r11
pushq 0xb8(%rax)
pushq %r10
callq 0x2db1e
addq $0x20, %rsp
testb %al, %al
movl 0x38(%rsp), %ebp
jne 0x2b3e2
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2f664
xorl %eax, %eax
movq %rax, 0x60(%rbx)
movq %rax, 0x88(%rbx)
movl %eax, 0x94(%rbx)
movl %eax, 0x68(%rbx)
movq %rax, 0x120(%rbx)
movq %rax, 0x148(%rbx)
movl %eax, 0x154(%rbx)
movl %eax, 0x128(%rbx)
movq %rax, 0xc0(%rbx)
movq %rax, 0xe8(%rbx)
movl %eax, 0xf4(%rbx)
movl %eax, 0xc8(%rbx)
movw $0x0, 0x158(%rbx)
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
je 0x2b417
cmpl $0x2, %ebp
je 0x2b3f8
cmpl $0x3, %ebp
jne 0x2b40c
jmp 0x2b417
movq %rbx, %rdi
callq 0x2c8de
cmpl $0x3, %ebp
je 0x2b417
cmpw %r12w, 0x10(%rax)
jne 0x2b417
cmpb $0x1, 0x9(%r14)
jne 0x2a9a3
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq