// File: /workspace/github_c_makefile_star2_O0/lh3[P]fermi-lite/unitig.c
// Function: fml_fmi2mag_core
mag_t *fml_fmi2mag_core(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;
	mag_t *g;

	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);
	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]);
	g = (mag_t*)calloc(1, sizeof(mag_t));
	for (j = 0; j < n_threads; ++j) {
		kv_resize(magv_t, g->v, g->v.n + w.d[j].v.n);
		memcpy(g->v.a + g->v.n, w.d[j].v.a, w.d[j].v.n * sizeof(magv_t));
		g->v.n += w.d[j].v.n;
		free(w.d[j].v.a);
		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); free(w.used); free(w.bend); free(w.visited);

	mag_g_build_hash(g);
	mag_g_amend(g);
	g->rdist = mag_cal_rdist(g);
	return g;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rdi
addq $0x3f, %rdi
shrq $0x6, %rdi
movl $0x8, %esi
callq 0x2140
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rdi
addq $0x3f, %rdi
shrq $0x6, %rdi
movl $0x8, %esi
callq 0x2140
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rdi
addq $0x3f, %rdi
shrq $0x6, %rdi
movl $0x8, %esi
callq 0x2140
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movl -0x14(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jb 0x10d4e
jmp 0x10d6d
leaq 0x14ba3(%rip), %rdi     # 0x258f8
leaq 0x14a95(%rip), %rsi     # 0x257f1
movl $0x1a1, %edx            # imm = 0x1A1
leaq 0x14bac(%rip), %rcx     # 0x25914
callq 0x20f0
movslq -0x14(%rbp), %rdi
movl $0x170, %esi            # imm = 0x170
callq 0x2140
movq %rax, -0x20(%rbp)
movq $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movslq -0x4c(%rbp), %rcx
leaq 0x194e7(%rip), %rax     # 0x2a280
cmpq $0x0, (%rax,%rcx,8)
jbe 0x10de5
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x4c(%rbp), %rsi
leaq 0x194c9(%rip), %rcx     # 0x2a280
xorl %edx, %edx
divq (%rcx,%rsi,8)
cmpq $0x0, %rdx
je 0x10dd8
movslq -0x4c(%rbp), %rcx
leaq 0x194b2(%rip), %rax     # 0x2a280
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
jmp 0x10de5
jmp 0x10dda
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x10d8e
cmpq $0x0, -0x48(%rbp)
je 0x10dee
jmp 0x10e0d
leaq 0x14b55(%rip), %rdi     # 0x2594a
leaq 0x149f5(%rip), %rsi     # 0x257f1
movl $0x1a9, %edx            # imm = 0x1A9
leaq 0x14b0c(%rip), %rcx     # 0x25914
callq 0x20f0
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x10eaf
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rdx
imulq $0x170, %rdx, %rdx      # imm = 0x170
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl -0xc(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rdx
imulq $0x170, %rdx, %rdx      # imm = 0x170
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movl -0x10(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rdx
imulq $0x170, %rdx, %rdx      # imm = 0x170
addq %rdx, %rax
movl %ecx, 0x14(%rax)
movq -0x40(%rbp), %rcx
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rdx
imulq $0x170, %rdx, %rdx      # imm = 0x170
addq %rdx, %rax
movq %rcx, 0x78(%rax)
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rdx
imulq $0x170, %rdx, %rdx      # imm = 0x170
addq %rdx, %rax
movq %rcx, 0x80(%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x10e14
movl -0x14(%rbp), %edi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rcx
leaq 0x37b(%rip), %rsi       # 0x11240
leaq -0x48(%rbp), %rdx
callq 0x20e50
movl $0x1, %edi
movl $0x28, %esi
callq 0x2140
movq %rax, -0x58(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x111e1
jmp 0x10ef6
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rcx), %rcx
movq -0x20(%rbp), %rdx
movslq -0x4c(%rbp), %rsi
imulq $0x170, %rsi, %rsi      # imm = 0x170
addq %rsi, %rdx
addq 0x158(%rdx), %rcx
cmpq %rcx, %rax
jae 0x11007
movq -0x58(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rdx
imulq $0x170, %rdx, %rdx      # imm = 0x170
addq %rdx, %rax
addq 0x158(%rax), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0x58(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0x58(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0x58(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0x58(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0x58(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x58(%rbp), %rax
imulq $0x68, 0x8(%rax), %rsi
callq 0x21e0
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x11009
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x58(%rbp), %rax
imulq $0x68, (%rax), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0x168(%rax), %rsi
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
imulq $0x68, 0x158(%rax), %rdx
callq 0x2190
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0x158(%rax), %rcx
movq -0x58(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0x168(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0x28(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0x40(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0x58(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0x70(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0x120(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0x138(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0x140(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0x148(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0x98(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0xd0(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x170, %rcx, %rcx      # imm = 0x170
addq %rcx, %rax
movq 0xe8(%rax), %rdi
callq 0x2040
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x10ee8
movq -0x20(%rbp), %rdi
callq 0x2040
movq -0x40(%rbp), %rdi
callq 0x2040
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x58(%rbp), %rdi
callq 0x16d10
movq -0x58(%rbp), %rdi
callq 0x16ed0
movq -0x58(%rbp), %rdi
callq 0x1c180
cvtsd2ss %xmm0, %xmm0
movq -0x58(%rbp), %rax
movss %xmm0, 0x18(%rax)
movq -0x58(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)