// File: BenLangmead[P]bowtie/./hit.h
// Function: HitSink::reorder(unsigned long, bool)
void reorder(size_t threadId, bool force) {
		COND_LOCK_T<COND_MUTEX_T> l(reorder_mutex_);
		size_t last_batch_flushed = next_batch_to_flush_;
		if (next_batch_to_flush_ == reorderInfo_[threadId].batchId || force) {
			if (!force) {
				out_.writeString(ptBufs_[threadId]);
				next_batch_to_flush_ += 1;
				reorderInfo_[threadId].flushed = true;
			}
			for (size_t i = 0; i < reorderInfo_.size();) {
				if (reorderInfo_[i].batchId == next_batch_to_flush_ &&
				    (reorderInfo_[i].waiting  || force)) {
					out_.writeString(ptBufs_[i]);
					reorderInfo_[i].flushed = true;
					next_batch_to_flush_ += 1;
					i = 0; // we may have skipped over a flushable batch
				} else
					i++;
			}
			if (next_batch_to_flush_ - last_batch_flushed > 1)
				output_cond.notify_all();
		} else {
			reorderInfo_[threadId].waiting = true;
			while (!reorderInfo_[threadId].flushed) {
				output_cond.wait(reorder_mutex_);
			}
			reorderInfo_[threadId].waiting = false;
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x58(%rbp)
addq $0xa0, %rsi
leaq -0x28(%rbp), %rdi
callq 0x2f410
movq -0x58(%rbp), %rdi
movq 0x70(%rdi), %rax
movq %rax, -0x30(%rbp)
movq 0x70(%rdi), %rax
movq %rax, -0x50(%rbp)
addq $0x80, %rdi
movq -0x10(%rbp), %rsi
callq 0x2d3f0
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq (%rcx), %rax
je 0x2f1ac
testb $0x1, -0x11(%rbp)
je 0x2f31f
testb $0x1, -0x11(%rbp)
jne 0x2f219
movq -0x58(%rbp), %rdi
movq 0x8(%rdi), %rax
movq %rax, -0x60(%rbp)
addq $0x28, %rdi
movq -0x10(%rbp), %rsi
callq 0x2ed00
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x2ed20
jmp 0x2f1d9
movq -0x58(%rbp), %rdi
movq 0x70(%rdi), %rax
addq $0x1, %rax
movq %rax, 0x70(%rdi)
addq $0x80, %rdi
movq -0x10(%rbp), %rsi
callq 0x2d3f0
movb $0x1, 0x8(%rax)
jmp 0x2f219
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2f590
jmp 0x2f39e
movq $0x0, -0x48(%rbp)
movq -0x58(%rbp), %rdi
movq -0x48(%rbp), %rax
movq %rax, -0x70(%rbp)
subq $-0x80, %rdi
callq 0x2f450
movq %rax, -0x68(%rbp)
jmp 0x2f23c
movq -0x70(%rbp), %rax
movq -0x68(%rbp), %rcx
cmpq %rcx, %rax
jae 0x2f2fb
movq -0x58(%rbp), %rdi
addq $0x80, %rdi
movq -0x48(%rbp), %rsi
callq 0x2d3f0
movq -0x58(%rbp), %rcx
movq (%rax), %rax
cmpq 0x70(%rcx), %rax
jne 0x2f2ea
movq -0x58(%rbp), %rdi
addq $0x80, %rdi
movq -0x48(%rbp), %rsi
callq 0x2d3f0
testb $0x1, 0x9(%rax)
jne 0x2f28e
testb $0x1, -0x11(%rbp)
je 0x2f2ea
movq -0x58(%rbp), %rdi
movq 0x8(%rdi), %rax
movq %rax, -0x78(%rbp)
addq $0x28, %rdi
movq -0x48(%rbp), %rsi
callq 0x2ed00
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0x2ed20
jmp 0x2f2b5
movq -0x58(%rbp), %rdi
addq $0x80, %rdi
movq -0x48(%rbp), %rsi
callq 0x2d3f0
movq %rax, %rcx
movq -0x58(%rbp), %rax
movb $0x1, 0x8(%rcx)
movq 0x70(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x70(%rax)
movq $0x0, -0x48(%rbp)
jmp 0x2f2f6
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2f221
movq -0x58(%rbp), %rax
movq 0x70(%rax), %rax
subq -0x30(%rbp), %rax
cmpq $0x1, %rax
jbe 0x2f31d
movq -0x58(%rbp), %rdi
addq $0xc8, %rdi
callq 0x2f470
jmp 0x2f38c
movq -0x58(%rbp), %rdi
addq $0x80, %rdi
movq -0x10(%rbp), %rsi
callq 0x2d3f0
movb $0x1, 0x9(%rax)
movq -0x58(%rbp), %rdi
addq $0x80, %rdi
movq -0x10(%rbp), %rsi
callq 0x2d3f0
movb 0x8(%rax), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x2f356
jmp 0x2f374
movq -0x58(%rbp), %rsi
movq %rsi, %rdi
addq $0xc8, %rdi
addq $0xa0, %rsi
callq 0x2f4c0
jmp 0x2f372
jmp 0x2f337
movq -0x58(%rbp), %rdi
addq $0x80, %rdi
movq -0x10(%rbp), %rsi
callq 0x2d3f0
movb $0x0, 0x9(%rax)
leaq -0x28(%rbp), %rdi
callq 0x2f590
addq $0x80, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0xab60
nopw (%rax,%rax)