// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]oatk/run_syncasm.c
// Function: syncasm
int syncasm(char **file_in, int n_file, size_t m_data, int k, int s, int bubble_size, int tip_size, int min_k_cov, double min_a_cov_f,
        double weak_cross, int do_ec, int do_unzip, int n_threads, char *out, scg_meta_t *meta, int VERBOSE)
{
    FILE *fo;
    sstream_t *sr_rdr;
    scg_t *scg;
    sr_db_t *sr_db;
    syncmer_db_t *scm_db;
    scg_ra_v *ra_db;
    int ret = 0;

    scg = 0;
    sr_db = 0;
    scm_db = 0;
    ra_db = 0;

    sr_rdr = sstream_open(file_in, n_file);
    if (sr_rdr == 0) {
        fprintf(stderr, "[E::%s] failed to open files: %s\n", __func__, strerror(errno));
        ret = 1;
        goto do_clean;
    }

    MYMALLOC(sr_db, 1);
    sr_db_init(sr_db, k, s);
    sr_read(sr_rdr, sr_db, m_data, n_threads);
    fprintf(stderr, "[M::%s] collected syncmers from %lu target sequence(s)\n", __func__, sr_rdr->n_seq);
    sstream_close(sr_rdr);
    if (sr_db_validate(sr_db)) {
        ret = 1;
        goto do_clean;
    }
    sr_db_stat(sr_db, stderr, VERBOSE);

    if (min_k_cov == 0) {
        min_k_cov = sr_db->stats->kmer_peak_het > 0? (sr_db->stats->kmer_peak_het * 10) : (sr_db->stats->kmer_peak_hom * 10);
        fprintf(stderr, "[M::%s] set minimum kmer coverage as %d\n", __func__, min_k_cov);
    }

#ifdef DEBUG_SYNCMER_SEQ
    uint32_t i;
    fo = open_outstream(out, "_syncmer_debug.fa");
    for (i = 0; i < sr_db->n; ++i) print_all_syncmers_on_seq(&sr_db->a[i], s, k, fo);
    fclose(fo);
#endif

    // make syncmer database
    scm_db = collect_syncmer_from_reads(sr_db);
    
    // syncmer_link_coverage_analysis(sr_db, scm_db, min_k_cov, 30, 30, .7, 0, 0, 0, VERBOSE);
    
    if (do_ec) {
        // make syncmer graph with all syncmers for error correction
        scg = make_syncmer_graph(sr_db, scm_db, 0, 0.);
#ifdef DEBUG_GRAPH_ERROR_CORRECTION
        // save sequence in graph
        fo = open_outstream(out, "_syncmer_hoco.gfa");
        scg_consensus(sr_db, scg, 1, 1, fo);
        fclose(fo);
#endif
        // do consensus in hoco space
        scg_consensus(sr_db, scg, 1, 1, 0);
        // naive error finding without checking arc coverage
#ifdef DEBUG_GRAPH_ERROR_CORRECTION
        fo = open_outstream(out, ".ec.fa");
#else
        fo = 0;
#endif
        read_error_correction(sr_db, scg, 0.02, min_k_cov, min_k_cov * 10, min_k_cov, min_a_cov_f, n_threads, fo, VERBOSE);
#ifdef DEBUG_GRAPH_ERROR_CORRECTION
        fclose(fo);
        fo = open_outstream(out, "_syncmer_hoco.noerr.gfa");
        scg_print(scg, fo, 0);
        fclose(fo);
#endif
        sr_db_stat(sr_db, stderr, VERBOSE);
        scg_destroy(scg); scg = 0;
        // goto do_clean;
    }

    // make syncmer graph
    fprintf(stderr, "[M::%s] make syncmer graph\n", __func__);
    scg = make_syncmer_graph(sr_db, scm_db, min_k_cov, min_a_cov_f);
    if (!scg || scg_is_empty(scg)) {
        fprintf(stderr, "[E::%s] empty syncmer graph\n", __func__);
        ret = 1;
        goto do_clean;
    }
    fprintf(stderr, "[M::%s] syncmer graph stats\n", __func__);
    scg_stat(scg, stderr, 0);
    if (VERBOSE > 1) scg_subgraph_stat(scg, stderr);

#ifdef DEBUG_SYNCMER_GRAPH
    fo = open_outstream(out, "_syncmer.gfa");
    scg_consensus(sr_db, scg, 0, 0, fo);
    fclose(fo);
    MYCALLOC(ra_db, 1);
    scg_read_alignment(sr_db, ra_db, scg, n_threads, 0);
    fprintf(stderr, "[DEBUG_SYNCMER_GRAPH::%s] read alignment\n", __func__);
    scg_rv_print(ra_db, stderr);
    scg_ra_v_destroy(ra_db);
#endif

    // make unitigs
    fprintf(stderr, "[M::%s] syncmer graph unitigging\n", __func__);
    process_mergeable_unitigs(scg);
    fprintf(stderr, "[M::%s] syncmer graph stats after unitigging\n", __func__);
    scg_stat(scg, stderr, 0);
    fo = open_outstream(out, ".utg.gfa");
    scg_consensus(sr_db, scg, 0, 0, fo);
    fclose(fo);

    if (VERBOSE > 1) scg_subgraph_stat(scg, stderr);

#ifdef DEBUG_GRAPH_UNITIG
    scg_print_unitig_syncmer_list(scg, stderr);
    MYCALLOC(ra_db, 1);
    scg_read_alignment(sr_db, ra_db, scg, n_threads, 0);
    fprintf(stderr, "[DEBUG_GRAPH_UNITIG::%s] read alignment\n", __func__);
    scg_rv_print(ra_db, stderr);
    scg_ra_v_destroy(ra_db);
#endif

    // do basic cleanup
    // already have consensus information
    fprintf(stderr, "[M::%s] syncmer graph cleanup\n", __func__);
    uint64_t cleaned = 1;
    while (cleaned) {
        // do not do bubble popping before unzipping to avoid removing haplotypes
        cleaned = 0;
        if (do_unzip <= 0) {
            cleaned += asmg_pop_bubble(scg->utg_asmg, bubble_size, 0, 0, 1, 0, VERBOSE);
            cleaned += asmg_remove_weak_crosslink(scg->utg_asmg, weak_cross, 10, 0, VERBOSE);
        }
        cleaned += asmg_drop_tip(scg->utg_asmg, INT32_MAX, tip_size, 1, 0, VERBOSE);
    }
    process_mergeable_unitigs(scg);
    
#ifdef DEBUG_GRAPH_MULTIPLEX
    fprintf(stderr, "[M::%s] syncmer graph stats after cleanup\n", __func__);
    scg_stat(scg, stderr, 0);
    fo = open_outstream(out, ".utg.clean.gfa");
    scg_consensus(sr_db, scg, 0, 0, fo);
    fclose(fo);
#endif

#ifdef DEBUG_GRAPH_MULTIPLEX
    scg_print_unitig_syncmer_list(scg, stderr);
#endif

    MYCALLOC(ra_db, 1);
    // do read threading
    if (do_unzip > 0) {
        fprintf(stderr, "[M::%s] assembly graph unzipping\n", __func__);
        int round, updated;
        uint32_t max_n_scm;

        // set max_n_scm for maximum repeats of ~15Kb which reach the HiFi read length limit
        max_n_scm = ceil(30000.0 / k);

        // do multiplexing
        round = 0;
        updated = 1;
        while (updated != 0 && round < do_unzip) {
            ++round;
            scg_read_alignment(sr_db, ra_db, scg, n_threads, 1);
            // scg_rv_print(ra_db, stderr);
            scg_update_utg_cov(scg);
            updated = scg_multiplex(scg, ra_db, max_n_scm, 10, .3);
            if (VERBOSE > 0) {
                fprintf(stderr, "[M::%s] syncmer graph stats after multiplexing round %d\n", __func__, round);
                scg_stat(scg, stderr, 0);
            }
#ifdef DEBUG_GRAPH_MULTIPLEX
            char *out1;
            MYMALLOC(out1, strlen(out) + 36);
            sprintf(out1, "%s.utg.unzip.r%02d.gfa", out, round);
            fo = open_outstream(out1, "");
            scg_consensus(sr_db, scg, 0, 0, fo);
            fclose(fo);
            free(out1);
            scg_print_unitig_syncmer_list(scg, stderr);
#endif
        }
        
        // arc coverage estimation from aligned reads
        // to remove weak cross arcs
        // only arc coverage is required
        scg_read_alignment(sr_db, ra_db, scg, n_threads, 1);
        scg_ra_arc_coverage(scg, sr_db, ra_db, 0, VERBOSE);
        asmg_remove_weak_crosslink(scg->utg_asmg, weak_cross, 10, 0, VERBOSE);

#ifdef DEBUG_GRAPH_MULTIPLEX
        fprintf(stderr, "[M::%s] syncmer graph stats after multiplexing\n", __func__);
        scg_stat(scg, stderr, 0);
        fo = open_outstream(out, ".utg.multiplex.gfa");
        scg_consensus(sr_db, scg, 0, 0, fo);
        fclose(fo);
#endif

        // do demultiplexing
        scg_demultiplex(scg);
        // the arc coverage is lost
        scg_read_alignment(sr_db, ra_db, scg, n_threads, 0);
        scg_ra_utg_coverage(scg, sr_db, ra_db, VERBOSE);
        scg_ra_arc_coverage(scg, sr_db, ra_db, 1, VERBOSE);
        
#ifdef DEBUG_GRAPH_MULTIPLEX
        fprintf(stderr, "[M::%s] syncmer graph stats after unzipping\n", __func__);
        scg_stat(scg, stderr, 0);
        fo = open_outstream(out, ".utg.unzip.gfa");
        scg_consensus(sr_db, scg, 0, 0, fo);
        fclose(fo);
#else
        // consensus infomration is required for basic cleanup
        scg_consensus(sr_db, scg, 0, 0, 0);
#endif

        // do basic cleanup
        cleaned = 1;
        while (cleaned) {
            cleaned = 0;
            cleaned += asmg_pop_bubble(scg->utg_asmg, bubble_size, 0, 0, 1, 0, VERBOSE);
            cleaned += asmg_remove_weak_crosslink(scg->utg_asmg, weak_cross, 10, 0, VERBOSE);
            cleaned += asmg_drop_tip(scg->utg_asmg, INT32_MAX, tip_size, 1, 0, VERBOSE);
        }
        process_mergeable_unitigs(scg);

#ifdef DEBUG_GRAPH_UNITIG
        scg_print_unitig_syncmer_list(scg, stderr);
#endif

#ifdef DEBUG_GRAPH_ALIGNMENT
        fprintf(stderr, "[DEBUG_GRAPH_ALIGNMENT::%s] read alignment\n", __func__);
        scg_rv_print(ra_db, stderr);
#endif
    }

    // unitig and arc coverage estimation
    scg_read_alignment(sr_db, ra_db, scg, n_threads, 0);
    scg_ra_utg_coverage(scg, sr_db, ra_db, VERBOSE);
    scg_ra_arc_coverage(scg, sr_db, ra_db, 1, VERBOSE);

    fprintf(stderr, "[M::%s] syncmer graph stats after final processing\n", __func__);
    scg_stat(scg, stderr, 0);
    fo = open_outstream(out, ".utg.final.gfa");
    scg_consensus(sr_db, scg, 0, 0, fo);
    fclose(fo);

do_clean:
    if (meta) {
        scg_meta_clean(meta);
        meta->k = k;
        meta->s = s;
        meta->scg = scg;
        meta->scm_db = scm_db;
        meta->sr_db = sr_db;
        meta->ra_db = ra_db;
    } else {
        scg_destroy(scg);
        syncmer_db_destroy(scm_db);
        sr_db_destroy(sr_db);
        scg_ra_v_destroy(ra_db);
    }

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl 0x48(%rbp), %eax
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movl 0x30(%rbp), %eax
movl 0x28(%rbp), %eax
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movsd %xmm0, -0x30(%rbp)
movsd %xmm1, -0x38(%rbp)
movl $0x0, -0x6c(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x283d0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x271b
movq 0x3191e(%rip), %rax     # 0x33ff8
movq (%rax), %rax
movq %rax, -0x90(%rbp)
callq 0x2080
movl (%rax), %edi
callq 0x24c0
movq -0x90(%rbp), %rdi
movq %rax, %rcx
leaq 0x2a937(%rip), %rsi     # 0x2d038
leaq 0x2a952(%rip), %rdx     # 0x2d05a
movb $0x0, %al
callq 0x2290
movl $0x1, -0x6c(%rbp)
jmp 0x2e32
movl $0x28, %edi
callq 0x2320
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x12280
movq -0x48(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl 0x30(%rbp), %ecx
callq 0x11a20
movq 0x318a5(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
movq -0x48(%rbp), %rax
movq (%rax), %rcx
leaq 0x2a8fe(%rip), %rsi     # 0x2d062
leaq 0x2a8ef(%rip), %rdx     # 0x2d05a
movb $0x0, %al
callq 0x2290
movq -0x48(%rbp), %rdi
callq 0x28350
movq -0x58(%rbp), %rdi
callq 0x13af0
cmpl $0x0, %eax
je 0x2795
movl $0x1, -0x6c(%rbp)
jmp 0x2e32
movq -0x58(%rbp), %rdi
movq 0x31858(%rip), %rax     # 0x33ff8
movq (%rax), %rsi
movl 0x48(%rbp), %edx
callq 0x12570
cmpl $0x0, 0x18(%rbp)
jne 0x2810
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
cmpl $0x0, 0x44(%rax)
jle 0x27d3
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
imull $0xa, 0x44(%rax), %eax
movl %eax, -0x94(%rbp)
jmp 0x27e5
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
imull $0xa, 0x40(%rax), %eax
movl %eax, -0x94(%rbp)
movl -0x94(%rbp), %eax
movl %eax, 0x18(%rbp)
movq 0x31803(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
movl 0x18(%rbp), %ecx
leaq 0x2a898(%rip), %rsi     # 0x2d09a
leaq 0x2a851(%rip), %rdx     # 0x2d05a
movb $0x0, %al
callq 0x2290
movq -0x58(%rbp), %rdi
callq 0x14860
movq %rax, -0x60(%rbp)
cmpl $0x0, 0x20(%rbp)
je 0x28bd
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
xorl %edx, %edx
xorps %xmm0, %xmm0
callq 0x3e00
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl $0x1, %ecx
xorl %eax, %eax
movl %eax, %r8d
movl %ecx, %edx
callq 0x5870
movq $0x0, -0x40(%rbp)
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl 0x18(%rbp), %edx
imull $0xa, 0x18(%rbp), %ecx
movl 0x18(%rbp), %r8d
movsd -0x30(%rbp), %xmm1
movl 0x30(%rbp), %r9d
movq -0x40(%rbp), %r10
movl 0x48(%rbp), %eax
movsd 0x2a77f(%rip), %xmm0    # 0x2d008
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x1b080
movq -0x58(%rbp), %rdi
movq 0x31757(%rip), %rax     # 0x33ff8
movq (%rax), %rsi
movl 0x48(%rbp), %edx
callq 0x12570
movq -0x50(%rbp), %rdi
callq 0x3d10
movq $0x0, -0x50(%rbp)
movq 0x31734(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x2a7f5(%rip), %rsi     # 0x2d0c3
leaq 0x2a785(%rip), %rdx     # 0x2d05a
movb $0x0, %al
callq 0x2290
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
movl 0x18(%rbp), %edx
movsd -0x30(%rbp), %xmm0
callq 0x3e00
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x290a
movq -0x50(%rbp), %rdi
callq 0x5070
cmpl $0x0, %eax
je 0x2935
movq 0x316e7(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x2a7c4(%rip), %rsi     # 0x2d0df
leaq 0x2a738(%rip), %rdx     # 0x2d05a
movb $0x0, %al
callq 0x2290
movl $0x1, -0x6c(%rbp)
jmp 0x2e32
movq 0x316bc(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x2a7b6(%rip), %rsi     # 0x2d0fc
leaq 0x2a70d(%rip), %rdx     # 0x2d05a
movb $0x0, %al
callq 0x2290
movq -0x50(%rbp), %rdi
movq 0x31699(%rip), %rax     # 0x33ff8
movq (%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x5100
cmpl $0x1, 0x48(%rbp)
jle 0x2984
movq -0x50(%rbp), %rdi
movq 0x3167c(%rip), %rax     # 0x33ff8
movq (%rax), %rsi
callq 0x5310
movq 0x3166d(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x2a784(%rip), %rsi     # 0x2d119
leaq 0x2a6be(%rip), %rdx     # 0x2d05a
movb $0x0, %al
callq 0x2290
movq -0x50(%rbp), %rdi
callq 0x7660
movq 0x31645(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x2a77e(%rip), %rsi     # 0x2d13b
leaq 0x2a696(%rip), %rdx     # 0x2d05a
movb $0x0, %al
callq 0x2290
movq -0x50(%rbp), %rdi
movq 0x31622(%rip), %rax     # 0x33ff8
movq (%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x5100
movq 0x38(%rbp), %rdi
leaq 0x2a77c(%rip), %rsi     # 0x2d169
callq 0x294e0
movq %rax, -0x40(%rbp)
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x40(%rbp), %r8
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x5870
movq -0x40(%rbp), %rdi
callq 0x2140
cmpl $0x1, 0x48(%rbp)
jle 0x2a2d
movq -0x50(%rbp), %rdi
movq 0x315d3(%rip), %rax     # 0x33ff8
movq (%rax), %rsi
callq 0x5310
movq 0x315c4(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x2a734(%rip), %rsi     # 0x2d172
leaq 0x2a615(%rip), %rdx     # 0x2d05a
movb $0x0, %al
callq 0x2290
movq $0x1, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x2af2
movq $0x0, -0x78(%rbp)
cmpl $0x0, 0x28(%rbp)
jg 0x2ac3
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0x24(%rbp), %rsi
movl 0x48(%rbp), %eax
xorl %ecx, %ecx
movl %ecx, %edx
xorl %r9d, %r9d
movl $0x1, %r8d
movl %r9d, %ecx
movl %eax, (%rsp)
callq 0x21d90
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
movsd -0x38(%rbp), %xmm0
movl 0x48(%rbp), %edx
movsd 0x2a564(%rip), %xmm1    # 0x2d018
xorl %esi, %esi
callq 0x218e0
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
movslq 0x10(%rbp), %rdx
movl 0x48(%rbp), %r9d
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x21160
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x2a54
movq -0x50(%rbp), %rdi
callq 0x7660
movl $0x1, %edi
movl $0x18, %esi
callq 0x2250
movq %rax, -0x68(%rbp)
cmpl $0x0, 0x28(%rbp)
jle 0x2d85
movq 0x314d9(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x2a668(%rip), %rsi     # 0x2d191
leaq 0x2a52a(%rip), %rdx     # 0x2d05a
xorl %eax, %eax
callq 0x2290
cvtsi2sdl -0x1c(%rbp), %xmm1
movsd 0x2a4cc(%rip), %xmm0    # 0x2d010
divsd %xmm1, %xmm0
callq 0x24e0
cvttsd2si %xmm0, %rax
movl %eax, -0x84(%rbp)
movl $0x0, -0x7c(%rbp)
movl $0x1, -0x80(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x80(%rbp)
movb %al, -0x95(%rbp)
je 0x2b83
movl -0x7c(%rbp), %eax
cmpl 0x28(%rbp), %eax
setl %al
movb %al, -0x95(%rbp)
movb -0x95(%rbp), %al
testb $0x1, %al
jne 0x2b92
jmp 0x2c28
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
movq -0x58(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x50(%rbp), %rdx
movl 0x30(%rbp), %ecx
movl $0x1, %r8d
callq 0x25f30
movq -0x50(%rbp), %rdi
callq 0x55a0
movq -0x50(%rbp), %rdi
movq -0x68(%rbp), %rsi
movl -0x84(%rbp), %edx
movsd 0x2a444(%rip), %xmm0    # 0x2d018
movsd 0x2a444(%rip), %xmm1    # 0x2d020
callq 0x76b0
movl %eax, -0x80(%rbp)
cmpl $0x0, 0x48(%rbp)
jle 0x2c23
movq 0x31407(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
movl -0x7c(%rbp), %ecx
leaq 0x2a5b5(%rip), %rsi     # 0x2d1b3
leaq 0x2a455(%rip), %rdx     # 0x2d05a
movb $0x0, %al
callq 0x2290
movq -0x50(%rbp), %rdi
movq 0x313e1(%rip), %rax     # 0x33ff8
movq (%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x5100
jmp 0x2b66
movq -0x58(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x50(%rbp), %rdx
movl 0x30(%rbp), %ecx
movl $0x1, %r8d
callq 0x25f30
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x68(%rbp), %rdx
movl 0x48(%rbp), %r8d
xorl %ecx, %ecx
callq 0xcb00
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
movsd -0x38(%rbp), %xmm0
movl 0x48(%rbp), %edx
movsd 0x2a3a7(%rip), %xmm1    # 0x2d018
xorl %esi, %esi
callq 0x218e0
movq -0x50(%rbp), %rdi
callq 0x9ee0
movq -0x58(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x50(%rbp), %rdx
movl 0x30(%rbp), %ecx
xorl %r8d, %r8d
callq 0x25f30
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x68(%rbp), %rdx
movl 0x48(%rbp), %ecx
callq 0xacd0
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x68(%rbp), %rdx
movl 0x48(%rbp), %r8d
movl $0x1, %ecx
callq 0xcb00
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r8d
movl %ecx, %edx
callq 0x5870
movq $0x1, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x2d7c
movq $0x0, -0x78(%rbp)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0x24(%rbp), %rsi
movl 0x48(%rbp), %eax
xorl %ecx, %ecx
movl %ecx, %edx
xorl %r9d, %r9d
movl $0x1, %r8d
movl %r9d, %ecx
movl %eax, (%rsp)
callq 0x21d90
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
movsd -0x38(%rbp), %xmm0
movl 0x48(%rbp), %edx
movsd 0x2a2da(%rip), %xmm1    # 0x2d018
xorl %esi, %esi
callq 0x218e0
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
movslq 0x10(%rbp), %rdx
movl 0x48(%rbp), %r9d
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x21160
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x2ce4
movq -0x50(%rbp), %rdi
callq 0x7660
movq -0x58(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x50(%rbp), %rdx
movl 0x30(%rbp), %ecx
xorl %r8d, %r8d
callq 0x25f30
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x68(%rbp), %rdx
movl 0x48(%rbp), %ecx
callq 0xacd0
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x68(%rbp), %rdx
movl 0x48(%rbp), %r8d
movl $0x1, %ecx
callq 0xcb00
movq 0x31227(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x2a411(%rip), %rsi     # 0x2d1ec
leaq 0x2a278(%rip), %rdx     # 0x2d05a
movb $0x0, %al
callq 0x2290
movq -0x50(%rbp), %rdi
movq 0x31204(%rip), %rax     # 0x33ff8
movq (%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x5100
movq 0x38(%rbp), %rdi
leaq 0x2a415(%rip), %rsi     # 0x2d220
callq 0x294e0
movq %rax, -0x40(%rbp)
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x40(%rbp), %r8
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x5870
movq -0x40(%rbp), %rdi
callq 0x2140
cmpq $0x0, 0x40(%rbp)
je 0x2e87
movq 0x40(%rbp), %rdi
callq 0x3d80
movl -0x1c(%rbp), %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
movl -0x20(%rbp), %ecx
movq 0x40(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x50(%rbp), %rcx
movq 0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x60(%rbp), %rcx
movq 0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rcx
movq 0x40(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x68(%rbp), %rcx
movq 0x40(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x2eab
movq -0x50(%rbp), %rdi
callq 0x3d10
movq -0x60(%rbp), %rdi
callq 0x13dc0
movq -0x58(%rbp), %rdi
callq 0x13cb0
movq -0x68(%rbp), %rdi
callq 0x25e90
movl -0x6c(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)