// File: chhylp123[P]hifiasm/inter.cpp
// Function: ul_load(ug_opt_t const*)
void ul_load(const ug_opt_t *uopt)
{
	fprintf(stderr, "[M::%s::] ==> UL\n", __func__);
	mg_idxopt_t opt; uldat_t sl;
	int32_t cutoff;
	init_aux_table(); ha_opt_update_cov(&asm_opt, asm_opt.hom_cov);
	cutoff = asm_opt.max_n_chain;
	init_mg_opt(&opt, !(asm_opt.flag&HA_F_NO_HPC), 19, 10, cutoff, asm_opt.max_n_chain, asm_opt.ul_error_rate, asm_opt.ul_error_rate, asm_opt.ul_error_rate_low, asm_opt.ul_error_rate_hpc, asm_opt.ul_ec_round);
	init_uldat_t(&sl, NULL, NULL, &opt, CHUNK_SIZE, asm_opt.thread_num, uopt, NULL);

	if(!load_all_ul_t(&UL_INF, asm_opt.output_file_name, &R_INF, NULL)) {
		gen_UL_ovlps(&sl, cutoff);
		write_all_ul_t(&UL_INF, asm_opt.output_file_name, NULL);
		// exit(1);
	}
	// detect_outlier_len("ul_load");
	// print_all_ul_t_stat(&UL_INF);
	// fprintf(stderr, "**1**\n");
	kt_for(sl.n_thread, update_ovlp_src, &sl, R_INF.total_reads);
	// fprintf(stderr, "**2**\n");
	kt_for(sl.n_thread, update_ovlp_src_bl, &sl, R_INF.total_reads);
	// fprintf(stderr, "**3**\n");
	
	print_ovlp_src_bl_stat(&UL_INF, sl.uopt);
	// exit(1);
	// print_ul_ovlps(&UL_INF, 0); 
	// print_ul_ovlps(&UL_INF, 1);

	// destory_all_ul_t(&UL_INF); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq 0xc61fa(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
leaq 0x97504(%rip), %rsi     # 0x3952f4
leaq 0x976f3(%rip), %rdx     # 0x3954ea
movb $0x0, %al
callq 0x22a0
callq 0x9690
leaq 0xc69ee(%rip), %rax     # 0x3c47f8
movl 0xd0(%rax), %esi
leaq 0xc69e1(%rip), %rdi     # 0x3c47f8
callq 0x3b60
leaq 0xc69d5(%rip), %rax     # 0x3c47f8
movl 0xe8(%rax), %eax
movl %eax, -0x17c(%rbp)
leaq 0xc69c2(%rip), %rax     # 0x3c47f8
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %esi
movl -0x17c(%rbp), %r8d
leaq 0xc69a2(%rip), %rax     # 0x3c47f8
movl 0xe8(%rax), %r9d
leaq 0xc6994(%rip), %rax     # 0x3c47f8
movsd 0x228(%rax), %xmm0
leaq 0xc6985(%rip), %rax     # 0x3c47f8
movsd 0x228(%rax), %xmm1
leaq 0xc6976(%rip), %rax     # 0x3c47f8
movsd 0x230(%rax), %xmm2
leaq 0xc6967(%rip), %rax     # 0x3c47f8
movsd 0x238(%rax), %xmm3
leaq 0xc6958(%rip), %rax     # 0x3c47f8
movl 0x240(%rax), %eax
leaq -0x90(%rbp), %rdi
movl $0x13, %edx
movl $0xa, %ecx
movl %eax, (%rsp)
callq 0x282cf0
leaq 0xc6932(%rip), %rax     # 0x3c47f8
movslq 0x7c(%rax), %r9
movq -0x8(%rbp), %rax
leaq -0x178(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
leaq -0x90(%rbp), %rcx
movl $0x3b9aca00, %r8d       # imm = 0x3B9ACA00
movq %rdx, %rsi
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x2fd4f0
leaq 0xc68f6(%rip), %rax     # 0x3c47f8
movq 0x10(%rax), %rsi
leaq 0xc74ab(%rip), %rdi     # 0x3c53b8
leaq 0xc73bc(%rip), %rdx     # 0x3c52d0
xorl %eax, %eax
movl %eax, %ecx
callq 0x2fd8d0
cmpl $0x0, %eax
jne 0x2fdf4f
movl -0x17c(%rbp), %esi
leaq -0x178(%rbp), %rdi
callq 0x2fcaf0
leaq 0xc68bd(%rip), %rax     # 0x3c47f8
movq 0x10(%rax), %rsi
leaq 0xc7472(%rip), %rdi     # 0x3c53b8
xorl %eax, %eax
movl %eax, %edx
callq 0x2fd590
movq -0x120(%rbp), %rax
movl %eax, %edi
leaq 0xc7371(%rip), %rax     # 0x3c52d0
movq 0x50(%rax), %rcx
leaq 0x56(%rip), %rsi        # 0x2fdfc0
leaq -0x178(%rbp), %rdx
callq 0x16d710
movq -0x120(%rbp), %rax
movl %eax, %edi
leaq 0xc734a(%rip), %rax     # 0x3c52d0
movq 0x50(%rax), %rcx
leaq 0x18f(%rip), %rsi       # 0x2fe120
leaq -0x178(%rbp), %rdx
callq 0x16d710
movq -0x150(%rbp), %rsi
leaq 0xc740d(%rip), %rdi     # 0x3c53b8
callq 0x2f0b40
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopl (%rax)