// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/gmap.c
// Function: worker_for
static void worker_for(void *_data, long i, int tid) // kt_for() callback
{
    step_t *s = (step_t*)_data;
	int qlens[MG_MAX_SEG], j, off = s->seg_off[i], pe_ori = s->p->opt->pe_ori;
	const char *qseqs[MG_MAX_SEG];
	mg_tbuf_t *b = s->buf[tid];
	assert(s->n_seg[i] <= MG_MAX_SEG);
	if (mg_dbg_flag & MG_DBG_QNAME)
		fprintf(stderr, "QR\t%s\t%d\t%d\n", s->seq[off].name, tid, s->seq[off].l_seq);
	for (j = 0; j < s->n_seg[i]; ++j) {
		if (s->n_seg[i] == 2 && ((j == 0 && (pe_ori>>1&1)) || (j == 1 && (pe_ori&1))))
			mg_revcomp_bseq(&s->seq[off + j]);
		qlens[j] = s->seq[off + j].l_seq;
		qseqs[j] = s->seq[off + j].seq;
	}
	if (s->p->opt->flag & MG_M_INDEPEND_SEG) {
		for (j = 0; j < s->n_seg[i]; ++j)
			mg_map_frag(s->p->gi, 1, &qlens[j], &qseqs[j], &s->gcs[off+j], b, s->p->opt, s->seq[off+j].name);
	} else {
		mg_map_frag(s->p->gi, s->n_seg[i], qlens, qseqs, &s->gcs[off], b, s->p->opt, s->seq[off].name);
	}
#if 0 // for paired-end reads
	for (j = 0; j < s->n_seg[i]; ++j) // flip the query strand and coordinate to the original read strand
		if (s->n_seg[i] == 2 && ((j == 0 && (pe_ori>>1&1)) || (j == 1 && (pe_ori&1)))) {
			int k, t;
			mg_revcomp_bseq(&s->seq[off + j]);
			for (k = 0; k < s->n_reg[off + j]; ++k) {
				mg_lchain_t *r = &s->reg[off + j][k];
				t = r->qs;
				r->qs = qlens[j] - r->qe;
				r->qe = qlens[j] - t;
				r->v ^= 1;
			}
		}
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc50, %rsp            # imm = 0xC50
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x428(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movl 0x18(%rax), %eax
movl %eax, -0x42c(%rbp)
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xc38(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
cmpl $0xff, (%rax,%rcx,4)
jg 0x334e5
jmp 0x33504
leaq 0xaa4f(%rip), %rdi      # 0x3df3b
leaq 0xaa62(%rip), %rsi      # 0x3df55
movl $0x23, %edx
leaq 0xaa5d(%rip), %rcx      # 0x3df5c
callq 0x2170
leaq 0x1217d(%rip), %rax     # 0x45688
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x33563
movq 0x11adc(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x428(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x428(%rbp), %rsi
imulq $0x28, %rsi, %rsi
addq %rsi, %rax
movl (%rax), %r8d
leaq 0xaa23(%rip), %rsi      # 0x3df7f
movb $0x0, %al
callq 0x2210
movl $0x0, -0x424(%rbp)
movl -0x424(%rbp), %eax
movq -0x20(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq -0x10(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x3365f
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x335ec
cmpl $0x0, -0x424(%rbp)
jne 0x335b3
movl -0x42c(%rbp), %eax
sarl %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x335ca
cmpl $0x1, -0x424(%rbp)
jne 0x335ec
movl -0x42c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x335ec
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x428(%rbp), %eax
addl -0x424(%rbp), %eax
cltq
imulq $0x28, %rax, %rax
addq %rax, %rdi
callq 0x33860
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x428(%rbp), %ecx
addl -0x424(%rbp), %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movslq -0x424(%rbp), %rax
movl %ecx, -0x420(%rbp,%rax,4)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x428(%rbp), %ecx
addl -0x424(%rbp), %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
movslq -0x424(%rbp), %rax
movq %rcx, -0xc30(%rbp,%rax,8)
movl -0x424(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x424(%rbp)
jmp 0x3356d
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
andq $0x20000, %rax          # imm = 0x20000
cmpq $0x0, %rax
je 0x33751
movl $0x0, -0x424(%rbp)
movl -0x424(%rbp), %eax
movq -0x20(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq -0x10(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x3374f
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rax), %rdi
movslq -0x424(%rbp), %rax
leaq -0x420(%rbp), %rdx
shlq $0x2, %rax
addq %rax, %rdx
movslq -0x424(%rbp), %rax
leaq -0xc30(%rbp), %rcx
shlq $0x3, %rax
addq %rax, %rcx
movq -0x20(%rbp), %rax
movq 0x28(%rax), %r8
movl -0x428(%rbp), %eax
addl -0x424(%rbp), %eax
cltq
shlq $0x3, %rax
addq %rax, %r8
movq -0xc38(%rbp), %r9
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %r10
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x428(%rbp), %esi
addl -0x424(%rbp), %esi
movslq %esi, %rsi
imulq $0x28, %rsi, %rsi
addq %rsi, %rax
movq 0x8(%rax), %rax
movl $0x1, %esi
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2cac0
movl -0x424(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x424(%rbp)
jmp 0x33687
jmp 0x337c9
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq -0x420(%rbp), %rdx
leaq -0xc30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x28(%rax), %r8
movslq -0x428(%rbp), %rax
shlq $0x3, %rax
addq %rax, %r8
movq -0xc38(%rbp), %r9
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %r10
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x428(%rbp), %r11
imulq $0x28, %r11, %r11
addq %r11, %rax
movq 0x8(%rax), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2cac0
addq $0xc50, %rsp            # imm = 0xC50
popq %rbp
retq
nopw %cs:(%rax,%rax)