// File: /workspace/github_c_makefile_star2_O3/lh3[P]fermi2/unitig.c
// Function: fm6_unitig
int fm6_unitig(const rld_t *e, int min_match, int min_merge_len, int n_threads)
{
	extern void kt_for(int n_threads, void (*func)(void*,long,int), void *data, long n);
	worker_t w;
	int j;
	w.used    = (uint64_t*)calloc((e->mcnt[1] + 63)/64, 8);
	w.bend    = (uint64_t*)calloc((e->mcnt[1] + 63)/64, 8);
	w.visited = (uint64_t*)calloc((e->mcnt[1] + 63)/64, 8);
	w.e       = e;
	assert(e->mcnt[1] >= n_threads * 2);
	w.d = calloc(n_threads, sizeof(thrdat_t));
	w.prime = 0;
	for (j = 0; utg_primes[j] > 0; ++j)
		if (e->mcnt[1] % utg_primes[j] != 0) {
			w.prime = utg_primes[j];
			break;
		}
	assert(w.prime);
	if (fm_verbose >= 3) fprintf(stderr, "[M::%s] choose prime %llu\n", __func__, (unsigned long long)w.prime);
	for (j = 0; j < n_threads; ++j) {
		w.d[j].a.e = e; w.d[j].a.min_match = min_match; w.d[j].a.min_merge_len = min_merge_len;
		w.d[j].a.used = w.used; w.d[j].a.bend = w.bend;
	}
	kt_for(n_threads, worker, &w, e->mcnt[1]);
	for (j = 0; j < n_threads; ++j) {
		free(w.d[j].a.a[0].a); free(w.d[j].a.a[1].a); free(w.d[j].a.nei.a); free(w.d[j].a.cat.a);
		free(w.d[j].z.nei[0].a); free(w.d[j].z.nei[1].a); free(w.d[j].z.seq); free(w.d[j].z.cov);
		free(w.d[j].a.str.s); free(w.d[j].str.s); free(w.d[j].cov.s); free(w.d[j].out.s);
	}
	free(w.used); free(w.bend); free(w.visited);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, 0x40(%rsp)
movl %edx, 0xc(%rsp)
movl %esi, %r15d
movq %rdi, %r14
movq 0x28(%rdi), %rax
movq 0x8(%rax), %rbx
leaq 0x3f(%rbx), %rbp
shrq $0x6, %rbp
movl $0x8, %esi
movq %rbp, %rdi
callq 0x2190
movq %rax, %r12
movq %rax, 0x18(%rsp)
movl $0x8, %esi
movq %rbp, %rdi
callq 0x2190
movq %rax, %r13
movq %rax, 0x20(%rsp)
movl $0x8, %esi
movq %rbp, %rdi
callq 0x2190
movq 0x40(%rsp), %rcx
movq %rax, 0x28(%rsp)
movq %r14, 0x30(%rsp)
leal (%rcx,%rcx), %eax
cltq
cmpq %rax, %rbx
jb 0x16c7d
movslq %ecx, %rdi
movl $0x150, %esi            # imm = 0x150
callq 0x2190
movq %rax, %rbp
movq %rax, 0x38(%rsp)
movl $0x1e241, %ecx          # imm = 0x1E241
movl $0x1, %esi
leaq 0x823d(%rip), %rdi      # 0x1ecb0
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
jne 0x16aac
movq (%rdi,%rsi,8), %rcx
incq %rsi
cmpq $0x6, %rsi
jne 0x16a73
leaq 0x80e0(%rip), %rdi      # 0x1eb74
leaq 0x7f89(%rip), %rsi      # 0x1ea24
leaq 0x80a5(%rip), %rcx      # 0x1eb47
movl $0x1a6, %edx            # imm = 0x1A6
callq 0x2120
movq %rcx, 0x10(%rsp)
leaq 0xe7a8(%rip), %rax      # 0x25260
cmpl $0x2, (%rax)
jg 0x16c59
movq 0x40(%rsp), %rdi
testl %edi, %edi
jle 0x16c11
movl %edi, %ebx
imulq $0x150, %rbx, %rax      # imm = 0x150
xorl %ecx, %ecx
movl 0xc(%rsp), %edx
movq %r14, 0x8(%rbp,%rcx)
movl %r15d, 0x10(%rbp,%rcx)
movl %edx, 0x14(%rbp,%rcx)
movq %r12, 0x78(%rbp,%rcx)
movq %r13, 0x80(%rbp,%rcx)
addq $0x150, %rcx            # imm = 0x150
cmpq %rcx, %rax
jne 0x16add
movq 0x28(%r14), %rax
movq 0x8(%rax), %rcx
leaq 0x189(%rip), %rsi       # 0x16c9c
leaq 0x10(%rsp), %rdx
movq %rdi, %r14
callq 0x340c
testl %r14d, %r14d
jle 0x16c2a
imulq $0x150, %rbx, %rbx      # imm = 0x150
xorl %r14d, %r14d
movq 0x38(%rsp), %rax
movq 0x28(%rax,%r14), %rdi
callq 0x2040
movq 0x38(%rsp), %rax
movq 0x40(%rax,%r14), %rdi
callq 0x2040
movq 0x38(%rsp), %rax
movq 0x58(%rax,%r14), %rdi
callq 0x2040
movq 0x38(%rsp), %rax
movq 0x70(%rax,%r14), %rdi
callq 0x2040
movq 0x38(%rsp), %rax
movq 0x118(%rax,%r14), %rdi
callq 0x2040
movq 0x38(%rsp), %rax
movq 0x130(%rax,%r14), %rdi
callq 0x2040
movq 0x38(%rsp), %rax
movq 0x138(%rax,%r14), %rdi
callq 0x2040
movq 0x38(%rsp), %rax
movq 0x140(%rax,%r14), %rdi
callq 0x2040
movq 0x38(%rsp), %rax
movq 0x90(%rax,%r14), %rdi
callq 0x2040
movq 0x38(%rsp), %rax
movq 0xc0(%rax,%r14), %rdi
callq 0x2040
movq 0x38(%rsp), %rax
movq 0xd0(%rax,%r14), %rdi
callq 0x2040
movq 0x38(%rsp), %rax
movq 0xe0(%rax,%r14), %rdi
callq 0x2040
addq $0x150, %r14            # imm = 0x150
cmpq %r14, %rbx
jne 0x16b33
jmp 0x16c2a
movq 0x28(%r14), %rax
movq 0x8(%rax), %rcx
leaq 0x7c(%rip), %rsi        # 0x16c9c
leaq 0x10(%rsp), %rdx
callq 0x340c
movq 0x18(%rsp), %rdi
callq 0x2040
movq 0x20(%rsp), %rdi
callq 0x2040
movq 0x28(%rsp), %rdi
callq 0x2040
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xe398(%rip), %rax      # 0x24ff8
movq (%rax), %rdi
leaq 0x7f12(%rip), %rsi      # 0x1eb7c
leaq 0x7f26(%rip), %rdx      # 0x1eb97
xorl %eax, %eax
callq 0x21c0
jmp 0x16ac1
leaq 0x7ea7(%rip), %rdi      # 0x1eb2b
leaq 0x7d99(%rip), %rsi      # 0x1ea24
leaq 0x7eb5(%rip), %rcx      # 0x1eb47
movl $0x19e, %edx            # imm = 0x19E
callq 0x2120