// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc38, %rsp            # imm = 0xC38
movq 0x28(%rdi), %rax
cmpl $0x100, (%rax,%rsi,4)   # imm = 0x100
jge 0xe389
movl %edx, %r9d
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %rax
movq 0x20(%rdi), %rcx
movslq (%rcx,%rsi,4), %r13
movq 0x18(%rax), %rax
movl 0xb8(%rax), %eax
movl %eax, 0x4(%rsp)
movq 0x48(%rdi), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
leaq 0x27ae5(%rip), %rax     # 0x35928
xorpd %xmm0, %xmm0
testb $0x2, (%rax)
movl %edx, 0x24(%rsp)
jne 0xe304
movq 0x28(%r12), %rax
movl (%rax,%r15,4), %esi
testl %esi, %esi
movq %r15, 0x18(%rsp)
jle 0xdfa0
xorl %eax, %eax
leaq (,%r13,4), %rcx
addq %r13, %rcx
leaq 0x27892(%rip), %rdx     # 0x35710
cmpl $0x2, %esi
jne 0xdf68
movl 0x4(%rsp), %edi
testb $0x1, %dil
sete %sil
testb $0x2, %dil
sete %dil
testq %rax, %rax
setne %r8b
orb %dil, %r8b
cmpq $0x1, %rax
setne %dil
cmpb $0x1, %r8b
jne 0xdebc
orb %sil, %dil
jne 0xdf68
leaq (%rax,%rax,4), %rsi
shlq $0x3, %rsi
addq 0x10(%r12), %rsi
leaq (%rsi,%rcx,8), %rsi
movl (%rsi), %edi
movl %edi, %r9d
sarl %r9d
movl %r9d, %r8d
testl %r9d, %r9d
jle 0xdf14
leal -0x1(%rdi), %r10d
xorl %r11d, %r11d
movq 0x10(%rsi), %rbx
movslq %r10d, %r10
movsbq (%rbx,%r10), %r14
movzbl (%rbx,%r11), %r15d
movb (%rdx,%r15), %bpl
movb %bpl, (%rbx,%r10)
movb (%rdx,%r14), %bl
movq 0x10(%rsi), %r14
movb %bl, (%r14,%r11)
incq %r11
decl %r10d
cmpq %r11, %r8
jne 0xdee4
testb $0x1, %dil
je 0xdf2d
movq 0x10(%rsi), %r10
movslq %r9d, %r11
movzbl (%r10,%r11), %ebx
movb (%rdx,%rbx), %bl
movb %bl, (%r10,%r11)
testl %r9d, %r9d
movq 0x18(%rsp), %r15
jle 0xdf68
cmpq $0x0, 0x18(%rsi)
je 0xdf68
decl %edi
xorl %r9d, %r9d
movq 0x18(%rsi), %r10
movslq %edi, %rdi
movb (%r10,%rdi), %r11b
movb (%r10,%r9), %bl
movb %bl, (%r10,%rdi)
movq 0x18(%rsi), %r10
movb %r11b, (%r10,%r9)
incq %r9
decl %edi
cmpq %r9, %r8
jne 0xdf43
movq 0x10(%r12), %rsi
leaq (%rax,%r13), %rdi
leaq (%rdi,%rdi,4), %rdi
movl (%rsi,%rdi,8), %r8d
movl %r8d, 0x40(%rsp,%rax,4)
movq 0x10(%rsi,%rdi,8), %rsi
movq %rsi, 0x440(%rsp,%rax,8)
incq %rax
movq 0x28(%r12), %rsi
movslq (%rsi,%r15,4), %rsi
cmpq %rsi, %rax
jl 0xde7e
movq (%r12), %rcx
movq 0x18(%rcx), %rax
testb $0x2, 0x2(%rax)
movq %r12, 0x10(%rsp)
movq %r13, 0x28(%rsp)
movsd %xmm0, 0x30(%rsp)
jne 0xe05c
movq 0x28(%rcx), %rdi
leaq (,%r13,4), %rbx
movq 0x18(%r12), %r8
addq %rbx, %r8
leaq (,%r13,8), %r9
addq 0x40(%r12), %r9
movq 0x10(%r12), %r10
leaq (,%r13,4), %r11
addq %r13, %r11
subq $0x8, %rsp
leaq 0x48(%rsp), %rdx
leaq 0x448(%rsp), %rcx
pushq 0x8(%r10,%r11,8)
pushq %rax
movq 0x20(%rsp), %r14
pushq %r14
callq 0xcab1
addq $0x20, %rsp
movq 0x28(%r12), %rax
cmpl $0x0, (%rax,%r15,4)
jle 0xe12e
movq %r14, %rdi
movq 0x10(%rsp), %rdx
movq 0x30(%rdx), %rcx
addq %rbx, %rcx
addq 0x38(%rdx), %rbx
xorl %edx, %edx
movl 0x8(%rdi), %esi
movl %esi, (%rcx,%rdx,4)
movl 0xc(%rdi), %esi
movl %esi, (%rbx,%rdx,4)
incq %rdx
movslq (%rax,%r15,4), %rsi
cmpq %rsi, %rdx
jl 0xe03f
jmp 0xe12e
movq 0x28(%r12), %rax
cmpl $0x0, (%rax,%r15,4)
movq 0x8(%rsp), %r11
jle 0xe12e
movq 0x28(%rsp), %rax
leaq (,%rax,4), %rbx
leaq (,%rax,8), %rcx
leaq (%rax,%rax,4), %rbp
incq %rbp
leaq 0x440(%rsp), %r12
leaq 0x40(%rsp), %r13
xorl %r14d, %r14d
movq %rcx, 0x38(%rsp)
movq 0x10(%rsp), %r15
movq (%r15), %rax
movq 0x10(%r15), %r10
movq 0x28(%rax), %rdi
movq 0x18(%r15), %r8
addq %rbx, %r8
movq 0x40(%r15), %r9
addq %rcx, %r9
subq $0x8, %rsp
movl $0x1, %esi
movq %r13, %rdx
movq %r12, %rcx
pushq (%r10,%rbp,8)
pushq 0x18(%rax)
pushq %r11
callq 0xb038
movq 0x28(%rsp), %r11
addq $0x20, %rsp
movl 0x8(%r11), %eax
movq 0x30(%r15), %rcx
movl %eax, (%rcx,%rbx)
movl 0xc(%r11), %eax
movq 0x38(%r15), %rcx
movl %eax, (%rcx,%rbx)
movq 0x38(%rsp), %rcx
incq %r14
movq 0x28(%r15), %rax
movq 0x18(%rsp), %r15
movslq (%rax,%r15,4), %rax
addq $0x4, %rbx
addq $0x8, %rcx
addq $0x5, %rbp
addq $0x8, %r12
addq $0x4, %r13
cmpq %rax, %r14
jl 0xe09d
movq 0x10(%rsp), %r12
movq 0x28(%r12), %rax
movl (%rax,%r15,4), %edx
testl %edx, %edx
movq 0x28(%rsp), %r13
jle 0xe2e6
xorl %eax, %eax
leaq 0x275be(%rip), %rcx     # 0x35710
cmpl $0x2, %edx
jne 0xe2d1
movl 0x4(%rsp), %esi
testb $0x1, %sil
sete %dl
testb $0x2, %sil
sete %sil
testq %rax, %rax
setne %dil
orb %sil, %dil
cmpq $0x1, %rax
setne %sil
cmpb $0x1, %dil
jne 0xe18f
orb %dl, %sil
jne 0xe2d1
movq 0x10(%r12), %rsi
leaq (%rax,%r13), %rdx
leaq (%rdx,%rdx,4), %rdi
leaq (%rsi,%rdi,8), %rsi
movl (%rsi), %edi
movl %edi, %r9d
sarl %r9d
movl %r9d, %r8d
testl %r9d, %r9d
jle 0xe1e7
leal -0x1(%rdi), %r10d
xorl %r11d, %r11d
movq 0x10(%rsi), %rbx
movslq %r10d, %r10
movsbq (%rbx,%r10), %r14
movzbl (%rbx,%r11), %r15d
movb (%rcx,%r15), %bpl
movb %bpl, (%rbx,%r10)
movb (%rcx,%r14), %bl
movq 0x10(%rsi), %r14
movb %bl, (%r14,%r11)
incq %r11
decl %r10d
cmpq %r11, %r8
jne 0xe1b7
testb $0x1, %dil
je 0xe200
movq 0x10(%rsi), %r10
movslq %r9d, %r11
movzbl (%r10,%r11), %ebx
movb (%rcx,%rbx), %bl
movb %bl, (%r10,%r11)
testl %r9d, %r9d
movq 0x18(%rsp), %r15
jle 0xe23b
cmpq $0x0, 0x18(%rsi)
je 0xe23b
decl %edi
xorl %r9d, %r9d
movq 0x18(%rsi), %r10
movslq %edi, %rdi
movb (%r10,%rdi), %r11b
movb (%r10,%r9), %bl
movb %bl, (%r10,%rdi)
movq 0x18(%rsi), %r10
movb %r11b, (%r10,%r9)
incq %r9
decl %edi
cmpq %r9, %r8
jne 0xe216
movq 0x18(%r12), %rsi
cmpl $0x0, (%rsi,%rdx,4)
jle 0xe2d1
movl $0x10, %esi
xorl %edi, %edi
movq 0x40(%r12), %r8
movq (%r8,%rdx,8), %r8
movl 0x40(%rsp,%rax,4), %r9d
subl 0x4(%r8,%rsi), %r9d
movl (%r8,%rsi), %r10d
movl %r9d, (%r8,%rsi)
movl 0x40(%rsp,%rax,4), %r9d
subl %r10d, %r9d
movl %r9d, 0x4(%r8,%rsi)
xorb $0x4, 0x2d(%r8,%rsi)
movq 0x38(%r8,%rsi), %r8
testq %r8, %r8
je 0xe2bc
movl 0x14(%r8), %r9d
movl %r9d, %r10d
shrl $0x1e, %r10d
cmpl $0x1, %r10d
je 0xe2a8
cmpl $0x2, %r10d
jne 0xe2bc
movl $0x40000000, %r10d      # imm = 0x40000000
jmp 0xe2ae
movl $0x80000000, %r10d      # imm = 0x80000000
andl $0x3fffffff, %r9d       # imm = 0x3FFFFFFF
orl %r10d, %r9d
movl %r9d, 0x14(%r8)
incq %rdi
movq 0x18(%r12), %r8
movslq (%r8,%rdx,4), %r8
addq $0x50, %rsi
cmpq %r8, %rdi
jl 0xe251
incq %rax
movq 0x28(%r12), %rdx
movslq (%rdx,%r15,4), %rdx
cmpq %rdx, %rax
jl 0xe152
leaq 0x2763b(%rip), %rax     # 0x35928
testb $0x2, (%rax)
jne 0xe342
addq $0xc38, %rsp            # imm = 0xC38
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x26ced(%rip), %rax     # 0x34ff8
movq (%rax), %rdi
movq 0x10(%r12), %rax
leaq (,%r13,4), %rcx
addq %r13, %rcx
movq 0x8(%rax,%rcx,8), %rdx
movl (%rax,%rcx,8), %r8d
leaq 0x1e660(%rip), %rsi     # 0x2c98e
movl %r9d, %ecx
xorl %eax, %eax
callq 0x2260
callq 0x586d
jmp 0xde54
movq 0x26caf(%rip), %rax     # 0x34ff8
movq (%rax), %r15
movq 0x10(%r12), %rax
leaq (,%r13,4), %rcx
addq %r13, %rcx
movq 0x8(%rax,%rcx,8), %r14
callq 0x586d
subsd 0x30(%rsp), %xmm0
leaq 0x1e628(%rip), %rsi     # 0x2c99b
movq %r15, %rdi
movq %r14, %rdx
movl 0x24(%rsp), %ecx
movb $0x1, %al
callq 0x2260
jmp 0xe2f2
leaq 0x1e5c1(%rip), %rdi     # 0x2c951
leaq 0x1e454(%rip), %rsi     # 0x2c7eb
leaq 0x1e5cd(%rip), %rcx     # 0x2c96b
movl $0x1b0, %edx            # imm = 0x1B0
callq 0x21a0