// File: BenLangmead[P]bowtie/ebwt_search.cpp
// Function: seededQualCutoffSearchFull(int, int, int, PatternComposer&, HitSink&, Ebwt&, Ebwt&, EList<SString<char>, 128>&)
static void seededQualCutoffSearchFull(
        int seedLen,                    /// length of seed (not a maq option)
        int qualCutoff,                 /// maximum sum of mismatch qualities
                                        /// like maq map's -e option
                                        /// default: 70
        int seedMms,                    /// max # mismatches allowed in seed
                                        /// (like maq map's -n option)
                                        /// Can only be 1 or 2, default: 1
        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)
{
	// Global intialization
	assert_leq(seedMms, 3);

	seededQualSearch_patsrc   = &_patsrc;
	seededQualSearch_sink     = &_sink;
	seededQualSearch_ebwtFw   = &ebwtFw;
	seededQualSearch_ebwtBw   = &ebwtBw;
	seededQualSearch_os       = &os;
	seededQualSearch_doneMask = NULL;
	seededQualSearch_hitMask  = NULL;
	seededQualSearch_pamFw    = NULL;
	seededQualSearch_pamRc    = NULL;
	seededQualSearch_qualCutoff = qualCutoff;

	// 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;
	}
	seededQualSearch_refs = refs;

	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

	SWITCH_TO_FW_INDEX();
	assert(!ebwtBw.isInMemory());
	{
		// Load the other half of the index into memory
		Timer _t(cerr, "Time loading mirror index: ", timing);
		ebwtBw.loadIntoMemory(-1, !noRefNames, startVerbose);
	}
	CHUD_START();
	{
		// Phase 1: Consider cases 1R and 2R
		Timer _t(cerr, "Seeded quality 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) {
					seededQualSearchWorkerFullStateful((void*)&tps[i]);
				} else {
					seededQualSearchWorkerFull((void*)&tps[i]);
				}
			}
			else {
				if(stateful) {
					threads.push_back(new std::thread(seededQualSearchWorkerFullStateful, (void*)&tps[i]));
				} else {
					threads.push_back(new std::thread(seededQualSearchWorkerFull, (void*)&tps[i]));
				}
				threads[i]->detach();
				SLEEP(10);
		    }
#else
			if (i == nthreads - 1) {
				if(stateful) {
					seededQualSearchWorkerFullStateful((void*)(tids + i));
				} else {
					seededQualSearchWorkerFull((void*)(tids + i));
				}
			}
			else {
				if(stateful) {
					threads.push_back(new tthread::thread(seededQualSearchWorkerFullStateful, (void *)(tids + i)));
				} else {
					threads.push_back(new tthread::thread(seededQualSearchWorkerFull, (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 - 1;
#if (__cplusplus >= 201103L)
					tps[nthreads-1].tid = nthreads - 1;
					tps[nthreads-1].done = &all_threads_done;
					if(stateful) {
						threads.push_back(new std::thread(seededQualSearchWorkerFullStateful, (void*)&tps[nthreads-1]));
					} else {
						threads.push_back(new std::thread(seededQualSearchWorkerFull, (void*)&tps[nthreads-1]));
					}
					threads[nthreads-1]->detach();
					SLEEP(10);
#else
					if(stateful) {
						threads.push_back(new tthread::thread(seededQualSearchWorkerFullStateful, (void *)(tids + nthreads - 1)));
					} else {
						threads.push_back(new tthread::thread(seededQualSearchWorkerFull, (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];
		}
	}

	ebwtBw.evictFromMemory();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, 0x9299d(%rip)     # 0xab490
movq -0x20(%rbp), %rax
movq %rax, 0x9299a(%rip)     # 0xab498
movq -0x28(%rbp), %rax
movq %rax, 0x92997(%rip)     # 0xab4a0
movq 0x10(%rbp), %rax
movq %rax, 0x92994(%rip)     # 0xab4a8
movq 0x18(%rbp), %rax
movq %rax, 0x92991(%rip)     # 0xab4b0
movq $0x0, 0x9298e(%rip) # 0xab4b8
movq $0x0, 0x9298b(%rip) # 0xab4c0
movq $0x0, 0x92988(%rip) # 0xab4c8
movq $0x0, 0x92985(%rip) # 0xab4d0
movl -0x8(%rbp), %eax
movl %eax, 0x92984(%rip)     # 0xab4d8
movq $0x0, -0x30(%rbp)
leaq 0x925dd(%rip), %rdi     # 0xab140
callq 0x26400
movq %rax, %rcx
movb $0x1, %al
cmpq $0x0, %rcx
movb %al, -0x181(%rbp)
ja 0x18b92
leaq 0x92600(%rip), %rdi     # 0xab180
callq 0x26400
cmpq $0x0, %rax
seta %al
movb %al, -0x181(%rbp)
movb -0x181(%rbp), %al
andb $0x1, %al
movb %al, -0x31(%rbp)
testb $0x1, -0x31(%rbp)
je 0x18d0a
cmpl $-0x1, 0x92892(%rip)    # 0xab440
jae 0x18d0a
movl 0x927e2(%rip), %eax     # 0xab39c
testl %eax, %eax
setne %al
movzbl %al, %ecx
movq 0x8f427(%rip), %rsi     # 0xa7ff0
leaq 0x73b6e(%rip), %rdx     # 0x8c73e
leaq -0x58(%rbp), %rdi
callq 0x273f0
movl $0x568, %edi            # imm = 0x568
callq 0xa5f0
movq %rax, -0x190(%rbp)
jmp 0x18bec
movq -0x190(%rbp), %rdi
movl 0x927af(%rip), %eax     # 0xab3a8
testl %eax, %eax
setne %al
movq 0x18(%rbp), %r8
movzbl 0x92822(%rip), %edx     # 0xab42b
movzbl 0x9281a(%rip), %esi     # 0xab42a
movzbl 0x92814(%rip), %r9d     # 0xab42c
movzbl 0x92780(%rip), %r10d    # 0xab3a0
movzbl 0x92760(%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 0x9253d(%rip), %rsi     # 0xab1a0
xorl %r9d, %r9d
movl %r9d, %ecx
callq 0x2fe70
addq $0x30, %rsp
jmp 0x18c74
movq -0x190(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x31950
movb %al, -0x191(%rbp)
jmp 0x18c90
movb -0x191(%rbp), %al
testb $0x1, %al
jne 0x18cf1
jmp 0x18c9c
movl $0x4, %edi
callq 0xa290
movq %rax, %rdi
movl $0x1, (%rdi)
movq 0x8f29a(%rip), %rsi     # 0xa7f50
xorl %eax, %eax
movl %eax, %edx
callq 0xab10
jmp 0x1975a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x18cfc
movq -0x190(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl $0x568, %esi            # imm = 0x568
callq 0xa600
jmp 0x18cfc
leaq -0x58(%rbp), %rdi
callq 0x27490
jmp 0x18d0a
leaq -0x58(%rbp), %rdi
callq 0x27490
jmp 0x19751
movq -0x30(%rbp), %rax
movq %rax, 0x927cb(%rip)     # 0xab4e0
leaq 0x926d4(%rip), %rdi     # 0xab3f0
leaq 0x926d5(%rip), %rsi     # 0xab3f8
callq 0x31970
movl (%rax), %eax
movq %rsp, %rcx
movq %rcx, -0x70(%rbp)
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x1a0(%rbp)
movq %rcx, %rsp
movq %rax, -0x78(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x319b0
leaq -0xb8(%rbp), %rdi
callq 0x319f0
jmp 0x18d6b
leaq 0x9267e(%rip), %rdi     # 0xab3f0
leaq 0x9267f(%rip), %rsi     # 0xab3f8
callq 0x31970
movq %rax, -0x1a8(%rbp)
jmp 0x18d87
movq -0x1a8(%rbp), %rax
movslq (%rax), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x31a30
jmp 0x18d9f
leaq -0xbc(%rbp), %rdi
xorl %esi, %esi
callq 0x31ab0
movq 0x10(%rbp), %rdi
callq 0x27d10
testb $0x1, %al
jne 0x18dbc
jmp 0x18de9
movq 0x10(%rbp), %rdi
callq 0x29140
jmp 0x18de9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x19745
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x19739
movq -0x28(%rbp), %rdi
callq 0x27d10
testb $0x1, %al
jne 0x18e73
movl 0x925a0(%rip), %eax     # 0xab39c
testl %eax, %eax
setne %al
movzbl %al, %ecx
movq 0x8f1e5(%rip), %rsi     # 0xa7ff0
leaq 0x73945(%rip), %rdx     # 0x8c757
leaq -0xe0(%rbp), %rdi
callq 0x273f0
jmp 0x18e20
movq -0x28(%rbp), %rdi
movb 0x925da(%rip), %al      # 0xab404
notb %al
movzbl 0x92555(%rip), %ecx     # 0xab388
andl $0x1, %ecx
movzbl %al, %edx
andl $0x1, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x290f0
jmp 0x18e48
leaq -0xe0(%rbp), %rdi
callq 0x27490
jmp 0x18e73
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x27490
jmp 0x19739
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
jmp 0x18e82
movl 0x92514(%rip), %eax     # 0xab39c
testl %eax, %eax
setne %al
movzbl %al, %ecx
movq 0x8f159(%rip), %rsi     # 0xa7ff0
leaq 0x738d6(%rip), %rdx     # 0x8c774
leaq -0x100(%rbp), %rdi
callq 0x273f0
jmp 0x18eac
movq 0x10(%rbp), %rdi
movb 0x9254e(%rip), %al      # 0xab404
notb %al
movzbl 0x924c9(%rip), %ecx     # 0xab388
andl $0x1, %ecx
movzbl %al, %edx
andl $0x1, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x290f0
jmp 0x18ed4
leaq -0x100(%rbp), %rdi
callq 0x27490
movl 0x924b6(%rip), %eax     # 0xab39c
testl %eax, %eax
setne %al
movzbl %al, %ecx
movq 0x8f0fb(%rip), %rsi     # 0xa7ff0
leaq 0x73894(%rip), %rdx     # 0x8c790
leaq -0x120(%rbp), %rdi
callq 0x273f0
jmp 0x18f0a
movl $0x0, -0x124(%rbp)
testb $0x1, 0x924e1(%rip)     # 0xab3fc
je 0x18f82
callq 0xa910
movl %eax, -0x124(%rbp)
leaq 0x922b9(%rip), %rdi     # 0xab1e8
callq 0xa210
movq %rax, %rdi
movl -0x124(%rbp), %esi
callq 0x1c7c0
jmp 0x18f44
leaq 0x92411(%rip), %rdi     # 0xab35c
xorl %esi, %esi
callq 0x31ab0
jmp 0x18f82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x27490
jmp 0x19739
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x19649
movl $0x0, -0x128(%rbp)
movl -0x128(%rbp), %eax
cmpl 0x92458(%rip), %eax     # 0xab3f0
jge 0x19233
movq -0x1a0(%rbp), %rax
movslq -0x128(%rbp), %rcx
movl %ecx, %edx
movl %edx, (%rax,%rcx,4)
movslq -0x128(%rbp), %rsi
movl (%rax,%rsi,4), %eax
movl %eax, -0x1b4(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x31b50
movq %rax, -0x1b0(%rbp)
jmp 0x18fd6
movq -0x1b0(%rbp), %rax
movl -0x1b4(%rbp), %ecx
movl %ecx, (%rax)
movslq -0x128(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x31b50
movq %rax, -0x1c0(%rbp)
jmp 0x19001
movq -0x1c0(%rbp), %rax
leaq -0xbc(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0x128(%rbp), %eax
movl 0x923d1(%rip), %ecx     # 0xab3f0
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1908c
testb $0x1, 0x92400(%rip)     # 0xab42d
je 0x1905b
movslq -0x128(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x31b50
movq %rax, -0x1c8(%rbp)
jmp 0x1904b
movq -0x1c8(%rbp), %rdi
callq 0x1c870
jmp 0x19059
jmp 0x19087
movslq -0x128(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x31b50
movq %rax, -0x1d0(%rbp)
jmp 0x19077
movq -0x1d0(%rbp), %rdi
callq 0x1d0b0
jmp 0x19085
jmp 0x19087
jmp 0x1921d
testb $0x1, 0x9239a(%rip)     # 0xab42d
je 0x1913c
movl $0x8, %edi
callq 0xa5f0
movq %rax, -0x1d8(%rbp)
jmp 0x190ac
movslq -0x128(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x31b50
movq %rax, -0x1e0(%rbp)
jmp 0x190c8
movq -0x1d8(%rbp), %rdi
movq -0x1e0(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq 0x378c(%rip), %rsi      # 0x1c870
leaq -0x138(%rbp), %rdx
callq 0x31bf0
jmp 0x190f2
movq -0x1d8(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x31b80
jmp 0x19115
jmp 0x191dc
movq -0x1d8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl $0x8, %esi
callq 0xa600
jmp 0x19649
movl $0x8, %edi
callq 0xa5f0
movq %rax, -0x1e8(%rbp)
jmp 0x1914f
movslq -0x128(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x31b50
movq %rax, -0x1f0(%rbp)
jmp 0x1916b
movq -0x1e8(%rbp), %rdi
movq -0x1f0(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq 0x3f29(%rip), %rsi      # 0x1d0b0
leaq -0x148(%rbp), %rdx
callq 0x31bf0
jmp 0x19195
movq -0x1e8(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x31b80
jmp 0x191b8
jmp 0x191dc
movq -0x1e8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl $0x8, %esi
callq 0xa600
jmp 0x19649
movslq -0x128(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x31cb0
movq %rax, -0x1f8(%rbp)
jmp 0x191f8
movq -0x1f8(%rbp), %rax
movq (%rax), %rdi
callq 0xab50
jmp 0x19209
leaq 0x70420(%rip), %rdi     # 0x89630
xorl %eax, %eax
movl %eax, %esi
callq 0xa1b0
jmp 0x1921b
jmp 0x1921d
jmp 0x1921f
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x18f8c
testb $0x1, 0x921c2(%rip)     # 0xab3fc
je 0x195b9
movl 0x921aa(%rip), %eax     # 0xab3f0
movl %eax, -0x14c(%rbp)
movl $0x1, -0x150(%rbp)
movl $0x0, -0x154(%rbp)
cmpl $0xa, -0x154(%rbp)
jge 0x19288
movl $0x1, %edi
callq 0xa450
jmp 0x19275
jmp 0x19277
movl -0x154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
jmp 0x19260
jmp 0x1928a
leaq 0x920cb(%rip), %rdi     # 0xab35c
callq 0x31ce0
cmpl $0x0, %eax
jle 0x195b7
movl -0x124(%rbp), %edi
movl -0x14c(%rbp), %esi
callq 0x1f730
movb %al, -0x1f9(%rbp)
jmp 0x192b8
movb -0x1f9(%rbp), %al
testb $0x1, %al
jne 0x192c7
jmp 0x19571
movq -0x1a0(%rbp), %rax
movl 0x9211c(%rip), %ecx     # 0xab3f0
incl %ecx
movl %ecx, 0x92114(%rip)     # 0xab3f0
movl 0x9210e(%rip), %edx     # 0xab3f0
decl %edx
movslq %edx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x92100(%rip), %eax     # 0xab3f0
decl %eax
movl %eax, -0x20c(%rbp)
movslq %eax, %rsi
leaq -0xb8(%rbp), %rdi
callq 0x31b50
movq %rax, -0x208(%rbp)
jmp 0x19310
movq -0x208(%rbp), %rax
movl -0x20c(%rbp), %ecx
movl %ecx, (%rax)
movl 0x920cb(%rip), %eax     # 0xab3f0
decl %eax
movslq %eax, %rsi
leaq -0xb8(%rbp), %rdi
callq 0x31b50
movq %rax, -0x218(%rbp)
jmp 0x1933f
movq -0x218(%rbp), %rax
leaq -0xbc(%rbp), %rcx
movq %rcx, 0x8(%rax)
testb $0x1, 0x920d5(%rip)     # 0xab42d
je 0x19405
movl $0x8, %edi
callq 0xa5f0
movq %rax, -0x220(%rbp)
jmp 0x19371
movl 0x92079(%rip), %eax     # 0xab3f0
decl %eax
movslq %eax, %rsi
leaq -0xb8(%rbp), %rdi
callq 0x31b50
movq %rax, -0x228(%rbp)
jmp 0x19391
movq -0x220(%rbp), %rdi
movq -0x228(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq 0x34c3(%rip), %rsi      # 0x1c870
leaq -0x168(%rbp), %rdx
callq 0x31bf0
jmp 0x193bb
movq -0x220(%rbp), %rax
movq %rax, -0x160(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x31b80
jmp 0x193de
jmp 0x194a9
movq -0x220(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl $0x8, %esi
callq 0xa600
jmp 0x19649
movl $0x8, %edi
callq 0xa5f0
movq %rax, -0x230(%rbp)
jmp 0x19418
movl 0x91fd2(%rip), %eax     # 0xab3f0
decl %eax
movslq %eax, %rsi
leaq -0xb8(%rbp), %rdi
callq 0x31b50
movq %rax, -0x238(%rbp)
jmp 0x19438
movq -0x230(%rbp), %rdi
movq -0x238(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq 0x3c5c(%rip), %rsi      # 0x1d0b0
leaq -0x178(%rbp), %rdx
callq 0x31bf0
jmp 0x19462
movq -0x230(%rbp), %rax
movq %rax, -0x170(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x31b80
jmp 0x19485
jmp 0x194a9
movq -0x230(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl $0x8, %esi
callq 0xa600
jmp 0x19649
movl 0x91f41(%rip), %eax     # 0xab3f0
decl %eax
movslq %eax, %rsi
leaq -0x98(%rbp), %rdi
callq 0x31cb0
movq %rax, -0x240(%rbp)
jmp 0x194c9
movq -0x240(%rbp), %rax
movq (%rax), %rdi
callq 0xab50
jmp 0x194da
leaq 0x7015f(%rip), %rdi     # 0x89640
xorl %eax, %eax
movl %eax, %esi
callq 0xa1b0
jmp 0x194ec
movq 0x8eafd(%rip), %rdi     # 0xa7ff0
leaq 0x732b9(%rip), %rsi     # 0x8c7b3
callq 0xa5d0
movq %rax, -0x248(%rbp)
jmp 0x19508
movq -0x248(%rbp), %rdi
movl -0x124(%rbp), %esi
callq 0xab40
movq %rax, -0x250(%rbp)
jmp 0x19523
movq -0x250(%rbp), %rdi
leaq 0x73287(%rip), %rsi     # 0x8c7b8
callq 0xa5d0
movq %rax, -0x258(%rbp)
jmp 0x1953f
movq -0x258(%rbp), %rdi
movl 0x91ea4(%rip), %esi     # 0xab3f0
callq 0xab40
movq %rax, -0x260(%rbp)
jmp 0x1955a
movq -0x260(%rbp), %rdi
movq 0x8ea00(%rip), %rsi     # 0xa7f68
callq 0xa640
jmp 0x1956f
jmp 0x19571
movl -0x150(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x150(%rbp)
movl $0x0, -0x17c(%rbp)
cmpl $0xa, -0x17c(%rbp)
jge 0x195b2
movl $0x1, %edi
callq 0xa450
jmp 0x1959f
jmp 0x195a1
movl -0x17c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x17c(%rbp)
jmp 0x1958a
jmp 0x1928a
jmp 0x195b9
jmp 0x195bb
leaq -0xbc(%rbp), %rdi
callq 0x31ce0
cmpl 0x91e23(%rip), %eax     # 0xab3f0
jge 0x195e3
leaq 0x7007a(%rip), %rdi     # 0x89650
xorl %eax, %eax
movl %eax, %esi
callq 0xa1b0
jmp 0x195e1
jmp 0x195bb
testb $0x1, 0x91e12(%rip)     # 0xab3fc
je 0x19606
leaq 0x91bf5(%rip), %rdi     # 0xab1e8
callq 0xa210
movq %rax, %rdi
movl -0x124(%rbp), %esi
callq 0x11ac0
leaq -0x120(%rbp), %rdi
callq 0x27490
cmpq $0x0, -0x30(%rbp)
je 0x1965a
movq -0x30(%rbp), %rax
movq %rax, -0x268(%rbp)
cmpq $0x0, %rax
je 0x19647
movq -0x268(%rbp), %rdi
callq 0x31d60
movq -0x268(%rbp), %rdi
movl $0x568, %esi            # imm = 0x568
callq 0xa600
jmp 0x1965a
leaq -0x120(%rbp), %rdi
callq 0x27490
jmp 0x19739
movl $0x0, -0x180(%rbp)
movl -0x180(%rbp), %eax
movl 0x91d80(%rip), %ecx     # 0xab3f0
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1970c
movslq -0x180(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x31cb0
movq %rax, -0x270(%rbp)
jmp 0x19697
movq -0x270(%rbp), %rax
cmpq $0x0, (%rax)
je 0x196f6
movslq -0x180(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x31cb0
movq %rax, -0x278(%rbp)
jmp 0x196c0
movq -0x278(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x280(%rbp)
cmpq $0x0, %rax
je 0x196f4
movq -0x280(%rbp), %rdi
callq 0x31e90
movq -0x280(%rbp), %rdi
movl $0x8, %esi
callq 0xa600
jmp 0x196f6
jmp 0x196f8
movl -0x180(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x180(%rbp)
jmp 0x19664
movq 0x10(%rbp), %rdi
callq 0x29140
leaq -0xb8(%rbp), %rdi
callq 0x31ec0
leaq -0x98(%rbp), %rdi
callq 0x31ee0
movq -0x70(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
leaq -0xb8(%rbp), %rdi
callq 0x31ec0
leaq -0x98(%rbp), %rdi
callq 0x31ee0
movq -0x60(%rbp), %rdi
callq 0xab60
nopw (%rax,%rax)