// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]oatk/path_to_fasta.c
// Function: main
int main(int argc, char *argv[])
{
    const char *opt_str = "p:s:l:n:o:Vv:h";
    ketopt_t opt = KETOPT_INIT;
    int c, force_linear, line_width, gap_size, ret = 0;
    asg_t *g;
    FILE *fp_help;
    char *seq_id, *path_file, *path_str;
    
    sys_init();

    fp_help = stderr;
    force_linear = 0;
    line_width = 60;
    gap_size = 100;
    seq_id = path_file = path_str = 0;

    while ((c = ketopt(&opt, argc, argv, 1, opt_str, long_options)) >=0 ) {
        if (c == 's') seq_id = opt.arg;
        else if (c == 'p') path_file = opt.arg;
        else if (c == 'l') line_width = atoi(opt.arg);
        else if (c == 'n') gap_size = atoi(opt.arg);
        else if (c == 301) force_linear = 1;
        else if (c == 'v') VERBOSE = atoi(opt.arg);
        else if (c == 'h') fp_help = stdout;
        else if (c == 'o') {
            if (strcmp(opt.arg, "-") != 0) {
                if (freopen(opt.arg, "wb", stdout) == NULL) {
                    fprintf(stderr, "[ERROR]\033[1;31m failed to write the output to file '%s'\033[0m: %s\n", opt.arg, strerror(errno));
                    return 1;
                }
            }
        }
        else if (c == 'V') {
            puts(PATHTOFASTA_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: path_to_fasta [options] <file>[.gfa[.gz]] [path_str]\n");
        fprintf(fp_help, "Options:\n");
        fprintf(fp_help, "    -p STR        two-column path file\n");
        fprintf(fp_help, "    -s STR        output sequence id\n");
        fprintf(fp_help, "    -l INT        number of residues per line; 0 for 2^31-1 [%d]\n", line_width);
        fprintf(fp_help, "    -n INT        number of 'N' put between sequences with no links [%d]\n", gap_size);
        fprintf(fp_help, "    -o FILE       output results to FILE [stdout]\n");
        fprintf(fp_help, "    -v INT        verbose level [%d]\n", VERBOSE);
        fprintf(fp_help, "    --linear      force linear output\n");
        fprintf(fp_help, "    --version     show version number\n");
        fprintf(fp_help, "\n");
        fprintf(fp_help, "Example: ./path_to_fasta asm.gfa u1+,u2-,u3-,u2+\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 (argc - opt.ind > 1) {
        path_str = argv[opt.ind + 1];
        if (path_file) {
            fprintf(stderr, "[W::%s] path file %s ignored\n", __func__, path_file);
            fprintf(stderr, "[W::%s] using path string: %s\n", __func__, path_str);
        }
    } else {
        if (!path_file) {
            fprintf(stderr, "[E::%s] need a path file (-p) or path string\n", __func__);
            return 1;
        }
    }

    if (line_width == 0) line_width = INT32_MAX;

    g = asg_read(argv[opt.ind]);
    if (g == 0) {
        fprintf(stderr, "[E::%s] failed to read the graph: %s\n", __func__, argv[opt.ind]);
        return 1;
    }

    path_v paths;
    kv_init(paths);
    if (path_str) {
        kv_push(path_t, paths, make_path_from_str(g, path_str, seq_id? seq_id : 0));
    } else {
        gzFile fp;
        kstring_t s = {0,0,0};
        kstream_t *ks;
        int dret;
        uint64_t lineno = 0;
        char *p, *q, *sid;

        fp = gzopen(path_file, "r");
        if (!fp) {
            fprintf(stderr, "[E::%s] failed to open file %s to read\n", __func__, path_file);
            return 1;
        }
        ks = ks_init(fp);
        while (ks_getuntil(ks, KS_SEP_LINE, &s, &dret) >= 0) {
            ++lineno;
            
            p = q = s.s;
            while (isspace(*q) && *q != '\0') ++q;
            p = q;
            while (!isspace(*q) && *q != '\0') ++q;
            if (p == q) continue; // empty line
            MYMALLOC(sid, q - p + 1);
            memcpy(sid, p, q - p);
            sid[q-p] = '\0';

            while (isspace(*q) && *q != '\0') ++q;
            p = q;
            while (!isspace(*q) && *q != '\0') ++q;
            if (p == q) {
                // no second column found
                fprintf(stderr, "[E::%s] invalid line at line %ld: %s\n", __func__, (long) lineno, s.s);
                return 1;
            }
            
            kv_push(path_t, paths, make_path_from_str(g, p, sid));
            free(sid);
        }

        ks_destroy(ks);
        gzclose(fp);
    }

    size_t i;
    for (i = 0; i < paths.n; ++i)
        print_seq(g, &paths.a[i], stdout, i+1, force_linear, line_width, gap_size);
    
    for (i = 0; i < paths.n; ++i)
        path_destroy(&paths.a[i]);
    kv_destroy(paths);

    if (ret) {
        fprintf(stderr, "[E::%s] failed to analysis the GFA file\n", __func__);
        exit(1);
    }

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

    asg_destroy(g);

    if (VERBOSE >= 0) {
        fprintf(stderr, "[M::%s] Version: %s\n", __func__, PATHTOFASTA_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 $0xb8, %rsp
movq %rsi, %rbx
movl %edi, %r14d
movabsq $0x100000000, %r15      # imm = 0x100000000
callq 0x14172
movq %r15, %rdi
movq 0x199cc(%rip), %rax     # 0x1cff8
movq (%rax), %rax
movq %rax, 0x68(%rsp)
movq %r14, 0x80(%rsp)
movslq %r14d, %r8
leal -0x1(%r8), %eax
movl %eax, 0x78(%rsp)
pushq $0x3c
popq %rax
movl %eax, 0x58(%rsp)
pushq $0x64
popq %r15
pushq $0x1
popq %rax
movq $0x0, 0x50(%rsp)
movq 0x19973(%rip), %rbp     # 0x1cfd8
movl $0x0, 0x48(%rsp)
movq $0x0, 0x60(%rsp)
xorl %r14d, %r14d
movl $0x0, 0xc(%rsp)
movq %r8, 0x10(%rsp)
movq %rbx, 0x28(%rsp)
movq %rax, 0x18(%rsp)
movslq %eax, %rcx
movq %rcx, %r12
shlq $0x20, %r12
leaq (%rbx,%rcx,8), %rdx
xorl %r13d, %r13d
movq %rcx, %rax
leaq (%rcx,%r13), %rsi
cmpq %r8, %rsi
jge 0x3a9e
movq (%rdx,%r13,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x36c0
cmpb $0x0, 0x1(%rsi)
jne 0x36cb
incq %rax
incq %r13
addq %rdi, %r12
jmp 0x36a4
movq %r14, 0x70(%rsp)
movl %r15d, %r14d
sarq $0x1d, %r12
movq (%rbx,%r12), %r15
cmpb $0x2d, (%r15)
jne 0x4263
movl 0x18(%rsp), %ebp
addq %r13, %rbp
movl 0x50(%rsp), %ecx
addq %r13, %rcx
movq %rcx, 0x38(%rsp)
movzbl 0x1(%r15), %ecx
cmpl $0x2d, %ecx
movl %r14d, 0x34(%rsp)
je 0x3766
testl %ecx, %ecx
je 0x42c5
movl 0x48(%rsp), %eax
cmpl $0x1, %eax
adcl $0x0, %eax
movl %eax, 0x48(%rsp)
movslq %eax, %rbx
movsbl (%r15,%rbx), %r14d
incq %rbx
leaq 0x1291d(%rip), %rdi     # 0x1604c
movl %r14d, %esi
pushq $0xf
popq %rdx
callq 0x3210
pushq $0x3f
popq %rcx
testq %rax, %rax
je 0x383c
cmpb $0x3a, 0x1(%rax)
jne 0x3839
cmpb $0x0, (%r15,%rbx)
je 0x38f1
movq %r15, %rax
addq %rbx, %rax
jmp 0x3848
movb 0x2(%r15), %dl
testb %dl, %dl
je 0x42ca
leaq 0x2(%r15), %rax
movq %rax, 0x48(%rsp)
addq $0x3, %r15
xorl %r12d, %r12d
testb %dl, %dl
je 0x3799
movzbl %dl, %eax
cmpl $0x3d, %eax
je 0x3799
movb (%r15), %dl
incq %r15
addq %rdi, %r12
jmp 0x3782
movb %dl, 0x27(%rsp)
movq %r15, 0x40(%rsp)
sarq $0x20, %r12
xorl %r14d, %r14d
leaq 0x19340(%rip), %r15     # 0x1caf0
xorl %ebx, %ebx
movq (%r15), %rsi
testq %rsi, %rsi
je 0x37e0
movq 0x48(%rsp), %rdi
movq %r12, %rdx
callq 0x30a0
movq 0x10(%rsp), %r8
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
cmoveq %r15, %rbx
addl %ecx, %r14d
addq $0x10, %r15
jmp 0x37b2
cmpl $0x1, %r14d
jne 0x3817
movl 0xc(%rbx), %r14d
movb 0x27(%rsp), %al
cmpb $0x3d, %al
movl 0xc(%rsp), %r12d
movabsq $0x100000000, %rdi      # imm = 0x100000000
jne 0x38af
movl %ebp, %r15d
movq 0x28(%rsp), %rbx
movq 0x40(%rsp), %rax
jmp 0x3919
xorl %eax, %eax
pushq $0x3f
popq %r14
movl %ebp, %r15d
movq 0x28(%rsp), %rbx
movl 0xc(%rsp), %r12d
movabsq $0x100000000, %rdi      # imm = 0x100000000
jmp 0x3919
movl %r14d, %ecx
cmpl $-0x2, 0x48(%rsp)
jg 0x3869
movl %ecx, %r14d
xorl %eax, %eax
movl %ebp, %r15d
movq 0x28(%rsp), %rbx
movl 0xc(%rsp), %r12d
movabsq $0x100000000, %rdi      # imm = 0x100000000
movq 0x10(%rsp), %r8
jmp 0x3919
movq 0x28(%rsp), %rax
movq (%rax,%r12), %rax
movl %ebx, %edx
cmpb $0x0, (%rax,%rdx)
movabsq $0x100000000, %rdi      # imm = 0x100000000
movq 0x10(%rsp), %r8
movl 0x34(%rsp), %r15d
je 0x38d9
movl %ebx, 0x48(%rsp)
movq %rbp, 0x18(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x28(%rsp), %rbx
movl 0xc(%rsp), %r12d
jmp 0x3965
testb %al, %al
jne 0x38ed
cmpl $0x1, 0x8(%rbx)
jne 0x38ed
cmpl %ebp, 0x78(%rsp)
jle 0x390b
movq 0x18(%rsp), %rax
leal (%rax,%r13), %r15d
incl %r15d
movslq %r15d, %rax
movq 0x28(%rsp), %rbx
movq (%rbx,%rax,8), %rax
jmp 0x3919
movl %ecx, %r14d
xorl %eax, %eax
movl %ebp, %r15d
movq 0x28(%rsp), %rbx
movl 0xc(%rsp), %r12d
jmp 0x3919
xorl %eax, %eax
jmp 0x3911
cmpl %ebp, 0x78(%rsp)
movl 0xc(%rsp), %r12d
movabsq $0x100000000, %rdi      # imm = 0x100000000
movq 0x10(%rsp), %r8
jg 0x38bf
xorl %eax, %eax
pushq $0x3a
popq %r14
movl %ebp, %r15d
movq 0x28(%rsp), %rbx
movq %rax, 0x40(%rsp)
leal 0x1(%r15), %eax
movq %rax, 0x18(%rsp)
movl $0x0, 0x48(%rsp)
cmpl $0x0, 0x38(%rsp)
jle 0x395d
cmpl %r15d, %ebp
jg 0x395d
movq %rbx, %rdi
movl %ebp, %esi
movq 0x38(%rsp), %rdx
callq 0x43d3
movq 0x10(%rsp), %r8
movabsq $0x100000000, %rdi      # imm = 0x100000000
incl %ebp
jmp 0x3936
movl %r14d, %ecx
movl 0x34(%rsp), %r15d
testl %ecx, %ecx
movq 0x1966a(%rip), %rbp     # 0x1cfd8
movq 0x70(%rsp), %r14
js 0x4270
leal -0x68(%rcx), %eax
cmpl $0xe, %eax
ja 0x399f
leaq 0x12688(%rip), %rcx     # 0x16010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbp), %rax
movq %rax, 0x68(%rsp)
jmp 0x3a85
cmpl $0x12d, %ecx            # imm = 0x12D
je 0x3a81
cmpl $0x56, %ecx
je 0x4304
cmpl $0x3a, %ecx
je 0x436c
cmpl $0x3f, %ecx
jne 0x3a85
jmp 0x438c
movq 0x40(%rsp), %rdi
callq 0x3400
movq 0x10(%rsp), %r8
movabsq $0x100000000, %rdi      # imm = 0x100000000
movl %eax, 0x198aa(%rip)     # 0x1d294
jmp 0x3a85
movq 0x40(%rsp), %r14
jmp 0x3a85
movq 0x40(%rsp), %rdi
callq 0x3400
movq 0x10(%rsp), %r8
movabsq $0x100000000, %rdi      # imm = 0x100000000
movl %eax, 0x58(%rsp)
jmp 0x3a85
movq 0x40(%rsp), %rdi
callq 0x3400
movq 0x10(%rsp), %r8
movabsq $0x100000000, %rdi      # imm = 0x100000000
movl %eax, %r15d
jmp 0x3a85
movq 0x40(%rsp), %r13
cmpb $0x2d, (%r13)
jne 0x3a49
cmpb $0x0, 0x1(%r13)
je 0x3a85
movq (%rbp), %rdx
movq %r13, %rdi
leaq 0x12604(%rip), %rsi     # 0x1605b
callq 0x31c0
movq 0x10(%rsp), %r8
movabsq $0x100000000, %rdi      # imm = 0x100000000
testq %rax, %rax
jne 0x3a85
jmp 0x4341
movq 0x40(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0x3a85
pushq $0x1
popq %r12
movl %r12d, 0xc(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x18(%rsp), %rax
jmp 0x368b
cmpq %r8, %rcx
cmovgq %rcx, %r8
movl 0xc(%rsp), %r12d
movq 0x80(%rsp), %rax
movq 0x50(%rsp), %rsi
addl %esi, %eax
movl %eax, %ecx
subl %r8d, %ecx
movl %r13d, %edx
addl %ecx, %edx
je 0x3b68
movq 0x68(%rsp), %rcx
cmpq (%rbp), %rcx
je 0x3b68
movl %r8d, %ecx
negl %ecx
addq %rcx, %rax
leaq (%rax,%r13), %rcx
testl %ecx, %ecx
jle 0x4145
movl %r15d, 0x34(%rsp)
leaq (%rax,%r13), %rcx
decq %rcx
movslq %r8d, %r15
movslq %esi, %rax
testl %ecx, %ecx
je 0x3c86
subq %rax, %r15
subq %r13, %r15
movq 0x8(%rbx,%r15,8), %rbx
testq %r14, %r14
je 0x3c97
movq 0x194d7(%rip), %r12     # 0x1cff8
movq (%r12), %rdi
leaq 0x127e6(%rip), %rsi     # 0x16312
movq %r14, %r13
leaq 0x1258a(%rip), %r14     # 0x160c0
movq %r14, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x3290
movq (%r12), %rdi
movl 0xc(%rsp), %r12d
leaq 0x127dd(%rip), %rsi     # 0x16330
movq %r14, %rdx
movq %r13, %r14
movq %rbx, %rcx
xorl %eax, %eax
callq 0x3290
jmp 0x3c97
pushq $0xa
popq %rbx
movl %ebx, %edi
movq 0x68(%rsp), %r13
movq %r13, %rsi
callq 0x3200
leaq 0x12562(%rip), %rdi     # 0x160e3
pushq $0x3c
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %r13, %rcx
callq 0x3450
leaq 0x12586(%rip), %rdi     # 0x16120
pushq $0x9
popq %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x3450
leaq 0x1257b(%rip), %rdi     # 0x1612a
pushq $0x27
popq %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x3450
leaq 0x1258e(%rip), %rdi     # 0x16152
pushq $0x25
popq %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x3450
leaq 0x1259f(%rip), %rsi     # 0x16178
movq %r13, %rdi
movl 0x58(%rsp), %edx
xorl %eax, %eax
callq 0x3290
leaq 0x125cc(%rip), %rsi     # 0x161ba
movq %r13, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x3290
leaq 0x12602(%rip), %rdi     # 0x16204
pushq $0x32
popq %r15
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x3450
movl 0x1967a(%rip), %edx     # 0x1d294
leaq 0x12616(%rip), %rsi     # 0x16237
movq %r13, %rdi
xorl %eax, %eax
callq 0x3290
leaq 0x1262b(%rip), %rdi     # 0x1625d
pushq $0x26
popq %r12
movq %r12, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x3450
leaq 0x12639(%rip), %rdi     # 0x16284
movq %r12, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x3450
movl %ebx, %edi
movq %r13, %rsi
callq 0x3200
leaq 0x12641(%rip), %rdi     # 0x162ab
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x3450
xorl %eax, %eax
cmpq (%rbp), %r13
setne %al
jmp 0x4133
testq %r14, %r14
je 0x427a
subq %rax, %r15
subq %r13, %r15
xorl %ebx, %ebx
movl 0x58(%rsp), %eax
testl %eax, %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmovnel %eax, %ecx
movl %ecx, 0x48(%rsp)
movq 0x28(%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0xa066
movq %rax, 0x38(%rsp)
testq %rax, %rax
je 0x415b
testq %rbx, %rbx
je 0x3d25
pushq $0x1
popq %rax
movq %rax, 0x10(%rsp)
pushq $0x60
popq %rdi
callq 0x32f0
movq %rax, %r13
leaq 0x88(%rsp), %r14
movq %r14, %rdi
movq 0x38(%rsp), %rsi
movq %rbx, %rdx
movq 0x60(%rsp), %rcx
callq 0x711e
movupd (%r14), %xmm0
movups 0x10(%r14), %xmm1
movupd 0x20(%r14), %xmm2
movupd %xmm2, 0x20(%r13)
movups %xmm1, 0x10(%r13)
movupd %xmm0, (%r13)
movl 0x34(%rsp), %r15d
jmp 0x40a6
leaq 0x12751(%rip), %rsi     # 0x1647d
movq %r14, %rdi
callq 0x3350
testq %rax, %rax
je 0x429b
movq %rax, %rbx
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0x3240
movq %rax, %r14
movq %rbx, 0x68(%rsp)
movq %rbx, 0x10(%rax)
movl $0x40000, 0x8(%rax)     # imm = 0x40000
movl $0x10000, %edi          # imm = 0x10000
callq 0x32f0
movq %rax, 0x18(%r14)
xorl %r15d, %r15d
xorl %ebp, %ebp
movq $0x0, 0x18(%rsp)
movq $0x0, 0x58(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x50(%rsp)
movl (%r14), %ecx
movl 0x4(%r14), %eax
cmpl %eax, %ecx
jl 0x3dab
testb $0x3, 0x8(%r14)
jne 0x4075
xorl %r12d, %r12d
cmpl %eax, %ecx
jl 0x3df3
movl 0x8(%r14), %r13d
testb $0x3, %r13b
jne 0x3ea9
andl $0x0, (%r14)
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
movl %r13d, %ebx
sarl $0x2, %ebx
movl %ebx, %edx
callq 0x3280
movl %eax, 0x4(%r14)
cmpl %ebx, %eax
jge 0x3de9
orl $0x1, %r13d
movl %r13d, 0x8(%r14)
testl %eax, %eax
je 0x3ea9
xorl %ecx, %ecx
movslq %ecx, %rsi
cltq
cmpl %esi, %eax
movl %esi, %ebx
cmovgl %eax, %ebx
movq %rsi, %rdx
cmpq %rax, %rdx
jge 0x3e18
movq 0x18(%r14), %rdi
cmpb $0xa, (%rdi,%rdx)
je 0x3e16
incq %rdx
jmp 0x3e02
movl %edx, %ebx
movq %r15, %rdx
subq %r12, %rdx
movl %ebx, %eax
subl %ecx, %eax
leal 0x1(%rax), %ecx
movslq %ecx, %rcx
cmpq %rcx, %rdx
jae 0x3e7b
cltq
addq %r12, %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %r15
shrq $0x10, %r15
orq %rax, %r15
incq %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x3330
movq %rax, %rbp
movslq (%r14), %rsi
movl %ebx, %eax
subl %esi, %eax
leaq (%r12,%rbp), %rdi
addq 0x18(%r14), %rsi
movslq %eax, %rdx
callq 0x32c0
movslq (%r14), %rax
movslq %ebx, %rcx
subq %rax, %rcx
addq %rcx, %r12
leal 0x1(%rbx), %ecx
movl %ecx, (%r14)
movl 0x4(%r14), %eax
cmpl %eax, %ebx
jge 0x3dae
testq %rbp, %rbp
je 0x3ec4
cmpq $0x2, %r12
jb 0x3ed6
xorl %eax, %eax
cmpb $0xd, -0x1(%rbp,%r12)
sete %al
subq %rax, %r12
jmp 0x3ed6
pushq $0x1
popq %r15
movq %r15, %rdi
movq %r15, %rsi
callq 0x3240
movq %rax, %rbp
movb $0x0, (%rbp,%r12)
testl %r12d, %r12d
js 0x4075
callq 0x34d0
movq (%rax), %r8
leaq -0x1(%rbp), %rbx
leaq 0x1(%rbp), %rsi
movq %rbx, %rdx
movq %rsi, %rcx
incq %rbx
movsbq 0x1(%rdx), %rsi
testq %rsi, %rsi
je 0x3f1c
movzwl (%r8,%rsi,2), %edi
andl $0x2000, %edi           # imm = 0x2000
leaq 0x1(%rcx), %rsi
testw %di, %di
jne 0x3ef5
pushq $-0x1
popq %r13
movq %rdx, %r12
movsbq -0x1(%rcx), %rdx
incq %r13
testq %rdx, %rdx
je 0x3f48
movzwl (%r8,%rdx,2), %esi
andl $0x2000, %esi           # imm = 0x2000
incq %rcx
leaq 0x1(%r12), %rdx
testw %si, %si
je 0x3f20
incq 0x50(%rsp)
testq %r13, %r13
je 0x3d95
leaq 0x1(%r13), %rdi
movq %rax, 0x78(%rsp)
callq 0x32f0
movq %rax, 0x60(%rsp)
movq %rax, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x32c0
movq 0x60(%rsp), %rax
movb $0x0, (%rax,%r13)
movq 0x78(%rsp), %rax
movq (%rax), %rax
movsbq 0x1(%r12), %rcx
incq %r12
testq %rcx, %rcx
je 0x3fa3
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
jne 0x3f89
pushq $0x1
popq %rcx
movq %r12, %rdx
movq 0x58(%rsp), %rdi
movsbq (%rdx), %rsi
decq %rcx
testq %rsi, %rsi
je 0x3fcc
movzwl (%rax,%rsi,2), %esi
andl $0x2000, %esi           # imm = 0x2000
incq %rdx
testw %si, %si
je 0x3fae
testq %rcx, %rcx
je 0x4315
cmpq %rdi, 0x10(%rsp)
jne 0x4002
leaq (%rdi,%rdi), %rbx
testq %rdi, %rdi
pushq $0x2
popq %rax
cmoveq %rax, %rbx
imulq $0x30, %rbx, %rsi
movq 0x18(%rsp), %rdi
callq 0x3330
movq %rax, %r13
movq %rbx, 0x58(%rsp)
jmp 0x4007
movq 0x18(%rsp), %r13
movq 0x10(%rsp), %rax
imulq $0x30, %rax, %rbx
incq %rax
movq %rax, 0x10(%rsp)
leaq 0x88(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq %r12, %rdx
movq 0x60(%rsp), %r12
movq %r12, %rcx
callq 0x711e
movupd 0x88(%rsp), %xmm0
movups 0x98(%rsp), %xmm1
movupd 0xa8(%rsp), %xmm2
movupd %xmm2, 0x20(%r13,%rbx)
movups %xmm1, 0x10(%r13,%rbx)
movq %r13, 0x18(%rsp)
movupd %xmm0, (%r13,%rbx)
movq %r12, %rdi
callq 0x3060
jmp 0x3d95
movq 0x18(%r14), %rdi
callq 0x3060
movq %r14, %rdi
callq 0x3060
movq 0x68(%rsp), %rdi
callq 0x3050
movq 0x18f41(%rip), %rbp     # 0x1cfd8
movl 0x34(%rsp), %r15d
movl 0xc(%rsp), %r12d
movq 0x18(%rsp), %r13
xorl %ebx, %ebx
movq %r13, 0x18(%rsp)
cmpq %rbx, 0x10(%rsp)
je 0x40dc
movq (%rbp), %rdx
incq %rbx
movl %r15d, (%rsp)
movq 0x38(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %ecx
movl %r12d, %r8d
movl 0x48(%rsp), %r9d
callq 0x8746
addq $0x30, %r13
jmp 0x40ad
movq 0x18(%rsp), %r15
movq %r15, %rbx
movq 0x10(%rsp), %r14
subq $0x1, %r14
jb 0x40fd
movq %rbx, %rdi
callq 0x440c
addq $0x30, %rbx
jmp 0x40e9
movq %r15, %rdi
callq 0x3060
movq (%rbp), %rdi
callq 0x3300
cmpl $-0x1, %eax
je 0x43ac
movq 0x38(%rsp), %rdi
callq 0x91e8
xorl %eax, %eax
cmpl $0x0, 0x1916a(%rip)     # 0x1d294
movq 0x18ec7(%rip), %r12     # 0x1cff8
jns 0x4181
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18eac(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x12188(%rip), %rsi     # 0x162de
jmp 0x428b
movq 0x18e96(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x28(%rsp), %rax
movq (%rax,%r15,8), %rcx
leaq 0x12208(%rip), %rsi     # 0x1637d
leaq 0x11f44(%rip), %rdx     # 0x160c0
jmp 0x42b6
movq (%r12), %rdi
leaq 0x1228a(%rip), %rsi     # 0x16416
leaq 0x11f2d(%rip), %rbx     # 0x160c0
leaq 0x11f04(%rip), %rcx     # 0x1609e
xorl %r14d, %r14d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3290
movq (%r12), %rdi
leaq 0x12279(%rip), %rsi     # 0x1642b
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3290
movq 0x80(%rsp), %r13
testl %r13d, %r13d
cmovlel %r14d, %r13d
leaq 0x13032(%rip), %r14     # 0x17204
xorl %r15d, %r15d
movq (%r12), %rbx
cmpq %r15, %r13
je 0x41f9
movq 0x28(%rsp), %rax
movq (%rax,%r15,8), %rdx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x3290
incq %r15
jmp 0x41d5
callq 0x14111
leaq 0x190a3(%rip), %rax     # 0x1d2a8
subsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x140a8
movsd %xmm0, 0x38(%rsp)
callq 0x140eb
cvtsi2sd %rax, %xmm2
movsd 0x11ddc(%rip), %xmm0    # 0x16008
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
leaq 0x121f9(%rip), %rsi     # 0x16438
leaq 0x11e7a(%rip), %rdx     # 0x160c0
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movb $0x3, %al
callq 0x3290
xorl %eax, %eax
jmp 0x4133
movq 0x18(%rsp), %r8
addl %r13d, %r8d
jmp 0x42f2
movq 0x18(%rsp), %r8
jmp 0x3aaa
movq 0x18d77(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x120c4(%rip), %rsi     # 0x1634f
leaq 0x11e2e(%rip), %rdx     # 0x160c0
xorl %eax, %eax
callq 0x3290
jmp 0x42bd
movq 0x18d56(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x120f7(%rip), %rsi     # 0x163a3
leaq 0x11e0d(%rip), %rdx     # 0x160c0
movq %r14, %rcx
xorl %eax, %eax
callq 0x3290
pushq $0x1
popq %rax
jmp 0x4133
movl %eax, %r8d
jmp 0x42eb
movq 0x50(%rsp), %rax
leal (%rax,%r13), %edx
movq 0x18(%rsp), %r12
leal (%r12,%r13), %esi
movq %rbx, %rdi
callq 0x43d3
leal (%r12,%r13), %r8d
incl %r8d
movq 0x18ce6(%rip), %rbp     # 0x1cfd8
movl 0xc(%rsp), %r12d
movl %r14d, %r15d
movq 0x70(%rsp), %r14
jmp 0x3aaa
leaq 0x11d93(%rip), %rdi     # 0x1609e
callq 0x30b0
jmp 0x425c
movq 0x18cdc(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x120a5(%rip), %rsi     # 0x163cb
leaq 0x11d93(%rip), %rdx     # 0x160c0
movq 0x50(%rsp), %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0x3290
jmp 0x42bd
movq 0x18cb0(%rip), %rax     # 0x1cff8
movq (%rax), %rbx
callq 0x3080
movl (%rax), %edi
callq 0x3490
leaq 0x11d00(%rip), %rsi     # 0x1605e
movq %rbx, %rdi
movq %r13, %rdx
movq %rax, %rcx
jmp 0x42b6
movq 0x18c85(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movslq 0x18(%rsp), %rax
movq -0x8(%rbx,%rax,8), %rcx
leaq 0x11d3e(%rip), %rsi     # 0x160c5
jmp 0x4175
movq 0x18c65(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movslq 0x18(%rsp), %rax
movq -0x8(%rbx,%rax,8), %rcx
leaq 0x11cfb(%rip), %rsi     # 0x160a2
jmp 0x4175
movq 0x18c45(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x12034(%rip), %rsi     # 0x163f1
leaq 0x11cfc(%rip), %rdx     # 0x160c0
xorl %eax, %eax
callq 0x3290
pushq $0x1
popq %rdi
callq 0x3430