// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/map.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[MM_MAX_SEG], j, off = s->seg_off[i], pe_ori = s->p->opt->pe_ori;
	const char *qseqs[MM_MAX_SEG];
	double t = 0.0;
	mm_tbuf_t *b = s->buf[tid];
	assert(s->n_seg[i] <= MM_MAX_SEG);
	if (mm_dbg_flag & MM_DBG_PRINT_QNAME) {
		fprintf(stderr, "QR\t%s\t%d\t%d\n", s->seq[off].name, tid, s->seq[off].l_seq);
		t = realtime();
	}
	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))))
			mm_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 & MM_F_INDEPEND_SEG) {
		for (j = 0; j < s->n_seg[i]; ++j) {
			mm_map_frag(s->p->mi, 1, &qlens[j], &qseqs[j], &s->n_reg[off+j], &s->reg[off+j], b, s->p->opt, s->seq[off+j].name);
			s->rep_len[off + j] = b->rep_len;
			s->frag_gap[off + j] = b->frag_gap;
		}
	} else {
		mm_map_frag(s->p->mi, s->n_seg[i], qlens, qseqs, &s->n_reg[off], &s->reg[off], b, s->p->opt, s->seq[off].name);
		for (j = 0; j < s->n_seg[i]; ++j) {
			s->rep_len[off + j] = b->rep_len;
			s->frag_gap[off + j] = b->frag_gap;
		}
	}
	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;
			mm_revcomp_bseq(&s->seq[off + j]);
			for (k = 0; k < s->n_reg[off + j]; ++k) {
				mm_reg1_t *r = &s->reg[off + j][k];
				t = r->qs;
				r->qs = qlens[j] - r->qe;
				r->qe = qlens[j] - t;
				r->rev = !r->rev;
				if (r->p) {
					if (r->p->trans_strand == 1) r->p->trans_strand = 2;
					else if (r->p->trans_strand == 2) r->p->trans_strand = 1;
				}
			}
		}
	if (mm_dbg_flag & MM_DBG_PRINT_QNAME)
		fprintf(stderr, "QT\t%s\t%d\t%.6f\n", s->seq[off].name, tid, realtime() - t);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xc88, %rsp            # imm = 0xC88
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x438(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movl 0xb8(%rax), %eax
movl %eax, -0x43c(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xc48(%rbp)
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xc50(%rbp)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
cmpl $0xff, (%rax,%rcx,4)
jg 0x13b04
jmp 0x13b23
leaq 0x43a4e(%rip), %rdi     # 0x57559
leaq 0x438e1(%rip), %rsi     # 0x573f3
movl $0x1b0, %edx            # imm = 0x1B0
leaq 0x43a55(%rip), %rcx     # 0x57573
callq 0x21a0
leaq 0x4ae0e(%rip), %rax     # 0x5e938
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x13b8f
movq 0x4a4bd(%rip), %rax     # 0x5dff8
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x438(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x438(%rbp), %rsi
imulq $0x28, %rsi, %rsi
addq %rsi, %rax
movl (%rax), %r8d
leaq 0x43a1b(%rip), %rsi     # 0x57596
movb $0x0, %al
callq 0x2250
callq 0x54e0
movsd %xmm0, -0xc48(%rbp)
movl $0x0, -0x434(%rbp)
movl -0x434(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x18(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x13c8b
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x13c18
cmpl $0x0, -0x434(%rbp)
jne 0x13bdf
movl -0x43c(%rbp), %eax
sarl %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x13bf6
cmpl $0x1, -0x434(%rbp)
jne 0x13c18
movl -0x43c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x13c18
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x438(%rbp), %eax
addl -0x434(%rbp), %eax
cltq
imulq $0x28, %rax, %rax
addq %rax, %rdi
callq 0x14230
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x438(%rbp), %ecx
addl -0x434(%rbp), %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movslq -0x434(%rbp), %rax
movl %ecx, -0x430(%rbp,%rax,4)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x438(%rbp), %ecx
addl -0x434(%rbp), %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
movslq -0x434(%rbp), %rax
movq %rcx, -0xc40(%rbp,%rax,8)
movl -0x434(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x434(%rbp)
jmp 0x13b99
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
andq $0x20000, %rax          # imm = 0x20000
cmpq $0x0, %rax
je 0x13dea
movl $0x0, -0x434(%rbp)
movl -0x434(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x18(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x13de5
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rax), %rdi
movslq -0x434(%rbp), %rax
leaq -0x430(%rbp), %rdx
shlq $0x2, %rax
addq %rax, %rdx
movslq -0x434(%rbp), %rax
leaq -0xc40(%rbp), %rcx
shlq $0x3, %rax
addq %rax, %rcx
movq -0x28(%rbp), %rax
movq 0x18(%rax), %r8
movl -0x438(%rbp), %eax
addl -0x434(%rbp), %eax
cltq
shlq $0x2, %rax
addq %rax, %r8
movq -0x28(%rbp), %rax
movq 0x40(%rax), %r9
movl -0x438(%rbp), %eax
addl -0x434(%rbp), %eax
cltq
shlq $0x3, %rax
addq %rax, %r9
movq -0xc50(%rbp), %r11
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %r10
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x438(%rbp), %esi
addl -0x434(%rbp), %esi
movslq %esi, %rsi
imulq $0x28, %rsi, %rsi
addq %rsi, %rax
movq 0x8(%rax), %rax
movl $0x1, %esi
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x119f0
movq -0xc50(%rbp), %rax
movl 0x8(%rax), %edx
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x438(%rbp), %ecx
addl -0x434(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0xc50(%rbp), %rax
movl 0xc(%rax), %edx
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movl -0x438(%rbp), %ecx
addl -0x434(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x434(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x434(%rbp)
jmp 0x13cb3
jmp 0x13ef9
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq -0x430(%rbp), %rdx
leaq -0xc40(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0x18(%rax), %r8
movslq -0x438(%rbp), %rax
shlq $0x2, %rax
addq %rax, %r8
movq -0x28(%rbp), %rax
movq 0x40(%rax), %r9
movslq -0x438(%rbp), %rax
shlq $0x3, %rax
addq %rax, %r9
movq -0xc50(%rbp), %r11
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %r10
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x438(%rbp), %rbx
imulq $0x28, %rbx, %rbx
addq %rbx, %rax
movq 0x8(%rax), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x119f0
movl $0x0, -0x434(%rbp)
movl -0x434(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x18(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x13ef7
movq -0xc50(%rbp), %rax
movl 0x8(%rax), %edx
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x438(%rbp), %ecx
addl -0x434(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0xc50(%rbp), %rax
movl 0xc(%rax), %edx
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movl -0x438(%rbp), %ecx
addl -0x434(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x434(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x434(%rbp)
jmp 0x13e87
jmp 0x13ef9
movl $0x0, -0x434(%rbp)
movl -0x434(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x18(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x1411e
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x14108
cmpl $0x0, -0x434(%rbp)
jne 0x13f4d
movl -0x43c(%rbp), %eax
sarl %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x13f6c
cmpl $0x1, -0x434(%rbp)
jne 0x14108
movl -0x43c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x14108
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x438(%rbp), %eax
addl -0x434(%rbp), %eax
cltq
imulq $0x28, %rax, %rax
addq %rax, %rdi
callq 0x14230
movl $0x0, -0xc54(%rbp)
movl -0xc54(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x438(%rbp), %edx
addl -0x434(%rbp), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x14106
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x438(%rbp), %ecx
addl -0x434(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc54(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xc60(%rbp)
movq -0xc60(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0xc58(%rbp)
movslq -0x434(%rbp), %rax
movl -0x430(%rbp,%rax,4), %ecx
movq -0xc60(%rbp), %rax
subl 0x14(%rax), %ecx
movq -0xc60(%rbp), %rax
movl %ecx, 0x10(%rax)
movslq -0x434(%rbp), %rax
movl -0x430(%rbp,%rax,4), %ecx
subl -0xc58(%rbp), %ecx
movq -0xc60(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0xc60(%rbp), %rax
movl 0x3c(%rax), %eax
shrl $0xa, %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edx
movq -0xc60(%rbp), %rax
movl 0x3c(%rax), %ecx
andl $0x1, %edx
shll $0xa, %edx
andl $0xfffffbff, %ecx       # imm = 0xFFFFFBFF
orl %edx, %ecx
movl %ecx, 0x3c(%rax)
movq -0xc60(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x140f0
movq -0xc60(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x14(%rax), %eax
shrl $0x1e, %eax
cmpl $0x1, %eax
jne 0x140b9
movq -0xc60(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x14(%rax), %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0x14(%rax)
jmp 0x140ee
movq -0xc60(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x14(%rax), %eax
shrl $0x1e, %eax
cmpl $0x2, %eax
jne 0x140ec
movq -0xc60(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x14(%rax), %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
orl $0x40000000, %ecx       # imm = 0x40000000
movl %ecx, 0x14(%rax)
jmp 0x140ee
jmp 0x140f0
jmp 0x140f2
movl -0xc54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc54(%rbp)
jmp 0x13f98
jmp 0x14108
jmp 0x1410a
movl -0x434(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x434(%rbp)
jmp 0x13f03
leaq 0x4a813(%rip), %rax     # 0x5e938
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x14199
movq 0x49ec2(%rip), %rax     # 0x5dff8
movq (%rax), %rax
movq %rax, -0xc78(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x438(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0xc70(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0xc64(%rbp)
callq 0x54e0
movq -0xc78(%rbp), %rdi
movq -0xc70(%rbp), %rdx
movl -0xc64(%rbp), %ecx
subsd -0xc48(%rbp), %xmm0
leaq 0x43411(%rip), %rsi     # 0x575a3
movb $0x1, %al
callq 0x2250
addq $0xc88, %rsp            # imm = 0xC88
popq %rbx
popq %rbp
retq
nopw %cs:(%rax,%rax)