// File: BenLangmead[P]bowtie/./diff_sample.h
// Function: DifferenceCoverSample<SString<char>>::build(int)
void DifferenceCoverSample<TStr>::build(int nthreads) {
	// Local names for relevant types
	VMSG_NL("Building DifferenceCoverSample");
	// Local names for relevant data
	const TStr& t = this->text();
	uint32_t v = this->v();
	assert_gt(v, 2);
	// Build s'
	size_t padding = 1;
	EList<TIndexOffU> sPrime;
	VMSG_NL("  Building sPrime");
	buildSPrime(sPrime, padding);
	size_t sPrimeSz = sPrime.size() - padding;
	assert_gt(sPrime.size(), 0);
	assert_leq(sPrime.size(), t.length()+1); // +1 is because of the end-cap
	TIndexOffU nextRank = 0;
	{
		VMSG_NL("  Building sPrimeOrder");
		EList<TIndexOffU> sPrimeOrder;
		sPrimeOrder.resizeExact(sPrimeSz);
		for(TIndexOffU i = 0; i < (TIndexOffU)sPrimeOrder.size(); i++) {
			sPrimeOrder[i] = i;
		}
		// sPrime now holds suffix-offsets for DC samples.
		{
			Timer timer(cout, "  V-Sorting samples time: ", this->verbose());
			VMSG_NL("  V-Sorting samples");
			// Extract backing-store array from sPrime and sPrimeOrder;
			// the mkeyQSortSuf2 routine works on the array for maximum
			// efficiency
			TIndexOffU *sPrimeArr = (TIndexOffU*)sPrime.ptr();
			assert_eq(sPrimeArr[0], sPrime[0]);
			assert_eq(sPrimeArr[sPrimeSz-1], sPrime[sPrimeSz-1]);
			TIndexOffU *sPrimeOrderArr = (TIndexOffU*)sPrimeOrder.ptr();
			assert_eq(sPrimeOrderArr[0], sPrimeOrder[0]);
			assert_eq(sPrimeOrderArr[sPrimeSz-1], sPrimeOrder[sPrimeSz-1]);

			TIndexOffU *sOrig = NULL;
			if(this->sanityCheck()) {
				sOrig = new TIndexOffU[sPrimeSz];
				memcpy(sOrig, sPrimeArr, OFF_SIZE * sPrimeSz);
			}
			// Sort sample suffixes up to the vth character using a
			// multikey quicksort.  Sort time is proportional to the
			// number of samples times v.  It isn't quadratic.
			// sPrimeOrder is passed in as a swapping partner for
			// sPrimeArr, i.e., every time the multikey qsort swaps
			// elements in sPrime, it swaps the same elements in
			// sPrimeOrder too.  This allows us to easily reconstruct
			// what the sort did.
			if(nthreads == 1) {
				mkeyQSortSuf2(t, sPrimeArr, sPrimeSz, sPrimeOrderArr, 4,
				              this->verbose(), this->sanityCheck(), v);
			} else {
				int query_depth = 0;
				int tmp_nthreads = nthreads;
				while(tmp_nthreads > 0) {
					query_depth++;
					tmp_nthreads >>= 1;
				}
				EList<size_t> boundaries; // bucket boundaries for parallelization
				mkeyQSortSuf2(t, sPrimeArr, sPrimeSz, sPrimeOrderArr, 4,
				              this->verbose(), false, query_depth, &boundaries);
				if(boundaries.size() > 0) {
#if (__cplusplus >= 201103)
					AutoArray<std::thread*> threads(nthreads);
#else
					AutoArray<tthread::thread*> threads(nthreads);
#endif
					EList<VSortingParam<TStr> > tparams;
					tparams.resize(nthreads);
					size_t cur = 0;
					MUTEX_T mutex;
					for(int tid = 0; tid < nthreads; tid++) {
						// Calculate bucket sizes by doing a binary search for each
						// suffix and noting where it lands
						tparams[tid].dcs = this;
						tparams[tid].sPrimeArr = sPrimeArr;
						tparams[tid].sPrimeSz = sPrimeSz;
						tparams[tid].sPrimeOrderArr = sPrimeOrderArr;
						tparams[tid].depth = query_depth;
						tparams[tid].boundaries = &boundaries;
						tparams[tid].cur = &cur;
						tparams[tid].mutex = &mutex;
#if (__cplusplus >= 201103L)
						threads[tid] = new std::thread(VSorting_worker<TStr>, (void*)&tparams[tid]);
#else
						threads[tid] = new tthread::thread(VSorting_worker<TStr>, (void*)&tparams[tid]);
#endif
					}
					for (int tid = 0; tid < nthreads; tid++) {
						threads[tid]->join();
					}
				}
			}
			if(this->sanityCheck()) {
				sanityCheckOrderedSufs(t, t.length(), sPrimeArr, sPrimeSz, v);
				for(size_t i = 0; i < sPrimeSz; i++) {
					assert_eq(sPrimeArr[i], sOrig[sPrimeOrderArr[i]]);
				}
				delete[] sOrig;
			}
			// Make sure sPrime and sPrimeOrder are consistent with
			// their respective backing-store arrays
			assert_eq(sPrimeArr[0], sPrime[0]);
			assert_eq(sPrimeArr[sPrimeSz-1], sPrime[sPrimeSz-1]);
			assert_eq(sPrimeOrderArr[0], sPrimeOrder[0]);
			assert_eq(sPrimeOrderArr[sPrimeSz-1], sPrimeOrder[sPrimeSz-1]);
		}
		// Now assign the ranking implied by the sorted sPrime/sPrimeOrder
		// arrays back into sPrime.
		VMSG_NL("  Allocating rank array");
		_isaPrime.resize(sPrime.size());
		_isaPrime.resizeExact(sPrime.size());
		ASSERT_ONLY(_isaPrime.fill(OFF_MASK));
		assert_gt(_isaPrime.size(), 0);
		{
			Timer timer(cout, "  Ranking v-sort output time: ", this->verbose());
			VMSG_NL("  Ranking v-sort output");
			for(size_t i = 0; i < sPrimeSz-1; i++) {
				// Place the appropriate ranking
				_isaPrime[sPrimeOrder[i]] = nextRank;
				// If sPrime[i] and sPrime[i+1] are identical up to v, then we
				// should give the next suffix the same rank
				if(!suffixSameUpTo(t, sPrime[i], sPrime[i+1], v)) nextRank++;
			}
			_isaPrime[sPrimeOrder[sPrimeSz-1]] = nextRank; // finish off
		}
		// sPrimeOrder is destroyed
		// All the information we need is now in _isaPrime
	}
#ifndef NDEBUG
	// Check that all ranks are sane
	for(size_t i = 0; i < sPrimeSz; i++) {
		assert_neq(_isaPrime[i], OFF_MASK);
		assert_lt(_isaPrime[i], sPrimeSz);
	}
#endif
	// Now pass the sPrimeRanks[] array to LarssonSadakane (in SeqAn).
	_isaPrime[_isaPrime.size() - 1] = sPrimeSz;
	sPrime[sPrime.size() - 1] = sPrimeSz;
	{
		Timer timer(cout, "  Invoking Larsson-Sadakane on ranks time: ", this->verbose());
		VMSG_NL("  Invoking Larsson-Sadakane on ranks");
		LarssonSadakane<TIndexOff> ls;
		ls.suffixsort(
			(TIndexOff*)&_isaPrime[0],
			(TIndexOff*)&sPrime[0],
			(TIndexOff)sPrimeSz,
			(TIndexOff)sPrime.size(),
			0);
	}
	// sPrime now contains the suffix array (which we ignore)
	assert_eq(_isaPrime.size(), sPrime.size());
	assert_gt(_isaPrime.size(), 0);
	// chop off final character of _isaPrime
	_isaPrime.resize(sPrimeSz);
	// Subtract 1 from each isaPrime (to adjust for LarssonSadakane
	// always ranking the final suffix as lexicographically first)
	for(size_t i = 0; i < _isaPrime.size(); i++) {
		_isaPrime[i]--;
	}
	VMSG_NL("  Sanity-checking and returning");

	// done!
	//if(this->verbose()) print(cout);
	if(this->sanityCheck()) doBuiltSanityCheck();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1140, %rsp           # imm = 0x1140
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xf00(%rbp)
callq 0x2a4d0
testb $0x1, %al
jne 0x2749b
jmp 0x2755f
leaq -0x198(%rbp), %rdi
callq 0x6280
leaq -0x188(%rbp), %rdi
leaq 0x1f145(%rip), %rsi     # 0x465fa
callq 0x6410
movq %rax, -0xf08(%rbp)
jmp 0x274c3
movq -0xf08(%rbp), %rdi
movq 0x2aa97(%rip), %rsi     # 0x51f68
callq 0x6470
jmp 0x274d8
leaq -0x1c8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x6400
jmp 0x274ed
movq -0xf00(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x2a4f0
jmp 0x27502
leaq -0x1c8(%rbp), %rdi
callq 0x69a8
leaq -0x198(%rbp), %rdi
callq 0x62c0
jmp 0x2755f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x2754e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x69a8
leaq -0x198(%rbp), %rdi
callq 0x62c0
jmp 0x288f9
movq -0xf00(%rbp), %rdi
callq 0x2a550
movq -0xf00(%rbp), %rdi
movq %rax, -0x1d0(%rbp)
callq 0x2a570
movl %eax, -0x1d4(%rbp)
movq $0x1, -0x1e0(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x1b460
movq -0xf00(%rbp), %rdi
callq 0x2a4d0
movb %al, -0xf09(%rbp)
jmp 0x275af
movb -0xf09(%rbp), %al
testb $0x1, %al
jne 0x275be
jmp 0x2769b
leaq -0x388(%rbp), %rdi
callq 0x6280
jmp 0x275cc
leaq -0x378(%rbp), %rdi
leaq 0x1f03f(%rip), %rsi     # 0x46619
callq 0x6410
movq %rax, -0xf18(%rbp)
jmp 0x275e8
movq -0xf18(%rbp), %rdi
movq 0x2a972(%rip), %rsi     # 0x51f68
callq 0x6470
jmp 0x275fd
leaq -0x3a8(%rbp), %rdi
leaq -0x388(%rbp), %rsi
callq 0x6400
jmp 0x27612
movq -0xf00(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x2a4f0
jmp 0x27627
leaq -0x3a8(%rbp), %rdi
callq 0x69a8
leaq -0x388(%rbp), %rdi
callq 0x62c0
jmp 0x2769b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x288ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x2768a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x3a8(%rbp), %rdi
callq 0x69a8
leaq -0x388(%rbp), %rdi
callq 0x62c0
jmp 0x288ed
movq -0xf00(%rbp), %rdi
movq -0x1e0(%rbp), %rdx
leaq -0x200(%rbp), %rsi
callq 0x2a590
jmp 0x276b7
leaq -0x200(%rbp), %rdi
callq 0x14440
movq -0xf00(%rbp), %rdi
movq -0x1e0(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x3b0(%rbp)
movl $0x0, -0x3b4(%rbp)
callq 0x2a4d0
movb %al, -0xf19(%rbp)
jmp 0x276f2
movb -0xf19(%rbp), %al
testb $0x1, %al
jne 0x27701
jmp 0x277c7
leaq -0x540(%rbp), %rdi
callq 0x6280
jmp 0x2770f
leaq -0x530(%rbp), %rdi
leaq 0x1ef0e(%rip), %rsi     # 0x4662b
callq 0x6410
movq %rax, -0xf28(%rbp)
jmp 0x2772b
movq -0xf28(%rbp), %rdi
movq 0x2a82f(%rip), %rsi     # 0x51f68
callq 0x6470
jmp 0x27740
leaq -0x560(%rbp), %rdi
leaq -0x540(%rbp), %rsi
callq 0x6400
jmp 0x27755
movq -0xf00(%rbp), %rdi
leaq -0x560(%rbp), %rsi
callq 0x2a4f0
jmp 0x2776a
leaq -0x560(%rbp), %rdi
callq 0x69a8
leaq -0x540(%rbp), %rdi
callq 0x62c0
jmp 0x277c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x277b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x560(%rbp), %rdi
callq 0x69a8
leaq -0x540(%rbp), %rdi
callq 0x62c0
jmp 0x288ed
leaq -0x580(%rbp), %rdi
callq 0x1b460
jmp 0x277d5
movq -0x3b0(%rbp), %rsi
leaq -0x580(%rbp), %rdi
callq 0x2a3c0
jmp 0x277ea
movl $0x0, -0x584(%rbp)
movl -0x584(%rbp), %eax
movl %eax, -0xf2c(%rbp)
leaq -0x580(%rbp), %rdi
callq 0x14440
movq %rax, %rcx
movl -0xf2c(%rbp), %eax
cmpl %ecx, %eax
jae 0x27869
movl -0x584(%rbp), %eax
movl %eax, -0xf30(%rbp)
movl -0x584(%rbp), %eax
movl %eax, %esi
leaq -0x580(%rbp), %rdi
callq 0x14410
movl -0xf30(%rbp), %ecx
movl %ecx, (%rax)
movl -0x584(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x584(%rbp)
jmp 0x277f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x2862a
movq -0xf00(%rbp), %rdi
callq 0x2a4d0
movb %al, -0xf31(%rbp)
jmp 0x2787d
movb -0xf31(%rbp), %al
movzbl %al, %ecx
andl $0x1, %ecx
movq 0x2a718(%rip), %rsi     # 0x51fa8
leaq 0x1edab(%rip), %rdx     # 0x46642
leaq -0x5a8(%rbp), %rdi
callq 0x16ee0
jmp 0x278a5
movq -0xf00(%rbp), %rdi
callq 0x2a4d0
movb %al, -0xf32(%rbp)
jmp 0x278b9
movb -0xf32(%rbp), %al
testb $0x1, %al
jne 0x278c8
jmp 0x279a5
leaq -0x730(%rbp), %rdi
callq 0x6280
jmp 0x278d6
leaq -0x720(%rbp), %rdi
leaq 0x1ed79(%rip), %rsi     # 0x4665d
callq 0x6410
movq %rax, -0xf40(%rbp)
jmp 0x278f2
movq -0xf40(%rbp), %rdi
movq 0x2a668(%rip), %rsi     # 0x51f68
callq 0x6470
jmp 0x27907
leaq -0x750(%rbp), %rdi
leaq -0x730(%rbp), %rsi
callq 0x6400
jmp 0x2791c
movq -0xf00(%rbp), %rdi
leaq -0x750(%rbp), %rsi
callq 0x2a4f0
jmp 0x27931
leaq -0x750(%rbp), %rdi
callq 0x69a8
leaq -0x730(%rbp), %rdi
callq 0x62c0
jmp 0x279a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x2816d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x27994
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x750(%rbp), %rdi
callq 0x69a8
leaq -0x730(%rbp), %rdi
callq 0x62c0
jmp 0x2816d
leaq -0x200(%rbp), %rdi
callq 0x2a7c0
movq %rax, -0xf48(%rbp)
jmp 0x279ba
movq -0xf48(%rbp), %rax
movq %rax, -0x758(%rbp)
leaq -0x580(%rbp), %rdi
callq 0x2a7c0
movq %rax, -0xf50(%rbp)
jmp 0x279dd
movq -0xf00(%rbp), %rdi
movq -0xf50(%rbp), %rax
movq %rax, -0x760(%rbp)
movq $0x0, -0x768(%rbp)
callq 0x2a7e0
movb %al, -0xf51(%rbp)
jmp 0x27a0a
movb -0xf51(%rbp), %al
testb $0x1, %al
jne 0x27a16
jmp 0x27a6d
movq -0x3b0(%rbp), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x6040
movq %rax, -0xf60(%rbp)
jmp 0x27a41
movq -0xf60(%rbp), %rax
movq %rax, -0x768(%rbp)
movq -0x768(%rbp), %rdi
movq -0x758(%rbp), %rsi
movq -0x3b0(%rbp), %rdx
shlq $0x2, %rdx
callq 0x6300
cmpl $0x1, -0xc(%rbp)
jne 0x27b3e
movq -0xf00(%rbp), %rdi
movq -0x1d0(%rbp), %rax
movq %rax, -0xf88(%rbp)
movq -0x758(%rbp), %rax
movq %rax, -0xf80(%rbp)
movq -0x3b0(%rbp), %rax
movq %rax, -0xf78(%rbp)
movq -0x760(%rbp), %rax
movq %rax, -0xf70(%rbp)
callq 0x2a4d0
movb %al, -0xf61(%rbp)
jmp 0x27ac3
movq -0xf00(%rbp), %rdi
callq 0x2a7e0
movb %al, -0xf89(%rbp)
jmp 0x27ad7
movq -0xf70(%rbp), %rcx
movq -0xf78(%rbp), %rdx
movq -0xf80(%rbp), %rsi
movq -0xf88(%rbp), %rdi
movb -0xf61(%rbp), %al
movb -0xf89(%rbp), %r9b
movl -0x1d4(%rbp), %r8d
movl %r8d, %r10d
movq %rsp, %r8
movq %r10, 0x8(%r8)
movzbl %r9b, %r9d
andl $0x1, %r9d
movl %r9d, (%r8)
movq $0x0, 0x10(%r8)
movzbl %al, %r9d
andl $0x1, %r9d
movl $0x4, %r8d
callq 0x2a800
jmp 0x27b39
jmp 0x27ff9
movl $0x0, -0x76c(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x770(%rbp)
cmpl $0x0, -0x770(%rbp)
jle 0x27b79
movl -0x76c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x76c(%rbp)
movl -0x770(%rbp), %eax
sarl %eax
movl %eax, -0x770(%rbp)
jmp 0x27b51
leaq -0x790(%rbp), %rdi
callq 0x19f60
jmp 0x27b87
movq -0xf00(%rbp), %rdi
movq -0x1d0(%rbp), %rax
movq %rax, -0xfb0(%rbp)
movq -0x758(%rbp), %rax
movq %rax, -0xfa8(%rbp)
movq -0x3b0(%rbp), %rax
movq %rax, -0xfa0(%rbp)
movq -0x760(%rbp), %rax
movq %rax, -0xf98(%rbp)
callq 0x2a4d0
movb %al, -0xf8a(%rbp)
jmp 0x27bd3
movq -0xf98(%rbp), %rcx
movq -0xfa0(%rbp), %rdx
movq -0xfa8(%rbp), %rsi
movq -0xfb0(%rbp), %rdi
movb -0xf8a(%rbp), %al
movslq -0x76c(%rbp), %r9
movq %rsp, %r8
leaq -0x790(%rbp), %r10
movq %r10, 0x10(%r8)
movq %r9, 0x8(%r8)
movl $0x0, (%r8)
movzbl %al, %r9d
andl $0x1, %r9d
movl $0x4, %r8d
callq 0x2a800
jmp 0x27c2a
leaq -0x790(%rbp), %rdi
callq 0x19e40
cmpq $0x0, %rax
jbe 0x27fda
movslq -0xc(%rbp), %rsi
leaq -0x7a8(%rbp), %rdi
xorl %edx, %edx
callq 0x2a990
jmp 0x27c54
leaq -0x7c8(%rbp), %rdi
callq 0x2aa10
jmp 0x27c62
movslq -0xc(%rbp), %rsi
leaq -0x7c8(%rbp), %rdi
callq 0x2aa50
jmp 0x27c74
movq $0x0, -0x7d0(%rbp)
leaq -0x7d1(%rbp), %rdi
callq 0x22af0
jmp 0x27c8d
movl $0x0, -0x7d8(%rbp)
movl -0x7d8(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x27f51
movslq -0x7d8(%rbp), %rsi
leaq -0x7c8(%rbp), %rdi
callq 0x2aad0
movq %rax, -0xfb8(%rbp)
jmp 0x27cc2
movq -0xfb8(%rbp), %rax
movq -0xf00(%rbp), %rcx
movq %rcx, (%rax)
movq -0x758(%rbp), %rax
movq %rax, -0xfc8(%rbp)
movslq -0x7d8(%rbp), %rsi
leaq -0x7c8(%rbp), %rdi
callq 0x2aad0
movq %rax, -0xfc0(%rbp)
jmp 0x27cfd
movq -0xfc0(%rbp), %rax
movq -0xfc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x3b0(%rbp), %rax
movq %rax, -0xfd8(%rbp)
movslq -0x7d8(%rbp), %rsi
leaq -0x7c8(%rbp), %rdi
callq 0x2aad0
movq %rax, -0xfd0(%rbp)
jmp 0x27d39
movq -0xfd0(%rbp), %rax
movq -0xfd8(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x760(%rbp), %rax
movq %rax, -0xfe8(%rbp)
movslq -0x7d8(%rbp), %rsi
leaq -0x7c8(%rbp), %rdi
callq 0x2aad0
movq %rax, -0xfe0(%rbp)
jmp 0x27d75
movq -0xfe0(%rbp), %rax
movq -0xfe8(%rbp), %rcx
movq %rcx, 0x18(%rax)
movslq -0x76c(%rbp), %rax
movq %rax, -0xff8(%rbp)
movslq -0x7d8(%rbp), %rsi
leaq -0x7c8(%rbp), %rdi
callq 0x2aad0
movq %rax, -0xff0(%rbp)
jmp 0x27db1
movq -0xff0(%rbp), %rax
movq -0xff8(%rbp), %rcx
movq %rcx, 0x20(%rax)
movslq -0x7d8(%rbp), %rsi
leaq -0x7c8(%rbp), %rdi
callq 0x2aad0
movq %rax, -0x1000(%rbp)
jmp 0x27ddf
movq -0x1000(%rbp), %rax
leaq -0x790(%rbp), %rcx
movq %rcx, 0x28(%rax)
movslq -0x7d8(%rbp), %rsi
leaq -0x7c8(%rbp), %rdi
callq 0x2aad0
movq %rax, -0x1008(%rbp)
jmp 0x27e0d
movq -0x1008(%rbp), %rax
leaq -0x7d0(%rbp), %rcx
movq %rcx, 0x30(%rax)
movslq -0x7d8(%rbp), %rsi
leaq -0x7c8(%rbp), %rdi
callq 0x2aad0
movq %rax, -0x1010(%rbp)
jmp 0x27e3b
movq -0x1010(%rbp), %rax
leaq -0x7d1(%rbp), %rcx
movq %rcx, 0x38(%rax)
movl $0x8, %edi
callq 0x6430
movq %rax, -0x1018(%rbp)
jmp 0x27e60
movslq -0x7d8(%rbp), %rsi
leaq -0x7c8(%rbp), %rdi
callq 0x2aad0
movq %rax, -0x1020(%rbp)
jmp 0x27e7c
movq -0x1018(%rbp), %rdi
movq -0x1020(%rbp), %rax
movq %rax, -0x7e0(%rbp)
leaq -0x157e8(%rip), %rsi    # 0x126b0
leaq -0x7e0(%rbp), %rdx
callq 0x25bc0
jmp 0x27ea6
movslq -0x7d8(%rbp), %rsi
leaq -0x7a8(%rbp), %rdi
callq 0x2ab00
movq %rax, -0x1028(%rbp)
jmp 0x27ec2
movq -0x1028(%rbp), %rax
movq -0x1018(%rbp), %rcx
movq %rcx, (%rax)
movl -0x7d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7d8(%rbp)
jmp 0x27c97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x27fe8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x27fcc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x27fc0
movq -0x1018(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
movl $0x8, %esi
callq 0x6440
jmp 0x27fc0
movl $0x0, -0x7e4(%rbp)
movl -0x7e4(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x27fa6
movslq -0x7e4(%rbp), %rsi
leaq -0x7a8(%rbp), %rdi
callq 0x2ab00
movq %rax, -0x1030(%rbp)
jmp 0x27f82
movq -0x1030(%rbp), %rax
movq (%rax), %rdi
callq 0x67e0
jmp 0x27f93
jmp 0x27f95
movl -0x7e4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7e4(%rbp)
jmp 0x27f5b
leaq -0x7c8(%rbp), %rdi
callq 0x2ab30
leaq -0x7a8(%rbp), %rdi
callq 0x2ab50
jmp 0x27fda
leaq -0x7c8(%rbp), %rdi
callq 0x2ab30
leaq -0x7a8(%rbp), %rdi
callq 0x2ab50
jmp 0x27fe8
leaq -0x790(%rbp), %rdi
callq 0x1a0b0
jmp 0x27ff9
leaq -0x790(%rbp), %rdi
callq 0x1a0b0
jmp 0x2816d
movq -0xf00(%rbp), %rdi
callq 0x2a7e0
movb %al, -0x1031(%rbp)
jmp 0x2800d
movb -0x1031(%rbp), %al
testb $0x1, %al
jne 0x2801c
jmp 0x280bb
movq -0x1d0(%rbp), %rdi
movq %rdi, -0x1040(%rbp)
callq 0x14c10
movq -0x1040(%rbp), %rdi
movq %rax, %rsi
movq -0x758(%rbp), %rdx
movq -0x3b0(%rbp), %rcx
movl -0x1d4(%rbp), %eax
movl %eax, %r8d
movq %rsp, %rax
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movq %r9, (%rax)
xorl %eax, %eax
movl %eax, %r9d
callq 0x2ab90
jmp 0x28068
movq $0x0, -0x7f0(%rbp)
movq -0x7f0(%rbp), %rax
cmpq -0x3b0(%rbp), %rax
jae 0x28099
jmp 0x28085
movq -0x7f0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x7f0(%rbp)
jmp 0x28073
movq -0x768(%rbp), %rax
movq %rax, -0x1048(%rbp)
cmpq $0x0, %rax
je 0x280b9
movq -0x1048(%rbp), %rdi
callq 0x65b0
jmp 0x280bb
leaq -0x5a8(%rbp), %rdi
callq 0x16f40
movq -0xf00(%rbp), %rdi
callq 0x2a4d0
movb %al, -0x1049(%rbp)
jmp 0x280db
movb -0x1049(%rbp), %al
testb $0x1, %al
jne 0x280ea
jmp 0x281c1
leaq -0x978(%rbp), %rdi
callq 0x6280
jmp 0x280f8
leaq -0x968(%rbp), %rdi
leaq 0x1e56b(%rip), %rsi     # 0x46671
callq 0x6410
movq %rax, -0x1058(%rbp)
jmp 0x28114
movq -0x1058(%rbp), %rdi
movq 0x29e46(%rip), %rsi     # 0x51f68
callq 0x6470
jmp 0x28129
leaq -0x998(%rbp), %rdi
leaq -0x978(%rbp), %rsi
callq 0x6400
jmp 0x2813e
movq -0xf00(%rbp), %rdi
leaq -0x998(%rbp), %rsi
callq 0x2a4f0
jmp 0x28153
leaq -0x998(%rbp), %rdi
callq 0x69a8
leaq -0x978(%rbp), %rdi
callq 0x62c0
jmp 0x281c1
leaq -0x5a8(%rbp), %rdi
callq 0x16f40
jmp 0x2862a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x281b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x998(%rbp), %rdi
callq 0x69a8
leaq -0x978(%rbp), %rdi
callq 0x62c0
jmp 0x2862a
movq -0xf00(%rbp), %rax
addq $0x78, %rax
movq %rax, -0x1060(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x14440
movq -0x1060(%rbp), %rdi
movq %rax, %rsi
callq 0x25d50
jmp 0x281f0
movq -0xf00(%rbp), %rax
addq $0x78, %rax
movq %rax, -0x1068(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x14440
movq -0x1068(%rbp), %rdi
movq %rax, %rsi
callq 0x2a3c0
jmp 0x2821f
movq -0xf00(%rbp), %rdi
callq 0x2a4d0
movb %al, -0x1069(%rbp)
jmp 0x28233
movb -0x1069(%rbp), %al
movzbl %al, %ecx
andl $0x1, %ecx
movq 0x29d62(%rip), %rsi     # 0x51fa8
leaq 0x1e43c(%rip), %rdx     # 0x46689
leaq -0x9b8(%rbp), %rdi
callq 0x16ee0
jmp 0x2825b
movq -0xf00(%rbp), %rdi
callq 0x2a4d0
movb %al, -0x106a(%rbp)
jmp 0x2826f
movb -0x106a(%rbp), %al
testb $0x1, %al
jne 0x2827e
jmp 0x2835b
leaq -0xb40(%rbp), %rdi
callq 0x6280
jmp 0x2828c
leaq -0xb30(%rbp), %rdi
leaq 0x1e40e(%rip), %rsi     # 0x466a8
callq 0x6410
movq %rax, -0x1078(%rbp)
jmp 0x282a8
movq -0x1078(%rbp), %rdi
movq 0x29cb2(%rip), %rsi     # 0x51f68
callq 0x6470
jmp 0x282bd
leaq -0xb60(%rbp), %rdi
leaq -0xb40(%rbp), %rsi
callq 0x6400
jmp 0x282d2
movq -0xf00(%rbp), %rdi
leaq -0xb60(%rbp), %rsi
callq 0x2a4f0
jmp 0x282e7
leaq -0xb60(%rbp), %rdi
callq 0x69a8
leaq -0xb40(%rbp), %rdi
callq 0x62c0
jmp 0x2835b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x2861e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x2834a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0xb60(%rbp), %rdi
callq 0x69a8
leaq -0xb40(%rbp), %rdi
callq 0x62c0
jmp 0x2861e
movq $0x0, -0xb68(%rbp)
movq -0xb68(%rbp), %rax
movq -0x3b0(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x28466
movq -0xf00(%rbp), %rax
movl -0x3b4(%rbp), %ecx
movl %ecx, -0x1094(%rbp)
addq $0x78, %rax
movq %rax, -0x10a0(%rbp)
movq -0xb68(%rbp), %rsi
leaq -0x580(%rbp), %rdi
callq 0x14410
movq -0x10a0(%rbp), %rdi
movl (%rax), %eax
movl %eax, %esi
callq 0x14410
movl -0x1094(%rbp), %ecx
movl %ecx, (%rax)
movq -0x1d0(%rbp), %rax
movq %rax, -0x1088(%rbp)
movq -0xb68(%rbp), %rsi
leaq -0x200(%rbp), %rdi
movq %rdi, -0x1090(%rbp)
callq 0x14410
movq -0x1090(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x1080(%rbp)
movq -0xb68(%rbp), %rsi
incq %rsi
callq 0x14410
movq -0x1088(%rbp), %rdi
movl -0x1080(%rbp), %esi
movl (%rax), %edx
movl -0x1d4(%rbp), %ecx
callq 0x12830
movb %al, -0x1079(%rbp)
jmp 0x28432
movb -0x1079(%rbp), %al
testb $0x1, %al
jne 0x2844d
jmp 0x2843e
movl -0x3b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3b4(%rbp)
jmp 0x2844f
movq -0xb68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb68(%rbp)
jmp 0x28366
movq -0xf00(%rbp), %rax
movl -0x3b4(%rbp), %ecx
movl %ecx, -0x10cc(%rbp)
addq $0x78, %rax
movq %rax, -0x10c0(%rbp)
movq -0x3b0(%rbp), %rsi
decq %rsi
leaq -0x580(%rbp), %rdi
movq %rdi, -0x10c8(%rbp)
callq 0x14410
movq -0x10c0(%rbp), %rdi
movl (%rax), %eax
movl %eax, %esi
callq 0x14410
movl -0x10cc(%rbp), %ecx
movl %ecx, (%rax)
leaq -0x9b8(%rbp), %rdi
callq 0x16f40
movq -0x10c8(%rbp), %rdi
callq 0x1d0c0
movq -0x10c0(%rbp), %rdi
movl -0x3b0(%rbp), %eax
movl %eax, -0x10b4(%rbp)
callq 0x14440
movq -0x10c0(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x14410
movl -0x10b4(%rbp), %ecx
movl %ecx, (%rax)
movl -0x3b0(%rbp), %eax
movl %eax, -0x10a8(%rbp)
leaq -0x200(%rbp), %rdi
movq %rdi, -0x10b0(%rbp)
callq 0x14440
movq -0x10b0(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x14410
movl -0x10a8(%rbp), %ecx
movq -0xf00(%rbp), %rdi
movl %ecx, (%rax)
callq 0x2a4d0
movb %al, -0x10a1(%rbp)
jmp 0x28550
movb -0x10a1(%rbp), %al
movzbl %al, %ecx
andl $0x1, %ecx
movq 0x29a45(%rip), %rsi     # 0x51fa8
leaq 0x1e156(%rip), %rdx     # 0x466c0
leaq -0xb88(%rbp), %rdi
callq 0x16ee0
jmp 0x28578
movq -0xf00(%rbp), %rdi
callq 0x2a4d0
movb %al, -0x10cd(%rbp)
jmp 0x2858c
movb -0x10cd(%rbp), %al
testb $0x1, %al
jne 0x2859b
jmp 0x28695
leaq -0xd10(%rbp), %rdi
callq 0x6280
jmp 0x285a9
leaq -0xd00(%rbp), %rdi
leaq 0x1e135(%rip), %rsi     # 0x466ec
callq 0x6410
movq %rax, -0x10d8(%rbp)
jmp 0x285c5
movq -0x10d8(%rbp), %rdi
movq 0x29995(%rip), %rsi     # 0x51f68
callq 0x6470
jmp 0x285da
leaq -0xd30(%rbp), %rdi
leaq -0xd10(%rbp), %rsi
callq 0x6400
jmp 0x285ef
movq -0xf00(%rbp), %rdi
leaq -0xd30(%rbp), %rsi
callq 0x2a4f0
jmp 0x28604
leaq -0xd30(%rbp), %rdi
callq 0x69a8
leaq -0xd10(%rbp), %rdi
callq 0x62c0
jmp 0x28695
leaq -0x9b8(%rbp), %rdi
callq 0x16f40
leaq -0x580(%rbp), %rdi
callq 0x1d0c0
jmp 0x288ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x287b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x28684
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0xd30(%rbp), %rdi
callq 0x69a8
leaq -0xd10(%rbp), %rdi
callq 0x62c0
jmp 0x287b1
movq -0xf00(%rbp), %rdi
addq $0x78, %rdi
xorl %eax, %eax
movl %eax, -0x10dc(%rbp)
movl %eax, %esi
movq %rsi, -0x1100(%rbp)
callq 0x14410
movq -0x1100(%rbp), %rsi
movq %rax, -0x10f0(%rbp)
leaq -0x200(%rbp), %rdi
movq %rdi, -0x10f8(%rbp)
callq 0x14410
movq -0x10f8(%rbp), %rdi
movq %rax, -0x10e8(%rbp)
movl -0x3b0(%rbp), %eax
movl %eax, -0x10e0(%rbp)
callq 0x14440
movq -0x10f0(%rbp), %rsi
movq -0x10e8(%rbp), %rdx
movl -0x10e0(%rbp), %ecx
movl -0x10dc(%rbp), %r9d
movl %eax, %r8d
leaq -0xd48(%rbp), %rdi
callq 0x2ac10
jmp 0x28722
leaq -0xb88(%rbp), %rdi
callq 0x16f40
movq -0xf00(%rbp), %rdi
addq $0x78, %rdi
movq -0x3b0(%rbp), %rsi
callq 0x25d50
jmp 0x28747
movq $0x0, -0xd50(%rbp)
movq -0xf00(%rbp), %rdi
movq -0xd50(%rbp), %rax
movq %rax, -0x1108(%rbp)
addq $0x78, %rdi
callq 0x14440
movq %rax, %rcx
movq -0x1108(%rbp), %rax
cmpq %rcx, %rax
jae 0x287c2
movq -0xf00(%rbp), %rdi
addq $0x78, %rdi
movq -0xd50(%rbp), %rsi
callq 0x14410
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movq -0xd50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xd50(%rbp)
jmp 0x28752
leaq -0xb88(%rbp), %rdi
callq 0x16f40
jmp 0x288ed
movq -0xf00(%rbp), %rdi
callq 0x2a4d0
movb %al, -0x1109(%rbp)
jmp 0x287d6
movb -0x1109(%rbp), %al
testb $0x1, %al
jne 0x287e5
jmp 0x288a8
leaq -0xed8(%rbp), %rdi
callq 0x6280
jmp 0x287f3
leaq -0xec8(%rbp), %rdi
leaq 0x1df10(%rip), %rsi     # 0x46711
callq 0x6410
movq %rax, -0x1118(%rbp)
jmp 0x2880f
movq -0x1118(%rbp), %rdi
movq 0x2974b(%rip), %rsi     # 0x51f68
callq 0x6470
jmp 0x28824
leaq -0xef8(%rbp), %rdi
leaq -0xed8(%rbp), %rsi
callq 0x6400
jmp 0x28839
movq -0xf00(%rbp), %rdi
leaq -0xef8(%rbp), %rsi
callq 0x2a4f0
jmp 0x2884e
leaq -0xef8(%rbp), %rdi
callq 0x69a8
leaq -0xed8(%rbp), %rdi
callq 0x62c0
jmp 0x288a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x2889a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0xef8(%rbp), %rdi
callq 0x69a8
leaq -0xed8(%rbp), %rdi
callq 0x62c0
jmp 0x288ed
movq -0xf00(%rbp), %rdi
callq 0x2a7e0
movb %al, -0x1119(%rbp)
jmp 0x288bc
movb -0x1119(%rbp), %al
testb $0x1, %al
jne 0x288c8
jmp 0x288d8
movq -0xf00(%rbp), %rdi
callq 0x2ae80
jmp 0x288d6
jmp 0x288d8
leaq -0x200(%rbp), %rdi
callq 0x1d0c0
addq $0x1140, %rsp           # imm = 0x1140
popq %rbp
retq
leaq -0x200(%rbp), %rdi
callq 0x1d0c0
movq -0x1a0(%rbp), %rdi
callq 0x6850
nopw %cs:(%rax,%rax)
nop