// File: chhylp123[P]hifiasm/horder.cpp
// Function: print_scaffold(ma_ug_t*, asg_t*, ma_sub_t*, char*, ma_hit_t_alloc*, ma_hit_t_alloc*, long long, float, long long, R_to_U*, float, float, int, int)
void print_scaffold(ma_ug_t *ug, asg_t *sg, ma_sub_t* coverage_cut, char* output_file_name, 
ma_hit_t_alloc* sources, ma_hit_t_alloc* reverse_sources, 
long long tipsLen, float tip_drop_ratio, long long stops_threshold, R_to_U* ruIndex, 
float chimeric_rate, float drop_ratio, int max_hang, int min_ovlp)
{
    char* gfa_name = (char*)malloc(strlen(output_file_name)+100);
    sprintf(gfa_name, "%s.%s.p_ctg.gfa", output_file_name, "stg");
    fprintf(stderr, "Writing %s to disk... \n", gfa_name);
    FILE* output_file = NULL;
    output_file = fopen(gfa_name, "w");


    kvec_asg_arc_t_warp new_rtg_edges;
    kv_init(new_rtg_edges.a);
    ma_ug_seq_scaffold(ug, sg, coverage_cut, sources, &new_rtg_edges, max_hang, min_ovlp, 0, 1);
    ma_ug_print(ug, sg, coverage_cut, sources, ruIndex, "stg", output_file);
    fclose(output_file);

    sprintf(gfa_name, "%s.%s.p_ctg.noseq.gfa", output_file_name, "stg");
    output_file = fopen(gfa_name, "w");
    ma_ug_print_simple(ug, sg, coverage_cut, sources, ruIndex, "stg", output_file);
    fclose(output_file);

    free(gfa_name);
    kv_destroy(new_rtg_edges.a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl 0x30(%rbp), %eax
movl 0x28(%rbp), %eax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movss %xmm0, -0x34(%rbp)
movss %xmm1, -0x38(%rbp)
movss %xmm2, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20a0
movq %rax, %rdi
addq $0x64, %rdi
callq 0x2270
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x142639(%rip), %rsi    # 0x388315
leaq 0x148ae1(%rip), %rcx    # 0x38e7c4
movb $0x0, %al
callq 0x2050
movq 0x17e2ef(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x48(%rbp), %rdx
leaq 0x1417a2(%rip), %rsi    # 0x3874a1
movb $0x0, %al
callq 0x22a0
movq $0x0, -0x50(%rbp)
movq -0x48(%rbp), %rdi
leaq 0x1536b9(%rip), %rsi    # 0x3993d2
callq 0x2200
movq %rax, -0x50(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl 0x28(%rbp), %r9d
movl 0x30(%rbp), %eax
leaq -0x70(%rbp), %r8
xorl %r10d, %r10d
movl %eax, (%rsp)
movq $0x0, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
callq 0xedc00
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq 0x20(%rbp), %r8
movq -0x50(%rbp), %rax
leaq 0x148a34(%rip), %r9     # 0x38e7c4
movq %rax, (%rsp)
callq 0xefa60
movq -0x50(%rbp), %rdi
callq 0x21a0
movq -0x48(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x142588(%rip), %rsi    # 0x388339
leaq 0x148a0c(%rip), %rcx    # 0x38e7c4
movb $0x0, %al
callq 0x2050
movq -0x48(%rbp), %rdi
leaq 0x153608(%rip), %rsi    # 0x3993d2
callq 0x2200
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq 0x20(%rbp), %r8
movq -0x50(%rbp), %rax
leaq 0x1489d2(%rip), %r9     # 0x38e7c4
movq %rax, (%rsp)
callq 0xf1c10
movq -0x50(%rbp), %rdi
callq 0x21a0
movq -0x48(%rbp), %rdi
callq 0x2210
movq -0x60(%rbp), %rdi
callq 0x2210
addq $0x90, %rsp
popq %rbp
retq
nop