// File: /workspace/github_c_makefile_star2_O0/ToniWestbrook[P]paladin/bwamem.c
// Function: worker2
static void worker2(void *data, int i, int tid)
{
	extern int mem_sam_pe(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, const mem_pestat_t pes[4], uint64_t id, bseq1_t s[2], mem_alnreg_v a[2]);
	extern void mem_reg2ovlp(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, bseq1_t *s, mem_alnreg_v *a);
	worker_t *w = (worker_t*)data;
	if (!(w->opt->flag&MEM_F_PE)) {
		if (bwa_verbose >= 4) printf("=====> Finalizing read '%s' <=====\n", w->seqs[i].name);
		if (w->opt->flag & MEM_F_ALN_REG) {
			mem_reg2ovlp(w->opt, w->bns, w->pac, &w->seqs[i], &w->regs[i]);
		} else {
			mem_mark_primary_se(w->opt, w->regs[i].n, w->regs[i].a, w->n_processed + i);
			mem_reg2sam(w->opt, w->bns, w->pac, &w->seqs[i], &w->regs[i], 0, 0);
		}

		//free(w->regs[i].a);
	} else {
		if (bwa_verbose >= 4) printf("=====> Finalizing read pair '%s' <=====\n", w->seqs[i<<1|0].name);
		mem_sam_pe(w->opt, w->bns, w->pac, w->pes, (w->n_processed>>1) + i, &w->seqs[i<<1], &w->regs[i<<1]);
		free(w->regs[i<<1|0].a); free(w->regs[i<<1|1].a);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl 0x48(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x2ca3a
leaq 0x14519(%rip), %rax     # 0x40e30
cmpl $0x4, (%rax)
jl 0x2c941
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
leaq 0xe72b(%rip), %rdi      # 0x3b065
movb $0x0, %al
callq 0x3060
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl 0x48(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x2c99c
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
movslq -0xc(%rbp), %rax
imulq $0x30, %rax, %rax
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq 0x38(%rax), %r8
movslq -0xc(%rbp), %rax
shlq $0x5, %rax
addq %rax, %r8
callq 0x30cd0
jmp 0x2ca35
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, %esi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rcx
movslq -0xc(%rbp), %rax
addq %rax, %rcx
callq 0x26fb0
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
movslq -0xc(%rbp), %rax
imulq $0x30, %rax, %rax
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq 0x38(%rax), %r8
movslq -0xc(%rbp), %rax
shlq $0x5, %rax
addq %rax, %r8
xorl %r9d, %r9d
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x2b0d0
jmp 0x2cb21
leaq 0x143ef(%rip), %rax     # 0x40e30
cmpl $0x4, (%rax)
jl 0x2ca72
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movl -0xc(%rbp), %ecx
shll %ecx
orl $0x0, %ecx
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
leaq 0xe61e(%rip), %rdi      # 0x3b089
movb $0x0, %al
callq 0x3060
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x40(%rax), %r8
sarq %r8
movslq -0xc(%rbp), %rax
addq %rax, %r8
movq -0x18(%rbp), %rax
movq 0x30(%rax), %r9
movl -0xc(%rbp), %eax
shll %eax
cltq
imulq $0x30, %rax, %rax
addq %rax, %r9
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movl -0xc(%rbp), %r10d
shll %r10d
movslq %r10d, %r10
shlq $0x5, %r10
addq %r10, %rax
movq %rax, (%rsp)
callq 0x2f300
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movl -0xc(%rbp), %ecx
shll %ecx
orl $0x0, %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rdi
callq 0x3380
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movl -0xc(%rbp), %ecx
shll %ecx
orl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rdi
callq 0x3380
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)