// File: chhylp123[P]hifiasm/Assembly.cpp
// Function: Output_corrected_fastq()
void Output_corrected_fastq()
{
    long long i; uint64_t k;
    UC_Read g_read; asg8_v dv;
    init_UC_Read(&g_read); kv_init(dv);
    char* gfa_name = (char*)malloc(strlen(asm_opt.output_file_name)+35);
    sprintf(gfa_name, "%s.ec.fq", asm_opt.output_file_name);
    FILE* fp = fopen(gfa_name, "w");
    free(gfa_name);

    for (i = 0; i < (long long)R_INF.total_reads; i++) {
        recover_UC_Read(&g_read, &R_INF, i);
        fprintf(fp, "@%.*s\n", (int32_t)Get_NAME_LENGTH(R_INF, i), Get_NAME(R_INF, i));
        fprintf(fp, "%.*s\n", (int32_t)g_read.length, g_read.seq);        
        fprintf(fp, "+\n");
        retrive_bqual(&dv, NULL, i, -1, -1, 0, sc_bn);
        for (k = 0; k < dv.n; k++) fprintf(fp, "%c", (char)(sc_tb[dv.a[k]] + 33 - 1));
        fprintf(fp, "\n");
    }
    destory_UC_Read(&g_read); kv_destroy(dv);
    fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq -0x30(%rbp), %rdi
callq 0x9850
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
leaq 0x3af048(%rip), %rax    # 0x3c47f8
movq 0x10(%rax), %rdi
callq 0x20a0
movq %rax, %rdi
addq $0x23, %rdi
callq 0x2270
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
leaq 0x3af024(%rip), %rax    # 0x3c47f8
movq 0x10(%rax), %rdx
leaq 0x36c1de(%rip), %rsi    # 0x3819bd
movb $0x0, %al
callq 0x2050
movq -0x50(%rbp), %rdi
leaq 0x383be1(%rip), %rsi    # 0x3993d2
callq 0x2200
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x2210
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq 0x3afb0a(%rip), %rax    # 0x3c5320
jge 0x15946
movq -0x8(%rbp), %rdx
leaq -0x30(%rbp), %rdi
leaq 0x3afaa5(%rip), %rsi    # 0x3c52d0
callq 0xa380
movq -0x58(%rbp), %rdi
movq 0x3afad5(%rip), %rax    # 0x3c5310
movq -0x8(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq 0x3afac5(%rip), %rcx    # 0x3c5310
movq -0x8(%rbp), %rdx
subq (%rcx,%rdx,8), %rax
movl %eax, %edx
movq 0x3afa7c(%rip), %rcx    # 0x3c52d8
movq 0x3afaad(%rip), %rax    # 0x3c5310
movq -0x8(%rbp), %rsi
addq (%rax,%rsi,8), %rcx
leaq 0x36c154(%rip), %rsi    # 0x3819c6
movb $0x0, %al
callq 0x22a0
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
movq -0x30(%rbp), %rcx
leaq 0x3814bc(%rip), %rsi    # 0x396d4a
movb $0x0, %al
callq 0x22a0
movq -0x58(%rbp), %rdi
leaq 0x36bc9b(%rip), %rsi    # 0x38153b
movb $0x0, %al
callq 0x22a0
movq -0x8(%rbp), %rdx
leaq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movq $-0x1, %r8
xorl %r9d, %r9d
movq %r8, %rcx
movq $0x2, (%rsp)
callq 0xaec0
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x15923
movq -0x58(%rbp), %rdi
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x36c6b8(%rip), %rax    # 0x381fb0
movq (%rax,%rcx,8), %rax
addq $0x21, %rax
subq $0x1, %rax
movsbl %al, %edx
leaq 0x3796bb(%rip), %rsi    # 0x38efc9
movb $0x0, %al
callq 0x22a0
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x158d5
movq -0x58(%rbp), %rdi
leaq 0x3710fa(%rip), %rsi    # 0x386a28
movb $0x0, %al
callq 0x22a0
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x1580b
leaq -0x30(%rbp), %rdi
callq 0x9670
movq -0x38(%rbp), %rdi
callq 0x2210
movq -0x58(%rbp), %rdi
callq 0x21a0
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)