// File: /workspace/github_c_makefile_star2_O3/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 $0xc8, %rsp
movq %rsi, %r15
movl %edi, %ebx
callq 0x1865f
movq %rbx, %r10
movq 0x1c1b7(%rip), %rax     # 0x1fff8
movq (%rax), %rsi
cmpl $0x2, %r10d
movq %rbx, 0x30(%rsp)
jl 0x442d
movq %rsi, 0x50(%rsp)
leal -0x1(%r10), %eax
movl %eax, 0x84(%rsp)
movl %r10d, %r13d
negl %r13d
movl $0x1, %r12d
movl $0x64, 0x28(%rsp)
movl $0x3c, %ebx
xorl %edx, %edx
movq $0x0, 0x58(%rsp)
xorl %r11d, %r11d
xorl %r8d, %r8d
xorl %esi, %esi
movq %r13, 0x70(%rsp)
movq %r11, %r14
movl %ebx, 0x38(%rsp)
movq %rdx, 0x20(%rsp)
movq %r12, 0x68(%rsp)
movslq %r12d, %r11
leal (%r8,%r10), %ecx
subl %r11d, %ecx
movl %r11d, %eax
leaq (%rax,%r13), %r9
movq %r11, %r12
shlq $0x20, %r12
leaq (%r15,%r11,8), %r10
movq %r10, %rbx
xorl %ebp, %ebp
movq %r8, 0x78(%rsp)
movl %r8d, %r13d
movq %r11, 0x88(%rsp)
movq (%r10,%rbp,8), %r8
cmpb $0x2d, (%r8)
jne 0x3ee7
cmpb $0x0, 0x1(%r8)
jne 0x3f0e
incq %r11
incl %r13d
incq %rbp
movabsq $0x100000000, %r8       # imm = 0x100000000
addq %r8, %r12
addq $0x8, %rbx
movl %r9d, %r8d
addl %ebp, %r8d
jne 0x3ed6
jmp 0x4447
sarq $0x1d, %r12
movq (%r15,%r12), %r9
cmpb $0x2d, (%r9)
jne 0x4b5c
movl %esi, %r8d
leaq (%rax,%rbp), %rcx
movq %rcx, 0x60(%rsp)
movl 0x78(%rsp), %ecx
leaq (%rcx,%rbp), %rdx
movq %rdx, 0x40(%rsp)
movzbl 0x1(%r9), %edx
cmpl $0x2d, %edx
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdi
movq %r14, %r11
movq %r14, 0x8(%rsp)
movq 0x30(%rsp), %r10
movq %r15, 0x48(%rsp)
je 0x3fd2
testl %edx, %edx
je 0x4ba2
cmpl $0x1, %r8d
adcl $0x0, %r8d
movl %r8d, 0x10(%rsp)
movslq %r8d, %r15
movq %r9, 0x18(%rsp)
movsbl (%r9,%r15), %esi
incq %r15
movl $0xf, %edx
leaq 0x160b8(%rip), %rdi     # 0x1a048
movq %rsi, %r14
callq 0x3210
testq %rax, %rax
je 0x4111
cmpb $0x3a, 0x1(%rax)
movq 0x40(%rsp), %r8
jne 0x4123
movq 0x18(%rsp), %rax
cmpb $0x0, (%rax,%r15)
movq 0x8(%rsp), %r9
je 0x41b8
addq %r15, %rax
movq %rax, 0x18(%rsp)
jmp 0x4138
movb 0x2(%r9), %sil
testb %sil, %sil
je 0x4bc2
movq %rbp, 0x90(%rsp)
leaq 0x2(%r9), %rbp
addq $0x3, %r9
xorl %edx, %edx
testb %sil, %sil
je 0x4014
movzbl %sil, %eax
cmpl $0x3d, %eax
je 0x4014
movb (%r9), %sil
incq %r9
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rdx
jmp 0x3ff1
movb %sil, 0x2f(%rsp)
movq %r9, 0x18(%rsp)
sarq $0x20, %rdx
xorl %r12d, %r12d
leaq 0x1bac4(%rip), %r15     # 0x1faf0
leaq 0x16441(%rip), %rsi     # 0x1a474
xorl %r14d, %r14d
movq %rdx, 0x10(%rsp)
movq %rbp, %rdi
callq 0x30a0
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
cmoveq %r15, %r12
addl %ecx, %r14d
movq 0x10(%rsp), %rdx
movq 0x10(%r15), %rsi
addq $0x10, %r15
testq %rsi, %rsi
jne 0x403b
cmpl $0x1, %r14d
jne 0x40d7
movl 0xc(%r12), %r14d
movb 0x2f(%rsp), %al
cmpb $0x3d, %al
movq 0x48(%rsp), %r15
movq 0x30(%rsp), %r10
movq 0x8(%rsp), %r9
movq 0x40(%rsp), %r8
movq 0x60(%rsp), %rcx
movq 0x90(%rsp), %rbp
je 0x41fe
testb %al, %al
jne 0x41f5
cmpl $0x1, 0x8(%r12)
jne 0x41f5
cmpl %ecx, 0x84(%rsp)
jle 0x41ef
movq 0x68(%rsp), %rax
leal (%rax,%rbp), %ecx
incl %ecx
movslq %ecx, %rax
movq (%r15,%rax,8), %rax
movq %rax, 0x18(%rsp)
jmp 0x41fe
movl $0x3f, %r14d
movq $0x0, 0x18(%rsp)
movq 0x48(%rsp), %r15
movq 0x30(%rsp), %r10
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %r9
movq 0x40(%rsp), %r8
movq 0x60(%rsp), %rcx
movq 0x90(%rsp), %rbp
jmp 0x4203
movl $0x3f, %r14d
movq 0x8(%rsp), %r9
movq 0x40(%rsp), %r8
jmp 0x4128
movq 0x8(%rsp), %r9
cmpl $-0x2, 0x10(%rsp)
jg 0x4151
movq $0x0, 0x18(%rsp)
movq 0x48(%rsp), %r15
movq 0x30(%rsp), %r10
movq 0x20(%rsp), %rdx
movq 0x60(%rsp), %rcx
jmp 0x4203
movq 0x48(%rsp), %rax
movq (%rax,%r12), %rax
movl %r15d, %ecx
cmpb $0x0, (%rax,%rcx)
movq 0x60(%rsp), %rcx
je 0x4199
movl %r15d, %esi
movl %ecx, %r12d
movq $0x0, 0x18(%rsp)
movq 0x48(%rsp), %r15
movq 0x30(%rsp), %r10
movq 0x20(%rsp), %rdx
movl 0x38(%rsp), %ebx
movq 0x70(%rsp), %r13
movq 0x40(%rsp), %r8
jmp 0x4286
movq $0x0, 0x18(%rsp)
movq 0x48(%rsp), %r15
movq 0x30(%rsp), %r10
movq 0x20(%rsp), %rdx
movq 0x40(%rsp), %r8
jmp 0x4203
movq 0x60(%rsp), %rcx
cmpl %ecx, 0x84(%rsp)
movq 0x20(%rsp), %rdx
jle 0x42f3
movq 0x68(%rsp), %rax
leal (%rax,%rbp), %ecx
incl %ecx
movslq %ecx, %rax
movq 0x48(%rsp), %r15
movq (%r15,%rax,8), %rax
movq %rax, 0x18(%rsp)
jmp 0x4307
movl $0x3a, %r14d
movq $0x0, 0x18(%rsp)
movq 0x20(%rsp), %rdx
leal 0x1(%rcx), %r12d
xorl %esi, %esi
testl %r8d, %r8d
jle 0x427d
movq %r10, %rsi
movq 0x88(%rsp), %r9
addq %rbp, %r9
movl %r8d, %eax
movslq %ecx, %rcx
movl %r13d, %edx
negq %rdx
movl 0x38(%rsp), %r11d
movq 0x70(%rsp), %r13
movq %r9, %rdi
movq (%r15,%r9,8), %r9
xorl %r10d, %r10d
movq -0x8(%rbx,%r10,8), %r8
movq %r8, (%rbx,%r10,8)
decq %r10
cmpq %r10, %rdx
jne 0x423c
movq %rdi, %r8
subq %rax, %r8
movq %r9, (%r15,%r8,8)
leaq 0x1(%rdi), %r9
addq $0x8, %rbx
cmpq %rcx, %rdi
jl 0x4232
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %r9
movq 0x40(%rsp), %r8
movl %r11d, %ebx
movq %rsi, %r10
xorl %esi, %esi
jmp 0x4286
movl 0x38(%rsp), %ebx
movq 0x70(%rsp), %r13
testl %r14d, %r14d
js 0x4b77
cmpl $0x67, %r14d
movq %r9, %r11
jg 0x42c4
cmpl $0x56, %r14d
je 0x4b20
cmpl $0x3a, %r14d
je 0x4c4b
cmpl $0x3f, %r14d
je 0x4c30
cmpl %r10d, %r12d
jl 0x3e94
jmp 0x4b93
leal -0x68(%r14), %eax
cmpl $0xe, %eax
ja 0x4311
leaq 0x15d30(%rip), %rcx     # 0x1a004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq 0x40(%rsp), %r8
jmpq *%rax
movq 0x1bcef(%rip), %rax     # 0x1ffd8
movq (%rax), %rax
movq %rax, 0x50(%rsp)
jmp 0x42b6
movl $0x3a, %r14d
movq $0x0, 0x18(%rsp)
movq 0x48(%rsp), %r15
movq 0x30(%rsp), %r10
jmp 0x4203
cmpl $0x12d, %r14d           # imm = 0x12D
jne 0x42b6
movl $0x1, %edx
jmp 0x42b6
movq 0x18(%rsp), %rdi
cmpb $0x2d, (%rdi)
jne 0x4331
cmpb $0x0, 0x1(%rdi)
je 0x42b6
movq 0x1bca0(%rip), %rax     # 0x1ffd8
movq (%rax), %rdx
movl %esi, 0x10(%rsp)
leaq 0x15d11(%rip), %rsi     # 0x1a057
movq %r10, %rbx
movq %rdi, %r14
callq 0x31c0
movl 0x10(%rsp), %esi
movq %rbx, %r10
movq 0x40(%rsp), %r8
movq 0x20(%rsp), %rdx
movl 0x38(%rsp), %ebx
movq 0x8(%rsp), %r11
testq %rax, %rax
jne 0x42b6
jmp 0x4c9c
movq 0x18(%rsp), %rdi
movq %rdx, %rbx
movq %r10, %r14
movl %esi, 0x10(%rsp)
callq 0x3400
movl 0x10(%rsp), %esi
movq %r14, %r10
movq 0x40(%rsp), %r8
movq %rbx, %rdx
movq 0x8(%rsp), %r11
movl %eax, %ebx
jmp 0x42b6
movq 0x18(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x42b6
movq 0x18(%rsp), %rdi
movq %rdx, %rbx
movq %r10, %r14
movl %esi, 0x10(%rsp)
callq 0x3400
movl 0x10(%rsp), %esi
movq %r14, %r10
movq 0x40(%rsp), %r8
movq %rbx, %rdx
movl 0x38(%rsp), %ebx
movq 0x8(%rsp), %r11
movl %eax, 0x28(%rsp)
jmp 0x42b6
movq 0x18(%rsp), %r11
jmp 0x42b6
movq 0x18(%rsp), %rdi
movq %rdx, %rbx
movq %r10, %r14
movl %esi, 0x10(%rsp)
callq 0x3400
movl 0x10(%rsp), %esi
movq %r14, %r10
movq 0x40(%rsp), %r8
movq %rbx, %rdx
movl 0x38(%rsp), %ebx
movq 0x8(%rsp), %r11
movl %eax, 0x1be6c(%rip)     # 0x20294
jmp 0x42b6
movl $0x1, %eax
xorl %r11d, %r11d
movl $0x3c, %ebx
movl $0x64, %ebp
xorl %edi, %edi
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x4469
movq 0x30(%rsp), %r10
movl %r10d, %eax
movl 0x28(%rsp), %ebp
movq 0x20(%rsp), %rdx
movl 0x38(%rsp), %ebx
movq 0x58(%rsp), %rdi
movq %r14, %r11
movq 0x50(%rsp), %rsi
subl %ecx, %eax
movq 0x1bb66(%rip), %rcx     # 0x1ffd8
cmpl %eax, %r10d
je 0x44b5
cmpq (%rcx), %rsi
je 0x44b5
movl %r10d, %ecx
subl %eax, %ecx
jle 0x4aea
cmpl $0x1, %ecx
movl %ebp, 0x28(%rsp)
movq %r11, 0x8(%rsp)
jne 0x45e4
testq %rdi, %rdi
je 0x4b09
movl %ebx, %r12d
movq %rdx, %rbp
movq %rdi, %r13
movslq %eax, %r14
xorl %ebx, %ebx
jmp 0x45fe
movl $0xa, %edi
movq %rsi, %r14
movq %rcx, %r15
callq 0x3200
leaq 0x15c13(%rip), %rdi     # 0x1a0df
movl $0x3c, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x3450
leaq 0x15c37(%rip), %rdi     # 0x1a11c
movl $0x9, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x3450
leaq 0x15c28(%rip), %rdi     # 0x1a126
movl $0x27, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x3450
leaq 0x15c37(%rip), %rdi     # 0x1a14e
movl $0x25, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x3450
leaq 0x15c44(%rip), %rsi     # 0x1a174
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x3290
leaq 0x15c73(%rip), %rsi     # 0x1a1b6
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3290
leaq 0x15caa(%rip), %rdi     # 0x1a200
movl $0x32, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x3450
movl 0x1bd26(%rip), %edx     # 0x20294
leaq 0x15cbe(%rip), %rsi     # 0x1a233
movq %r14, %rdi
xorl %eax, %eax
callq 0x3290
leaq 0x15cd3(%rip), %rdi     # 0x1a259
movl $0x26, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x3450
leaq 0x15ce1(%rip), %rdi     # 0x1a280
movl $0x26, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x3450
movl $0xa, %edi
movq %r14, %rsi
callq 0x3200
leaq 0x15ce2(%rip), %rdi     # 0x1a2a7
movl $0x32, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x3450
xorl %ebx, %ebx
cmpq (%r15), %r14
setne %bl
jmp 0x4ad6
movl %ebx, %r12d
movq %rdx, %rbp
movslq %eax, %r14
movq 0x8(%r15,%r14,8), %rbx
testq %rdi, %rdi
jne 0x4b10
movq %rdi, %r13
testl %r12d, %r12d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmovnel %r12d, %eax
movl %eax, 0x58(%rsp)
movq (%r15,%r14,8), %rdi
callq 0xbb88
testq %rax, %rax
je 0x4af1
movq %rax, 0x50(%rsp)
testq %rbx, %rbx
movq %r15, 0x48(%rsp)
je 0x4682
movl $0x60, %edi
callq 0x32f0
movq %rax, %r12
leaq 0x98(%rsp), %r14
movq %r14, %rdi
movq 0x50(%rsp), %rsi
movq %rbx, %rdx
movq 0x8(%rsp), %rcx
callq 0x878e
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%r12)
movups %xmm1, 0x10(%r12)
movups %xmm0, (%r12)
movl $0x1, %eax
jmp 0x4a2c
leaq 0x15df0(%rip), %rsi     # 0x1a479
movq %r13, %rdi
callq 0x3350
testq %rax, %rax
je 0x4b30
movq %rax, %r12
movq %rbp, 0x20(%rsp)
movl $0x1, %edi
movl $0x20, %esi
callq 0x3240
movq %rax, %r14
movq %r12, 0x78(%rsp)
movq %r12, 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, 0x8(%rsp)
movq $0x0, 0x88(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x38(%rsp)
movl (%r14), %ecx
movl 0x4(%r14), %eax
cmpl %eax, %ecx
jl 0x4714
testb $0x3, 0x8(%r14)
jne 0x49f8
xorl %r12d, %r12d
cmpl %eax, %ecx
jl 0x475f
movl 0x8(%r14), %r13d
testb $0x3, %r13b
jne 0x4812
movl $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 0x4755
orl $0x1, %r13d
movl %r13d, 0x8(%r14)
testl %eax, %eax
je 0x4812
xorl %ecx, %ecx
movl %ecx, %ebx
cmpl %eax, %ecx
jge 0x477e
movslq %ecx, %rdx
addq 0x18(%r14), %rdx
movl %ecx, %ebx
cmpb $0xa, (%rdx)
je 0x477e
incl %ebx
incq %rdx
cmpl %ebx, %eax
jne 0x476e
movl %eax, %ebx
movq %r15, %rdx
subq %r12, %rdx
movl %ebx, %eax
subl %ecx, %eax
leal 0x1(%rax), %esi
movslq %esi, %rsi
cmpq %rsi, %rdx
jae 0x47e1
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
movl (%r14), %ecx
movl %ebx, %eax
subl %ecx, %eax
leaq (%r12,%rbp), %rdi
movslq %ecx, %rsi
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 0x4717
testq %rbp, %rbp
je 0x482d
cmpq $0x2, %r12
jb 0x4845
xorl %eax, %eax
cmpb $0xd, -0x1(%rbp,%r12)
sete %al
subq %rax, %r12
jmp 0x4845
movl $0x1, %r15d
movl $0x1, %edi
movl $0x1, %esi
callq 0x3240
movq %rax, %rbp
movb $0x0, (%rbp,%r12)
testl %r12d, %r12d
js 0x49f8
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 0x488b
movzwl (%r8,%rsi,2), %edi
andl $0x2000, %edi           # imm = 0x2000
leaq 0x1(%rcx), %rsi
testw %di, %di
jne 0x4864
movq $-0x1, %r13
movq %rdx, %r12
movsbq -0x1(%rcx), %rdx
incq %r13
testq %rdx, %rdx
je 0x48ba
movzwl (%r8,%rdx,2), %esi
andl $0x2000, %esi           # imm = 0x2000
incq %rcx
leaq 0x1(%r12), %rdx
testw %si, %si
je 0x4892
incq 0x38(%rsp)
testq %r13, %r13
je 0x46fe
leaq 0x1(%r13), %rdi
movq %rax, 0x68(%rsp)
callq 0x32f0
movq %rax, 0x70(%rsp)
movq %rax, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x32c0
movq 0x70(%rsp), %rax
movb $0x0, (%rax,%r13)
movq 0x68(%rsp), %rax
movq (%rax), %rax
movsbq 0x1(%r12), %rcx
incq %r12
testq %rcx, %rcx
je 0x4915
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
jne 0x48fb
movl $0x1, %ecx
movq %r12, %rdx
movq 0x88(%rsp), %rdi
movsbq (%rdx), %rsi
decq %rcx
testq %rsi, %rsi
je 0x4943
movzwl (%rax,%rsi,2), %esi
andl $0x2000, %esi           # imm = 0x2000
incq %rdx
testw %si, %si
je 0x4925
testq %rcx, %rcx
je 0x4c70
cmpq %rdi, 0x10(%rsp)
jne 0x4985
leaq (%rdi,%rdi), %rbx
testq %rdi, %rdi
movl $0x2, %eax
cmoveq %rax, %rbx
movq %rbx, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
movq 0x8(%rsp), %rdi
callq 0x3330
movq %rax, %r13
movq %rbx, 0x88(%rsp)
jmp 0x498a
movq 0x8(%rsp), %r13
movq 0x10(%rsp), %rax
leaq (%rax,%rax,2), %rbx
incq %rax
movq %rax, 0x10(%rsp)
shlq $0x4, %rbx
leaq 0x98(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq %r12, %rdx
movq 0x70(%rsp), %r12
movq %r12, %rcx
callq 0x878e
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups 0xb8(%rsp), %xmm2
movups %xmm2, 0x20(%r13,%rbx)
movups %xmm1, 0x10(%r13,%rbx)
movq %r13, 0x8(%rsp)
movups %xmm0, (%r13,%rbx)
movq %r12, %rdi
callq 0x3060
jmp 0x46fe
movq 0x18(%r14), %rdi
callq 0x3060
movq %r14, %rdi
callq 0x3060
movq 0x78(%rsp), %rdi
callq 0x3050
movq 0x10(%rsp), %rax
testq %rax, %rax
movq 0x48(%rsp), %r15
movq 0x20(%rsp), %rbp
movq 0x8(%rsp), %r12
je 0x4a9c
movq %rax, 0x10(%rsp)
xorl %ebx, %ebx
movq %r12, 0x8(%rsp)
movq %r12, %r14
movq 0x50(%rsp), %r15
movl 0x58(%rsp), %r12d
movl 0x28(%rsp), %r13d
movq 0x1b587(%rip), %rax     # 0x1ffd8
movq (%rax), %rdx
incq %rbx
movl %r13d, (%rsp)
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %ecx
movl %ebp, %r8d
movl %r12d, %r9d
callq 0xa101
addq $0x30, %r14
cmpq %rbx, 0x10(%rsp)
jne 0x4a4a
movq 0x8(%rsp), %r12
movq %r12, %rbx
movq 0x10(%rsp), %r14
movq %rbx, %rdi
callq 0x4cb0
addq $0x30, %rbx
decq %r14
jne 0x4a86
movq 0x48(%rsp), %r15
movq %r12, %rdi
callq 0x3060
movq 0x1b52d(%rip), %rax     # 0x1ffd8
movq (%rax), %rdi
callq 0x3300
cmpl $-0x1, %eax
movq 0x30(%rsp), %r14
je 0x4ca9
movq 0x50(%rsp), %rdi
callq 0xac44
xorl %ebx, %ebx
cmpl $0x0, 0x1b7c0(%rip)     # 0x20294
jns 0x4afc
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x36ef
jmp 0x4b52
leaq (%r15,%r14,8), %rdi
callq 0x36ab
jmp 0x4b52
movl %r14d, %edi
movq %r15, %rsi
callq 0x3594
jmp 0x4ad6
callq 0x36d0
jmp 0x4b52
movq %rdi, %r13
movq %rbx, %rsi
callq 0x354b
jmp 0x45fe
leaq 0x15573(%rip), %rdi     # 0x1a09a
callq 0x30b0
xorl %ebx, %ebx
jmp 0x4ad6
movq 0x1b4c1(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x1585e(%rip), %rsi     # 0x1a39f
leaq 0x15574(%rip), %rdx     # 0x1a0bc
movq %r13, %rcx
xorl %eax, %eax
callq 0x3290
movl $0x1, %ebx
jmp 0x4ad6
movl %r11d, %eax
movq 0x20(%rsp), %rdx
movl 0x38(%rsp), %ebx
movq 0x58(%rsp), %rdi
movq %r14, %r11
movq 0x30(%rsp), %r10
jmp 0x4b9b
subl 0x78(%rsp), %r12d
subl %ebp, %r12d
movl %r12d, %eax
movl 0x28(%rsp), %ebp
movq %r9, %r11
movq 0x58(%rsp), %rdi
jmp 0x4c26
movl %r12d, %eax
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
jmp 0x4bb2
movq 0x68(%rsp), %rax
addl %ebp, %eax
movq 0x20(%rsp), %rdx
movl 0x38(%rsp), %ebx
movq 0x78(%rsp), %rcx
addl %ebp, %ecx
movl 0x28(%rsp), %ebp
jmp 0x4469
movq %r9, %rsi
addq %rbp, %rcx
addq %rbp, %rax
testl %ecx, %ecx
movq 0x20(%rsp), %r12
movq 0x68(%rsp), %rbx
jle 0x4bf9
movl %ecx, %edx
negq %rdx
movslq %eax, %r8
leaq (%r15,%r8,8), %r9
xorl %r10d, %r10d
movq -0x8(%r9,%r10,8), %r8
movq %r8, (%r9,%r10,8)
decq %r10
cmpq %r10, %rdx
jne 0x4be8
xorl %edx, %edx
testl %r13d, %r13d
cmovgl %r13d, %edx
subl %edx, %ebx
addl %ebx, %ebp
movslq %ebp, %rdx
movq %rsi, (%r15,%rdx,8)
subl %ecx, %eax
incl %eax
movl 0x28(%rsp), %ebp
movl 0x38(%rsp), %ebx
movq %r12, %rdx
movq 0x58(%rsp), %rdi
movq 0x30(%rsp), %r10
movq 0x50(%rsp), %rsi
jmp 0x446b
movq 0x1b3c1(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
movslq %r12d, %rax
movq -0x8(%r15,%rax,8), %rcx
leaq 0x15455(%rip), %rsi     # 0x1a09e
jmp 0x4c64
movq 0x1b3a6(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
movslq %r12d, %rax
movq -0x8(%r15,%rax,8), %rcx
leaq 0x1545d(%rip), %rsi     # 0x1a0c1
leaq 0x15451(%rip), %rdx     # 0x1a0bc
jmp 0x4b4b
movq 0x1b381(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0x15746(%rip), %rsi     # 0x1a3c7
leaq 0x15434(%rip), %rdx     # 0x1a0bc
movq 0x38(%rsp), %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0x3290
jmp 0x4b52
movq %r14, %rdi
callq 0x3510
jmp 0x4b52
callq 0x3683
nop