// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: load_all_data_from_disk(ma_hit_t_alloc**, ma_hit_t_alloc**, char*)
int load_all_data_from_disk(ma_hit_t_alloc **sources, ma_hit_t_alloc **reverse_sources, char* output_file_name)
{
	char* gfa_name = (char*)malloc(strlen(output_file_name)+25);
	sprintf(gfa_name, "%s.ec", output_file_name);
	if (!load_All_reads(&R_INF, gfa_name)) {
		free(gfa_name);
		return 0;
	}

    if(ha_opt_triobin(&asm_opt)) {
        if(!((asm_opt.fn_bin_yak[0]) && (asm_opt.fn_bin_yak[1]) && 
                        (load_yak_binning(&asm_opt, asm_opt.output_file_name)))) {
            ha_triobin(&asm_opt); 
            write_yak_binning(asm_opt.output_file_name, asm_opt.fn_bin_yak[0], asm_opt.fn_bin_yak[1]);
        }
    }

    if((asm_opt.flag & HA_F_VERBOSE_GFA) && load_debug_graph(NULL, NULL, NULL, output_file_name, NULL, NULL, NULL))
    {
        (*sources) = NULL;
        (*reverse_sources) = NULL;
        free(gfa_name);
        return 1;
    }

	sprintf(gfa_name, "%s.ovlp.source", output_file_name);
	if (!load_ma_hit_ts(sources, gfa_name)) {
		free(gfa_name);
		return 0;
	}
	sprintf(gfa_name, "%s.ovlp.reverse", output_file_name);
	if (!load_ma_hit_ts(reverse_sources, gfa_name)) {
		free(gfa_name);
		return 0;
	}
	free(gfa_name);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20a0
movq %rax, %rdi
addq $0x19, %rdi
callq 0x2270
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x24e556(%rip), %rsi    # 0x381bf2
movb $0x0, %al
callq 0x2050
movq -0x28(%rbp), %rsi
leaq 0x291c22(%rip), %rdi    # 0x3c52d0
callq 0x79a0
cmpl $0x0, %eax
jne 0x1336cd
movq -0x28(%rbp), %rdi
callq 0x2210
movl $0x0, -0x4(%rbp)
jmp 0x133831
leaq 0x291124(%rip), %rdi    # 0x3c47f8
callq 0x133600
cmpl $0x0, %eax
je 0x13374a
leaq 0x291113(%rip), %rax    # 0x3c47f8
cmpq $0x0, 0x20(%rax)
je 0x133716
leaq 0x291105(%rip), %rax    # 0x3c47f8
cmpq $0x0, 0x28(%rax)
je 0x133716
leaq 0x2910f7(%rip), %rax    # 0x3c47f8
movq 0x10(%rax), %rsi
leaq 0x2910ec(%rip), %rdi    # 0x3c47f8
callq 0x133280
cmpl $0x0, %eax
jne 0x133748
leaq 0x2910db(%rip), %rdi    # 0x3c47f8
callq 0x16a7f0
leaq 0x2910cf(%rip), %rax    # 0x3c47f8
movq 0x10(%rax), %rdi
leaq 0x2910c4(%rip), %rax    # 0x3c47f8
movq 0x20(%rax), %rsi
leaq 0x2910b9(%rip), %rax    # 0x3c47f8
movq 0x28(%rax), %rdx
callq 0x132fa0
jmp 0x13374a
leaq 0x2910a7(%rip), %rax    # 0x3c47f8
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1337ad
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %rdi
movq %r9, %rsi
movq %r9, %rdx
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x133840
cmpl $0x0, %eax
je 0x1337ad
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x28(%rbp), %rdi
callq 0x2210
movl $0x1, -0x4(%rbp)
jmp 0x133831
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x255258(%rip), %rsi    # 0x388a14
movb $0x0, %al
callq 0x2050
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x132620
cmpl $0x0, %eax
jne 0x1337e7
movq -0x28(%rbp), %rdi
callq 0x2210
movl $0x0, -0x4(%rbp)
jmp 0x133831
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x25522d(%rip), %rsi    # 0x388a23
movb $0x0, %al
callq 0x2050
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x132620
cmpl $0x0, %eax
jne 0x133821
movq -0x28(%rbp), %rdi
callq 0x2210
movl $0x0, -0x4(%rbp)
jmp 0x133831
movq -0x28(%rbp), %rdi
callq 0x2210
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)