// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rdi, %r14
movq 0x261fea(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x210450(%rip), %rsi    # 0x238450
leaq 0x21063f(%rip), %rdx    # 0x238646
xorl %eax, %eax
callq 0x22b0
callq 0x3366f
leaq 0x26273e(%rip), %rbx    # 0x28a758
movl 0xd0(%rbx), %esi
movq %rbx, %rdi
callq 0x2f59
movl (%rbx), %eax
movl 0xe8(%rbx), %ebp
notl %eax
andl $0x1, %eax
movsd 0x228(%rbx), %xmm0
movups 0x230(%rbx), %xmm1
movl 0x240(%rbx), %ecx
movabsq $0x130000000a, %rdx     # imm = 0x130000000A
leaq 0xf0(%rsp), %r12
movq %rdx, (%r12)
movl %ebp, 0x14(%r12)
movl %eax, 0x10(%r12)
movabsq $0x7a12000002710, %rax  # imm = 0x7A12000002710
movq %rax, 0x8(%r12)
movabsq $0x271000000014, %rax   # imm = 0x271000000014
movq %rax, 0x18(%r12)
movabsq $0x3f0000003e428f5c, %rax # imm = 0x3F0000003E428F5C
movq %rax, 0x50(%r12)
movabsq $0x271000000019, %rax   # imm = 0x271000000019
movq %rax, 0x28(%r12)
movaps 0x20b793(%rip), %xmm2   # 0x233840
movups %xmm2, 0x30(%r12)
movabsq $0xb00000005, %rax      # imm = 0xB00000005
movq %rax, 0x20(%r12)
movaps 0x20b787(%rip), %xmm2   # 0x233850
movups %xmm2, 0x40(%r12)
movl $0x3f4ccccd, 0x58(%r12) # imm = 0x3F4CCCCD
movl %ebp, 0x80(%r12)
movsd %xmm0, 0x60(%r12)
movsd %xmm0, 0x68(%r12)
movups %xmm1, 0x70(%r12)
movl %ecx, 0x84(%r12)
movslq 0x7c(%rbx), %r13
leaq 0x8(%rsp), %r15
movl $0xe8, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x20e0
movq %r12, 0x10(%r15)
movq $0x3b9aca00, 0x50(%r15) # imm = 0x3B9ACA00
movq %r13, 0x58(%r15)
andq $0x0, 0x30(%r15)
movq %r14, 0x28(%r15)
movq 0x10(%rbx), %rsi
leaq 0x2631e0(%rip), %rdi    # 0x28b318
leaq 0x2630f1(%rip), %r14    # 0x28b230
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1dc0e1
testl %eax, %eax
jne 0x2816b
leaq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x27bf3
movq 0x10(%rbx), %rsi
leaq 0x2631b4(%rip), %rdi    # 0x28b318
xorl %edx, %edx
callq 0x1dc067
leaq 0x8(%rsp), %rbx
movl 0x58(%rbx), %edi
movq 0x50(%r14), %rcx
leaq 0x1b42e4(%rip), %rsi    # 0x1dc462
movq %rbx, %rdx
callq 0x1047b4
movl 0x58(%rbx), %edi
movq 0x50(%r14), %rcx
leaq 0x1b437e(%rip), %rsi    # 0x1dc512
movq %rbx, %rdx
callq 0x1047b4
movq 0x28(%rbx), %rsi
leaq 0x263171(%rip), %rdi    # 0x28b318
callq 0x26465
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq