// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: clean_graph(int, ma_hit_t_alloc*, ma_hit_t_alloc*, long long, unsigned long*, long long, long long, long long, long long, float, float, char*, long long, int, R_to_U*, asg_t**, ma_sub_t**, unsigned char*, int)
void clean_graph(
int min_dp, ma_hit_t_alloc* sources, ma_hit_t_alloc* reverse_sources, 
long long n_read, uint64_t* readLen, long long mini_overlap_length, 
long long max_hang_length, long long clean_round, long long gap_fuzz,
float min_ovlp_drop_ratio, float max_ovlp_drop_ratio, char* output_file_name, 
long long bubble_dist, int read_graph, R_to_U* ruIndex, asg_t **sg_ptr, 
ma_sub_t **coverage_cut_ptr, uint8_t *cmk, int debug_g)
{
    char *o_file = get_outfile_name(output_file_name);
	ma_sub_t *coverage_cut = *coverage_cut_ptr;
	asg_t *sg = *sg_ptr;
    bub_label_t b_mask_t;
    ug_opt_t uopt; 
    telo_end_t *te = NULL;

    if(asm_opt.telo_motif) te = gen_telo_end_t(&R_INF, asm_opt.telo_motif, asm_opt.telo_mic_sc, asm_opt.telo_pen, asm_opt.telo_drop, asm_opt.thread_num);

    if(debug_g) 
    {
        init_bub_label_t(&b_mask_t, MIN(10, asm_opt.thread_num), n_read);
        goto debug_gfa;
    }
    ///just for debug
    if(!cmk) renew_graph_init(sources, reverse_sources, sg, coverage_cut, ruIndex, n_read);
    // if(asm_opt.is_ont) handle_chemical_arc(asm_opt.thread_num, R_INF.total_reads);
    // if(asm_opt.is_ont) handle_chemical_r(asm_opt.thread_num, R_INF.total_reads);
    
    ///it's hard to say which function is better       
    ///normalize_ma_hit_t_single_side(sources, n_read);

    normalize_ma_hit_t_single_side_advance(sources, n_read, asm_opt.is_ont, cmk);
    // normalize_ma_hit_t_single_side_advance_mult(sources, n_read, asm_opt.thread_num);
    normalize_ma_hit_t_single_side_advance(reverse_sources, n_read, 0, cmk);
    // normalize_ma_hit_t_single_side_advance_mult(reverse_sources, n_read, asm_opt.thread_num);

    if (ha_opt_triobin(&asm_opt))
    {
        drop_edges_by_trio(sources, n_read);
    }
    else
    {
        memset(R_INF.trio_flag, AMBIGU, R_INF.total_reads*sizeof(uint8_t));
    }
    if(asm_opt.ar) init_all_ul_t(&UL_INF, &R_INF);
    // if (asm_opt.flag & HA_F_VERBOSE_GFA) {
    //     write_debug_graph(NULL, sources, coverage_cut, output_file_name, reverse_sources, ruIndex, &UL_INF);
    //     debug_gfa:;
    // }
    ///should recover edges from sources by using UL alignments
    // prt_specific_overlap(sources, 22233, 22235, "0-a");
    // prt_specific_overlap(sources, 22235, 22233, "0-a");
    if(asm_opt.ar) {
        create_ul_info(sources, reverse_sources, max_hang_length, mini_overlap_length, gap_fuzz, min_dp, readLen, coverage_cut, ruIndex, 
        (asm_opt.max_short_tip*2), 0.15, 3, 0.05, 0.9, &b_mask_t, te);
    } 
    // prt_specific_overlap(sources, 22233, 22235, "0-b");
    // prt_specific_overlap(sources, 22235, 22233, "0-b");
    // prt_dbg_rid_ovlp(sources, 27087, NULL, "0-a");
    if(!(asm_opt.is_ont)) clean_weak_ma_hit_t(sources, reverse_sources, n_read, asm_opt.ar?UL_COV_THRES:(uint32_t)-1);
    // prt_dbg_rid_ovlp(sources, 27087, NULL, "0-b");
    // prt_specific_overlap(sources, 22233, 22235, "0-c");
    // prt_specific_overlap(sources, 22235, 22233, "0-c");
    sg = gen_init_sg(min_dp, n_read, mini_overlap_length, max_hang_length, gap_fuzz, sources, readLen, ruIndex, 
    &b_mask_t, &coverage_cut, asm_opt.ar?&UL_INF:NULL, te);
    // if(asm_opt.ar) exit(1);
    /**
    ///print_binned_reads(sources, n_read, coverage_cut);
    
    ///ma_hit_sub is just use to init coverage_cut,
    ///it seems we do not need ma_hit_cut & ma_hit_flt
    ma_hit_sub(min_dp, sources, n_read, readLen, mini_overlap_length, &coverage_cut);
    detect_chimeric_reads(sources, n_read, readLen, coverage_cut, asm_opt.max_ov_diff_final * 2.0, asm_opt.ar?&UL_INF:NULL);
    ma_hit_cut(sources, n_read, readLen, mini_overlap_length, &coverage_cut);
    ///print_binned_reads(sources, n_read, coverage_cut);
    ma_hit_flt(sources, n_read, coverage_cut, max_hang_length, mini_overlap_length);
    ///fix_binned_reads(sources, n_read, coverage_cut);
    ///just need to deal with trio here
    ma_hit_contained_advance(sources, n_read, coverage_cut, ruIndex, max_hang_length, mini_overlap_length);
    sg = ma_sg_gen(sources, n_read, coverage_cut, max_hang_length, mini_overlap_length);
    ///debug_info_of_specfic_node((char*)"m64043_200504_050026/93784180/ccs", sg, ruIndex, (char*)"sbsbsb");
    init_bub_label_t(&b_mask_t, MIN(10, asm_opt.thread_num), sg->n_seq);
    asg_arc_del_trans(sg, gap_fuzz);
    asm_opt.coverage = get_coverage(sources, coverage_cut, n_read);
    **/
    if(VERBOSE >= 1)
    {
        char* unlean_name = (char*)malloc(strlen(output_file_name)+25);
        sprintf(unlean_name, "%s.unclean", output_file_name);
        output_read_graph(sg, coverage_cut, unlean_name, n_read);
        free(unlean_name);
    }


    // if (asm_opt.flag & HA_F_VERBOSE_GFA) {
    //     write_debug_graph(sg, sources, coverage_cut, output_file_name, reverse_sources, ruIndex, &UL_INF);
    //     debug_gfa:;
    // }
    
    gen_ug_opt_t(&uopt, sources, reverse_sources, max_hang_length, mini_overlap_length, gap_fuzz, min_dp, readLen, coverage_cut, ruIndex, 
            (asm_opt.max_short_tip*2), 0.15, 3, 0.05, 0.9, &b_mask_t, te);
    ul_clean_gfa(&uopt, sg, sources, reverse_sources, ruIndex, clean_round, min_ovlp_drop_ratio, max_ovlp_drop_ratio, 
    0.6, asm_opt.max_short_tip, gap_fuzz, &b_mask_t, !!asm_opt.ar, ha_opt_triobin(&asm_opt), UL_COV_THRES, cmk, o_file);
    ///@brief debug
    if (asm_opt.flag & HA_F_VERBOSE_GFA) {
        write_debug_graph(sg, sources, coverage_cut, output_file_name, reverse_sources, ruIndex, &UL_INF);
        debug_gfa:;
        gen_ug_opt_t(&uopt, sources, reverse_sources, max_hang_length, mini_overlap_length, gap_fuzz, min_dp, readLen, coverage_cut, ruIndex, 
                (asm_opt.max_short_tip*2), 0.15, 3, 0.05, 0.9, &b_mask_t, te);
        // set_hom_global_coverage(&asm_opt, sg, coverage_cut, sources, reverse_sources, ruIndex, max_hang_length, mini_overlap_length);
    }

    if(asm_opt.ar) {
        gradually_renew_g(&sources, &reverse_sources, &n_read, &readLen, &coverage_cut, ruIndex, 
        &sg, mini_overlap_length, max_hang_length, &uopt, clean_round, min_ovlp_drop_ratio, 
        max_ovlp_drop_ratio, asm_opt.max_short_tip, gap_fuzz, min_dp, &b_mask_t, 
        ha_opt_triobin(&asm_opt), asm_opt.ul_clean_round, o_file, "re", te);
    } else {
        ug_ext_gfa(&uopt, sg, ug_ext_len);
        if(!ha_opt_triobin(&asm_opt)) {
            // output_unitig_graph(sg, coverage_cut, "pre_clean", sources, ruIndex, max_hang_length, mini_overlap_length);
            hic_clean_adv(sg, &uopt);
        }
    }

    /**
    if(asm_opt.ar) {
        renew_g(&sources, &reverse_sources, &n_read, &readLen, &coverage_cut, ruIndex, &sg, mini_overlap_length, max_hang_length,
        &uopt, clean_round, min_ovlp_drop_ratio, max_ovlp_drop_ratio, asm_opt.max_short_tip, &b_mask_t, 
        ha_opt_triobin(&asm_opt), o_file);
        ///make sure uopt has been updated; not necessary
        gen_ug_opt_t(&uopt, sources, reverse_sources, max_hang_length, mini_overlap_length, gap_fuzz, min_dp, readLen, coverage_cut, ruIndex, 
            (asm_opt.max_short_tip*2), 0.15, 3, 0.05, 0.9, &b_mask_t);
    }
    **/
    // print_debug_gfa(sg, NULL, coverage_cut, "UL.debug", sources, ruIndex, max_hang_length, mini_overlap_length, 0, 0, 0);
    /**
    asg_cut_tip(sg, asm_opt.max_short_tip);
    ///debug_info_of_specfic_node("m64043_200505_112554/8849050/ccs", sg, "inner_1");
    ///drop_inexact_edegs_at_bubbles(sg, bubble_dist);
    
    if(clean_round > 0)
    {
        double cut_step;
        if(clean_round == 1)
        {
            cut_step = max_ovlp_drop_ratio;
        }
        else
        {
            cut_step = (max_ovlp_drop_ratio - min_ovlp_drop_ratio) / (clean_round - 1);
        }
        double drop_ratio = min_ovlp_drop_ratio;
        int i = 0;
        for (i = 0; i < clean_round; i++, drop_ratio += cut_step)
        {
            if(drop_ratio > max_ovlp_drop_ratio)
            {
                drop_ratio = max_ovlp_drop_ratio;
            }

            if(VERBOSE >= 1)
            {
                fprintf(stderr, "\n\n**********%d-th round drop: drop_ratio = %f**********\n", 
                i, drop_ratio);
            }

            ///just topological clean
            pre_clean(sources, coverage_cut, sg, 1);
            ///asg_arc_del_orthology(sg, reverse_sources, drop_ratio, asm_opt.max_short_tip);
            // asg_arc_del_orthology_multiple_way(sg, reverse_sources, drop_ratio, asm_opt.max_short_tip);
            // asg_cut_tip(sg, asm_opt.max_short_tip);

            asg_arc_identify_simple_bubbles_multi(sg, &b_mask_t, 1);
            //reomve edge between two chromesomes
            //this node must be a single read
            asg_arc_del_false_node(sg, sources, asm_opt.max_short_tip);
            asg_cut_tip(sg, asm_opt.max_short_tip);

            ///asg_arc_identify_simple_bubbles_multi(sg, 1);
            asg_arc_identify_simple_bubbles_multi(sg, &b_mask_t, 0);
            ///asg_arc_del_short_diploid_unclean_exact(sg, drop_ratio, sources);
            if (ha_opt_triobin(&asm_opt))
            {
                asg_arc_del_short_diploid_by_exact_trio(sg, asm_opt.max_short_tip, sources);
            }
            else
            {
                asg_arc_del_short_diploid_by_exact(sg, asm_opt.max_short_tip, sources);
            }
            asg_cut_tip(sg, asm_opt.max_short_tip);

            asg_arc_identify_simple_bubbles_multi(sg, &b_mask_t, 1);
            if (ha_opt_triobin(&asm_opt))
            {
                asg_arc_del_short_diploid_by_length_trio(sg, drop_ratio, asm_opt.max_short_tip, reverse_sources, 
                asm_opt.max_short_tip, 1, 1, 0, 0, ruIndex);
            }
            else
            {
                asg_arc_del_short_diploid_by_length(sg, drop_ratio, asm_opt.max_short_tip, reverse_sources, 
                asm_opt.max_short_tip, 1, 1, 0, 0, ruIndex);
            }
            asg_cut_tip(sg, asm_opt.max_short_tip);

            asg_arc_identify_simple_bubbles_multi(sg, &b_mask_t, 1);
            asg_arc_del_short_false_link(sg, 0.6, 0.85, bubble_dist, reverse_sources, asm_opt.max_short_tip, ruIndex);     
    
            asg_arc_identify_simple_bubbles_multi(sg, &b_mask_t, 1);
            asg_arc_del_complex_false_link(sg, 0.6, 0.85, bubble_dist, reverse_sources, asm_opt.max_short_tip);

            asg_cut_tip(sg, asm_opt.max_short_tip);
        }
    }
    if(VERBOSE >= 1)
    {
        fprintf(stderr, "\n\n**********final clean**********\n");
    }


    pre_clean(sources, coverage_cut, sg, 1);


    asg_arc_del_short_diploi_by_suspect_edge(sg, asm_opt.max_short_tip);
    asg_cut_tip(sg, asm_opt.max_short_tip);
    asg_arc_del_triangular_directly(sg, asm_opt.max_short_tip, reverse_sources, ruIndex);


    asg_arc_identify_simple_bubbles_multi(sg, &b_mask_t, 0);
    asg_arc_del_orthology_multiple_way(sg, reverse_sources, 0.4, asm_opt.max_short_tip, ruIndex);
    asg_cut_tip(sg, asm_opt.max_short_tip);




    asg_arc_identify_simple_bubbles_multi(sg, &b_mask_t, 0);
    asg_arc_del_too_short_overlaps(sg, 2000, min_ovlp_drop_ratio, reverse_sources, asm_opt.max_short_tip, ruIndex);
    asg_cut_tip(sg, asm_opt.max_short_tip);

    asg_arc_del_simple_circle_untig(sources, coverage_cut, sg, 100, 0);
    
    ///note: don't apply asg_arc_del_too_short_overlaps() after this function!!!!
    rescue_contained_reads_aggressive(NULL, sg, sources, coverage_cut, ruIndex, max_hang_length, 
    mini_overlap_length, 10, 1, 0, NULL, NULL, &b_mask_t);
    rescue_missing_overlaps_aggressive(NULL, sg, sources, coverage_cut, ruIndex, max_hang_length,
    mini_overlap_length, 1, 0, NULL, &b_mask_t);
    rescue_missing_overlaps_backward(NULL, sg, sources, coverage_cut, ruIndex, max_hang_length, 
    mini_overlap_length, 10, 1, 0, &b_mask_t);
    // rescue_wrong_overlaps_to_unitigs(NULL, sg, sources, reverse_sources, coverage_cut, ruIndex, 
    // max_hang_length, mini_overlap_length, bubble_dist, NULL);
    // rescue_no_coverage_aggressive(sg, sources, reverse_sources, &coverage_cut, ruIndex, max_hang_length, 
    // mini_overlap_length, bubble_dist, 10);

    
    set_hom_global_coverage(&asm_opt, sg, coverage_cut, sources, reverse_sources, ruIndex, 
    max_hang_length, mini_overlap_length);

    rescue_bubble_by_chain(sg, coverage_cut, sources, reverse_sources, (asm_opt.max_short_tip*2), 0.15, 3, 
    ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, 10, gap_fuzz, &b_mask_t);
    

    output_unitig_graph(sg, coverage_cut, o_file, sources, ruIndex, max_hang_length, mini_overlap_length);
    // flat_bubbles(sg, ruIndex->is_het); free(ruIndex->is_het); ruIndex->is_het = NULL;
    flat_soma_v(sg, sources, ruIndex);
    **/

    output_contig_graph_primary_pre(sg, coverage_cut, o_file, sources, reverse_sources, 
        asm_opt.small_pop_bubble_size, asm_opt.max_short_tip, ruIndex, max_hang_length, mini_overlap_length, &uopt);
    
    // if(asm_opt.ar) {
    //     char *op_file = get_outfile_name(o_file);
    //     ul_clean_gfa(&uopt, sg, sources, reverse_sources, ruIndex, clean_round, min_ovlp_drop_ratio, max_ovlp_drop_ratio, 
    //     0.6, asm_opt.max_short_tip, gap_fuzz, &b_mask_t, 0/**!!asm_opt.ar**/, ha_opt_triobin(&asm_opt), UL_COV_THRES, op_file);
    //     output_contig_graph_primary_pre(sg, coverage_cut, op_file, sources, reverse_sources, 
    //     asm_opt.small_pop_bubble_size, asm_opt.max_short_tip, ruIndex, max_hang_length, mini_overlap_length, &uopt);
    //     free(op_file);
    // }
    /**
    if (asm_opt.flag & HA_F_VERBOSE_GFA)
    {
        write_debug_graph(sg, sources, coverage_cut, output_file_name, n_read, reverse_sources, ruIndex);
        debug_gfa:;
    }**/

    if(asm_opt.fn_bin_poy)
    {
        if(asm_opt.flag & HA_F_PARTITION) asm_opt.flag -= HA_F_PARTITION;
        output_poly_trio(sg, coverage_cut, o_file, sources, reverse_sources, (asm_opt.max_short_tip*2), 0.15, 3, ruIndex, 
        0.05, 0.9, max_hang_length, mini_overlap_length, gap_fuzz, 0, &b_mask_t, asm_opt.polyploidy);
    }
    else if (ha_opt_triobin(&asm_opt) && ha_opt_hic(&asm_opt))
    {
        if(asm_opt.flag & HA_F_PARTITION) asm_opt.flag -= HA_F_PARTITION;
        benchmark_hic_graph(sg, coverage_cut, o_file, sources, reverse_sources, (asm_opt.max_short_tip*2), 0.15, 3, 
        ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, gap_fuzz, &b_mask_t);
    }
    else if (ha_opt_triobin(&asm_opt))
    {   
        if(asm_opt.flag & HA_F_PARTITION) asm_opt.flag -= HA_F_PARTITION;
        // output_trio_graph(sg, coverage_cut, o_file, sources, reverse_sources, (asm_opt.max_short_tip*2), 
        // 0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, 0, gap_fuzz, &uopt, &b_mask_t);
        if(asm_opt.trio_cov_het_ovlp > 0) {
            output_bp_trio_graph(sg, coverage_cut, o_file, sources, reverse_sources, (asm_opt.max_short_tip*2), 
            0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, &b_mask_t, gap_fuzz, &uopt);
        } else {
            output_trio_graph_joint(sg, coverage_cut, o_file, sources, reverse_sources, (asm_opt.max_short_tip*2), 
            0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, gap_fuzz, &b_mask_t, NULL, NULL, &uopt);
        }
    }
    else if(ha_opt_hic(&asm_opt))
    {
        if(asm_opt.flag & HA_F_PARTITION) asm_opt.flag -= HA_F_PARTITION;
        if(asm_opt.polyploidy <= 2) {
            output_hic_graph(sg, coverage_cut, o_file, sources, reverse_sources, (asm_opt.max_short_tip*2), 
            0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, gap_fuzz, &b_mask_t, &uopt);
        } else {
            output_hic_graph_mmhap(sg, coverage_cut, o_file, sources, reverse_sources, (asm_opt.max_short_tip*2), 
            0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, gap_fuzz, &b_mask_t, &uopt);
        }
        
        // output_hic_graph_polyploid(sg, coverage_cut, o_file, sources, reverse_sources, (asm_opt.max_short_tip*2), 
        // 0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, gap_fuzz, &b_mask_t);
    }
    else if((asm_opt.flag & HA_F_PARTITION) && (asm_opt.purge_level_primary > 0))
    {
        output_bp_graph(sg, coverage_cut, o_file, sources, reverse_sources, (asm_opt.max_short_tip*2), 
        0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, &b_mask_t, gap_fuzz, &uopt);
    }
    else
    {
        if(asm_opt.flag & HA_F_PARTITION) asm_opt.flag -= HA_F_PARTITION;
        output_contig_graph_primary(sg, coverage_cut, o_file, sources, reverse_sources, 
        (asm_opt.max_short_tip*2), 0.15, 3, ruIndex, 0.05, 0.9, max_hang_length, mini_overlap_length, &b_mask_t);

        output_contig_graph_alternative(sg, coverage_cut, o_file, sources, ruIndex, max_hang_length, mini_overlap_length);
    }

	*coverage_cut_ptr = coverage_cut;
	*sg_ptr = sg;
    destory_bub_label_t(&b_mask_t); 
    if(te) {
        destory_telo_end_t(te); free(te); te = NULL;
    }
    free(o_file); ///if(asm_opt.ar) destory_all_ul_t(&UL_INF); 
    fprintf(stderr, "Inconsistency threshold for low-quality regions in BED files: %u%%\n", asm_opt.bed_inconsist_rate);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movl 0x60(%rbp), %eax
movq 0x58(%rbp), %rax
movq 0x50(%rbp), %rax
movq 0x48(%rbp), %rax
movq 0x40(%rbp), %rax
movl 0x38(%rbp), %eax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0x2c(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movss %xmm0, -0x5c(%rbp)
movss %xmm1, -0x60(%rbp)
movq 0x28(%rbp), %rdi
callq 0x163c00
movq %rax, -0x68(%rbp)
movq 0x50(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x70(%rbp)
movq 0x48(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq $0x0, -0x120(%rbp)
leaq 0x25f864(%rip), %rax    # 0x3c47f8
cmpq $0x0, 0x288(%rax)
je 0x164ff4
leaq 0x25f853(%rip), %rax    # 0x3c47f8
movq 0x288(%rax), %rsi
leaq 0x25f845(%rip), %rax    # 0x3c47f8
movq 0x2a0(%rax), %rdx
leaq 0x25f837(%rip), %rax    # 0x3c47f8
movq 0x290(%rax), %rcx
leaq 0x25f829(%rip), %rax    # 0x3c47f8
movq 0x298(%rax), %r8
leaq 0x25f81b(%rip), %rax    # 0x3c47f8
movslq 0x7c(%rax), %r9
leaq 0x2602e8(%rip), %rdi    # 0x3c52d0
callq 0xcb710
movq %rax, -0x120(%rbp)
cmpl $0x0, 0x60(%rbp)
je 0x165045
movl $0xa, %eax
leaq 0x25f7f2(%rip), %rcx    # 0x3c47f8
cmpl 0x7c(%rcx), %eax
jg 0x165018
movl $0xa, %eax
movl %eax, -0x124(%rbp)
jmp 0x165028
leaq 0x25f7d9(%rip), %rax    # 0x3c47f8
movl 0x7c(%rax), %eax
movl %eax, -0x124(%rbp)
movl -0x124(%rbp), %esi
movq -0x48(%rbp), %rax
movl %eax, %edx
leaq -0xa0(%rbp), %rdi
callq 0xccd40
jmp 0x16542d
cmpq $0x0, 0x58(%rbp)
jne 0x165069
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq -0x70(%rbp), %rcx
movq 0x40(%rbp), %r8
movq -0x48(%rbp), %r9
callq 0x1509c0
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq 0x25f780(%rip), %rax    # 0x3c47f8
movq 0x2a8(%rax), %rax
movl %eax, %edx
movq 0x58(%rbp), %rcx
callq 0xce390
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq 0x58(%rbp), %rcx
xorl %edx, %edx
callq 0xce390
leaq 0x25f754(%rip), %rdi    # 0x3c47f8
callq 0x133600
cmpl $0x0, %eax
je 0x1650bd
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0xcfd00
jmp 0x1650de
leaq 0x26020c(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rdi
leaq 0x260201(%rip), %rax    # 0x3c52d0
movq 0x50(%rax), %rdx
shlq $0x0, %rdx
xorl %esi, %esi
callq 0x2100
leaq 0x25f713(%rip), %rax    # 0x3c47f8
cmpq $0x0, 0x68(%rax)
je 0x1650ff
leaq 0x2602c5(%rip), %rdi    # 0x3c53b8
leaq 0x2601d6(%rip), %rsi    # 0x3c52d0
callq 0xbb50
leaq 0x25f6f2(%rip), %rax    # 0x3c47f8
cmpq $0x0, 0x68(%rax)
je 0x165198
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq 0x10(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq 0x20(%rbp), %r8
movslq -0x2c(%rbp), %r9
movq -0x50(%rbp), %r15
movq -0x70(%rbp), %r14
movq 0x40(%rbp), %rbx
leaq 0x25f6bc(%rip), %rax    # 0x3c47f8
movl 0x11c(%rax), %eax
shll %eax
movslq %eax, %r11
movq -0x120(%rbp), %rax
movss 0x22174a(%rip), %xmm0   # 0x3868a0
movss 0x221746(%rip), %xmm1   # 0x3868a4
movss 0x221736(%rip), %xmm2   # 0x38689c
leaq -0xa0(%rbp), %r10
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq $0x3, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x163e90
leaq 0x25f659(%rip), %rax    # 0x3c47f8
cmpq $0x0, 0x2a8(%rax)
jne 0x1651d6
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq 0x25f63c(%rip), %rax    # 0x3c47f8
movq 0x68(%rax), %r8
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0x2, %eax
cmpq $0x0, %r8
cmovnel %eax, %ecx
callq 0xf0d50
movl -0x2c(%rbp), %edi
movq -0x48(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq 0x10(%rbp), %rcx
movq 0x20(%rbp), %r8
movq -0x38(%rbp), %r9
movq -0x50(%rbp), %r15
movq 0x40(%rbp), %r14
leaq 0x25f5fc(%rip), %rax    # 0x3c47f8
movq 0x68(%rax), %r11
xorl %eax, %eax
movl %eax, %r10d
leaq 0x2601ac(%rip), %rax    # 0x3c53b8
cmpq $0x0, %r11
cmovneq %rax, %r10
movq -0x120(%rbp), %rax
leaq -0xa0(%rbp), %rbx
leaq -0x70(%rbp), %r11
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x1644b0
movq %rax, -0x78(%rbp)
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x10(%rbp), %rcx
movq -0x58(%rbp), %r8
movq 0x20(%rbp), %r9
movslq -0x2c(%rbp), %r12
movq -0x50(%rbp), %r15
movq -0x70(%rbp), %r14
movq 0x40(%rbp), %rbx
leaq 0x25f581(%rip), %rax    # 0x3c47f8
movl 0x11c(%rax), %eax
shll %eax
movslq %eax, %r11
movq -0x120(%rbp), %rax
leaq -0x118(%rbp), %rdi
movss 0x221608(%rip), %xmm0   # 0x3868a0
movss 0x221604(%rip), %xmm1   # 0x3868a4
movss 0x2215f4(%rip), %xmm2   # 0x38689c
leaq -0xa0(%rbp), %r10
movq %r12, (%rsp)
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq $0x3, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq %rax, 0x38(%rsp)
callq 0x163d60
movq -0x78(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x150(%rbp)
movq 0x40(%rbp), %rax
movq %rax, -0x148(%rbp)
movq 0x18(%rbp), %rax
movq %rax, -0x140(%rbp)
movss -0x5c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x138(%rbp)
movss -0x60(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x130(%rbp)
leaq 0x25f4b9(%rip), %rax    # 0x3c47f8
movslq 0x11c(%rax), %r12
movq 0x20(%rbp), %r15
leaq 0x25f4a7(%rip), %rax    # 0x3c47f8
cmpq $0x0, 0x68(%rax)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %ebx
leaq 0x25f48f(%rip), %rdi    # 0x3c47f8
callq 0x133600
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdx
movq -0x150(%rbp), %rcx
movq -0x148(%rbp), %r8
movq -0x140(%rbp), %r9
movsd -0x138(%rbp), %xmm0
movsd -0x130(%rbp), %xmm1
movl %eax, %r11d
movq 0x58(%rbp), %r10
movq -0x68(%rbp), %rax
leaq -0x118(%rbp), %rdi
movsd 0x21ce55(%rip), %xmm2   # 0x382210
leaq -0xa0(%rbp), %r14
movq %r12, (%rsp)
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movl %r11d, 0x20(%rsp)
movl $0x2, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq %rax, 0x38(%rsp)
callq 0x320f90
leaq 0x25f401(%rip), %rax    # 0x3c47f8
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1654c0
movq -0x78(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq 0x28(%rbp), %rcx
movq -0x40(%rbp), %r8
movq 0x40(%rbp), %r9
leaq 0x25ff94(%rip), %rax    # 0x3c53b8
movq %rax, (%rsp)
callq 0x14dea0
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x10(%rbp), %rcx
movq -0x58(%rbp), %r8
movq 0x20(%rbp), %r9
movslq -0x2c(%rbp), %r12
movq -0x50(%rbp), %r15
movq -0x70(%rbp), %r14
movq 0x40(%rbp), %rbx
leaq 0x25f3a0(%rip), %rax    # 0x3c47f8
movl 0x11c(%rax), %eax
shll %eax
movslq %eax, %r11
movq -0x120(%rbp), %rax
leaq -0x118(%rbp), %rdi
movss 0x221427(%rip), %xmm0   # 0x3868a0
movss 0x221423(%rip), %xmm1   # 0x3868a4
movss 0x221413(%rip), %xmm2   # 0x38689c
leaq -0xa0(%rbp), %r10
movq %r12, (%rsp)
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq $0x3, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq %rax, 0x38(%rsp)
callq 0x163d60
leaq 0x25f331(%rip), %rax    # 0x3c47f8
cmpq $0x0, 0x68(%rax)
je 0x16562b
movq 0x40(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x190(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0x188(%rbp)
movq 0x18(%rbp), %rax
movq %rax, -0x178(%rbp)
movss -0x5c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x1a0(%rbp)
movss -0x60(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x198(%rbp)
leaq 0x25f2d1(%rip), %rax    # 0x3c47f8
movslq 0x11c(%rax), %rax
movq %rax, -0x170(%rbp)
movq 0x20(%rbp), %r13
movslq -0x2c(%rbp), %r12
leaq 0x25f2b4(%rip), %rdi    # 0x3c47f8
callq 0x133600
movq -0x1a8(%rbp), %r9
movsd -0x1a0(%rbp), %xmm0
movsd -0x198(%rbp), %xmm1
movl %eax, %r14d
leaq 0x25f28e(%rip), %rax    # 0x3c47f8
movl 0x250(%rax), %ebx
movq -0x68(%rbp), %r11
movq -0x120(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x48(%rbp), %rdx
leaq -0x50(%rbp), %rcx
leaq -0x70(%rbp), %r8
leaq -0x78(%rbp), %rax
leaq -0x118(%rbp), %r10
movq %r10, -0x180(%rbp)
leaq -0xa0(%rbp), %r15
leaq 0x22e63b(%rip), %r10    # 0x393bf1
movq %rax, (%rsp)
movq -0x190(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x188(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x180(%rbp), %rax
movq %rax, 0x18(%rsp)
movq -0x178(%rbp), %rax
movq %rax, 0x20(%rsp)
movq -0x170(%rbp), %rax
movq %rax, 0x28(%rsp)
movq -0x168(%rbp), %rax
movq %r13, 0x30(%rsp)
movq %r12, 0x38(%rsp)
movq %r15, 0x40(%rsp)
movl %r14d, 0x48(%rsp)
movl %ebx, 0x50(%rsp)
movq %r11, 0x58(%rsp)
movq %r10, 0x60(%rsp)
movq %rax, 0x68(%rsp)
callq 0x1649e0
jmp 0x165663
movq -0x78(%rbp), %rsi
leaq -0x118(%rbp), %rdi
movl $0x124f8, %edx          # imm = 0x124F8
callq 0x321cc0
leaq 0x25f1b1(%rip), %rdi    # 0x3c47f8
callq 0x133600
cmpl $0x0, %eax
jne 0x165661
movq -0x78(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0xfec60
jmp 0x165663
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq 0x25f17a(%rip), %rax    # 0x3c47f8
movq 0x180(%rax), %r9
leaq 0x25f16c(%rip), %rax    # 0x3c47f8
movslq 0x11c(%rax), %r14
movq 0x40(%rbp), %rbx
movq 0x10(%rbp), %rax
movl %eax, %r11d
movq -0x58(%rbp), %rax
movl %eax, %r10d
leaq -0x118(%rbp), %rax
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x14ef60
leaq 0x25f128(%rip), %rax    # 0x3c47f8
cmpq $0x0, 0x40(%rax)
je 0x1657a9
leaq 0x25f116(%rip), %rax    # 0x3c47f8
movl (%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x165706
leaq 0x25f103(%rip), %rax    # 0x3c47f8
movl (%rax), %ecx
subl $0x800, %ecx            # imm = 0x800
leaq 0x25f0f4(%rip), %rax    # 0x3c47f8
movl %ecx, (%rax)
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq 0x25f0d7(%rip), %rax    # 0x3c47f8
movl 0x11c(%rax), %eax
shll %eax
movslq %eax, %r9
movq 0x40(%rbp), %r15
movq 0x10(%rbp), %rax
movl %eax, %r14d
movq -0x58(%rbp), %rax
movl %eax, %ebx
movq 0x20(%rbp), %rax
movl %eax, %r11d
leaq 0x25f0ad(%rip), %rax    # 0x3c47f8
movl 0x1bc(%rax), %eax
movss 0x221147(%rip), %xmm0   # 0x3868a0
movss 0x221143(%rip), %xmm1   # 0x3868a4
movss 0x221133(%rip), %xmm2   # 0x38689c
xorl %r10d, %r10d
leaq -0xa0(%rbp), %r10
movq $0x3, (%rsp)
movq %r15, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movl %r11d, 0x20(%rsp)
movl $0x0, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movl %eax, 0x38(%rsp)
callq 0x100b50
jmp 0x165d0f
leaq 0x25f048(%rip), %rdi    # 0x3c47f8
callq 0x133600
cmpl $0x0, %eax
je 0x165885
leaq 0x25f033(%rip), %rdi    # 0x3c47f8
callq 0x163d20
cmpl $0x0, %eax
je 0x165885
leaq 0x25f01e(%rip), %rax    # 0x3c47f8
movl (%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x1657fe
leaq 0x25f00b(%rip), %rax    # 0x3c47f8
movl (%rax), %ecx
subl $0x800, %ecx            # imm = 0x800
leaq 0x25effc(%rip), %rax    # 0x3c47f8
movl %ecx, (%rax)
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq 0x25efdf(%rip), %rax    # 0x3c47f8
movl 0x11c(%rax), %eax
shll %eax
movslq %eax, %r9
movq 0x40(%rbp), %r14
movq 0x10(%rbp), %rax
movl %eax, %ebx
movq -0x58(%rbp), %rax
movl %eax, %r11d
movq 0x20(%rbp), %rax
movl %eax, %r10d
movss 0x22105c(%rip), %xmm0   # 0x3868a0
movss 0x221058(%rip), %xmm1   # 0x3868a4
movss 0x221048(%rip), %xmm2   # 0x38689c
leaq -0xa0(%rbp), %rax
movq $0x3, (%rsp)
movq %r14, 0x8(%rsp)
movl %ebx, 0x10(%rsp)
movl %r11d, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x114e40
jmp 0x165d0d
leaq 0x25ef6c(%rip), %rdi    # 0x3c47f8
callq 0x133600
cmpl $0x0, %eax
je 0x165a0e
leaq 0x25ef57(%rip), %rax    # 0x3c47f8
movl (%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x1658c5
leaq 0x25ef44(%rip), %rax    # 0x3c47f8
movl (%rax), %ecx
subl $0x800, %ecx            # imm = 0x800
leaq 0x25ef35(%rip), %rax    # 0x3c47f8
movl %ecx, (%rax)
leaq 0x25ef2c(%rip), %rax    # 0x3c47f8
cmpq $0x0, 0x220(%rax)
jle 0x16596a
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq 0x25ef03(%rip), %rax    # 0x3c47f8
movl 0x11c(%rax), %eax
shll %eax
movslq %eax, %r9
movq 0x40(%rbp), %r15
movq 0x10(%rbp), %rax
movl %eax, %r14d
movq -0x58(%rbp), %rax
movl %eax, %ebx
movq 0x20(%rbp), %r10
movss 0x220f83(%rip), %xmm0   # 0x3868a0
movss 0x220f7f(%rip), %xmm1   # 0x3868a4
movss 0x220f6f(%rip), %xmm2   # 0x38689c
leaq -0xa0(%rbp), %r11
leaq -0x118(%rbp), %rax
movq $0x3, (%rsp)
movq %r15, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x114640
jmp 0x165a09
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq 0x25ee73(%rip), %rax    # 0x3c47f8
movl 0x11c(%rax), %eax
shll %eax
movslq %eax, %r9
movq 0x40(%rbp), %r15
movq 0x10(%rbp), %rax
movl %eax, %r14d
movq -0x58(%rbp), %rax
movl %eax, %ebx
movq 0x20(%rbp), %r11
movss 0x220ef3(%rip), %xmm0   # 0x3868a0
movss 0x220eef(%rip), %xmm1   # 0x3868a4
movss 0x220edf(%rip), %xmm2   # 0x38689c
leaq -0xa0(%rbp), %r10
xorl %eax, %eax
leaq -0x118(%rbp), %rax
movq $0x3, (%rsp)
movq %r15, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq %rax, 0x40(%rsp)
callq 0x10ca20
jmp 0x165d0b
leaq 0x25ede3(%rip), %rdi    # 0x3c47f8
callq 0x163d20
cmpl $0x0, %eax
je 0x165b82
leaq 0x25edce(%rip), %rax    # 0x3c47f8
movl (%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x165a4e
leaq 0x25edbb(%rip), %rax    # 0x3c47f8
movl (%rax), %ecx
subl $0x800, %ecx            # imm = 0x800
leaq 0x25edac(%rip), %rax    # 0x3c47f8
movl %ecx, (%rax)
leaq 0x25eda3(%rip), %rax    # 0x3c47f8
cmpl $0x2, 0x1bc(%rax)
jg 0x165af2
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq 0x25ed7b(%rip), %rax    # 0x3c47f8
movl 0x11c(%rax), %eax
shll %eax
movslq %eax, %r9
movq 0x40(%rbp), %r15
movq 0x10(%rbp), %rax
movl %eax, %r14d
movq -0x58(%rbp), %rax
movl %eax, %ebx
movq 0x20(%rbp), %r11
movss 0x220dfb(%rip), %xmm0   # 0x3868a0
movss 0x220df7(%rip), %xmm1   # 0x3868a4
movss 0x220de7(%rip), %xmm2   # 0x38689c
leaq -0xa0(%rbp), %r10
leaq -0x118(%rbp), %rax
movq $0x3, (%rsp)
movq %r15, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x10af60
jmp 0x165b7d
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq 0x25eceb(%rip), %rax    # 0x3c47f8
movl 0x11c(%rax), %eax
shll %eax
movslq %eax, %r9
movq 0x40(%rbp), %r15
movq 0x10(%rbp), %rax
movl %eax, %r14d
movq -0x58(%rbp), %rax
movl %eax, %ebx
movq 0x20(%rbp), %r11
movss 0x220d6b(%rip), %xmm0   # 0x3868a0
movss 0x220d67(%rip), %xmm1   # 0x3868a4
movss 0x220d57(%rip), %xmm2   # 0x38689c
leaq -0xa0(%rbp), %r10
leaq -0x118(%rbp), %rax
movq $0x3, (%rsp)
movq %r15, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x10dcd0
jmp 0x165d09
leaq 0x25ec6f(%rip), %rax    # 0x3c47f8
movl (%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x165c3d
leaq 0x25ec58(%rip), %rax    # 0x3c47f8
cmpl $0x0, 0x130(%rax)
jle 0x165c3d
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq 0x25ec30(%rip), %rax    # 0x3c47f8
movl 0x11c(%rax), %eax
shll %eax
movslq %eax, %r9
movq 0x40(%rbp), %r15
movq 0x10(%rbp), %rax
movl %eax, %r14d
movq -0x58(%rbp), %rax
movl %eax, %ebx
movq 0x20(%rbp), %r10
movss 0x220cb0(%rip), %xmm0   # 0x3868a0
movss 0x220cac(%rip), %xmm1   # 0x3868a4
movss 0x220c9c(%rip), %xmm2   # 0x38689c
leaq -0xa0(%rbp), %r11
leaq -0x118(%rbp), %rax
movq $0x3, (%rsp)
movq %r15, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x1143a0
jmp 0x165d07
leaq 0x25ebb4(%rip), %rax    # 0x3c47f8
movl (%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x165c68
leaq 0x25eba1(%rip), %rax    # 0x3c47f8
movl (%rax), %ecx
subl $0x800, %ecx            # imm = 0x800
leaq 0x25eb92(%rip), %rax    # 0x3c47f8
movl %ecx, (%rax)
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq 0x25eb75(%rip), %rax    # 0x3c47f8
movl 0x11c(%rax), %eax
shll %eax
movslq %eax, %r9
movq 0x40(%rbp), %rbx
movq 0x10(%rbp), %rax
movl %eax, %r11d
movq -0x58(%rbp), %rax
movl %eax, %r10d
movss 0x220bf8(%rip), %xmm0   # 0x3868a0
movss 0x220bf4(%rip), %xmm1   # 0x3868a4
movss 0x220be4(%rip), %xmm2   # 0x38689c
leaq -0xa0(%rbp), %rax
movq $0x3, (%rsp)
movq %rbx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x14f2d0
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq 0x40(%rbp), %r8
movq 0x10(%rbp), %rax
movl %eax, %r9d
movq -0x58(%rbp), %rax
movl %eax, (%rsp)
callq 0x10c710
jmp 0x165d09
jmp 0x165d0b
jmp 0x165d0d
jmp 0x165d0f
movq -0x70(%rbp), %rcx
movq 0x50(%rbp), %rax
movq %rcx, (%rax)
movq -0x78(%rbp), %rcx
movq 0x48(%rbp), %rax
movq %rcx, (%rax)
leaq -0xa0(%rbp), %rdi
callq 0xccf70
cmpq $0x0, -0x120(%rbp)
je 0x165d5e
movq -0x120(%rbp), %rdi
callq 0xccd20
movq -0x120(%rbp), %rdi
callq 0x2210
movq $0x0, -0x120(%rbp)
movq -0x68(%rbp), %rdi
callq 0x2210
movq 0x25e272(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x25ea80(%rip), %rax    # 0x3c47f8
movl 0x150(%rax), %edx
leaq 0x223f25(%rip), %rsi    # 0x389caa
movb $0x0, %al
callq 0x22a0
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop