// File: /workspace/github_c_makefile_star2_O1/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, %r15
movl %edi, %ebx
callq 0x16d73
movq 0x1b17a(%rip), %rax     # 0x1eff8
movq (%rax), %rax
movq %rax, 0x58(%rsp)
movslq %ebx, %r10
leal -0x1(%r10), %eax
movl %eax, 0x60(%rsp)
movl %r10d, %r11d
negl %r11d
movl $0x3c, 0x40(%rsp)
movl $0x64, 0x28(%rsp)
movl $0x1, %esi
xorl %r9d, %r9d
movq $0x0, 0x8(%rsp)
movq $0x0, 0x68(%rsp)
movq $0x0, 0x38(%rsp)
xorl %ecx, %ecx
movq %r10, 0x20(%rsp)
movq %r11, 0x10(%rsp)
movl %ecx, %r14d
cmpl %ebx, %esi
setl %cl
jge 0x3f22
movslq %esi, %rax
leal (%r9,%rbx), %edx
subl %esi, %edx
incq %rax
movq %rsi, %r12
leal (%r11,%rsi), %edi
movb $0x1, %cl
xorl %esi, %esi
movq -0x8(%r15,%rax,8), %r8
cmpb $0x2d, (%r8)
jne 0x3f09
cmpb $0x0, 0x1(%r8)
jne 0x3f27
cmpq %r10, %rax
setl %cl
decl %esi
incq %rax
cmpl %esi, %edi
jne 0x3ef7
movl %edx, %r9d
movl %ebx, %esi
movl %ebx, %r12d
jmp 0x3f30
movl %esi, %r12d
jmp 0x3f30
subl %esi, %r9d
subl %esi, %r12d
movq %r12, %rsi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x1, %cl
je 0x41a2
movslq %r12d, %rbp
movq (%r15,%rbp,8), %r8
cmpb $0x2d, (%r8)
jne 0x41a2
movzbl 0x1(%r8), %ecx
testl %ecx, %ecx
je 0x41a2
cmpl $0x2d, %ecx
jne 0x3fa9
cmpb $0x0, 0x2(%r8)
je 0x410c
movq %rbp, 0x70(%rsp)
movq %rbx, 0x50(%rsp)
leaq 0x2(%r8), %rbp
addq $0x3, %r8
xorl %r13d, %r13d
movabsq $0x100000000, %rax      # imm = 0x100000000
movzbl -0x1(%r8), %ebx
testl %ebx, %ebx
je 0x4030
cmpl $0x3d, %ebx
je 0x4030
addq %rax, %r13
incq %r8
jmp 0x3f8b
movq %r12, 0x18(%rsp)
movq %rsi, %r13
movq %r9, %r12
movl %r14d, 0x2c(%rsp)
movq 0x8(%rsp), %rax
cmpl $0x1, %eax
adcl $0x0, %eax
cltq
movq %r8, 0x48(%rsp)
movsbl (%r8,%rax), %r14d
incq %rax
movq %rax, 0x8(%rsp)
movl $0xf, %edx
leaq 0x15064(%rip), %rdi     # 0x19048
movl %r14d, %esi
callq 0x3210
testq %rax, %rax
je 0x412f
cmpb $0x3a, 0x1(%rax)
movq 0x20(%rsp), %r10
movq 0x10(%rsp), %r11
movq %r12, %r9
movq %r13, %rsi
jne 0x417f
movq 0x8(%rsp), %rax
movq 0x48(%rsp), %rdi
cmpb $0x0, (%rdi,%rax)
movq 0x18(%rsp), %r8
je 0x42f8
addq %rax, %rdi
jmp 0x430f
movq %r12, 0x18(%rsp)
movq %r8, 0x48(%rsp)
movq %rsi, 0x78(%rsp)
movq %r9, 0x80(%rsp)
movl %r14d, 0x2c(%rsp)
movq %r15, 0x30(%rsp)
sarq $0x20, %r13
xorl %r15d, %r15d
leaq 0x1aa91(%rip), %r12     # 0x1eaf0
leaq 0x1540e(%rip), %rsi     # 0x19474
xorl %r14d, %r14d
movq %rbp, %rdi
movq %r13, %rdx
callq 0x30a0
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
cmoveq %r12, %r15
addl %ecx, %r14d
movq 0x10(%r12), %rsi
addq $0x10, %r12
testq %rsi, %rsi
jne 0x4069
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x8(%rsp)
cmpl $0x1, %r14d
jne 0x4148
movl 0xc(%r15), %r14d
cmpb $0x3d, %bl
movl $0x0, %eax
movq 0x48(%rsp), %rdi
cmovneq %rax, %rdi
testb %bl, %bl
movq 0x20(%rsp), %r10
movq 0x10(%rsp), %r11
movq 0x80(%rsp), %r9
movq 0x78(%rsp), %rsi
movq 0x18(%rsp), %r8
movq 0x70(%rsp), %rbp
jne 0x43c2
cmpl $0x1, 0x8(%r15)
movq 0x50(%rsp), %rbx
jne 0x43b5
movl $0x3a, %eax
cmpl 0x60(%rsp), %r8d
movq 0x30(%rsp), %r15
jl 0x4303
jmp 0x431c
testl %r9d, %r9d
jle 0x418e
movl %r9d, %edx
leaq (%r15,%rbp,8), %rsi
xorl %ecx, %ecx
movq -0x8(%rsi), %rdi
movq %rdi, (%rsi)
addq $-0x8, %rsi
incq %rcx
cmpq %rcx, %rdx
jne 0x411a
jmp 0x4190
movl $0x3f, %eax
xorl %edi, %edi
movq 0x20(%rsp), %r10
movq 0x10(%rsp), %r11
movq %r12, %r9
movq %r13, %rsi
jmp 0x4184
movl $0x3f, %eax
xorl %edi, %edi
movq 0x30(%rsp), %r15
movq 0x50(%rsp), %rbx
movq 0x20(%rsp), %r10
movq 0x10(%rsp), %r11
movq 0x80(%rsp), %r9
movq 0x78(%rsp), %rsi
movq 0x18(%rsp), %r8
movq 0x70(%rsp), %rbp
jmp 0x431c
xorl %edi, %edi
movl %r14d, %eax
movq 0x18(%rsp), %r8
jmp 0x431c
xorl %ecx, %ecx
movl %r12d, %edx
subl %ecx, %edx
movslq %edx, %rcx
movq %r8, (%r15,%rcx,8)
incl %r12d
movl %r12d, %esi
xorl %edi, %edi
testl %eax, %eax
js 0x43fd
cmpl $0x67, %eax
jg 0x41d4
cmpl $0x56, %eax
je 0x43ea
cmpl $0x3a, %eax
je 0x4acb
movl %r14d, %ecx
cmpl $0x3f, %eax
jne 0x3ed6
jmp 0x4ab0
leal -0x68(%rax), %ecx
cmpl $0xe, %ecx
ja 0x4200
leaq 0x14e21(%rip), %rdx     # 0x19004
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x1ade5(%rip), %rax     # 0x1efd8
movq (%rax), %rax
movq %rax, 0x58(%rsp)
jmp 0x42f0
movl $0x1, %ecx
cmpl $0x12d, %eax            # imm = 0x12D
je 0x3ed6
jmp 0x42f0
movq %rsi, %r13
leaq 0x1562e(%rip), %rsi     # 0x1984d
movq %r9, %r12
movq %rdi, %rbp
callq 0x3250
movq %r13, %rsi
movq %r12, %r9
movq 0x10(%rsp), %r11
movq 0x20(%rsp), %r10
movl %r14d, %ecx
testl %eax, %eax
je 0x3ed6
movq %rbp, %rdi
movq 0x1ad89(%rip), %rax     # 0x1efd8
movq (%rax), %rdx
leaq 0x14dfe(%rip), %rsi     # 0x19057
callq 0x31c0
movq %r13, %rsi
movq %r12, %r9
movq 0x10(%rsp), %r11
movq 0x20(%rsp), %r10
movl %r14d, %ecx
testq %rax, %rax
jne 0x3ed6
jmp 0x4b71
movq %r9, %r12
movq %rsi, %r13
callq 0x3400
movq %r13, %rsi
movq %r12, %r9
movq 0x10(%rsp), %r11
movq 0x20(%rsp), %r10
movl %eax, 0x40(%rsp)
jmp 0x42f0
movq %rdi, 0x38(%rsp)
jmp 0x42f0
movq %r9, %r12
movq %rsi, %r13
callq 0x3400
movq %r13, %rsi
movq %r12, %r9
movq 0x10(%rsp), %r11
movq 0x20(%rsp), %r10
movl %eax, 0x28(%rsp)
jmp 0x42f0
movq %rdi, 0x68(%rsp)
jmp 0x42f0
movq %r9, %r12
movq %rsi, %r13
callq 0x3400
movq %r13, %rsi
movq %r12, %r9
movq 0x10(%rsp), %r11
movq 0x20(%rsp), %r10
movl %eax, 0x1afa4(%rip)     # 0x1f294
movl %r14d, %ecx
jmp 0x3ed6
cmpl 0x60(%rsp), %r8d
jge 0x43d4
leal 0x1(%r8), %esi
movslq %r8d, %rax
movq 0x8(%r15,%rax,8), %rdi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x8(%rsp)
movl %r14d, %eax
movq 0x8(%rsp), %rdx
testl %edx, %edx
js 0x4341
movslq %esi, %rcx
movq (%r15,%rcx,8), %rcx
movl %edx, %edx
cmpb $0x0, (%rcx,%rdx)
je 0x4341
movl %esi, %r12d
movl 0x2c(%rsp), %r14d
jmp 0x41a4
leal 0x1(%rsi), %ecx
testl %r9d, %r9d
setle %dl
cmpl %esi, %r8d
setg %sil
movq $0x0, 0x8(%rsp)
orb %dl, %sil
movl 0x2c(%rsp), %r14d
je 0x436e
movl %ecx, %esi
movl %ecx, %r12d
jmp 0x41a4
movq %rdi, %r13
movq %r9, %r12
movl %r9d, %edx
leaq (%r15,%rbp,8), %rsi
negq %rdx
movq (%r15,%rbp,8), %rdi
xorl %r8d, %r8d
movq -0x8(%rsi,%r8,8), %r9
movq %r9, (%rsi,%r8,8)
decq %r8
cmpq %r8, %rdx
jne 0x4385
movq %rdi, (%rsi,%r8,8)
incq %rbp
addq $0x8, %rsi
cmpl %ebp, %ecx
jne 0x437e
movl %ecx, %esi
movq %r12, %r9
movq %rcx, %r12
movq %r13, %rdi
jmp 0x41a4
movl %r14d, %eax
movq 0x30(%rsp), %r15
jmp 0x431c
movl %r14d, %eax
movq 0x30(%rsp), %r15
movq 0x50(%rsp), %rbx
jmp 0x431c
movl $0x3a, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, 0x8(%rsp)
xorl %edi, %edi
jmp 0x431c
leaq 0x14ca9(%rip), %rdi     # 0x1909a
callq 0x30b0
xorl %ebp, %ebp
jmp 0x4af7
subl %r9d, %r12d
cmpl %r12d, %ebx
movq 0x58(%rsp), %r13
je 0x444b
movq 0x1abc7(%rip), %rax     # 0x1efd8
cmpq (%rax), %r13
je 0x444b
movl %ebx, %eax
subl %r12d, %eax
jle 0x4b0b
movq %rbx, 0x50(%rsp)
movslq %r12d, %rbx
cmpl $0x1, %eax
movl %r14d, 0x2c(%rsp)
jne 0x4583
cmpq $0x0, 0x38(%rsp)
je 0x4b1d
xorl %r14d, %r14d
jmp 0x4594
movl $0xa, %edi
movq %r13, %rsi
callq 0x3200
leaq 0x14c80(%rip), %rdi     # 0x190df
movl $0x3c, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x3450
leaq 0x14ca4(%rip), %rdi     # 0x1911c
movl $0x9, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x3450
leaq 0x14c95(%rip), %rdi     # 0x19126
movl $0x27, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x3450
leaq 0x14ca4(%rip), %rdi     # 0x1914e
movl $0x25, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x3450
leaq 0x14cb1(%rip), %rsi     # 0x19174
movq %r13, %rdi
movl 0x40(%rsp), %edx
xorl %eax, %eax
callq 0x3290
leaq 0x14cde(%rip), %rsi     # 0x191b6
movq %r13, %rdi
movl 0x28(%rsp), %edx
xorl %eax, %eax
callq 0x3290
leaq 0x14d13(%rip), %rdi     # 0x19200
movl $0x32, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x3450
movl 0x1ad8f(%rip), %edx     # 0x1f294
leaq 0x14d27(%rip), %rsi     # 0x19233
movq %r13, %rdi
xorl %eax, %eax
callq 0x3290
leaq 0x14d3c(%rip), %rdi     # 0x19259
movl $0x26, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x3450
leaq 0x14d4a(%rip), %rdi     # 0x19280
movl $0x26, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x3450
movl $0xa, %edi
movq %r13, %rsi
callq 0x3200
leaq 0x14d4b(%rip), %rdi     # 0x192a7
movl $0x32, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x3450
xorl %ebp, %ebp
movq 0x1aa61(%rip), %rax     # 0x1efd8
cmpq (%rax), %r13
setne %bpl
jmp 0x4af7
movq 0x8(%r15,%rbx,8), %r14
cmpq $0x0, 0x38(%rsp)
jne 0x4b24
movl 0x40(%rsp), %eax
testl %eax, %eax
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
cmovnel %eax, %r13d
movq (%r15,%rbx,8), %rdi
callq 0xb6b4
testq %rax, %rax
je 0x4b12
movq %rax, %rbp
testq %r14, %r14
movq %rax, 0x10(%rsp)
je 0x461a
movl $0x60, %edi
callq 0x32f0
movq %rax, %r12
movq %r15, %rbx
leaq 0x88(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq 0x68(%rsp), %rcx
callq 0x81e6
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movq %rbx, %r15
movups %xmm2, 0x20(%r12)
movups %xmm1, 0x10(%r12)
movups %xmm0, (%r12)
movl $0x1, %eax
jmp 0x49f4
leaq 0x14e58(%rip), %rsi     # 0x19479
movq 0x38(%rsp), %rbx
movq %rbx, %rdi
callq 0x3350
testq %rax, %rax
je 0x4b36
movq %rax, %r14
movl %r13d, 0x48(%rsp)
movq %r15, 0x30(%rsp)
movl $0x1, %edi
movl $0x20, %esi
callq 0x3240
movq %rax, %rbp
movq %r14, 0x38(%rsp)
movq %r14, 0x10(%rax)
movl 0x8(%rax), %eax
andl $0x3, %eax
orl $0x40000, %eax          # imm = 0x40000
movl %eax, 0x8(%rbp)
movl $0x10000, %edi          # imm = 0x10000
callq 0x32f0
movq %rax, 0x18(%rbp)
xorl %r15d, %r15d
xorl %ebx, %ebx
movq $0x0, 0x18(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x20(%rsp)
movl (%rbp), %eax
cmpl 0x4(%rbp), %eax
jl 0x46bc
testb $0x3, 0x8(%rbp)
je 0x46bc
xorl %eax, %eax
movq %rbx, %r13
jmp 0x4808
xorl %r12d, %r12d
movq %rbx, %r13
movl (%rbp), %eax
cmpl 0x4(%rbp), %eax
jl 0x470a
movl 0x8(%rbp), %ebx
testb $0x3, %bl
jne 0x47c9
movl $0x0, (%rbp)
movq 0x10(%rbp), %rdi
movq 0x18(%rbp), %rsi
movl %ebx, %r14d
sarl $0x2, %r14d
movl %r14d, %edx
callq 0x3280
movl %eax, 0x4(%rbp)
cmpl %r14d, %eax
jge 0x4702
orl $0x1, %ebx
movl %ebx, 0x8(%rbp)
testl %eax, %eax
je 0x47c9
movl (%rbp), %eax
movl 0x4(%rbp), %ecx
movl %eax, %r14d
cmpl %ecx, %eax
jge 0x4734
movslq %eax, %rdx
addq 0x18(%rbp), %rdx
movl %eax, %r14d
cmpb $0xa, (%rdx)
je 0x4734
incl %r14d
incq %rdx
cmpl %r14d, %ecx
jne 0x4721
movl %ecx, %r14d
movq %r15, %rdx
subq %r12, %rdx
movl %r14d, %ecx
subl %eax, %ecx
leal 0x1(%rcx), %eax
cltq
cmpq %rax, %rdx
jae 0x4791
movslq %ecx, %rax
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 %r13, %rdi
movq %r15, %rsi
callq 0x3330
movq %rax, %r13
leaq (%r12,%r13), %rdi
movslq (%rbp), %rax
movq 0x18(%rbp), %rsi
addq %rax, %rsi
movslq %r14d, %rbx
movq %rbx, %rdx
subq %rax, %rdx
callq 0x32c0
movslq (%rbp), %rax
subq %rax, %rbx
addq %rbx, %r12
leal 0x1(%r14), %eax
movl %eax, (%rbp)
cmpl 0x4(%rbp), %r14d
jge 0x46c2
testq %r13, %r13
je 0x47e4
cmpq $0x2, %r12
jb 0x47fc
xorl %eax, %eax
cmpb $0xd, -0x1(%r13,%r12)
sete %al
subq %rax, %r12
jmp 0x47fc
movl $0x1, %r15d
movl $0x1, %edi
movl $0x1, %esi
callq 0x3240
movq %rax, %r13
movb $0x0, (%r13,%r12)
testl %r12d, %r12d
setns %al
testb %al, %al
je 0x49b7
callq 0x34d0
movq (%rax), %rdi
movq %r13, %rbx
leaq -0x1(%r13), %r12
movl $0x1, %edx
movq %r12, %rcx
incq %r12
movsbq 0x1(%rcx), %rsi
testq %rsi, %rsi
je 0x4846
movzwl (%rdi,%rsi,2), %esi
andl $0x2000, %esi           # imm = 0x2000
decq %rdx
testw %si, %si
jne 0x4824
movq %rcx, %rdx
xorl %r13d, %r13d
movq %rdx, %r14
movsbq 0x1(%rcx,%r13), %rdx
incq %r13
testq %rdx, %rdx
je 0x4870
movzwl (%rdi,%rdx,2), %esi
andl $0x2000, %esi           # imm = 0x2000
leaq 0x1(%r14), %rdx
testw %si, %si
je 0x484c
incq 0x20(%rsp)
cmpq $0x1, %r13
je 0x46a4
leaq -0x1(%r13), %rcx
movq %rcx, 0x60(%rsp)
movq %rax, 0x68(%rsp)
movq %r13, %rdi
callq 0x32f0
movq %rax, 0x58(%rsp)
movq %rax, %rdi
movq %r12, %rsi
movq 0x60(%rsp), %rdx
callq 0x32c0
movq 0x58(%rsp), %rax
movb $0x0, -0x1(%rax,%r13)
movq 0x68(%rsp), %rax
movq (%rax), %rax
movsbq 0x1(%r14), %rcx
incq %r14
testq %rcx, %rcx
je 0x48d6
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
jne 0x48bd
movl $0x1, %ecx
movq %r14, %rdx
movsbq (%rdx), %rsi
decq %rcx
testq %rsi, %rsi
je 0x48fc
movzwl (%rax,%rsi,2), %esi
andl $0x2000, %esi           # imm = 0x2000
incq %rdx
testw %si, %si
je 0x48de
testq %rcx, %rcx
movl 0x28(%rsp), %eax
movl 0x48(%rsp), %r13d
movq 0x18(%rsp), %r12
je 0x4b7e
movq 0x40(%rsp), %rax
cmpq %rax, 0x8(%rsp)
jne 0x494a
leaq (%rax,%rax), %r13
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r13
movq %r13, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
movq %r12, %rdi
callq 0x3330
movq %rax, %r12
movq %r13, 0x40(%rsp)
movq 0x8(%rsp), %rax
leaq (%rax,%rax,2), %r13
incq %rax
movq %rax, 0x8(%rsp)
shlq $0x4, %r13
leaq 0x88(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
movq 0x58(%rsp), %r14
movq %r14, %rcx
callq 0x81e6
movups 0x88(%rsp), %xmm0
movups 0x98(%rsp), %xmm1
movups 0xa8(%rsp), %xmm2
movups %xmm2, 0x20(%r12,%r13)
movups %xmm1, 0x10(%r12,%r13)
movq %r12, 0x18(%rsp)
movups %xmm0, (%r12,%r13)
movq %r14, %rdi
callq 0x3060
jmp 0x46a4
movq 0x18(%rbp), %rdi
callq 0x3060
movq %rbp, %rdi
callq 0x3060
movq 0x38(%rsp), %rdi
callq 0x3050
xorl %ebp, %ebp
movb $0x1, %r14b
movq 0x30(%rsp), %r15
movl 0x48(%rsp), %r13d
movq 0x18(%rsp), %r12
testb %r14b, %r14b
movq 0x8(%rsp), %rax
je 0x4af7
testq %rax, %rax
je 0x4a6c
movq %r15, 0x30(%rsp)
xorl %r14d, %r14d
movq %r12, 0x18(%rsp)
movq %r12, %r15
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rbx
movq 0x1a5be(%rip), %r12     # 0x1efd8
movl 0x28(%rsp), %ebp
movq (%r12), %rdx
incq %r14
movl %ebp, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %ecx
movl 0x2c(%rsp), %r8d
movl %r13d, %r9d
callq 0x9bc4
addq $0x30, %r15
cmpq %r14, 0x8(%rsp)
jne 0x4a1e
movq 0x18(%rsp), %r12
movq %r12, %r14
movq 0x30(%rsp), %r15
movq 0x8(%rsp), %rbx
movq %r14, %rdi
callq 0x4bc0
addq $0x30, %r14
decq %rbx
jne 0x4a5b
movq %r12, %rdi
callq 0x3060
movq 0x1a55d(%rip), %rax     # 0x1efd8
movq (%rax), %rdi
callq 0x3300
cmpl $-0x1, %eax
movq 0x10(%rsp), %rdi
je 0x4bbb
callq 0xa782
xorl %ebp, %ebp
cmpl $0x0, 0x1a7f5(%rip)     # 0x1f294
movq 0x50(%rsp), %rdi
js 0x4af7
movq %r15, %rsi
callq 0x3559
jmp 0x4af7
movq 0x1a541(%rip), %rax     # 0x1eff8
movq (%rax), %rdi
movslq %esi, %rax
movq -0x8(%r15,%rax,8), %rcx
leaq 0x145d5(%rip), %rsi     # 0x1909e
jmp 0x4ae4
movq 0x1a526(%rip), %rax     # 0x1eff8
movq (%rax), %rdi
movslq %esi, %rax
movq -0x8(%r15,%rax,8), %rcx
leaq 0x145dd(%rip), %rsi     # 0x190c1
leaq 0x145d1(%rip), %rdx     # 0x190bc
xorl %eax, %eax
callq 0x3290
movl $0x1, %ebp
movl %ebp, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x36b4
jmp 0x4af2
leaq (%r15,%rbx,8), %rdi
callq 0x3670
jmp 0x4af2
callq 0x3695
jmp 0x4af2
movq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x3510
jmp 0x4594
movq 0x1a4bb(%rip), %rax     # 0x1eff8
movq (%rax), %rdi
leaq 0x14858(%rip), %rsi     # 0x1939f
leaq 0x1456e(%rip), %rdx     # 0x190bc
xorl %r12d, %r12d
movq %rbx, %rcx
xorl %eax, %eax
callq 0x3290
movl $0x1, %ebp
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
jmp 0x49e6
movq %rbp, %rdi
callq 0x36d3
jmp 0x4af2
movl %eax, 0x28(%rsp)
movq 0x1a46f(%rip), %rax     # 0x1eff8
movq (%rax), %rdi
leaq 0x14834(%rip), %rsi     # 0x193c7
leaq 0x14522(%rip), %rdx     # 0x190bc
xorl %r14d, %r14d
movq 0x20(%rsp), %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x3290
movl $0x1, %ebp
movq 0x30(%rsp), %r15
jmp 0x49e6
callq 0x3648