// File: /workspace/github_c_makefile_star2_O0/lh3[P]pre-pe/pre-meta.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];
				bseq1_t *s_r = &data->seqs[i+1];        
				printf("%s\t%d\t%d\t%d\t%zd\t%zd\n", s->name, s->type, s->olig_pos_f, s->olig_pos_r, strlen(s->seq),strlen(s_r->seq));
			}
		} 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_MERGE_AMBIGUOUS || s->type == LT_MERGE_PARTIAL || s->type == LT_MERGE_COMPLETE || (s->type == LT_SHORT_PE && ~i&1)) ) {
					putchar(s->qual? '@' : '>'); fputs(s->name, stdout);
					if (s->type == LT_NO_MERGE || s->type == LT_MERGE_AMBIGUOUS) {
						putchar('/'); putchar("12"[i&1]);
					}
					printf(" YT:i:%d", s->type);
					if (s->bc_cat) { fputs("\tBC:Z:", stdout); fputs(s->bc_cat, stdout); }
					else fputs("\tBC:Z:*", stdout);
					printf("\tPF:i:%d", s->olig_pos_f);
					printf("\tPR:i:%d", s->olig_pos_r);
					if (s->bc_f) { fputs("\tBF:Z:", stdout); fputs(s->bc_f[0] == 0? "*" : s->bc_f, stdout); }
					if (s->bc_r) { fputs("\tBR:Z:", stdout); fputs(s->bc_r[0] == 0? "*" :s->bc_r, stdout); }
					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_cat); free(s->bc_f); free(s->bc_r); free(s->seq); free(s->qual); free(s->name);
		}
		free(data->seqs); free(data);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %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 0x509f
movl $0x1, %edi
movl $0x18, %esi
callq 0x2120
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x38(%rbp), %rdx
callq 0x3050
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 0x504e
jmp 0x506d
leaq 0x11ad(%rip), %rdi      # 0x6202
leaq 0x11bb(%rip), %rsi      # 0x6217
movl $0x1d7, %edx            # imm = 0x1D7
leaq 0x11ba(%rip), %rcx      # 0x6222
callq 0x20f0
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x5091
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x550c
movq -0x38(%rbp), %rdi
callq 0x2040
jmp 0x5504
cmpl $0x1, -0x14(%rbp)
jne 0x50db
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 0xaa7(%rip), %rsi       # 0x5b70
callq 0x2380
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x550c
cmpl $0x2, -0x14(%rbp)
jne 0x5500
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x51c9
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x51c4
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x7c(%rbp)
movq -0x50(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x74(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x20c0
movq %rax, -0x70(%rbp)
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x20c0
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %edx
movl -0x78(%rbp), %ecx
movl -0x74(%rbp), %r8d
movq -0x70(%rbp), %r9
leaq 0x10a2(%rip), %rdi      # 0x624d
movq %rax, (%rsp)
movb $0x0, %al
callq 0x20d0
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0x5102
jmp 0x5468
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x5466
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x0, %eax
jle 0x5456
movq -0x60(%rbp), %rax
cmpl $0x20, 0x4(%rax)
je 0x5252
movq -0x60(%rbp), %rax
cmpl $0x1f, 0x4(%rax)
je 0x5252
movq -0x60(%rbp), %rax
cmpl $0x16, 0x4(%rax)
je 0x5252
movq -0x60(%rbp), %rax
cmpl $0x15, 0x4(%rax)
je 0x5252
movq -0x60(%rbp), %rax
cmpl $0x3, 0x4(%rax)
jne 0x5456
movl -0x24(%rbp), %eax
xorl $-0x1, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x5456
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rcx
movl $0x3e, %edi
movl $0x40, %eax
cmpq $0x0, %rcx
cmovnel %eax, %edi
callq 0x2050
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x2d41(%rip), %rax      # 0x7fc0
movq (%rax), %rsi
callq 0x2100
movq -0x60(%rbp), %rax
cmpl $0x20, 0x4(%rax)
je 0x529b
movq -0x60(%rbp), %rax
cmpl $0x1f, 0x4(%rax)
jne 0x52be
movl $0x2f, %edi
callq 0x2050
movl -0x24(%rbp), %eax
andl $0x1, %eax
movslq %eax, %rcx
leaq 0xfad(%rip), %rax       # 0x6262
movsbl (%rax,%rcx), %edi
callq 0x2050
movq -0x60(%rbp), %rax
movl 0x4(%rax), %esi
leaq 0xf99(%rip), %rdi       # 0x6265
movb $0x0, %al
callq 0x20d0
movq -0x60(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x530d
movq 0x2cdb(%rip), %rax      # 0x7fc0
movq (%rax), %rsi
leaq 0xf7f(%rip), %rdi       # 0x626e
callq 0x2100
movq -0x60(%rbp), %rax
movq 0x38(%rax), %rdi
movq 0x2cbd(%rip), %rax      # 0x7fc0
movq (%rax), %rsi
callq 0x2100
jmp 0x5323
movq 0x2cac(%rip), %rax      # 0x7fc0
movq (%rax), %rsi
leaq 0xf57(%rip), %rdi       # 0x6275
callq 0x2100
movq -0x60(%rbp), %rax
movl 0x8(%rax), %esi
leaq 0xf4c(%rip), %rdi       # 0x627d
movb $0x0, %al
callq 0x20d0
movq -0x60(%rbp), %rax
movl 0xc(%rax), %esi
leaq 0xf40(%rip), %rdi       # 0x6286
movb $0x0, %al
callq 0x20d0
movq -0x60(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x53b3
movq 0x2c61(%rip), %rax      # 0x7fc0
movq (%rax), %rsi
leaq 0xf26(%rip), %rdi       # 0x628f
callq 0x2100
movq -0x60(%rbp), %rax
movq 0x28(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x538e
leaq 0xef6(%rip), %rax       # 0x627b
movq %rax, -0x90(%rbp)
jmp 0x539d
movq -0x60(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
movq 0x2c15(%rip), %rax      # 0x7fc0
movq (%rax), %rsi
callq 0x2100
movq -0x60(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x5419
movq 0x2bfb(%rip), %rax      # 0x7fc0
movq (%rax), %rsi
leaq 0xec7(%rip), %rdi       # 0x6296
callq 0x2100
movq -0x60(%rbp), %rax
movq 0x30(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x53f4
leaq 0xe90(%rip), %rax       # 0x627b
movq %rax, -0x98(%rbp)
jmp 0x5403
movq -0x60(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
movq 0x2baf(%rip), %rax      # 0x7fc0
movq (%rax), %rsi
callq 0x2100
movl $0xa, %edi
callq 0x2050
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2090
movq -0x60(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x5454
leaq 0xe5b(%rip), %rdi       # 0x629d
callq 0x2090
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2090
jmp 0x5456
jmp 0x5458
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x51d0
jmp 0x5468
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x54ea
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x2040
movq -0x68(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2040
movq -0x68(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2040
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2040
movq -0x68(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2040
movq -0x68(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2040
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x546f
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2040
movq -0x48(%rbp), %rdi
callq 0x2040
jmp 0x5502
jmp 0x5504
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)