// File: /workspace/github_c_makefile_star2_O0/lh3[P]pre-pe/pre-lianti.c
// Function: worker_pipeline
static void *worker_pipeline(void *shared, int step, void *_data)
{
	int i;
	lt_global_t *g = (lt_global_t*)shared;
	if (step == 0) {
		data_for_t *ret;
		ret = calloc(1, sizeof(data_for_t));
		ret->seqs = bseq_read(g->ks, g->opt.chunk_size, &ret->n_seqs);
		assert((ret->n_seqs&1) == 0);
		ret->g = g;
		if (ret->seqs) return ret;
		else free(ret);
	} else if (step == 1) {
		data_for_t *data = (data_for_t*)_data;
		kt_for(g->opt.n_threads, worker_for, data, data->n_seqs>>1);
		return data;
	} else if (step == 2) {
		data_for_t *data = (data_for_t*)_data;
		if (g->opt.tab_out) { // tabular output
			for (i = 0; i < data->n_seqs; i += 2) {
				bseq1_t *s = &data->seqs[i];
				printf("%s\t%d\n", s->name, s->type);
			}
		} else { // FASTQ output (FASTA not supported yet)
			for (i = 0; i < data->n_seqs; ++i) {
				bseq1_t *s = &data->seqs[i];
				if (s->l_seq > 0 && (s->type == LT_NO_MERGE || s->type == LT_AMBI_MERGE || s->type == LT_MERGED || s->type == LT_NO_BINDING)) {
					putchar(s->qual? '@' : '>'); fputs(s->name, stdout);
					if (s->type != LT_MERGED) {
						putchar('/'); putchar("12"[i&1]);
					}
					printf(" YT:i:%d", s->type);
					if (s->type == LT_NO_MERGE || s->type == LT_AMBI_MERGE || s->type == LT_MERGED) {
						if (s->bc) { fputs("\tBC:Z:", stdout); fputs(s->bc[0] == 0? "*" : s->bc, stdout); }
						printf("\tYD:i:%d", s->dbl_bind);
					}
					putchar('\n');
					puts(s->seq);
					if (s->qual) { puts("+"); puts(s->qual); }
				}
			}
		}
		for (i = 0; i < data->n_seqs; ++i) { // deallocate
			bseq1_t *s = &data->seqs[i];
			free(s->bc); free(s->seq); free(s->qual); free(s->name);
		}
		free(data->seqs); free(data);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x5dbc
movl $0x1, %edi
movl $0x18, %esi
callq 0x2120
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x38(%rbp), %rdx
callq 0x3900
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x5d6b
jmp 0x5d8a
leaq 0x146e(%rip), %rdi      # 0x71e0
leaq 0x147c(%rip), %rsi      # 0x71f5
movl $0x249, %edx            # imm = 0x249
leaq 0x147d(%rip), %rcx      # 0x7202
callq 0x20f0
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x5dae
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x60b9
movq -0x38(%rbp), %rdi
callq 0x2040
jmp 0x60b1
cmpl $0x1, -0x14(%rbp)
jne 0x5df8
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %edi
movq -0x40(%rbp), %rdx
movq -0x40(%rbp), %rax
movl (%rax), %eax
sarl %eax
movslq %eax, %rcx
leaq 0xd2a(%rip), %rsi       # 0x6b10
callq 0x2380
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x60b9
cmpl $0x2, -0x14(%rbp)
jne 0x60ad
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
je 0x5e6a
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x5e65
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x50(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0x13da(%rip), %rdi      # 0x722d
movb $0x0, %al
callq 0x20d0
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0x5e1b
jmp 0x602f
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x602d
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x0, %eax
jle 0x601d
movq -0x58(%rbp), %rax
cmpl $0x16, 0x4(%rax)
je 0x5ed7
movq -0x58(%rbp), %rax
cmpl $0x17, 0x4(%rax)
je 0x5ed7
movq -0x58(%rbp), %rax
cmpl $0x15, 0x4(%rax)
je 0x5ed7
movq -0x58(%rbp), %rax
cmpl $0x3, 0x4(%rax)
jne 0x601d
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rcx
movl $0x3e, %edi
movl $0x40, %eax
cmpq $0x0, %rcx
cmovnel %eax, %edi
callq 0x2050
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x30bc(%rip), %rax      # 0x8fc0
movq (%rax), %rsi
callq 0x2100
movq -0x58(%rbp), %rax
cmpl $0x15, 0x4(%rax)
je 0x5f39
movl $0x2f, %edi
callq 0x2050
movl -0x24(%rbp), %eax
andl $0x1, %eax
movslq %eax, %rcx
leaq 0x1304(%rip), %rax      # 0x7234
movsbl (%rax,%rcx), %edi
callq 0x2050
movq -0x58(%rbp), %rax
movl 0x4(%rax), %esi
leaq 0x12f0(%rip), %rdi      # 0x7237
movb $0x0, %al
callq 0x20d0
movq -0x58(%rbp), %rax
cmpl $0x16, 0x4(%rax)
je 0x5f6c
movq -0x58(%rbp), %rax
cmpl $0x17, 0x4(%rax)
je 0x5f6c
movq -0x58(%rbp), %rax
cmpl $0x15, 0x4(%rax)
jne 0x5fe0
movq -0x58(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x5fc9
movq 0x3042(%rip), %rax      # 0x8fc0
movq (%rax), %rsi
leaq 0x12b8(%rip), %rdi      # 0x7240
callq 0x2100
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x5faa
leaq 0x12a3(%rip), %rax      # 0x7247
movq %rax, -0x68(%rbp)
jmp 0x5fb6
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
movq 0x2fff(%rip), %rax      # 0x8fc0
movq (%rax), %rsi
callq 0x2100
movq -0x58(%rbp), %rax
movl (%rax), %esi
shrl $0x1f, %esi
leaq 0x1270(%rip), %rdi      # 0x7249
movb $0x0, %al
callq 0x20d0
movl $0xa, %edi
callq 0x2050
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2090
movq -0x58(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x601b
leaq 0x1249(%rip), %rdi      # 0x7252
callq 0x2090
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2090
jmp 0x601d
jmp 0x601f
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x5e71
jmp 0x602f
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x6097
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2040
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2040
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2040
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2040
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x6036
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2040
movq -0x48(%rbp), %rdi
callq 0x2040
jmp 0x60af
jmp 0x60b1
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)