// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/ggen.c
// Function: mg_ggen_cov
int mg_ggen_cov(gfa_t *g, int32_t n_fn, const char **fn, const mg_idxopt_t *ipt, const mg_mapopt_t *opt0, const mg_ggopt_t *go, int n_threads)
{
	int32_t i;
	mg_mapopt_t opt = *opt0;
	mg_idx_t *gi;
	double *cov_seg, *cov_link;
	int64_t j;
	if ((gi = mg_index(g, ipt, n_threads, &opt)) == 0) return -1;
	KCALLOC(0, cov_seg,  g->n_seg);
	KCALLOC(0, cov_link, g->n_arc);
	for (i = 0; i < n_fn; ++i) {
		maprst_t *r;
		r = ggen_map(gi, &opt, fn[i], n_threads);
		mg_cov_asm(g, r->n_seq, r->gcs, go->min_mapq, go->min_map_len, cov_seg, cov_link);
		mg_free_maprst(r);
	}
	mg_idx_destroy(gi);
	for (j = 0; j < g->n_seg; ++j) cov_seg[j] /= n_fn;
	for (j = 0; j < g->n_arc; ++j) cov_link[j] /= n_fn;
	gfa_aux_update_cv(g, "cf", cov_seg, cov_link);
	free(cov_seg); free(cov_link);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x30(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
movl $0xa8, %edx
callq 0x2230
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl 0x10(%rbp), %edx
leaq -0xe8(%rbp), %rcx
callq 0x21110
movq %rax, -0xf0(%rbp)
cmpq $0x0, %rax
jne 0x382ba
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x38476
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %esi
xorl %eax, %eax
movl %eax, %edi
movl $0x8, %edx
callq 0x2540
movq %rax, -0xf8(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
xorl %eax, %eax
movl %eax, %edi
movl $0x8, %edx
callq 0x2540
movq %rax, -0x100(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x38389
movq -0xf0(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movl 0x10(%rbp), %ecx
leaq -0xe8(%rbp), %rsi
callq 0x37ee0
movq %rax, -0x110(%rbp)
movq -0x10(%rbp), %rdi
movq -0x110(%rbp), %rax
movl (%rax), %esi
movq -0x110(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x38(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x38(%rbp), %rax
movl 0x10(%rax), %r8d
movq -0xf8(%rbp), %r9
movq -0x100(%rbp), %rax
movq %rax, (%rsp)
callq 0x2fdc0
movq -0x110(%rbp), %rdi
callq 0x381b0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x382fc
movq -0xf0(%rbp), %rdi
callq 0x203d0
movq $0x0, -0x108(%rbp)
movq -0x108(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
jge 0x383e8
cvtsi2sdl -0x14(%rbp), %xmm1
movq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x108(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x108(%rbp)
jmp 0x383a0
movq $0x0, -0x108(%rbp)
movq -0x108(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x40(%rcx), %rax
jae 0x38439
cvtsi2sdl -0x14(%rbp), %xmm1
movq -0x100(%rbp), %rax
movq -0x108(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x108(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x108(%rbp)
jmp 0x383f3
movq -0x10(%rbp), %rdi
movq -0xf8(%rbp), %rdx
movq -0x100(%rbp), %rcx
leaq 0x6091(%rip), %rsi      # 0x3e4e3
callq 0x7b00
movq -0xf8(%rbp), %rdi
callq 0x2040
movq -0x100(%rbp), %rdi
callq 0x2040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)