// File: /workspace/github_cpp_makefile_star2_O3/BenLangmead[P]bowtie/./aligner.h
// Function: MixedMultiAligner::run(bool, int)
void run(bool verbose = false, int tid = -1) {
#ifdef PER_THREAD_TIMING
		uint64_t ncpu_changeovers = 0;
		uint64_t nnuma_changeovers = 0;

		int current_cpu = 0, current_node = 0;
		get_cpu_and_node(current_cpu, current_node);

		std::stringstream ss;
		std::string msg;
		ss << "thread: " << tid << " time: ";
		msg = ss.str();
		Timer timer(std::cout, msg.c_str());
#endif
		bool first = true;
		bool saw_last_read = false;
		if(n_ == 1) {
			Aligner *al = seOrPe_[0] ? (*alignersSE_)[0] : (*alignersPE_)[0];
			PatternSourcePerThread *ps = (*patsrcs_)[0];
			while(true) {
#ifdef PER_THREAD_TIMING
				int cpu = 0, node = 0;
				get_cpu_and_node(cpu, node);
				if(cpu != current_cpu) {
					ncpu_changeovers++;
					current_cpu = cpu;
				}
				if(node != current_node) {
					nnuma_changeovers++;
					current_node = node;
				}
#endif
				if(!first && !al->done) {
					// Advance an aligner already in progress; this is
					// the common case
					al->advance();
				} else {
					if(saw_last_read) {
						break;
					}
					// Get a new read
					pair<bool, bool> ret = ps->nextReadPair();
					saw_last_read = ret.second;
					if(ret.first && ps->rdid() < qUpto_) {
						if(ps->paired()) {
							// Read currently in buffer is paired-end
							(*alignersPE_)[0]->setQuery(ps);
							al = (*alignersPE_)[0];
							seOrPe_[0] = false; // false -> paired
						} else {
							// Read currently in buffer is single-end
							(*alignersSE_)[0]->setQuery(ps);
							al = (*alignersSE_)[0];
							seOrPe_[0] = true; // true = unpaired
						}
					} else if (ret.first) {
						break;
					}
				}
				first = false;
			}
		} else {
			while(true) {
#ifdef PER_THREAD_TIMING
				int cpu = 0, node = 0;
				get_cpu_and_node(cpu, node);
				if(cpu != current_cpu) {
					ncpu_changeovers++;
					current_cpu = cpu;
				}
				if(node != current_node) {
					nnuma_changeovers++;
					current_node = node;
				}
#endif
				bool saw_last_read = false;
				for(uint32_t i = 0; i < n_; i++) {
					Aligner *al = seOrPe_[i] ? (*alignersSE_)[i] :
											   (*alignersPE_)[i];
					if(!first && !al->done) {
						// Advance an aligner already in progress; this is
						// the common case
						al->advance();
					} else {
						if(saw_last_read) {
							break;
						}
						// Feed a new read to a vacant aligner
						PatternSourcePerThread *ps = (*patsrcs_)[i];
						// Get a new read
						pair<bool, bool> ret = ps->nextReadPair();
						saw_last_read = ret.second;
						if (ret.first && ps->rdid() < qUpto_) {
							if(ps->paired()) {
								// Read currently in buffer is paired-end
								(*alignersPE_)[i]->setQuery(ps);
								seOrPe_[i] = false; // false -> paired
							} else {
								// Read currently in buffer is single-end
								(*alignersSE_)[i]->setQuery(ps);
								seOrPe_[i] = true; // true = unpaired
							}
						} else if (ret.first) {
							break;
						}
					}
				}
				first = false;
			}
		}
#ifdef PER_THREAD_TIMING
		ss.str("");
		ss.clear();
		ss << "thread: " << tid << " cpu_changeovers: " << ncpu_changeovers << std::endl
		   << "thread: " << tid << " node_changeovers: " << nnuma_changeovers << std::endl;
		std::cout << ss.str();
#endif
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x8(%rdi), %eax
cmpl $0x1, %eax
jne 0x232fe
movq 0x38(%rbx), %rax
movq 0x40(%rbx), %rcx
movzbl (%rax), %eax
xorl $0x1, %eax
movq 0x28(%rbx,%rax,8), %rax
movq 0x8(%rax), %rax
movq (%rax), %r15
movq 0x8(%rcx), %rax
movq (%rax), %r14
movb $0x1, %cl
xorl %ebp, %ebp
testb $0x1, %cl
je 0x232bf
testb $0x1, %bpl
jne 0x233f0
movq %r14, %rdi
callq 0x4aeaa
movl %eax, %ebp
shrl $0x8, %ebp
andl $0x1, %ebp
xorl %ecx, %ecx
testb $0x1, %al
je 0x23244
movq 0x50(%r14), %rax
movq 0x58(%r14), %rcx
addq %rax, %rcx
movl 0xc(%rbx), %edx
cmpq %rdx, %rcx
jae 0x233f0
movq 0x38(%r14), %rcx
imulq $0x268, %rax, %rax      # imm = 0x268
cmpb $0x1, 0x190(%rcx,%rax)
jne 0x232d1
movq 0x30(%rbx), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
movq 0x30(%rbx), %rax
movq 0x38(%rbx), %rcx
movq 0x8(%rax), %rax
movq (%rax), %r15
movb $0x0, (%rcx)
xorl %ecx, %ecx
jmp 0x23244
cmpb $0x0, 0x8(%r15)
jne 0x23249
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
jmp 0x232bf
movq 0x28(%rbx), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
movq 0x28(%rbx), %rax
movq 0x38(%rbx), %rcx
movq 0x8(%rax), %rax
movq (%rax), %r15
movb $0x1, (%rcx)
xorl %ecx, %ecx
jmp 0x23244
movb $0x1, %cl
movl %eax, %edx
movl %ecx, %ebp
xorl %ecx, %ecx
testl %edx, %edx
movl $0x0, %edx
je 0x23302
xorl %r15d, %r15d
xorl %r12d, %r12d
testb $0x1, %bpl
jne 0x2333a
movq 0x38(%rbx), %rcx
movzbl (%rcx,%r15), %ecx
xorl $0x1, %ecx
movq 0x28(%rbx,%rcx,8), %rcx
movq 0x8(%rcx), %rcx
movq (%rcx,%r15,8), %rdi
cmpb $0x0, 0x8(%rdi)
je 0x233af
testb $0x1, %r12b
jne 0x233e9
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rax
movq (%rax,%r15,8), %r14
movq %r14, %rdi
callq 0x4aeaa
movl %eax, %r12d
shrl $0x8, %r12d
andl $0x1, %r12d
testb $0x1, %al
je 0x233d5
movq 0x50(%r14), %rax
movq 0x58(%r14), %rcx
addq %rax, %rcx
movl 0xc(%rbx), %edx
cmpq %rdx, %rcx
jae 0x233e6
movq 0x38(%r14), %rcx
imulq $0x268, %rax, %rax      # imm = 0x268
cmpb $0x1, 0x190(%rcx,%rax)
jne 0x233b7
movq 0x30(%rbx), %rax
movq 0x8(%rax), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
movq 0x38(%rbx), %rax
movb $0x0, (%rax,%r15)
jmp 0x233d5
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x233d5
movq 0x28(%rbx), %rax
movq 0x8(%rax), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
movq 0x38(%rbx), %rax
movb $0x1, (%rax,%r15)
incq %r15
movl 0x8(%rbx), %eax
cmpq %rax, %r15
jb 0x23315
jmp 0x233e9
movl 0x8(%rbx), %eax
xorl %ecx, %ecx
jmp 0x23300
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop