// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]yahs/yahs.c
// Function: run_yahs
int run_yahs(char *fai, char *agp, char *link_file, uint32_t ml, uint8_t mq, char *out, int *resolutions, int nr, int rr, re_cuts_t *re_cuts, int8_t *telo_ends, uint32_t d_min_cell, double d_mass_frac, int no_contig_ec, int no_scaffold_ec, int no_mem_check)
{
    int ec_round, resolution, re, r, rn, rc, ex;
    uint64_t n50;
    char *out_fn, *out_agp, *out_agp_break;
    double noise;
    FILE *fo;
    sdict_t *sdict;
    asm_dict_t *dict;
    cov_norm_t *cov_norm;
    long rss_total, rss_limit;  
    
    ram_limit(&rss_total, &rss_limit);
    fprintf(stderr, "[I::%s] RAM total: %.3fGB\n", __func__, (double) rss_total / GB);
    fprintf(stderr, "[I::%s] RAM limit: %.3fGB\n", __func__, (double) rss_limit / GB);
    if (no_mem_check)
        fprintf(stderr, "[I::%s] RAM check disabled\n", __func__);

    sdict = make_sdict_from_index(fai, ml);
    out_fn = (char *) malloc(strlen(out) + 35);
    out_agp = (char *) malloc(strlen(out) + 35);
    out_agp_break = (char *) malloc(strlen(out) + 35);
    
    if (no_contig_ec == 0) {
#ifdef DEBUG
        fprintf(stderr, "[DEBUG::%s] perform contig error break...\n", __func__);
#endif
        sprintf(out_agp_break, "%s_inital_break", out);
        ec_round = contig_error_break(agp, fai, link_file, ml, out_agp_break);
        sprintf(out_agp_break, "%s_inital_break_%02d.agp", out, ec_round);
#ifdef DEBUG
        fprintf(stderr, "[DEBUG::%s] contig error break done\n", __func__);
#endif
    } else {
#ifdef DEBUG
        fprintf(stderr, "[DEBUG::%s] no contig error break...\n", __func__);
#endif
        if (agp != 0) {
#ifdef DEBUG
            fprintf(stderr, "[DEBUG::%s] use input AGP file\n", __func__);
#endif
            if (strlen(agp) > strlen(out)) {
                free(out_agp_break);
                out_agp_break = (char *) malloc(strlen(agp) + 35);
            }
            sprintf(out_agp_break, "%s", agp);
        } else {
#ifdef DEBUG
            fprintf(stderr, "[DEBUG::%s] make AGP file from input FASTA file\n", __func__);
#endif
            sprintf(out_agp_break, "%s_no_break.agp", out);
            fo = fopen(out_agp_break, "w");
            if (fo == NULL) {
                fprintf(stderr, "[E::%s] cannot open file %s for writing\n", __func__, out_agp_break);
                exit(EXIT_FAILURE);
            }
            write_sdict_to_agp(sdict, fo);
            fclose(fo);
        }
    }

    dict = make_asm_dict_from_agp(sdict, out_agp_break, 1);
    if (dict->n > MAX_N_SEQ) {
        fprintf(stderr, "[E::%s] sequence number exceeds limit (%d > %d)\n", __func__, dict->n, MAX_N_SEQ);
        fprintf(stderr, "[E::%s] consider removing short sequences before scaffolding, or\n", __func__);
        fprintf(stderr, "[E::%s] running without error correction (--no-contig-ec) if due to excessive contig error breaks\n", __func__);
        fprintf(stderr, "[E::%s] program halted...\n", __func__);
        return 1;
    }
    asm_sd_stats(dict, n_stats, l_stats);
    print_asm_stats(n_stats, l_stats, 1);
    asm_destroy(dict);

    cov_norm = cov_norm_from_file(link_file, sdict);

    r = rc = 0;
    rn = rr;
    ex = max_extra_try;
    while (r < nr) {
        resolution = resolutions[r];

        // dict = make_asm_dict_from_agp(sdict, out_agp_break, 1);
        if (n_stats[4] < resolution * 10) {
            if (!ex) {
                fprintf(stderr, "[I::%s] assembly N50 (%lu) too small. End of scaffolding.\n", __func__, n_stats[4]);
                fprintf(stderr, "[I::%s] consider running with increased memory limit if there was a memory issue.\n", __func__);
                break;
            } else {
                if (r > 0)
                    resolution = resolutions[r - 1]; // use the previous resolution level
                else {
                    resolution /= 10;
                    if (resolution < 1000)
                        resolution = 1000;
                    if (resolution > resolutions[0])
                        resolution = resolutions[0] / 2;
                }

                fprintf(stderr, "[I::%s] assembly N50 (%lu) too small.\n", __func__, n_stats[4]);
                fprintf(stderr, "[I::%s] do an extra round scaffolding with resolution = %d\n", __func__, resolution);
                ex--; // increase extra try number
            }
        } else {
            rn--;
            if (!rn || n_stats[8] > resolution * 10) {
                r++; // move to the next resolution level
                rn = rr;
            }
            ex = max_extra_try; // reset extra try number
        }

        rc++;
        fprintf(stderr, "[I::%s] scaffolding round %d resolution = %d\n", __func__, rc, resolution);
        
        sprintf(out_fn, "%s_r%02d", out, rc);
        // noise per unit
        re = run_scaffolding(fai, out_agp_break, link_file, cov_norm, ml, mq, re_cuts, telo_ends, out_fn, resolution, 
                &noise, d_min_cell, d_mass_frac, rss_limit, no_mem_check);
        if (!re) {
            sprintf(out_agp, "%s_r%02d.agp", out, rc);
            if (no_scaffold_ec == 0) {
#ifdef DEBUG
                fprintf(stderr, "[DEBUG::%s] perform scaffold error break\n", __func__);
#endif

                sprintf(out_agp_break, "%s_r%02d_break.agp", out, rc);
                scaffold_error_break(fai, link_file, ml, mq, out_agp, resolution, noise, out_agp_break);
#ifdef DEBUG
                fprintf(stderr, "[DEBUG::%s] scaffold error break done\n", __func__);
#endif

            } else {
#ifdef DEBUG
                fprintf(stderr, "[DEBUG::%s] no scaffold error break\n", __func__);
#endif
                sprintf(out_agp_break, "%s", out_agp);
            }
        }
        // asm_destroy(dict);

        fprintf(stderr, "[I::%s] scaffolding round %d done\n", __func__, rc);

        dict = make_asm_dict_from_agp(sdict, out_agp_break, 1);
        n50 = n_stats[4]; // old n50
        asm_sd_stats(dict, n_stats, l_stats);
        // no improvements in a retry round 
        if (ex < max_extra_try && n50 == n_stats[4])
            ex = 0;
        print_asm_stats(n_stats, l_stats, 0);
        asm_destroy(dict);

        /*** 
        if (re && re != ENOMEM_ERR) {
            fprintf(stderr, "[I::%s] Reach data limit for HiC contact density estimation in lower resulutions. End of scaffolding.\n", __func__);
            break;
        }
        **/
    }

#ifdef DEBUG
    fprintf(stderr, "[DEBUG::%s] make final output...\n", __func__);
#endif

    sprintf(out_agp, "%s_scaffolds_final.agp", out);
    // output sorted agp by scaffold size instead of file copy
    // file_copy(out_agp_break, out_agp);
    if (ml > 0) {
        // add short sequences to dict
#ifdef DEBUG
        fprintf(stderr, "[DEBUG::%s] add unused short sequences back...\n", __func__);
#endif
        sd_destroy(sdict);
        sdict = make_sdict_from_index(fai, 0);
        dict = make_asm_dict_from_agp(sdict, out_agp_break, 1);
        add_unplaced_short_seqs(dict, ml);
    } else {
        dict = make_asm_dict_from_agp(sdict, out_agp_break, 1);
    }
    fo = fopen(out_agp, "w");
    if (fo == NULL) {
        fprintf(stderr, "[E::%s] cannot open file %s for writing\n", __func__, out_agp);
        exit(EXIT_FAILURE);
    }
    write_sorted_agp(dict, fo);
    fclose(fo);
    
    asm_destroy(dict);
    sd_destroy(sdict);
    cov_norm_destroy(cov_norm);

    free(out_agp);
    free(out_fn);
    free(out_agp_break);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movb %r8b, %al
movl 0x50(%rbp), %r8d
movl 0x48(%rbp), %r8d
movl 0x40(%rbp), %r8d
movl 0x38(%rbp), %r8d
movq 0x30(%rbp), %r8
movq 0x28(%rbp), %r8
movl 0x20(%rbp), %r8d
movl 0x18(%rbp), %r8d
movq 0x10(%rbp), %r8
movq %rdi, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movl %ecx, -0x4c(%rbp)
movb %al, -0x4d(%rbp)
movq %r9, -0x58(%rbp)
movsd %xmm0, -0x60(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2870
movq 0xc668(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
cvtsi2sdq -0xd0(%rbp), %xmm0
movsd 0x641c(%rip), %xmm1     # 0x32dc0
divsd %xmm1, %xmm0
leaq 0x6713(%rip), %rsi      # 0x330c2
leaq 0x6727(%rip), %rdx      # 0x330dd
movb $0x1, %al
callq 0x22c0
movq 0xc634(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
cvtsi2sdq -0xd8(%rbp), %xmm0
movsd 0x63e8(%rip), %xmm1     # 0x32dc0
divsd %xmm1, %xmm0
leaq 0x6703(%rip), %rsi      # 0x330e6
leaq 0x66f3(%rip), %rdx      # 0x330dd
movb $0x1, %al
callq 0x22c0
cmpl $0x0, 0x50(%rbp)
je 0x2ca16
movq 0xc5fa(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
leaq 0x66f9(%rip), %rsi      # 0x33101
leaq 0x66ce(%rip), %rdx      # 0x330dd
movb $0x0, %al
callq 0x22c0
movq -0x38(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x17660
movq %rax, -0xb8(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2160
movq %rax, %rdi
addq $0x23, %rdi
callq 0x2340
movq %rax, -0x90(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2160
movq %rax, %rdi
addq $0x23, %rdi
callq 0x2340
movq %rax, -0x98(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2160
movq %rax, %rdi
addq $0x23, %rdi
callq 0x2340
movq %rax, -0xa0(%rbp)
cmpl $0x0, 0x40(%rbp)
jne 0x2cadb
movq -0xa0(%rbp), %rdi
movq -0x58(%rbp), %rdx
leaq 0x6688(%rip), %rsi      # 0x3311d
movb $0x0, %al
callq 0x24b0
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rdx
movl -0x4c(%rbp), %ecx
movq -0xa0(%rbp), %r8
callq 0x2c580
movl %eax, -0x64(%rbp)
movq -0xa0(%rbp), %rdi
movq -0x58(%rbp), %rdx
movl -0x64(%rbp), %ecx
leaq 0x665e(%rip), %rsi      # 0x3312d
movb $0x0, %al
callq 0x24b0
jmp 0x2cbde
cmpq $0x0, -0x40(%rbp)
je 0x2cb50
movq -0x40(%rbp), %rdi
callq 0x2160
movq %rax, -0xe0(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2160
movq %rax, %rcx
movq -0xe0(%rbp), %rax
cmpq %rcx, %rax
jbe 0x2cb32
movq -0xa0(%rbp), %rdi
callq 0x2050
movq -0x40(%rbp), %rdi
callq 0x2160
movq %rax, %rdi
addq $0x23, %rdi
callq 0x2340
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x45f9(%rip), %rsi      # 0x3113d
movb $0x0, %al
callq 0x24b0
jmp 0x2cbdc
movq -0xa0(%rbp), %rdi
movq -0x58(%rbp), %rdx
leaq 0x65e4(%rip), %rsi      # 0x33146
movb $0x0, %al
callq 0x24b0
movq -0xa0(%rbp), %rdi
leaq 0x4499(%rip), %rsi      # 0x31010
callq 0x23f0
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
jne 0x2cbbd
movq 0xc464(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
movq -0xa0(%rbp), %rcx
leaq 0x4da1(%rip), %rsi      # 0x31946
leaq 0x6531(%rip), %rdx      # 0x330dd
movb $0x0, %al
callq 0x22c0
movl $0x1, %edi
callq 0x24c0
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x1b040
movq -0xb0(%rbp), %rdi
callq 0x2150
jmp 0x2cbde
movq -0xb8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movl $0x1, %edx
callq 0x18560
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
cmpl $0xafc8, (%rax)         # imm = 0xAFC8
jbe 0x2cca7
movq 0xc3e1(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
movq -0xc0(%rbp), %rax
movl (%rax), %ecx
leaq 0x652c(%rip), %rsi      # 0x33156
leaq 0x64ac(%rip), %rdx      # 0x330dd
movl $0xafc8, %r8d           # imm = 0xAFC8
movb $0x0, %al
callq 0x22c0
movq 0xc3b3(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
leaq 0x6538(%rip), %rsi      # 0x33187
leaq 0x6487(%rip), %rdx      # 0x330dd
movb $0x0, %al
callq 0x22c0
movq 0xc394(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
leaq 0x655b(%rip), %rsi      # 0x331c9
leaq 0x6468(%rip), %rdx      # 0x330dd
movb $0x0, %al
callq 0x22c0
movq 0xc375(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
leaq 0x659f(%rip), %rsi      # 0x3322c
leaq 0x6449(%rip), %rdx      # 0x330dd
movb $0x0, %al
callq 0x22c0
movl $0x1, -0x2c(%rbp)
jmp 0x2d1e1
movq -0xc0(%rbp), %rdi
leaq 0xd11b(%rip), %rsi      # 0x39dd0
leaq 0xd164(%rip), %rdx      # 0x39e20
callq 0x19f80
leaq 0xd108(%rip), %rdi      # 0x39dd0
leaq 0xd151(%rip), %rsi      # 0x39e20
movl $0x1, %edx
callq 0x2d200
movq -0xc0(%rbp), %rdi
callq 0x16780
movq -0x48(%rbp), %rdi
movq -0xb8(%rbp), %rsi
callq 0xfe40
movq %rax, -0xc8(%rbp)
movl $0x0, -0x78(%rbp)
movl $0x0, -0x70(%rbp)
movl 0x20(%rbp), %eax
movl %eax, -0x74(%rbp)
movl 0xcf16(%rip), %eax      # 0x39c2c
movl %eax, -0x7c(%rbp)
movl -0x70(%rbp), %eax
cmpl 0x18(%rbp), %eax
jge 0x2d093
movq 0x10(%rbp), %rax
movslq -0x70(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x68(%rbp)
movq 0xd0b6(%rip), %rax      # 0x39df0
imull $0xa, -0x68(%rbp), %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jae 0x2ce44
cmpl $0x0, -0x7c(%rbp)
jne 0x2cd9a
movq 0xc2a1(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
movq 0xd08f(%rip), %rcx      # 0x39df0
leaq 0x64df(%rip), %rsi      # 0x33247
leaq 0x636e(%rip), %rdx      # 0x330dd
movb $0x0, %al
callq 0x22c0
movq 0xc27b(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
leaq 0x64fb(%rip), %rsi      # 0x33282
leaq 0x634f(%rip), %rdx      # 0x330dd
movb $0x0, %al
callq 0x22c0
jmp 0x2d093
cmpl $0x0, -0x70(%rbp)
jle 0x2cdb5
movq 0x10(%rbp), %rax
movl -0x70(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x68(%rbp)
jmp 0x2cdf1
movl -0x68(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, -0x68(%rbp)
cmpl $0x3e8, -0x68(%rbp)     # imm = 0x3E8
jge 0x2cdd3
movl $0x3e8, -0x68(%rbp)     # imm = 0x3E8
movl -0x68(%rbp), %eax
movq 0x10(%rbp), %rcx
cmpl (%rcx), %eax
jle 0x2cdef
movq 0x10(%rbp), %rax
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x68(%rbp)
jmp 0x2cdf1
movq 0xc200(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
movq 0xcfee(%rip), %rcx      # 0x39df0
leaq 0x64cc(%rip), %rsi      # 0x332d5
leaq 0x62cd(%rip), %rdx      # 0x330dd
movb $0x0, %al
callq 0x22c0
movq 0xc1da(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
movl -0x68(%rbp), %ecx
leaq 0x64d1(%rip), %rsi      # 0x332fc
leaq 0x62ab(%rip), %rdx      # 0x330dd
movb $0x0, %al
callq 0x22c0
movl -0x7c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x2ce7e
movl -0x74(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x74(%rbp)
cmpl $0x0, -0x74(%rbp)
je 0x2ce66
movq 0xcfb6(%rip), %rax      # 0x39e10
imull $0xa, -0x68(%rbp), %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jbe 0x2ce75
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
movl 0x20(%rbp), %eax
movl %eax, -0x74(%rbp)
movl 0xcdb1(%rip), %eax      # 0x39c2c
movl %eax, -0x7c(%rbp)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
movq 0xc16a(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
movl -0x78(%rbp), %ecx
movl -0x68(%rbp), %r8d
leaq 0x6499(%rip), %rsi      # 0x33338
leaq 0x6237(%rip), %rdx      # 0x330dd
movb $0x0, %al
callq 0x22c0
movq -0x90(%rbp), %rdi
movq -0x58(%rbp), %rdx
movl -0x78(%rbp), %ecx
leaq 0x64a4(%rip), %rsi      # 0x33366
movb $0x0, %al
callq 0x24b0
movq -0x38(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0xc8(%rbp), %rcx
movl -0x4c(%rbp), %r8d
movb -0x4d(%rbp), %r9b
movq 0x28(%rbp), %r13
movq 0x30(%rbp), %r12
movq -0x90(%rbp), %r15
movl -0x68(%rbp), %r14d
movl 0x38(%rbp), %r11d
movsd -0x60(%rbp), %xmm0
movq -0xd8(%rbp), %r10
movl 0x50(%rbp), %eax
leaq -0xa8(%rbp), %rbx
movzbl %r9b, %r9d
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movl %r14d, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movl %r11d, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movl %eax, 0x38(%rsp)
callq 0x2bee0
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
jne 0x2cfe2
movq -0x98(%rbp), %rdi
movq -0x58(%rbp), %rdx
movl -0x78(%rbp), %ecx
leaq 0x640a(%rip), %rsi      # 0x3336f
movb $0x0, %al
callq 0x24b0
cmpl $0x0, 0x48(%rbp)
jne 0x2cfc4
movq -0xa0(%rbp), %rdi
movq -0x58(%rbp), %rdx
movl -0x78(%rbp), %ecx
leaq 0x63f5(%rip), %rsi      # 0x3337c
movb $0x0, %al
callq 0x24b0
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x4c(%rbp), %edx
movb -0x4d(%rbp), %cl
movq -0x98(%rbp), %r8
movl -0x68(%rbp), %r9d
movsd -0xa8(%rbp), %xmm0
movq -0xa0(%rbp), %rax
movzbl %cl, %ecx
movq %rax, (%rsp)
callq 0x2c7e0
jmp 0x2cfe0
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rdx
leaq 0x4164(%rip), %rsi      # 0x3113d
movb $0x0, %al
callq 0x24b0
jmp 0x2cfe2
movq 0xc00f(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
movl -0x78(%rbp), %ecx
leaq 0x6399(%rip), %rsi      # 0x3338f
leaq 0x60e0(%rip), %rdx      # 0x330dd
movb $0x0, %al
callq 0x22c0
movq -0xb8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movl $0x1, %edx
callq 0x18560
movq %rax, -0xc0(%rbp)
movq 0xcdc6(%rip), %rax      # 0x39df0
movq %rax, -0x88(%rbp)
movq -0xc0(%rbp), %rdi
leaq 0xcd91(%rip), %rsi      # 0x39dd0
leaq 0xcdda(%rip), %rdx      # 0x39e20
callq 0x19f80
movl -0x7c(%rbp), %eax
cmpl 0xcbd8(%rip), %eax      # 0x39c2c
jge 0x2d06d
movq -0x88(%rbp), %rax
cmpq 0xcd8c(%rip), %rax      # 0x39df0
jne 0x2d06d
movl $0x0, -0x7c(%rbp)
leaq 0xcd5c(%rip), %rdi      # 0x39dd0
leaq 0xcda5(%rip), %rsi      # 0x39e20
xorl %edx, %edx
callq 0x2d200
movq -0xc0(%rbp), %rdi
callq 0x16780
jmp 0x2cd19
movq -0x98(%rbp), %rdi
movq -0x58(%rbp), %rdx
leaq 0x630d(%rip), %rsi      # 0x333b2
movb $0x0, %al
callq 0x24b0
cmpl $0x0, -0x4c(%rbp)
jbe 0x2d100
movq -0xb8(%rbp), %rdi
callq 0x16650
movq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x17660
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movl $0x1, %edx
callq 0x18560
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x19830
jmp 0x2d11f
movq -0xb8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movl $0x1, %edx
callq 0x18560
movq %rax, -0xc0(%rbp)
movq -0x98(%rbp), %rdi
leaq 0x3ee3(%rip), %rsi      # 0x31010
callq 0x23f0
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
jne 0x2d173
movq 0xbeae(%rip), %rax      # 0x38ff8
movq (%rax), %rdi
movq -0x98(%rbp), %rcx
leaq 0x47eb(%rip), %rsi      # 0x31946
leaq 0x5f7b(%rip), %rdx      # 0x330dd
movb $0x0, %al
callq 0x22c0
movl $0x1, %edi
callq 0x24c0
movq -0xc0(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x1aed0
movq -0xb0(%rbp), %rdi
callq 0x2150
movq -0xc0(%rbp), %rdi
callq 0x16780
movq -0xb8(%rbp), %rdi
callq 0x16650
movq -0xc8(%rbp), %rdi
callq 0x1d000
movq -0x98(%rbp), %rdi
callq 0x2050
movq -0x90(%rbp), %rdi
callq 0x2050
movq -0xa0(%rbp), %rdi
callq 0x2050
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)