// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/path_finder.c
// Function: main
int main(int argc, char *argv[])
{
    const char *opt_str = "c:e:f:g:hl:m:N:o:p:q:s:v:V";
    ketopt_t opt = KETOPT_INIT;
    int c, out_s, out_c, max_copy, max_path, ret = 0;
    FILE *fp_help;
    char *out_pref, *mito_annot, *pltd_annot, *ec_tag, *kc_tag, *sc_tag;
    int no_trn, no_rrn, min_len, ext_p, ext_m, bubble_size, tip_size, do_graph_clean;
    double max_eval, min_score, min_cf, seq_cf, weak_cross;

    sys_init();

    out_s = -1;
    out_c = 0;
    out_pref = "oatk.asm";
    max_copy = 10;
    max_path = 1000000;
    fp_help = stderr;
    mito_annot = 0;
    pltd_annot = 0;
    ec_tag = 0;
    kc_tag = 0;
    sc_tag = 0;
    no_trn = 1;
    no_rrn = 1;
    do_graph_clean = 1;
    bubble_size = 100000;
    tip_size = 10000;
    weak_cross = 0.3;
    max_eval = 1e-6;
    min_len = 10000;
    min_score = 300;
    ext_p = 3;
    ext_m = 1;
    seq_cf = .90;
    min_cf = .20;

    while ((c = ketopt(&opt, argc, argv, 1, opt_str, long_options)) >=0 ) {
        if (c == 'm') mito_annot = opt.arg;
        else if (c == 'p') pltd_annot = opt.arg;
        else if (c == 'f') seq_cf = atof(opt.arg);
        else if (c == 's') min_score = atof(opt.arg);
        else if (c == 'c') max_copy = atoi(opt.arg);
        else if (c == 'N') max_path = atoi(opt.arg);
        else if (c == 'g') {
            char *p;
            ext_p = strtol(opt.arg, &p, 10);
            if (*p == ',') ext_m = strtol(p + 1, &p, 10);
        }
        else if (c == 'q') min_cf = atof(opt.arg);
        else if (c == 'e') max_eval = atof(opt.arg);
        else if (c == 'l') min_len = atoi(opt.arg);
        else if (c == 'o') out_pref = opt.arg;
        else if (c == 301) out_s = 0, ++out_c;
        else if (c == 302) out_s = 1, ++out_c;
        else if (c == 303) out_s = 2, ++out_c;
        else if (c == 304) ec_tag = opt.arg;
        else if (c == 305) kc_tag = opt.arg;
        else if (c == 306) sc_tag = opt.arg;
        else if (c == 307) no_trn = 0;
        else if (c == 308) no_rrn = 1;
        else if (c == 309) bubble_size = atoi(opt.arg);
        else if (c == 310) tip_size = atoi(opt.arg);
        else if (c == 311) weak_cross = atof(opt.arg);
        else if (c == 312) do_graph_clean = 0;
        else if (c == 'v') VERBOSE = atoi(opt.arg);
        else if (c == 'h') fp_help = stdout;
        else if (c == 'V') {
            puts(PATHFINDER_VERSION);
            return 0;
        }
        else if (c == '?') {
            fprintf(stderr, "[E::%s] unknown option: \"%s\"\n", __func__, argv[opt.i - 1]);
            return 1;
        }
        else if (c == ':') {
            fprintf(stderr, "[E::%s] missing option: \"%s\"\n", __func__, argv[opt.i - 1]);
            return 1;
        }
    }

    if (argc == opt.ind || fp_help == stdout) {
        fprintf(fp_help, "\n");
        fprintf(fp_help, "Usage: pathfinder [options] <file>[.gfa[.gz]]\n");
        fprintf(fp_help, "Options:\n");
        fprintf(fp_help, "  Input/Output:\n");
        fprintf(fp_help, "    -m FILE              mitochondria core gene annotation file [NULL]\n");
        fprintf(fp_help, "    -p FILE              plastid core gene annotation file [NULL]\n");
        fprintf(fp_help, "    -o FILE              prefix of output files [%s]\n", out_pref);
        fprintf(fp_help, "    -f FLOAT             prefer circular path to longest if >= FLOAT sequence covered [%.2f]\n", seq_cf);
        //fprintf(fp_help, "    --longest            output only the longest path [default]\n");
        //fprintf(fp_help, "    --circular           output only the longest circular path\n");
        //fprintf(fp_help, "    --all                output all best paths\n");
        fprintf(fp_help, "    --edge-c-tag STR     edge coverage tag in the GFA file [EC:i] \n");
        fprintf(fp_help, "    --kmer-c-tag STR     kmer coverage tag in the GFA file [KC:i] \n");
        fprintf(fp_help, "    --seq-c-tag  STR     sequence coverage tag in the GFA file [SC:f]\n");
        fprintf(fp_help, "    -v INT               verbose level [%d]\n", VERBOSE);
        fprintf(fp_help, "    --version            show version number\n");
        fprintf(fp_help, "  Classification:\n");
        fprintf(fp_help, "    -s FLOAT             minimum annotation score of a core gene [%.1f]\n", min_score);
        fprintf(fp_help, "    -e FLOAT             maximum E-value of a core gene [%.3e]\n", max_eval);
        fprintf(fp_help, "    -g INT[,INT]         minimum number of core gene gain; the second INT for mitochondria [%d,%d]\n", ext_p, ext_m);
        fprintf(fp_help, "    -l INT               minimum length of a singleton sequence to keep [%d]\n", min_len);
        fprintf(fp_help, "    --include-trn        include tRNA genes for sequence classification\n");
        fprintf(fp_help, "    --include-rrn        include rRNA genes for sequence classification\n");
        fprintf(fp_help, "  Path-finding:\n");
        fprintf(fp_help, "    -q FLOAT             minimum coverage of a sequence compared to the subgraph average [%.2f]\n", min_cf);
        fprintf(fp_help, "    -c INT               maximum copy number to consider [%d]\n", max_copy);
        fprintf(fp_help, "    -N INT               maximum number of graph paths to explore [%d]\n", max_path);
        fprintf(fp_help, "    --max-bubble INT     maximum bubble size for assembly graph clean [%d]\n", bubble_size);
        fprintf(fp_help, "    --max-tip    INT     maximum tip size for assembly graph clean [%d]\n", tip_size);
        fprintf(fp_help, "    --weak-cross FLOAT   maximum relative edge coverage for weak crosslink clean [%.2f]\n", weak_cross);
        fprintf(fp_help, "    --no-graph-clean     do not do assembly graph clean\n");
        fprintf(fp_help, "\n");
        fprintf(fp_help, "Example: ./pathfinder -m asm_annot.mito.txt -p asm_annot.pltd.txt -o oatk.asm asm.gfa\n\n");
        return fp_help == stdout? 0 : 1;
    }

    if (argc - opt.ind < 1) {
        fprintf(stderr, "[E::%s] missing input: please specify the GFA file\n", __func__);
        return 1;
    }

    if (out_c > 1) {
        fprintf(stderr, "[E::%s] options --longest, --circular and --all are mutually exclusive\n", __func__);
        return 1;
    }
    
    if (mito_annot == 0 && pltd_annot == 0) {
        fprintf(stderr, "[E::%s] provide at least one HMM profile annotation file (-m and/or -p)\n", __func__);
        return 1;
    }

    if (ec_tag != 0) {
        if(is_valid_gfa_tag(ec_tag)) {
            memcpy(TAG_ARC_COV, ec_tag, 4);
        } else {
            fprintf(stderr, "[E::%s] invalid GFA tag (Regexp: [A-Za-z][A-Za-z0-9]:[A|i|f|Z|B]): %s\n", __func__, ec_tag);
            return 1;
        }
    }

    if (kc_tag != 0) {
        if(is_valid_gfa_tag(kc_tag)) {
            memcpy(TAG_SBP_COV, kc_tag, 4);
        } else {
            fprintf(stderr, "[E::%s] invalid GFA tag (Regexp: [A-Za-z][A-Za-z0-9]:[A|i|f|Z|B]): %s\n", __func__, kc_tag);
            return 1;
        }
    }

    if (sc_tag != 0) {
        if(is_valid_gfa_tag(sc_tag)) {
            memcpy(TAG_SEQ_COV, sc_tag, 4);
        } else {
            fprintf(stderr, "[E::%s] invalid GFA tag (Regexp: [A-Za-z][A-Za-z0-9]:[A|i|f|Z|B]): %s\n", __func__, sc_tag);
            return 1;
        }
    }

    if (out_s < 0) out_s = 0;
    
    ret = pathfinder(argv[opt.ind], mito_annot, pltd_annot, min_len, ext_p, ext_m, max_copy, max_path, 
            max_eval, min_score, min_cf, seq_cf, no_trn, no_rrn, do_graph_clean, bubble_size, tip_size, weak_cross,
            out_s, out_pref, VERBOSE);
    
    if (ret) {
        fprintf(stderr, "[E::%s] failed to analysis the GFA file\n", __func__);
        exit(EXIT_FAILURE);
    }

    if (fflush(stdout) == EOF) {
        fprintf(stderr, "[E::%s] failed to write the results\n", __func__);
        exit(EXIT_FAILURE);
    }

    if (VERBOSE >= 0) {
        fprintf(stderr, "[M::%s] Version: %s\n", __func__, PATHFINDER_VERSION);
        fprintf(stderr, "[M::%s] CMD:", __func__);
        int i;
        for (i = 0; i < argc; ++i)
            fprintf(stderr, " %s", argv[i]);
        fprintf(stderr, "\n[M::%s] Real time: %.3f sec; CPU: %.3f sec; Peak RSS: %.3f GB\n", __func__, realtime() - realtime0, cputime(), peakrss() / 1024.0 / 1024.0 / 1024.0);
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, 0x30(%rsp)
movl %edi, %ebx
callq 0x2fa67
movq %rbx, %r9
movq 0x35017(%rip), %rax     # 0x3cff8
movq (%rax), %rsi
cmpl $0x2, %r9d
jl 0x895f
leal -0x1(%r9), %eax
movl %eax, 0x94(%rsp)
movl %r9d, %edx
negl %edx
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
movq $0x0, 0x110(%rsp)
movl $0xa, %edi
movl $0xf4240, %eax          # imm = 0xF4240
movq %rax, 0xf8(%rsp)
leaq 0x2a22c(%rip), %rax     # 0x32257
movq %rax, 0xc8(%rsp)
movl $0x3, %eax
movq %rax, 0xe8(%rsp)
movl $0x186a0, %r15d         # imm = 0x186A0
movl $0x2710, %r13d          # imm = 0x2710
movl $0x1, %eax
movq %rax, 0x108(%rsp)
movsd 0x2a057(%rip), %xmm0    # 0x320b8
movsd %xmm0, 0xe0(%rsp)
movsd 0x2a03e(%rip), %xmm0    # 0x320b0
movsd %xmm0, 0xd8(%rsp)
movsd 0x2a025(%rip), %xmm0    # 0x320a8
movsd %xmm0, 0xf0(%rsp)
movsd 0x2a00c(%rip), %xmm0    # 0x320a0
movsd %xmm0, 0xd0(%rsp)
movsd 0x29ff3(%rip), %xmm0    # 0x32098
movsd %xmm0, 0xc0(%rsp)
movl $0x1, %eax
movq %rax, 0xb8(%rsp)
movl $0x2710, 0x64(%rsp)     # imm = 0x2710
movl $0x1, %r10d
movl $0x0, %r12d
xorl %r11d, %r11d
movq $0x0, 0xa8(%rsp)
movq $0x0, 0xb0(%rsp)
movq $0x0, 0x58(%rsp)
movl $0x1, %r8d
xorl %ebp, %ebp
movl $0x0, 0x78(%rsp)
movq %rdx, 0x28(%rsp)
movq %r12, 0x80(%rsp)
movq %r13, 0x68(%rsp)
movq %rdi, 0x88(%rsp)
movq %r15, 0x40(%rsp)
movl %ebp, %edi
movq %r8, 0x10(%rsp)
movslq %r8d, %r14
leal (%rdi,%r9), %eax
subl %r14d, %eax
movl %r14d, %ebp
addq %rbp, %rdx
movq %r14, %r15
shlq $0x20, %r15
movq 0x30(%rsp), %rcx
leaq (%rcx,%r14,8), %r8
movq %r8, %r12
xorl %ebx, %ebx
movq %rdi, 0x100(%rsp)
movl %edi, %r13d
movq %r14, 0x120(%rsp)
movq %r14, %rcx
movq (%r8,%rbx,8), %rdi
cmpb $0x2d, (%rdi)
jne 0x8173
cmpb $0x0, 0x1(%rdi)
jne 0x8198
incq %rcx
incl %r13d
incq %rbx
movabsq $0x100000000, %rdi      # imm = 0x100000000
addq %rdi, %r15
addq $0x8, %r12
movl %edx, %edi
addl %ebx, %edi
jne 0x8164
jmp 0x8a5b
sarq $0x1d, %r15
movq 0x30(%rsp), %rax
movq (%rax,%r15), %rdx
cmpb $0x2d, (%rdx)
jne 0x8f65
leaq (%rbx,%rbp), %rax
movq %rax, 0x98(%rsp)
movl 0x100(%rsp), %eax
leaq (%rax,%rbx), %rcx
movq %rcx, 0x48(%rsp)
movzbl 0x1(%rdx), %ecx
cmpl $0x2d, %ecx
movq %rsi, 0x20(%rsp)
movq %r11, 0x18(%rsp)
movq %r9, 0xa0(%rsp)
movq %r10, 0x8(%rsp)
je 0x8267
testl %ecx, %ecx
je 0x8f96
movl 0x78(%rsp), %eax
cmpl $0x1, %eax
adcl $0x0, %eax
movl %eax, %r14d
movslq %eax, %rbp
movq %rdx, (%rsp)
movsbl (%rdx,%rbp), %esi
incq %rbp
movl $0x1b, %edx
leaq 0x2a023(%rip), %rdi     # 0x3223c
movq %rsi, 0x70(%rsp)
callq 0x3250
testq %rax, %rax
je 0x83ca
cmpb $0x3a, 0x1(%rax)
movq 0x28(%rsp), %rdx
movq 0x98(%rsp), %r9
jne 0x83ed
movq (%rsp), %rax
cmpb $0x0, (%rax,%rbp)
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %r11
je 0x844f
addq %rbp, %rax
movq %rax, (%rsp)
jmp 0x843e
movb 0x2(%rdx), %cl
testb %cl, %cl
je 0x8fbe
movq %rbx, 0x78(%rsp)
leaq 0x2(%rdx), %rbx
addq $0x3, %rdx
xorl %r8d, %r8d
testb %cl, %cl
je 0x82a2
movzbl %cl, %eax
cmpl $0x3d, %eax
je 0x82a2
movb (%rdx), %cl
incq %rdx
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r8
jmp 0x8282
movl %r13d, 0x90(%rsp)
movb %cl, 0x3f(%rsp)
movq %rdx, (%rsp)
sarq $0x20, %r8
xorl %r15d, %r15d
leaq 0x346d0(%rip), %rbp     # 0x3c990
leaq 0x2b06c(%rip), %rsi     # 0x33333
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r8, %rdx
movq %r8, %r13
callq 0x30a0
movq %r13, %r8
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
cmoveq %rbp, %r15
addl %ecx, %r14d
movq 0x10(%rbp), %rsi
addq $0x10, %rbp
testq %rsi, %rsi
jne 0x82ca
cmpl $0x1, %r14d
jne 0x8380
movl 0xc(%r15), %eax
movq %rax, 0x70(%rsp)
movb 0x3f(%rsp), %al
cmpb $0x3d, %al
movq 0x20(%rsp), %rsi
movq 0x30(%rsp), %r10
movq 0x18(%rsp), %r11
movq 0x28(%rsp), %rdx
movq 0x48(%rsp), %rbp
movq 0x98(%rsp), %r9
movq 0x78(%rsp), %rbx
movl 0x90(%rsp), %r13d
je 0x8492
testb %al, %al
jne 0x848a
cmpl $0x1, 0x8(%r15)
jne 0x848a
cmpl %r9d, 0x94(%rsp)
jle 0x8480
movq 0x10(%rsp), %rax
leal (%rax,%rbx), %r9d
incl %r9d
movslq %r9d, %rax
movq (%r10,%rax,8), %rax
movq %rax, (%rsp)
jmp 0x8492
movl $0x3f, %eax
movq %rax, 0x70(%rsp)
movq $0x0, (%rsp)
movq 0x40(%rsp), %r15
movq 0x20(%rsp), %rsi
movq 0x30(%rsp), %r10
movq 0x18(%rsp), %r11
movq 0x28(%rsp), %rdx
movq 0x48(%rsp), %rbp
movq 0x98(%rsp), %r9
movq 0x78(%rsp), %rbx
movl 0x90(%rsp), %r13d
jmp 0x8497
movl $0x3f, %eax
movq %rax, 0x70(%rsp)
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %r11
movq 0x28(%rsp), %rdx
movq 0x98(%rsp), %r9
jmp 0x83f7
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %r11
cmpl $-0x2, %r14d
jle 0x8436
movq 0x30(%rsp), %rax
movq (%rax,%r15), %rax
movl %ebp, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x8436
movl %ebp, 0x78(%rsp)
movl %r9d, %r8d
movq $0x0, (%rsp)
movq 0x40(%rsp), %r15
movq 0x68(%rsp), %r13
movq 0x30(%rsp), %r10
movq 0x48(%rsp), %rbp
jmp 0x8519
movq $0x0, (%rsp)
movq 0x40(%rsp), %r15
movq 0x30(%rsp), %r10
movq 0x48(%rsp), %rbp
jmp 0x8497
cmpl %r9d, 0x94(%rsp)
movq 0x40(%rsp), %r15
jle 0x8663
movq 0x10(%rsp), %rax
leal (%rax,%rbx), %r9d
incl %r9d
movslq %r9d, %rax
movq 0x30(%rsp), %r10
movq (%r10,%rax,8), %rax
movq %rax, (%rsp)
jmp 0x8448
movl $0x3a, %eax
movq %rax, 0x70(%rsp)
movq $0x0, (%rsp)
movq 0x40(%rsp), %r15
leal 0x1(%r9), %r8d
movl $0x0, 0x78(%rsp)
testl %ebp, %ebp
jle 0x8514
movq %r15, %r14
movq %r11, %r15
movq %rbp, %rax
movq %r8, %rbp
movq 0x120(%rsp), %rdi
addq %rbx, %rdi
movl %eax, %eax
movslq %r9d, %rcx
movl %r13d, %edx
negq %rdx
movq 0x68(%rsp), %r13
movq %rdi, %r11
movq (%r10,%rdi,8), %r9
xorl %edi, %edi
movq -0x8(%r12,%rdi,8), %r8
movq %r8, (%r12,%rdi,8)
decq %rdi
cmpq %rdi, %rdx
jne 0x84d7
movq %r11, %rdi
subq %rax, %rdi
movq %r9, (%r10,%rdi,8)
leaq 0x1(%r11), %rdi
addq $0x8, %r12
cmpq %rcx, %r11
jl 0x84ce
movq 0x28(%rsp), %rdx
movq %rbp, %r8
movq 0x48(%rsp), %rbp
movq %r15, %r11
movq %r14, %r15
jmp 0x8519
movq 0x68(%rsp), %r13
movq 0x70(%rsp), %r9
testl %r9d, %r9d
movq 0x88(%rsp), %rdi
movq 0x80(%rsp), %r12
js 0x8f69
cmpl $0x62, %r9d
jg 0x8595
cmpl $0x55, %r9d
jg 0x860c
movq %r15, %rbp
movq %rdi, %r15
cmpl $0x4e, %r9d
jne 0x8617
movq (%rsp), %rdi
movq %r8, %r14
callq 0x34a0
movq %r14, %r8
movq %rax, 0xf8(%rsp)
movq 0x20(%rsp), %rsi
movq 0x8(%rsp), %r10
movq 0x18(%rsp), %r11
movq 0x28(%rsp), %rdx
movq 0x48(%rsp), %rax
movq %r15, %rdi
movq %rbp, %r15
movq %rax, %rbp
jmp 0x864d
leal -0x63(%r9), %eax
cmpl $0x13, %eax
jbe 0x85d5
addl $0xfffffed3, %r9d       # imm = 0xFFFFFED3
cmpl $0xb, %r9d
ja 0x8648
leaq 0x29b62(%rip), %rcx     # 0x32118
movslq (%rcx,%r9,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x58(%rsp), %rax
incl %eax
movq %rax, 0x58(%rsp)
movl $0x0, 0x54(%rsp)
jmp 0x8648
leaq 0x29aec(%rip), %rcx     # 0x320c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rsp), %rdi
movq %r8, %rbp
callq 0x34a0
movq %rbp, %r8
movq 0x48(%rsp), %rbp
movq 0x28(%rsp), %rdx
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %rsi
movl %eax, %edi
jmp 0x8648
cmpl $0x56, %r9d
jne 0x8648
jmp 0x902e
cmpl $0x3a, %r9d
je 0x9041
cmpl $0x3f, %r9d
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %r11
movq 0x28(%rsp), %rdx
movq 0x48(%rsp), %rax
movq %r15, %rdi
movq %rbp, %r15
movq %rax, %rbp
je 0x905c
movq 0x8(%rsp), %r10
movq 0xa0(%rsp), %r9
cmpl %r9d, %r8d
jl 0x8108
jmp 0x8f89
movl $0x3a, %eax
movq %rax, 0x70(%rsp)
movq $0x0, (%rsp)
jmp 0x8443
movq (%rsp), %rax
movq %rax, 0xc8(%rsp)
jmp 0x8648
movq %rdi, %r14
movq (%rsp), %rdi
movq %r8, 0x10(%rsp)
callq 0x34a0
movq %r14, %rdi
movq 0x10(%rsp), %r8
movq 0x28(%rsp), %rdx
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %rsi
movl %eax, 0x64(%rsp)
jmp 0x8648
movq %rdi, %r14
movq (%rsp), %rdi
movq %r8, 0x10(%rsp)
callq 0x3100
movq %r14, %rdi
movq 0x10(%rsp), %r8
movq 0x28(%rsp), %rdx
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %rsi
movsd %xmm0, 0xe0(%rsp)
jmp 0x8648
movq %rdi, %r14
movq (%rsp), %rdi
movq %r8, 0x10(%rsp)
callq 0x3100
movq %r14, %rdi
movq 0x10(%rsp), %r8
movq 0x28(%rsp), %rdx
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %rsi
movsd %xmm0, 0xd0(%rsp)
jmp 0x8648
movq 0x348af(%rip), %rax     # 0x3cfd8
movq (%rax), %rsi
jmp 0x8648
movq %rdi, %r14
movq %r8, 0x10(%rsp)
movq (%rsp), %rdi
leaq 0x118(%rsp), %rsi
movl $0xa, %edx
callq 0x3300
movq %rax, 0xe8(%rsp)
movq 0x118(%rsp), %rdi
cmpb $0x2c, (%rdi)
jne 0x8781
incq %rdi
leaq 0x118(%rsp), %rsi
movl $0xa, %edx
callq 0x3300
movq %rax, 0xb8(%rsp)
movq 0x20(%rsp), %rsi
movq 0x8(%rsp), %r10
movq 0x18(%rsp), %r11
movq 0x28(%rsp), %rdx
movq 0x10(%rsp), %r8
movq %r14, %rdi
jmp 0x864d
movq (%rsp), %rax
movq %rax, 0xb0(%rsp)
jmp 0x8648
movq %rdi, %r14
movq (%rsp), %rdi
movq %r8, 0x10(%rsp)
callq 0x3100
movq %r14, %rdi
movq 0x10(%rsp), %r8
movq 0x28(%rsp), %rdx
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %rsi
movsd %xmm0, 0xd8(%rsp)
jmp 0x8648
movq %rdi, %r14
movq (%rsp), %rdi
movq %r8, 0x10(%rsp)
callq 0x3100
movq %r14, %rdi
movq 0x10(%rsp), %r8
movq 0x28(%rsp), %rdx
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %rsi
movsd %xmm0, 0xf0(%rsp)
jmp 0x8648
movq (%rsp), %rax
movq %rax, 0xa8(%rsp)
jmp 0x8648
movq %rdi, %r14
movq (%rsp), %rdi
movq %r8, 0x10(%rsp)
callq 0x34a0
movq %r14, %rdi
movq 0x10(%rsp), %r8
movq 0x28(%rsp), %rdx
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %rsi
movl %eax, 0x34aae(%rip)     # 0x3d30c
jmp 0x8648
movq $0x0, 0x108(%rsp)
jmp 0x8648
movq (%rsp), %r11
jmp 0x8648
movq %rdi, %r14
movq (%rsp), %rdi
movq %r8, %r13
callq 0x34a0
movq %r14, %rdi
movq %r13, %r8
movq 0x28(%rsp), %rdx
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %rsi
movl %eax, %r13d
jmp 0x8648
movq 0x58(%rsp), %rax
incl %eax
movq %rax, 0x58(%rsp)
movl $0x1, 0x54(%rsp)
jmp 0x8648
movq 0x58(%rsp), %rax
incl %eax
movq %rax, 0x58(%rsp)
movl $0x2, 0x54(%rsp)
jmp 0x8648
xorl %r10d, %r10d
jmp 0x864d
movq (%rsp), %r12
jmp 0x8648
movq (%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x8648
movq %rdi, %r14
movq (%rsp), %rdi
movq %r8, 0x10(%rsp)
callq 0x3100
movq %r14, %rdi
movq 0x10(%rsp), %r8
movq 0x28(%rsp), %rdx
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %rsi
movsd %xmm0, 0xc0(%rsp)
jmp 0x8648
movq %rdi, %r14
movq (%rsp), %rdi
movq %r8, %r15
callq 0x34a0
movq %r14, %rdi
movq %r15, %r8
movq 0x28(%rsp), %rdx
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %rsi
movl %eax, %r15d
jmp 0x8648
movsd 0x29731(%rip), %xmm0    # 0x32098
movsd %xmm0, 0xc0(%rsp)
movsd 0x29728(%rip), %xmm0    # 0x320a0
movsd %xmm0, 0xd0(%rsp)
movsd 0x2971f(%rip), %xmm0    # 0x320a8
movsd %xmm0, 0xf0(%rsp)
movsd 0x29716(%rip), %xmm0    # 0x320b0
movsd %xmm0, 0xd8(%rsp)
movsd 0x2970d(%rip), %xmm0    # 0x320b8
movsd %xmm0, 0xe0(%rsp)
movl $0x186a0, %r15d         # imm = 0x186A0
movl $0x3, %eax
movq %rax, 0xe8(%rsp)
movl $0x2710, 0x64(%rsp)     # imm = 0x2710
movl $0x1, %r10d
leaq 0x2987b(%rip), %rax     # 0x32257
movq %rax, 0xc8(%rsp)
movl $0xf4240, %eax          # imm = 0xF4240
movq %rax, 0xf8(%rsp)
movl $0xa, %eax
movq %rax, 0x88(%rsp)
xorl %ecx, %ecx
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
movq $0x0, 0xb0(%rsp)
movq $0x0, 0xa8(%rsp)
xorl %r11d, %r11d
xorl %r12d, %r12d
movq $0x0, 0x110(%rsp)
movl $0x1, %eax
movq %rax, 0xb8(%rsp)
movl $0x2710, %r13d          # imm = 0x2710
movl $0x1, %eax
movq %rax, 0x108(%rsp)
xorl %eax, %eax
movl $0x1, %ebp
jmp 0x8a75
movl %r9d, %ebp
movq 0x40(%rsp), %r15
movq 0x68(%rsp), %r13
movq 0x80(%rsp), %r12
movq 0x58(%rsp), %rcx
subl %eax, %ebp
movq 0x3455a(%rip), %rbx     # 0x3cfd8
cmpl %r9d, %ebp
je 0x8c1a
cmpq (%rbx), %rsi
je 0x8c1a
cmpl %r9d, %ebp
jge 0x8ef8
cmpl $0x2, %ecx
jge 0x8f1c
movq 0xb0(%rsp), %rax
orq 0xa8(%rsp), %rax
je 0x8f23
movq %r10, 0x8(%rsp)
movq %r9, 0xa0(%rsp)
testq %r11, %r11
je 0x8aee
movq %rbx, %r14
movq %r11, %rdi
movq %r11, %rbx
callq 0x21119
testl %eax, %eax
je 0x8f2a
movl (%rbx), %eax
leaq 0x3484f(%rip), %rcx     # 0x3d338
movl %eax, (%rcx)
movq %r14, %rbx
testq %r12, %r12
je 0x8b10
movq %r12, %rdi
callq 0x21119
testl %eax, %eax
je 0x8eff
movl (%r12), %eax
leaq 0x34832(%rip), %rcx     # 0x3d340
movl %eax, (%rcx)
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x8b3a
movq %rdi, %r12
callq 0x21119
testl %eax, %eax
je 0x8eff
movl (%r12), %eax
leaq 0x34804(%rip), %rcx     # 0x3d33c
movl %eax, (%rcx)
xorl %eax, %eax
movl 0x54(%rsp), %ecx
testl %ecx, %ecx
cmovgl %ecx, %eax
movslq %ebp, %rcx
movq 0x30(%rsp), %rdx
movq (%rdx,%rcx,8), %rdi
movl 0x347b4(%rip), %r10d    # 0x3d30c
movq 0xb0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movl 0x64(%rsp), %ecx
movq 0xe8(%rsp), %r8
movq 0xb8(%rsp), %r9
movsd 0xe0(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm1
movsd 0xf0(%rsp), %xmm2
movsd 0xd0(%rsp), %xmm3
movsd 0xc0(%rsp), %xmm4
pushq %r10
pushq 0xd0(%rsp)
pushq %rax
pushq %r13
pushq %r15
pushq 0x130(%rsp)
pushq $0x1
pushq 0x40(%rsp)
pushq 0x138(%rsp)
pushq 0xd0(%rsp)
callq 0x5d70
addq $0x50, %rsp
testl %eax, %eax
jne 0x9081
movq (%rbx), %rdi
callq 0x3380
cmpl $-0x1, %eax
je 0x9086
xorl %ebp, %ebp
cmpl $0x0, 0x3470f(%rip)     # 0x3d30c
movq 0xa0(%rsp), %rdi
js 0x8f51
movq 0x30(%rsp), %rsi
callq 0x39cc
jmp 0x8f51
movl $0xa, %edi
movq %rsi, %r14
callq 0x3240
leaq 0x29677(%rip), %rdi     # 0x322a5
movl $0x2e, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
leaq 0x2968d(%rip), %rdi     # 0x322d4
movl $0x9, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
leaq 0x2967e(%rip), %rdi     # 0x322de
movl $0x10, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
leaq 0x29676(%rip), %rdi     # 0x322ef
movl $0x47, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
leaq 0x296a5(%rip), %rdi     # 0x32337
movl $0x42, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
leaq 0x296cf(%rip), %rsi     # 0x3237a
movq %r14, %rdi
movq 0xc8(%rsp), %rdx
xorl %eax, %eax
callq 0x32e0
leaq 0x296ec(%rip), %rsi     # 0x323b0
movq %r14, %rdi
movsd 0xd0(%rsp), %xmm0
movb $0x1, %al
callq 0x32e0
leaq 0x29730(%rip), %rdi     # 0x3240e
movl $0x43, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
leaq 0x2975b(%rip), %rdi     # 0x32452
movl $0x43, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
leaq 0x29786(%rip), %rdi     # 0x32496
movl $0x46, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
movl 0x345e4(%rip), %edx     # 0x3d30c
leaq 0x297ae(%rip), %rsi     # 0x324dd
movq %r14, %rdi
xorl %eax, %eax
callq 0x32e0
leaq 0x297ca(%rip), %rdi     # 0x3250a
movl $0x2d, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
leaq 0x297df(%rip), %rdi     # 0x32538
movl $0x12, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
leaq 0x297d9(%rip), %rsi     # 0x3254b
movq %r14, %rdi
movsd 0xd8(%rsp), %xmm0
movb $0x1, %al
callq 0x32e0
leaq 0x29808(%rip), %rsi     # 0x32594
movq %r14, %rdi
movsd 0xe0(%rsp), %xmm0
movb $0x1, %al
callq 0x32e0
leaq 0x2982e(%rip), %rsi     # 0x325d4
movq %r14, %rdi
movq 0xe8(%rsp), %rdx
movq 0xb8(%rsp), %rcx
xorl %eax, %eax
callq 0x32e0
leaq 0x29871(%rip), %rsi     # 0x32638
movq %r14, %rdi
movl 0x64(%rsp), %edx
xorl %eax, %eax
callq 0x32e0
leaq 0x298aa(%rip), %rdi     # 0x32686
movl $0x48, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
leaq 0x298da(%rip), %rdi     # 0x326cf
movl $0x48, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
leaq 0x2990a(%rip), %rdi     # 0x32718
movl $0x10, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
leaq 0x29902(%rip), %rsi     # 0x32729
movq %r14, %rdi
movsd 0xf0(%rsp), %xmm0
movb $0x1, %al
callq 0x32e0
leaq 0x29949(%rip), %rsi     # 0x3278a
movq %r14, %rdi
movq 0x88(%rsp), %rdx
xorl %eax, %eax
callq 0x32e0
leaq 0x2996f(%rip), %rsi     # 0x327c9
movq %r14, %rdi
movq 0xf8(%rsp), %rdx
xorl %eax, %eax
callq 0x32e0
leaq 0x2999e(%rip), %rsi     # 0x32811
movq %r14, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x32e0
leaq 0x299d6(%rip), %rsi     # 0x3285d
movq %r14, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0x32e0
leaq 0x29a0b(%rip), %rsi     # 0x328a6
movq %r14, %rdi
movsd 0xc0(%rsp), %xmm0
movb $0x1, %al
callq 0x32e0
leaq 0x29a4a(%rip), %rdi     # 0x328ff
movl $0x38, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
movl $0xa, %edi
movq %r14, %rsi
callq 0x3240
leaq 0x29a5d(%rip), %rdi     # 0x32938
movl $0x57, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x34f0
xorl %ebp, %ebp
cmpq (%rbx), %r14
setne %bpl
jmp 0x8f51
callq 0x3985
jmp 0x8f4c
movq 0x340f2(%rip), %rax     # 0x3cff8
movq (%rax), %rdi
leaq 0x29b45(%rip), %rsi     # 0x32a55
leaq 0x2936b(%rip), %rdx     # 0x32282
movq %r12, %rcx
jmp 0x8f45
callq 0x3b01
jmp 0x8f4c
callq 0x3ae2
jmp 0x8f4c
movq 0x340c7(%rip), %rax     # 0x3cff8
movq (%rax), %rdi
leaq 0x29b1a(%rip), %rsi     # 0x32a55
leaq 0x29340(%rip), %rdx     # 0x32282
movq %rbx, %rcx
xorl %eax, %eax
callq 0x32e0
movl $0x1, %ebp
movl %ebp, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ecx, %ebp
jmp 0x8f9d
subl 0x100(%rsp), %r8d
subl %ebx, %r8d
movl %r8d, %ebp
movq 0xa0(%rsp), %r9
movq 0x8(%rsp), %r10
jmp 0x9024
movq %rdi, 0x88(%rsp)
movl %r8d, %ebp
jmp 0x8faf
movq 0x10(%rsp), %rbp
addl %ebx, %ebp
movq 0x40(%rsp), %r15
movq 0x68(%rsp), %r13
movq 0x80(%rsp), %r12
movq 0x100(%rsp), %rax
addl %ebx, %eax
jmp 0x8a70
movq %rdx, %r14
addq %rbx, %rax
addq %rbx, %rbp
testl %eax, %eax
movq 0x40(%rsp), %r15
jle 0x8ff5
movl %eax, %ecx
negq %rcx
movslq %ebp, %rdx
movq 0x30(%rsp), %rdi
leaq (%rdi,%rdx,8), %rdx
xorl %r8d, %r8d
movq -0x8(%rdx,%r8,8), %rdi
movq %rdi, (%rdx,%r8,8)
decq %r8
cmpq %r8, %rcx
jne 0x8fe4
xorl %ecx, %ecx
testl %r13d, %r13d
cmovgl %r13d, %ecx
movq 0x10(%rsp), %rdx
subl %ecx, %edx
addl %edx, %ebx
movslq %ebx, %rcx
movq 0x30(%rsp), %rdx
movq %r14, (%rdx,%rcx,8)
subl %eax, %ebp
incl %ebp
movq 0x68(%rsp), %r13
movq 0x80(%rsp), %r12
movq 0x58(%rsp), %rcx
jmp 0x8a77
leaq 0x2922b(%rip), %rdi     # 0x32260
callq 0x30c0
xorl %ebp, %ebp
jmp 0x8f51
movq 0x33fb0(%rip), %rax     # 0x3cff8
movq (%rax), %rdi
movslq %r8d, %rax
movq -0x8(%r10,%rax,8), %rcx
leaq 0x2922d(%rip), %rsi     # 0x32287
jmp 0x9075
movq 0x33f95(%rip), %rax     # 0x3cff8
movq (%rax), %rdi
movslq %r8d, %rax
movq -0x8(%r10,%rax,8), %rcx
leaq 0x291ef(%rip), %rsi     # 0x32264
leaq 0x29206(%rip), %rdx     # 0x32282
jmp 0x8f45
callq 0x39a4
callq 0x3aba