// File: BenLangmead[P]bowtie/ebwt_search.cpp
// Function: twoOrThreeMismatchSearchFull(PatternComposer&, HitSink&, Ebwt&, Ebwt&, EList<SString<char>, 128>&, bool)
static void twoOrThreeMismatchSearchFull(
		PatternComposer& _patsrc,   /// pattern source
		HitSink& _sink,                 /// hit sink
		Ebwt& ebwtFw,             /// index of original text
		Ebwt& ebwtBw,             /// index of mirror text
		EList<BTRefString >& os,      /// text strings, if available (empty otherwise)
		bool two = true)                /// true -> 2, false -> 3
{
	// Global initialization
	assert(!ebwtFw.isInMemory());
	assert(!ebwtBw.isInMemory());
	{
		// Load the other half of the index into memory
		Timer _t(cerr, "Time loading forward index: ", timing);
		ebwtFw.loadIntoMemory(-1, !noRefNames, startVerbose);
	}
	{
		// Load the other half of the index into memory
		Timer _t(cerr, "Time loading mirror index: ", timing);
		ebwtBw.loadIntoMemory(-1, !noRefNames, startVerbose);
	}
	// Create range caches, which are shared among all aligners
	BitPairReference *refs = NULL;
	bool pair = mates1.size() > 0 || mates12.size() > 0;
	if(pair && mixedThresh < 0xffffffff) {
		Timer _t(cerr, "Time loading reference: ", timing);
		refs = new BitPairReference(adjustedEbwtFileBase, sanityCheck, NULL, &os, false, true, useMm, useShmem, mmSweep, verbose, startVerbose);
		if(!refs->loaded()) throw 1;
	}
	twoOrThreeMismatchSearch_refs     = refs;
	twoOrThreeMismatchSearch_patsrc   = &_patsrc;
	twoOrThreeMismatchSearch_sink     = &_sink;
	twoOrThreeMismatchSearch_ebwtFw   = &ebwtFw;
	twoOrThreeMismatchSearch_ebwtBw   = &ebwtBw;
	twoOrThreeMismatchSearch_os       = &os;
	twoOrThreeMismatchSearch_doneMask = NULL;
	twoOrThreeMismatchSearch_hitMask  = NULL;
	twoOrThreeMismatchSearch_two      = two;

	int tids[max(nthreads, thread_ceiling)];
#if (__cplusplus >= 201103L)
	EList<std::thread*> threads;
	EList<thread_tracking_pair> tps;
	tps.resizeExact(max(nthreads, thread_ceiling));
#else
	EList<tthread::thread*> threads;
#endif

#if (__cplusplus >= 201103L)
	std::atomic<int> all_threads_done;
	all_threads_done = 0;
#endif

	CHUD_START();
	{
		Timer _t(cerr, "End-to-end 2/3-mismatch full-index search: ", timing);

#ifndef _WIN32
		int pid = 0;
		if(thread_stealing) {
			pid = getpid();
			write_pid(thread_stealing_dir.c_str(), pid);
			thread_counter = 0;
		}
#endif

		for(int i = 0; i < nthreads; i++) {
			tids[i] = i;
#if (__cplusplus >= 201103L)
			tps[i].tid = tids[i];
			tps[i].done = &all_threads_done;
			if (i == nthreads - 1) {
				if(stateful) {
					twoOrThreeMismatchSearchWorkerStateful((void*)&tps[i]);
				} else {
					twoOrThreeMismatchSearchWorkerFull((void*)&tps[i]);
				}
			}
			else {
				if(stateful) {
					threads.push_back(new std::thread(twoOrThreeMismatchSearchWorkerStateful, (void*)&tps[i]));
				} else {
					threads.push_back(new std::thread(twoOrThreeMismatchSearchWorkerFull, (void*)&tps[i]));
				}
				threads[i]->detach();
				SLEEP(10);
			}
#else
			if (i == nthreads - 1) {
				if(stateful) {
					twoOrThreeMismatchSearchWorkerStateful((void*)(tids + i));
				} else {
					twoOrThreeMismatchSearchWorkerFull((void*)(tids + i));
				}
			}
			else {
				if(stateful) {
					threads.push_back(new tthread::thread(twoOrThreeMismatchSearchWorkerStateful, (void *)(tids + i)));
				} else {
					threads.push_back(new tthread::thread(twoOrThreeMismatchSearchWorkerFull, (void *)(tids + i)));
				}
			}
#endif
		}

#ifndef _WIN32
		if(thread_stealing) {
			int orig_threads = nthreads, steal_ctr = 1;
			for(int j = 0; j < 10; j++) {
				sleep(1);
			}
			while(thread_counter > 0) {
				if(steal_thread(pid, orig_threads)) {
					nthreads++;
					tids[nthreads-1] = nthreads;
#if (__cplusplus >= 201103L)
					tps[nthreads-1].tid = nthreads - 1;
					tps[nthreads-1].done = &all_threads_done;
					if(stateful) {
						threads.push_back(new std::thread(twoOrThreeMismatchSearchWorkerStateful, (void*)&tps[nthreads-1]));
					} else {
						threads.push_back(new std::thread(twoOrThreeMismatchSearchWorkerFull, (void*)&tps[nthreads-1]));
					}
					threads[nthreads-1]->detach();
					SLEEP(10);
#else
					if(stateful) {
						threads.push_back(new tthread::thread(twoOrThreeMismatchSearchWorkerStateful, (void *)(tids + nthreads - 1)));
					} else {
						threads.push_back(new tthread::thread(twoOrThreeMismatchSearchWorkerFull, (void *)(tids + nthreads - 1)));
					}
#endif
					cerr << "pid " << pid << " started new worker # " << nthreads << endl;
				}
				steal_ctr++;
				for(int j = 0; j < 10; j++) {
					sleep(1);
				}
			}
		}
#endif

#if (__cplusplus >= 201103L)
		while(all_threads_done < nthreads) {
			SLEEP(10);
		}
#else
		for (int i = 0; i < nthreads - 1; i++) {
			threads[i]->join();
		}
#endif

#ifndef _WIN32
		if(thread_stealing) {
			del_pid(thread_stealing_dir.c_str(), pid);
		}
#endif
	}
	if(refs != NULL) delete refs;

	for (int i = 0; i < nthreads - 1; i++) {
		if (threads[i] != NULL) {
			delete threads[i];
		}
	}
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
movb %r9b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movl 0x910af(%rip), %eax     # 0xab39c
testl %eax, %eax
setne %al
movzbl %al, %ecx
movq 0x8dcf4(%rip), %rsi     # 0xa7ff0
leaq 0x72454(%rip), %rdx     # 0x8c757
leaq -0x50(%rbp), %rdi
callq 0x273f0
movq -0x18(%rbp), %rdi
movb 0x910ee(%rip), %al      # 0xab404
notb %al
movzbl 0x91069(%rip), %ecx     # 0xab388
andl $0x1, %ecx
movzbl %al, %edx
andl $0x1, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x290f0
jmp 0x1a334
leaq -0x50(%rbp), %rdi
callq 0x27490
movl 0x91059(%rip), %eax     # 0xab39c
testl %eax, %eax
setne %al
movzbl %al, %ecx
movq 0x8dc9e(%rip), %rsi     # 0xa7ff0
leaq 0x7241b(%rip), %rdx     # 0x8c774
leaq -0x80(%rbp), %rdi
callq 0x273f0
movq -0x20(%rbp), %rdi
movb 0x91098(%rip), %al      # 0xab404
notb %al
movzbl 0x91013(%rip), %ecx     # 0xab388
andl $0x1, %ecx
movzbl %al, %edx
andl $0x1, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x290f0
jmp 0x1a38a
leaq -0x80(%rbp), %rdi
callq 0x27490
movq $0x0, -0x88(%rbp)
leaq 0x90d9b(%rip), %rdi     # 0xab140
callq 0x26400
movq %rax, %rcx
movb $0x1, %al
cmpq $0x0, %rcx
movb %al, -0x189(%rbp)
ja 0x1a3d4
leaq 0x90dbe(%rip), %rdi     # 0xab180
callq 0x26400
cmpq $0x0, %rax
seta %al
movb %al, -0x189(%rbp)
movb -0x189(%rbp), %al
andb $0x1, %al
movb %al, -0x89(%rbp)
testb $0x1, -0x89(%rbp)
je 0x1a589
cmpl $-0x1, 0x9104a(%rip)    # 0xab440
jae 0x1a589
movl 0x90f9a(%rip), %eax     # 0xab39c
testl %eax, %eax
setne %al
movzbl %al, %ecx
movq 0x8dbdf(%rip), %rsi     # 0xa7ff0
leaq 0x72326(%rip), %rdx     # 0x8c73e
leaq -0xb0(%rbp), %rdi
callq 0x273f0
movl $0x568, %edi            # imm = 0x568
callq 0xa5f0
movq %rax, -0x198(%rbp)
jmp 0x1a437
movq -0x198(%rbp), %rdi
movl 0x90f64(%rip), %eax     # 0xab3a8
testl %eax, %eax
setne %al
movq -0x28(%rbp), %r8
movzbl 0x90fd7(%rip), %edx     # 0xab42b
movzbl 0x90fcf(%rip), %esi     # 0xab42a
movzbl 0x90fc9(%rip), %r9d     # 0xab42c
movzbl 0x90f35(%rip), %r10d    # 0xab3a0
movzbl 0x90f15(%rip), %r11d    # 0xab388
subq $0x30, %rsp
andl $0x1, %r11d
movq %rsp, %rcx
movl %r11d, 0x28(%rcx)
andl $0x1, %r10d
movl %r10d, 0x20(%rcx)
andl $0x1, %r9d
movl %r9d, 0x18(%rcx)
andl $0x1, %esi
movl %esi, 0x10(%rcx)
andl $0x1, %edx
movl %edx, 0x8(%rcx)
movl $0x1, (%rcx)
movzbl %al, %edx
leaq 0x90cf2(%rip), %rsi     # 0xab1a0
xorl %r9d, %r9d
movl %r9d, %ecx
callq 0x2fe70
addq $0x30, %rsp
jmp 0x1a4bf
movq -0x198(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0x31950
testb $0x1, %al
jne 0x1a56a
movl $0x4, %edi
callq 0xa290
movq %rax, %rdi
movl $0x1, (%rdi)
movq 0x8da55(%rip), %rsi     # 0xa7f50
xorl %eax, %eax
movl %eax, %edx
callq 0xab10
jmp 0x1ae3c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x27490
jmp 0x1ae33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x27490
jmp 0x1ae33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1a578
movq -0x198(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
movl $0x568, %esi            # imm = 0x568
callq 0xa600
jmp 0x1a578
leaq -0xb0(%rbp), %rdi
callq 0x27490
jmp 0x1a589
leaq -0xb0(%rbp), %rdi
callq 0x27490
jmp 0x1ae33
movq -0x88(%rbp), %rax
movq %rax, 0x90f91(%rip)     # 0xab528
movq -0x8(%rbp), %rax
movq %rax, 0x90f8e(%rip)     # 0xab530
movq -0x10(%rbp), %rax
movq %rax, 0x90f8b(%rip)     # 0xab538
movq -0x18(%rbp), %rax
movq %rax, 0x90f88(%rip)     # 0xab540
movq -0x20(%rbp), %rax
movq %rax, 0x90f85(%rip)     # 0xab548
movq -0x28(%rbp), %rax
movq %rax, 0x90f82(%rip)     # 0xab550
movq $0x0, 0x90f7f(%rip) # 0xab558
movq $0x0, 0x90f7c(%rip) # 0xab560
movb -0x29(%rbp), %al
andb $0x1, %al
movb %al, 0x90f79(%rip)      # 0xab568
leaq 0x90dfa(%rip), %rdi     # 0xab3f0
leaq 0x90dfb(%rip), %rsi     # 0xab3f8
callq 0x31970
movl (%rax), %eax
movq %rsp, %rcx
movq %rcx, -0xb8(%rbp)
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x1a0(%rbp)
movq %rcx, %rsp
movq %rax, -0xc0(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x319b0
leaq -0x100(%rbp), %rdi
callq 0x319f0
jmp 0x1a64b
leaq 0x90d9e(%rip), %rdi     # 0xab3f0
leaq 0x90d9f(%rip), %rsi     # 0xab3f8
callq 0x31970
movslq (%rax), %rsi
leaq -0x100(%rbp), %rdi
callq 0x31a30
jmp 0x1a66f
leaq -0x104(%rbp), %rdi
xorl %esi, %esi
callq 0x31ab0
movl 0x90d19(%rip), %eax     # 0xab39c
testl %eax, %eax
setne %al
movzbl %al, %ecx
movq 0x8d95e(%rip), %rsi     # 0xa7ff0
leaq 0x72ded(%rip), %rdx     # 0x8d486
leaq -0x128(%rbp), %rdi
callq 0x273f0
jmp 0x1a6a7
movl $0x0, -0x12c(%rbp)
testb $0x1, 0x90d44(%rip)     # 0xab3fc
je 0x1a724
callq 0xa910
movl %eax, -0x12c(%rbp)
leaq 0x90b1c(%rip), %rdi     # 0xab1e8
callq 0xa210
movq %rax, %rdi
movl -0x12c(%rbp), %esi
callq 0x1c7c0
jmp 0x1a6e1
leaq 0x90c74(%rip), %rdi     # 0xab35c
xorl %esi, %esi
callq 0x31ab0
jmp 0x1a724
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1ae27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1ae1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1ad55
movl $0x0, -0x130(%rbp)
movl -0x130(%rbp), %eax
cmpl 0x90cb6(%rip), %eax     # 0xab3f0
jge 0x1a976
movq -0x1a0(%rbp), %rax
movl -0x130(%rbp), %edx
movslq -0x130(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movslq -0x130(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1a4(%rbp)
movslq -0x130(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x31b50
movl -0x1a4(%rbp), %ecx
movl %ecx, (%rax)
movslq -0x130(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x31b50
leaq -0x104(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0x130(%rbp), %eax
movl 0x90c44(%rip), %ecx     # 0xab3f0
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1a7ff
testb $0x1, 0x90c73(%rip)     # 0xab42d
je 0x1a7db
movslq -0x130(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x31b50
movq %rax, %rdi
callq 0x21080
jmp 0x1a7d9
jmp 0x1a7fa
movslq -0x130(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x31b50
movq %rax, %rdi
callq 0x21780
jmp 0x1a7f8
jmp 0x1a7fa
jmp 0x1a960
testb $0x1, 0x90c27(%rip)     # 0xab42d
je 0x1a89f
movl $0x8, %edi
callq 0xa5f0
movq %rax, -0x1b0(%rbp)
jmp 0x1a81f
movslq -0x130(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x31b50
movq -0x1b0(%rbp), %rdi
movq %rax, -0x140(%rbp)
leaq 0x6839(%rip), %rsi      # 0x21080
leaq -0x140(%rbp), %rdx
callq 0x31bf0
jmp 0x1a855
movq -0x1b0(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x31b80
jmp 0x1a878
jmp 0x1a92f
movq -0x1b0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
movl $0x8, %esi
callq 0xa600
jmp 0x1ad55
movl $0x8, %edi
callq 0xa5f0
movq %rax, -0x1b8(%rbp)
jmp 0x1a8b2
movslq -0x130(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x31b50
movq -0x1b8(%rbp), %rdi
movq %rax, -0x150(%rbp)
leaq 0x6ea6(%rip), %rsi      # 0x21780
leaq -0x150(%rbp), %rdx
callq 0x31bf0
jmp 0x1a8e8
movq -0x1b8(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x31b80
jmp 0x1a90b
jmp 0x1a92f
movq -0x1b8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
movl $0x8, %esi
callq 0xa600
jmp 0x1ad55
movslq -0x130(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x31cb0
movq (%rax), %rdi
callq 0xab50
jmp 0x1a94c
leaq 0x6ed3d(%rip), %rdi     # 0x89690
xorl %eax, %eax
movl %eax, %esi
callq 0xa1b0
jmp 0x1a95e
jmp 0x1a960
jmp 0x1a962
movl -0x130(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x130(%rbp)
jmp 0x1a72e
testb $0x1, 0x90a7f(%rip)     # 0xab3fc
je 0x1acbf
movl 0x90a67(%rip), %eax     # 0xab3f0
movl %eax, -0x154(%rbp)
movl $0x1, -0x158(%rbp)
movl $0x0, -0x15c(%rbp)
cmpl $0xa, -0x15c(%rbp)
jge 0x1a9cb
movl $0x1, %edi
callq 0xa450
jmp 0x1a9b8
jmp 0x1a9ba
movl -0x15c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x15c(%rbp)
jmp 0x1a9a3
jmp 0x1a9cd
leaq 0x90988(%rip), %rdi     # 0xab35c
callq 0x31ce0
cmpl $0x0, %eax
jle 0x1acbd
movl -0x12c(%rbp), %edi
movl -0x154(%rbp), %esi
callq 0x1f730
movb %al, -0x1b9(%rbp)
jmp 0x1a9fb
movb -0x1b9(%rbp), %al
testb $0x1, %al
jne 0x1aa0a
jmp 0x1ac77
movq -0x1a0(%rbp), %rax
movl 0x909d9(%rip), %ecx     # 0xab3f0
addl $0x1, %ecx
movl %ecx, 0x909d0(%rip)     # 0xab3f0
movl 0x909ca(%rip), %edx     # 0xab3f0
movl 0x909c4(%rip), %ecx     # 0xab3f0
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x909b5(%rip), %eax     # 0xab3f0
subl $0x1, %eax
movl %eax, -0x1c0(%rbp)
movl 0x909a6(%rip), %eax     # 0xab3f0
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x100(%rbp), %rdi
callq 0x31b50
movl -0x1c0(%rbp), %ecx
movl %ecx, (%rax)
movl 0x90986(%rip), %eax     # 0xab3f0
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x100(%rbp), %rdi
callq 0x31b50
leaq -0x104(%rbp), %rcx
movq %rcx, 0x8(%rax)
testb $0x1, 0x9099f(%rip)     # 0xab42d
je 0x1ab2b
movl $0x8, %edi
callq 0xa5f0
movq %rax, -0x1c8(%rbp)
jmp 0x1aaa7
movl 0x90943(%rip), %eax     # 0xab3f0
decl %eax
movslq %eax, %rsi
leaq -0x100(%rbp), %rdi
callq 0x31b50
movq -0x1c8(%rbp), %rdi
movq %rax, -0x170(%rbp)
leaq 0x65ad(%rip), %rsi      # 0x21080
leaq -0x170(%rbp), %rdx
callq 0x31bf0
jmp 0x1aae1
movq -0x1c8(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x31b80
jmp 0x1ab04
jmp 0x1abbf
movq -0x1c8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
movl $0x8, %esi
callq 0xa600
jmp 0x1ad55
movl $0x8, %edi
callq 0xa5f0
movq %rax, -0x1d0(%rbp)
jmp 0x1ab3e
movl 0x908ac(%rip), %eax     # 0xab3f0
decl %eax
movslq %eax, %rsi
leaq -0x100(%rbp), %rdi
callq 0x31b50
movq -0x1d0(%rbp), %rdi
movq %rax, -0x180(%rbp)
leaq 0x6c16(%rip), %rsi      # 0x21780
leaq -0x180(%rbp), %rdx
callq 0x31bf0
jmp 0x1ab78
movq -0x1d0(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x31b80
jmp 0x1ab9b
jmp 0x1abbf
movq -0x1d0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
movl $0x8, %esi
callq 0xa600
jmp 0x1ad55
movl 0x9082b(%rip), %eax     # 0xab3f0
decl %eax
movslq %eax, %rsi
leaq -0xe0(%rbp), %rdi
callq 0x31cb0
movq (%rax), %rdi
callq 0xab50
jmp 0x1abe0
leaq 0x6eab9(%rip), %rdi     # 0x896a0
xorl %eax, %eax
movl %eax, %esi
callq 0xa1b0
jmp 0x1abf2
movq 0x8d3f7(%rip), %rdi     # 0xa7ff0
leaq 0x71bb3(%rip), %rsi     # 0x8c7b3
callq 0xa5d0
movq %rax, -0x1d8(%rbp)
jmp 0x1ac0e
movq -0x1d8(%rbp), %rdi
movl -0x12c(%rbp), %esi
callq 0xab40
movq %rax, -0x1e0(%rbp)
jmp 0x1ac29
movq -0x1e0(%rbp), %rdi
leaq 0x71b81(%rip), %rsi     # 0x8c7b8
callq 0xa5d0
movq %rax, -0x1e8(%rbp)
jmp 0x1ac45
movq -0x1e8(%rbp), %rdi
movl 0x9079e(%rip), %esi     # 0xab3f0
callq 0xab40
movq %rax, -0x1f0(%rbp)
jmp 0x1ac60
movq -0x1f0(%rbp), %rdi
movq 0x8d2fa(%rip), %rsi     # 0xa7f68
callq 0xa640
jmp 0x1ac75
jmp 0x1ac77
movl -0x158(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x158(%rbp)
movl $0x0, -0x184(%rbp)
cmpl $0xa, -0x184(%rbp)
jge 0x1acb8
movl $0x1, %edi
callq 0xa450
jmp 0x1aca5
jmp 0x1aca7
movl -0x184(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x184(%rbp)
jmp 0x1ac90
jmp 0x1a9cd
jmp 0x1acbf
jmp 0x1acc1
leaq -0x104(%rbp), %rdi
callq 0x31ce0
cmpl 0x9071d(%rip), %eax     # 0xab3f0
jge 0x1ace9
leaq 0x6e9d4(%rip), %rdi     # 0x896b0
xorl %eax, %eax
movl %eax, %esi
callq 0xa1b0
jmp 0x1ace7
jmp 0x1acc1
testb $0x1, 0x9070c(%rip)     # 0xab3fc
je 0x1ad0c
leaq 0x904ef(%rip), %rdi     # 0xab1e8
callq 0xa210
movq %rax, %rdi
movl -0x12c(%rbp), %esi
callq 0x11ac0
leaq -0x128(%rbp), %rdi
callq 0x27490
cmpq $0x0, -0x88(%rbp)
je 0x1ad66
movq -0x88(%rbp), %rax
movq %rax, -0x1f8(%rbp)
cmpq $0x0, %rax
je 0x1ad53
movq -0x1f8(%rbp), %rdi
callq 0x31d60
movq -0x1f8(%rbp), %rdi
movl $0x568, %esi            # imm = 0x568
callq 0xa600
jmp 0x1ad66
leaq -0x128(%rbp), %rdi
callq 0x27490
jmp 0x1ae1b
movl $0x0, -0x188(%rbp)
movl -0x188(%rbp), %eax
movl 0x90674(%rip), %ecx     # 0xab3f0
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1adf4
movslq -0x188(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x31cb0
cmpq $0x0, (%rax)
je 0x1adde
movslq -0x188(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x31cb0
movq (%rax), %rax
movq %rax, -0x200(%rbp)
cmpq $0x0, %rax
je 0x1addc
movq -0x200(%rbp), %rdi
callq 0x31e90
movq -0x200(%rbp), %rdi
movl $0x8, %esi
callq 0xa600
jmp 0x1adde
jmp 0x1ade0
movl -0x188(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x188(%rbp)
jmp 0x1ad70
leaq -0x100(%rbp), %rdi
callq 0x31ec0
leaq -0xe0(%rbp), %rdi
callq 0x31ee0
movq -0xb8(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
leaq -0x100(%rbp), %rdi
callq 0x31ec0
leaq -0xe0(%rbp), %rdi
callq 0x31ee0
movq -0x58(%rbp), %rdi
callq 0xab60
nopl (%rax)