// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: bam_sym_lookup
static int bam_sym_lookup(void *data, char *str, char **end,
                          hts_expr_val_t *res) {
    hb_pair *hb = (hb_pair *)data;
    const bam1_t *b = hb->b;

    res->is_str = 0;
    switch(*str) {
    case 'c':
        if (memcmp(str, "cigar", 5) == 0) {
            *end = str+5;
            res->is_str = 1;
            ks_clear(&res->s);
            uint32_t *cigar = bam_get_cigar(b);
            int i, n = b->core.n_cigar, r = 0;
            if (n) {
                for (i = 0; i < n; i++) {
                    r |= kputw (bam_cigar_oplen(cigar[i]), &res->s) < 0;
                    r |= kputc_(bam_cigar_opchr(cigar[i]), &res->s) < 0;
                }
                r |= kputs("", &res->s) < 0;
            } else {
                r |= kputs("*", &res->s) < 0;
            }
            return r ? -1 : 0;
        }
        break;

    case 'e':
        if (memcmp(str, "endpos", 6) == 0) {
            *end = str+6;
            res->d = bam_endpos(b);
            return 0;
        }
        break;

    case 'f':
        if (memcmp(str, "flag", 4) == 0) {
            str = *end = str+4;
            if (*str != '.') {
                res->d = b->core.flag;
                return 0;
            } else {
                str++;
                if (!memcmp(str, "paired", 6)) {
                    *end = str+6;
                    res->d = b->core.flag & BAM_FPAIRED;
                    return 0;
                } else if (!memcmp(str, "proper_pair", 11)) {
                    *end = str+11;
                    res->d = b->core.flag & BAM_FPROPER_PAIR;
                    return 0;
                } else if (!memcmp(str, "unmap", 5)) {
                    *end = str+5;
                    res->d = b->core.flag & BAM_FUNMAP;
                    return 0;
                } else if (!memcmp(str, "munmap", 6)) {
                    *end = str+6;
                    res->d = b->core.flag & BAM_FMUNMAP;
                    return 0;
                } else if (!memcmp(str, "reverse", 7)) {
                    *end = str+7;
                    res->d = b->core.flag & BAM_FREVERSE;
                    return 0;
                } else if (!memcmp(str, "mreverse", 8)) {
                    *end = str+8;
                    res->d = b->core.flag & BAM_FMREVERSE;
                    return 0;
                } else if (!memcmp(str, "read1", 5)) {
                    *end = str+5;
                    res->d = b->core.flag & BAM_FREAD1;
                    return 0;
                } else if (!memcmp(str, "read2", 5)) {
                    *end = str+5;
                    res->d = b->core.flag & BAM_FREAD2;
                    return 0;
                } else if (!memcmp(str, "secondary", 9)) {
                    *end = str+9;
                    res->d = b->core.flag & BAM_FSECONDARY;
                    return 0;
                } else if (!memcmp(str, "qcfail", 6)) {
                    *end = str+6;
                    res->d = b->core.flag & BAM_FQCFAIL;
                    return 0;
                } else if (!memcmp(str, "dup", 3)) {
                    *end = str+3;
                    res->d = b->core.flag & BAM_FDUP;
                    return 0;
                } else if (!memcmp(str, "supplementary", 13)) {
                    *end = str+13;
                    res->d = b->core.flag & BAM_FSUPPLEMENTARY;
                    return 0;
                } else {
                    hts_log_error("Unrecognised flag string");
                    return -1;
                }
            }
        }
        break;

    case 'h':
        if (memcmp(str, "hclen", 5) == 0) {
            int hclen = 0;
            uint32_t *cigar = bam_get_cigar(b);
            uint32_t ncigar = b->core.n_cigar;

            // left
            if (ncigar > 0 && bam_cigar_op(cigar[0]) == BAM_CHARD_CLIP)
                hclen = bam_cigar_oplen(cigar[0]);

            // right
            if (ncigar > 1 && bam_cigar_op(cigar[ncigar-1]) == BAM_CHARD_CLIP)
                hclen += bam_cigar_oplen(cigar[ncigar-1]);

            *end = str+5;
            res->d = hclen;
            return 0;
        }
        break;

    case 'l':
        if (memcmp(str, "library", 7) == 0) {
            *end = str+7;
            res->is_str = 1;
            const char *lib = bam_get_library(hb->h, b);
            kputs(lib ? lib : "", ks_clear(&res->s));
            return 0;
        }
        break;

    case 'm':
        if (memcmp(str, "mapq", 4) == 0) {
            *end = str+4;
            res->d = b->core.qual;
            return 0;
        } else if (memcmp(str, "mpos", 4) == 0) {
            *end = str+4;
            res->d = b->core.mpos+1;
            return 0;
        } else if (memcmp(str, "mrname", 6) == 0) {
            *end = str+6;
            res->is_str = 1;
            const char *rn = sam_hdr_tid2name(hb->h, b->core.mtid);
            kputs(rn ? rn : "*", ks_clear(&res->s));
            return 0;
        } else if (memcmp(str, "mrefid", 6) == 0) {
            *end = str+6;
            res->d = b->core.mtid;
            return 0;
        }
        break;

    case 'n':
        if (memcmp(str, "ncigar", 6) == 0) {
            *end = str+6;
            res->d = b->core.n_cigar;
            return 0;
        }
        break;

    case 'p':
        if (memcmp(str, "pos", 3) == 0) {
            *end = str+3;
            res->d = b->core.pos+1;
            return 0;
        } else if (memcmp(str, "pnext", 5) == 0) {
            *end = str+5;
            res->d = b->core.mpos+1;
            return 0;
        }
        break;

    case 'q':
        if (memcmp(str, "qlen", 4) == 0) {
            *end = str+4;
            res->d = bam_cigar2qlen(b->core.n_cigar, bam_get_cigar(b));
            return 0;
        } else if (memcmp(str, "qname", 5) == 0) {
            *end = str+5;
            res->is_str = 1;
            kputs(bam_get_qname(b), ks_clear(&res->s));
            return 0;
        } else if (memcmp(str, "qual", 4) == 0) {
            *end = str+4;
            ks_clear(&res->s);
            if (ks_resize(&res->s, b->core.l_qseq+1) < 0)
                return -1;
            memcpy(res->s.s, bam_get_qual(b), b->core.l_qseq);
            res->s.l = b->core.l_qseq;
            res->is_str = 1;
            return 0;
        }
        break;

    case 'r':
        if (memcmp(str, "rlen", 4) == 0) {
            *end = str+4;
            res->d = bam_cigar2rlen(b->core.n_cigar, bam_get_cigar(b));
            return 0;
        } else if (memcmp(str, "rname", 5) == 0) {
            *end = str+5;
            res->is_str = 1;
            const char *rn = sam_hdr_tid2name(hb->h, b->core.tid);
            kputs(rn ? rn : "*", ks_clear(&res->s));
            return 0;
        } else if (memcmp(str, "rnext", 5) == 0) {
            *end = str+5;
            res->is_str = 1;
            const char *rn = sam_hdr_tid2name(hb->h, b->core.mtid);
            kputs(rn ? rn : "*", ks_clear(&res->s));
            return 0;
        } else if (memcmp(str, "refid", 5) == 0) {
            *end = str+5;
            res->d = b->core.tid;
            return 0;
        }
        break;

    case 's':
        if (memcmp(str, "seq", 3) == 0) {
            *end = str+3;
            ks_clear(&res->s);
            if (ks_resize(&res->s, b->core.l_qseq+1) < 0)
                return -1;
            nibble2base(bam_get_seq(b), res->s.s, b->core.l_qseq);
            res->s.s[b->core.l_qseq] = 0;
            res->s.l = b->core.l_qseq;
            res->is_str = 1;
            return 0;
        } else if (memcmp(str, "sclen", 5) == 0) {
            int sclen = 0;
            uint32_t *cigar = bam_get_cigar(b);
            int ncigar = b->core.n_cigar;
            int left = 0;

            // left
            if (ncigar > 0
                && bam_cigar_op(cigar[0]) == BAM_CSOFT_CLIP)
                left = 0, sclen += bam_cigar_oplen(cigar[0]);
            else if (ncigar > 1
                     && bam_cigar_op(cigar[0]) == BAM_CHARD_CLIP
                     && bam_cigar_op(cigar[1]) == BAM_CSOFT_CLIP)
                left = 1, sclen += bam_cigar_oplen(cigar[1]);

            // right
            if (ncigar-1 > left
                && bam_cigar_op(cigar[ncigar-1]) == BAM_CSOFT_CLIP)
                sclen += bam_cigar_oplen(cigar[ncigar-1]);
            else if (ncigar-2 > left
                     && bam_cigar_op(cigar[ncigar-1]) == BAM_CHARD_CLIP
                     && bam_cigar_op(cigar[ncigar-2]) == BAM_CSOFT_CLIP)
                sclen += bam_cigar_oplen(cigar[ncigar-2]);

            *end = str+5;
            res->d = sclen;
            return 0;
        }
        break;

    case 't':
        if (memcmp(str, "tlen", 4) == 0) {
            *end = str+4;
            res->d = b->core.isize;
            return 0;
        }
        break;

    case '[':
        if (*str == '[' && str[1] && str[2] && str[3] == ']') {
            /* aux tags */
            *end = str+4;

            uint8_t *aux = bam_aux_get(b, str+1);
            if (aux) {
                // we define the truth of a tag to be its presence, even if 0.
                res->is_true = 1;
                switch (*aux) {
                case 'Z':
                case 'H':
                    res->is_str = 1;
                    kputs((char *)aux+1, ks_clear(&res->s));
                    break;

                case 'A':
                    res->is_str = 1;
                    kputsn((char *)aux+1, 1, ks_clear(&res->s));
                    break;

                case 'i': case 'I':
                case 's': case 'S':
                case 'c': case 'C':
                    res->is_str = 0;
                    res->d = bam_aux2i(aux);
                    break;

                case 'f':
                case 'd':
                    res->is_str = 0;
                    res->d = bam_aux2f(aux);
                    break;

                default:
                    hts_log_error("Aux type '%c not yet supported by filters",
                                  *aux);
                    return -1;
                }
                return 0;

            } else {
                // hence absent tags are always false (and strings)
                res->is_str = 1;
                res->s.l = 0;
                res->d = 0;
                res->is_true = 0;
                return 0;
            }
        }
        break;
    }

    // All successful matches in switch should return 0.
    // So if we didn't match, it's a parse error.
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x8(%rdi), %r15
movb $0x0, (%rcx)
movzbl (%rsi), %eax
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
addl $-0x5b, %eax
cmpl $0x19, %eax
ja 0x25246
movq %rcx, %r11
leaq 0x72b28(%rip), %rcx     # 0x9716c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpb $0x0, 0x1(%rsi)
je 0x25246
cmpb $0x0, 0x2(%rsi)
je 0x25246
cmpb $0x5d, 0x3(%rsi)
jne 0x25246
movq %r11, %rbx
leaq 0x1(%rsi), %rax
addq $0x4, %rsi
movq %rsi, (%rdx)
movq %r15, %rdi
movq %rax, %rsi
callq 0x2beb1
testq %rax, %rax
je 0x250a0
movq %rbx, %r8
movb $0x1, 0x1(%rbx)
movzbl (%rax), %ecx
cmpl $0x59, %ecx
jle 0x250c9
leal -0x63(%rcx), %edx
cmpl $0x6, %edx
ja 0x25135
leaq 0x72b45(%rip), %rsi     # 0x971f8
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
movb $0x0, (%r8)
movq %rax, %rdi
movq %r8, %rbx
callq 0x2e917
jmp 0x24afe
cmpl $0x6e656c72, (%rsi)     # imm = 0x6E656C72
je 0x24d8c
movl $0x6d616e72, %eax       # imm = 0x6D616E72
xorl (%rsi), %eax
movzbl 0x4(%rsi), %ecx
xorl $0x65, %ecx
orl %eax, %ecx
je 0x24eb8
movl $0x78656e72, %eax       # imm = 0x78656E72
xorl (%rsi), %eax
movzbl 0x4(%rsi), %ecx
xorl $0x74, %ecx
orl %eax, %ecx
je 0x24f53
movl $0x69666572, %eax       # imm = 0x69666572
xorl (%rsi), %eax
movzbl 0x4(%rsi), %ecx
xorl $0x64, %ecx
orl %eax, %ecx
jne 0x25246
addq $0x5, %rsi
movq %rsi, (%rdx)
cvtsi2sdl 0x8(%r15), %xmm0
jmp 0x2523d
movl $0x656c6368, %eax       # imm = 0x656C6368
xorl (%rsi), %eax
movzbl 0x4(%rsi), %ecx
xorl $0x6e, %ecx
orl %eax, %ecx
jne 0x25246
movl 0x14(%r15), %ecx
xorl %r14d, %r14d
movl $0x0, %eax
testl %ecx, %ecx
je 0x24790
movzwl 0x12(%r15), %edi
addq 0x38(%r15), %rdi
movl (%rdi), %r8d
movl %r8d, %r9d
andl $0xf, %r9d
shrl $0x4, %r8d
xorl %eax, %eax
cmpl $0x5, %r9d
cmovel %r8d, %eax
cmpl $0x1, %ecx
je 0x24790
decl %ecx
movl (%rdi,%rcx,4), %ecx
movl %ecx, %edi
andl $0xf, %edi
cmpl $0x5, %edi
jne 0x24790
shrl $0x4, %ecx
addl %ecx, %eax
addq $0x5, %rsi
movq %rsi, (%rdx)
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x20(%r11)
jmp 0x25246
cmpl $0x6e656c74, (%rsi)     # imm = 0x6E656C74
jne 0x25246
addq $0x4, %rsi
movq %rsi, (%rdx)
cvtsi2sdq 0x28(%r15), %xmm0
jmp 0x2523d
movl $0x7262696c, %eax       # imm = 0x7262696C
xorl (%rsi), %eax
movl $0x79726172, %ecx       # imm = 0x79726172
xorl 0x3(%rsi), %ecx
orl %eax, %ecx
jne 0x25246
addq $0x7, %rsi
movq %rsi, (%rdx)
movq %r11, %rbx
movb $0x1, (%r11)
movq (%rdi), %r14
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x738f2(%rip), %rsi     # 0x980f8
movq %r15, %rdi
callq 0x2beb1
leaq 0x71558(%rip), %r15     # 0x95d6d
testq %rax, %rax
je 0x2487f
incq %rax
leaq 0x738d4(%rip), %rsi     # 0x980f8
leaq 0x738d0(%rip), %rdx     # 0x980fb
leaq 0x738cc(%rip), %r8      # 0x980fe
leaq 0x20(%rsp), %r9
movq %r14, %rdi
movq %rax, %rcx
callq 0x88dbe
testl %eax, %eax
js 0x2487f
movq 0x20(%rsp), %rax
movq 0x30(%rsp), %r14
movl $0x3ff, %r12d           # imm = 0x3FF
cmpq %r12, %rax
cmovbq %rax, %r12
leaq 0x9245c(%rip), %r15     # 0xb6cc0
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x43c0
movb $0x0, (%r12,%r15)
movq %r14, %rdi
callq 0x45c0
movq %rbx, %r14
movq $0x0, 0x8(%rbx)
movq %r15, %rdi
callq 0x41d0
movq %rax, %r12
addq $0x2, %rax
je 0x24f9a
cmpq %rax, 0x10(%r14)
movq %r14, %rsi
jae 0x24fbe
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r14d, %r14d
testq %rcx, %rcx
movl $0x0, %r13d
cmoveq %rdx, %r13
addq %rax, %r13
movq 0x18(%rsi), %rdi
movq %r13, %rsi
callq 0x4840
testq %rax, %rax
je 0x25246
movq %rax, 0x18(%rbx)
movq %r13, 0x10(%rbx)
movq 0x8(%rbx), %rdi
jmp 0x24fc7
movzwl (%rsi), %eax
xorl $0x6573, %eax           # imm = 0x6573
movzbl 0x2(%rsi), %ecx
xorl $0x71, %ecx
orw %ax, %cx
je 0x24ddd
movl $0x656c6373, %eax       # imm = 0x656C6373
xorl (%rsi), %eax
movzbl 0x4(%rsi), %ecx
xorl $0x6e, %ecx
orl %eax, %ecx
jne 0x25246
movzwl 0x12(%r15), %ecx
addq 0x38(%r15), %rcx
movslq 0x14(%r15), %rdi
xorl %r8d, %r8d
testq %rdi, %rdi
jle 0x25042
movl (%rcx), %eax
movl %eax, %r9d
andl $0xf, %r9d
cmpl $0x4, %r9d
jne 0x25010
shrl $0x4, %eax
jmp 0x25044
cmpl $0x67616c66, (%rsi)     # imm = 0x67616C66
jne 0x25246
leaq 0x4(%rsi), %rax
movq %rax, (%rdx)
cmpb $0x2e, 0x4(%rsi)
jne 0x24f49
movl $0x72696170, %eax       # imm = 0x72696170
xorl 0x5(%rsi), %eax
movzwl 0x9(%rsi), %ecx
xorl $0x6465, %ecx           # imm = 0x6465
orl %eax, %ecx
je 0x250b5
movabsq $0x705f7265706f7270, %rax # imm = 0x705F7265706F7270
xorq 0x5(%rsi), %rax
movabsq $0x726961705f726570, %rcx # imm = 0x726961705F726570
xorq 0x8(%rsi), %rcx
orq %rax, %rcx
je 0x2510d
movl $0x616d6e75, %eax       # imm = 0x616D6E75
xorl 0x5(%rsi), %eax
movzbl 0x9(%rsi), %ecx
xorl $0x70, %ecx
orl %eax, %ecx
je 0x25121
movl $0x6d6e756d, %eax       # imm = 0x6D6E756D
xorl 0x5(%rsi), %eax
movzwl 0x9(%rsi), %ecx
xorl $0x7061, %ecx           # imm = 0x7061
orl %eax, %ecx
je 0x2515d
movl $0x65766572, %eax       # imm = 0x65766572
xorl 0x5(%rsi), %eax
movl $0x65737265, %ecx       # imm = 0x65737265
xorl 0x8(%rsi), %ecx
orl %eax, %ecx
je 0x251a9
movabsq $0x657372657665726d, %rax # imm = 0x657372657665726D
cmpq %rax, 0x5(%rsi)
je 0x251ba
movl $0x64616572, %eax       # imm = 0x64616572
movl 0x5(%rsi), %ecx
xorl %eax, %ecx
movzbl 0x9(%rsi), %edi
xorl $0x31, %edi
orl %ecx, %edi
je 0x251cb
xorl 0x5(%rsi), %eax
movzbl 0x9(%rsi), %ecx
xorl $0x32, %ecx
orl %eax, %ecx
je 0x251dc
movabsq $0x7261646e6f636573, %rax # imm = 0x7261646E6F636573
xorq 0x5(%rsi), %rax
movzbl 0xd(%rsi), %ecx
xorq $0x79, %rcx
orq %rax, %rcx
je 0x251ef
movl $0x61666371, %eax       # imm = 0x61666371
xorl 0x5(%rsi), %eax
movzwl 0x9(%rsi), %ecx
xorl $0x6c69, %ecx           # imm = 0x6C69
orl %eax, %ecx
je 0x25202
movzwl 0x5(%rsi), %eax
xorl $0x7564, %eax           # imm = 0x7564
movzbl 0x7(%rsi), %ecx
xorl $0x70, %ecx
orw %ax, %cx
je 0x25215
movabsq $0x656d656c70707573, %rax # imm = 0x656D656C70707573
xorq 0x5(%rsi), %rax
movabsq $0x797261746e656d65, %rcx # imm = 0x797261746E656D65
xorq 0xa(%rsi), %rcx
orq %rax, %rcx
je 0x25228
leaq 0x7359e(%rip), %rsi     # 0x98054
leaq 0x735a6(%rip), %rdx     # 0x98063
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
jmp 0x25246
movl $0x70646e65, %eax       # imm = 0x70646E65
xorl (%rsi), %eax
movzwl 0x4(%rsi), %ecx
xorl $0x736f, %ecx           # imm = 0x736F
orl %eax, %ecx
jne 0x25246
addq $0x6, %rsi
movq %rsi, (%rdx)
movq %r15, %rdi
movq %r11, %rbx
callq 0x23104
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x20(%rbx)
jmp 0x25243
movl $0x61676963, %eax       # imm = 0x61676963
xorl (%rsi), %eax
movzbl 0x4(%rsi), %ecx
xorl $0x72, %ecx
orl %eax, %ecx
jne 0x25246
addq $0x5, %rsi
movq %rsi, (%rdx)
movb $0x1, (%r11)
leaq 0x8(%r11), %r12
movq $0x0, 0x8(%r11)
movl 0x14(%r15), %eax
testq %rax, %rax
je 0x24faa
movq %rax, 0x8(%rsp)
testl %eax, %eax
jle 0x24feb
movzwl 0x12(%r15), %eax
addq 0x38(%r15), %rax
movq %rax, 0x18(%rsp)
xorl %ebx, %ebx
xorl %r13d, %r13d
movq 0x8(%rsp), %rbp
movq %r12, 0x10(%rsp)
movq 0x18(%rsp), %r15
movl (%r15,%rbx,4), %edi
shrl $0x4, %edi
movq %r12, %rsi
movq %r11, %r14
callq 0x31b51
movq %r14, %r11
movl %eax, %esi
movl (%r15,%rbx,4), %eax
andl $0xf, %eax
leaq 0x7345a(%rip), %rcx     # 0x97ff0
movb (%rax,%rcx), %r14b
movq 0x8(%r11), %rdx
leaq 0x1(%rdx), %rcx
cmpq %rcx, 0x10(%r11)
jae 0x24c06
movl %esi, 0x4(%rsp)
movq %rcx, %rax
shrq %rax
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rcx
movl $0x0, %r15d
cmovbeq %rax, %r15
addq %rcx, %r15
movq 0x18(%r11), %rdi
movq %r15, %rsi
movq %r11, %r12
callq 0x4840
testq %rax, %rax
je 0x24c30
movq %rax, 0x18(%r12)
movq %r15, 0x10(%r12)
movq 0x8(%r12), %rdx
leaq 0x1(%rdx), %rcx
movq %r12, %r11
movq 0x10(%rsp), %r12
movq 0x8(%rsp), %rbp
movl 0x4(%rsp), %esi
jmp 0x24c0a
movq 0x18(%r11), %rax
movq %rcx, (%r12)
movb %r14b, (%rax,%rdx)
movl $0x1, %eax
orl %esi, %eax
shrl $0x1f, %eax
orl %eax, %r13d
incq %rbx
cmpq %rbx, %rbp
jne 0x24b6c
jmp 0x24fee
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %r12, %r11
movq 0x10(%rsp), %r12
movq 0x8(%rsp), %rbp
movl 0x4(%rsp), %esi
jmp 0x24c17
cmpl $0x7170616d, (%rsi)     # imm = 0x7170616D
je 0x24e3f
cmpl $0x736f706d, (%rsi)     # imm = 0x736F706D
je 0x24ecf
movl $0x616e726d, %eax       # imm = 0x616E726D
xorl (%rsi), %eax
movzwl 0x4(%rsi), %ecx
xorl $0x656d, %ecx           # imm = 0x656D
orl %eax, %ecx
je 0x24f59
movl $0x6665726d, %eax       # imm = 0x6665726D
xorl (%rsi), %eax
movzwl 0x4(%rsi), %ecx
xorl $0x6469, %ecx           # imm = 0x6469
orl %eax, %ecx
jne 0x25246
addq $0x6, %rsi
movq %rsi, (%rdx)
cvtsi2sdl 0x1c(%r15), %xmm0
jmp 0x2523d
movl $0x6769636e, %eax       # imm = 0x6769636E
xorl (%rsi), %eax
movzwl 0x4(%rsi), %ecx
xorl $0x7261, %ecx           # imm = 0x7261
orl %eax, %ecx
jne 0x25246
addq $0x6, %rsi
movq %rsi, (%rdx)
movl 0x14(%r15), %eax
jmp 0x24edd
cmpl $0x6e656c71, (%rsi)     # imm = 0x6E656C71
je 0x24e50
movl $0x6d616e71, %eax       # imm = 0x6D616E71
xorl (%rsi), %eax
movzbl 0x4(%rsi), %ecx
xorl $0x65, %ecx
orl %eax, %ecx
je 0x24ee7
cmpl $0x6c617571, (%rsi)     # imm = 0x6C617571
jne 0x25246
addq $0x4, %rsi
movq %rsi, (%rdx)
leaq 0x8(%r11), %rdi
movq $0x0, 0x8(%r11)
movslq 0x18(%r15), %rsi
incq %rsi
movq %r11, %rbx
callq 0x2cfdb
testl %eax, %eax
js 0x25246
movl 0x14(%r15), %eax
shll $0x2, %eax
addq 0x38(%r15), %rax
movq 0x18(%rbx), %rdi
movzwl 0x12(%r15), %ecx
movslq 0x18(%r15), %rdx
leal 0x1(%rdx), %esi
sarl %esi
movslq %esi, %rsi
addq %rcx, %rsi
addq %rax, %rsi
callq 0x43c0
jmp 0x24f39
movzwl (%rsi), %eax
xorl $0x6f70, %eax           # imm = 0x6F70
movzbl 0x2(%rsi), %ecx
xorl $0x73, %ecx
orw %ax, %cx
je 0x24ea3
movl $0x78656e70, %eax       # imm = 0x78656E70
xorl (%rsi), %eax
movzbl 0x4(%rsi), %ecx
xorl $0x74, %ecx
orl %eax, %ecx
jne 0x25246
addq $0x5, %rsi
jmp 0x24ed3
addq $0x4, %rsi
movq %rsi, (%rdx)
movslq 0x14(%r15), %rax
testq %rax, %rax
jle 0x24eaf
movzwl 0x12(%r15), %edx
addq 0x38(%r15), %rdx
xorl %esi, %esi
xorl %edi, %edi
movl (%rdx,%rsi,4), %r8d
leal (%r8,%r8), %ecx
movl $0x3c1a7, %r9d          # imm = 0x3C1A7
shrl %cl, %r9d
shll $0x1e, %r9d
sarl $0x1f, %r9d
shrl $0x4, %r8d
andl %r9d, %r8d
addq %r8, %rdi
incq %rsi
cmpq %rsi, %rax
jne 0x24dad
jmp 0x24e99
addq $0x3, %rsi
movq %rsi, (%rdx)
movq $0x0, 0x8(%r11)
movslq 0x18(%r15), %rdx
movq %rdx, %rax
incq %rax
cmpq %rax, 0x10(%r11)
jae 0x24f0a
movq %rax, %rcx
shrq %rcx
xorl %r12d, %r12d
cmpl $-0x1, %edx
cmovgeq %rcx, %r12
addq %rax, %r12
movq 0x18(%r11), %rdi
movq %r12, %rsi
movq %r11, %rbx
callq 0x4840
testq %rax, %rax
je 0x25246
movq %rax, %rsi
movq %rax, 0x18(%rbx)
movq %r12, 0x10(%rbx)
movl 0x18(%r15), %edx
jmp 0x24f11
addq $0x4, %rsi
movq %rsi, (%rdx)
movzbl 0xe(%r15), %eax
jmp 0x25239
addq $0x4, %rsi
movq %rsi, (%rdx)
movslq 0x14(%r15), %rax
testq %rax, %rax
jle 0x24eaf
movzwl 0x12(%r15), %ecx
addq 0x38(%r15), %rcx
xorl %edx, %edx
movl $0x3c1a7, %esi          # imm = 0x3C1A7
xorl %edi, %edi
movl (%rcx,%rdx,4), %r8d
leal (%r8,%r8), %r9d
btl %r9d, %esi
movl $0x0, %r9d
sbbl %r9d, %r9d
shrl $0x4, %r8d
andl %r9d, %r8d
addq %r8, %rdi
incq %rdx
cmpq %rdx, %rax
jne 0x24e72
cvtsi2sd %rdi, %xmm0
jmp 0x2523d
addq $0x3, %rsi
movq %rsi, (%rdx)
movq (%r15), %rax
jmp 0x24eda
xorpd %xmm0, %xmm0
jmp 0x2523d
addq $0x5, %rsi
movq %rsi, (%rdx)
movb $0x1, (%r11)
movq (%rdi), %rdi
movl 0x8(%r15), %esi
jmp 0x24f6b
addq $0x4, %rsi
movq %rsi, (%rdx)
movq 0x20(%r15), %rax
incq %rax
cvtsi2sd %rax, %xmm0
jmp 0x2523d
addq $0x5, %rsi
movq %rsi, (%rdx)
movb $0x1, (%r11)
movq 0x38(%r15), %rdi
movq $0x0, 0x8(%r11)
addq $0x8, %r11
movq %r11, %rsi
jmp 0x24f90
movq 0x18(%r11), %rsi
movq %r11, %rbx
movl 0x14(%r15), %eax
shll $0x2, %eax
addq 0x38(%r15), %rax
movzwl 0x12(%r15), %edi
addq %rax, %rdi
leaq 0x9185d(%rip), %rax     # 0xb6788
callq *(%rax)
movq 0x18(%rbx), %rax
movslq 0x18(%r15), %rcx
movb $0x0, (%rax,%rcx)
movslq 0x18(%r15), %rax
movq %rax, 0x8(%rbx)
movb $0x1, (%rbx)
jmp 0x25243
movzwl 0x10(%r15), %eax
jmp 0x25239
addq $0x5, %rsi
jmp 0x24f5d
addq $0x6, %rsi
movq %rsi, (%rdx)
movb $0x1, (%r11)
movq (%rdi), %rdi
movl 0x1c(%r15), %esi
movq %r11, %rbx
callq 0x8943c
testq %rax, %rax
leaq 0x7381a(%rip), %rdi     # 0x98797
cmovneq %rax, %rdi
movq $0x0, 0x8(%rbx)
addq $0x8, %rbx
movq %rbx, %rsi
callq 0x27110
jmp 0x25243
callq 0x4050
movl $0x4b, (%rax)
jmp 0x25243
leaq 0x737e6(%rip), %rdi     # 0x98797
movq %r12, %rsi
callq 0x27110
shrl $0x1f, %eax
jmp 0x25003
movq 0x18(%rsi), %rax
xorl %edi, %edi
movq %rsi, %rbx
addq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x43c0
addq 0x8(%rbx), %r12
movq %r12, 0x8(%rbx)
movq 0x18(%rbx), %rax
movb $0x0, (%rax,%r12)
jmp 0x25243
xorl %r13d, %r13d
leaq 0x70d78(%rip), %rdi     # 0x95d6d
movq %r12, %rsi
callq 0x27110
shrl $0x1f, %eax
orl %r13d, %eax
xorl %r14d, %r14d
negl %eax
sbbl %r14d, %r14d
jmp 0x25246
cmpl $0x1, %edi
je 0x25042
movl $0x0, %eax
cmpl $0x5, %r9d
jne 0x25044
movl 0x4(%rcx), %r9d
movl %r9d, %r10d
andl $0xf, %r10d
shrl $0x4, %r9d
xorl %eax, %eax
xorl %r8d, %r8d
cmpl $0x4, %r10d
sete %r8b
cmovel %r9d, %eax
jmp 0x25044
xorl %eax, %eax
leal -0x1(%rdi), %r9d
cmpl %r8d, %r9d
jle 0x2506a
movl %r9d, %r9d
movl (%rcx,%r9,4), %r9d
movl %r9d, %r10d
andl $0xf, %r10d
cmpl $0x4, %r10d
jne 0x2506a
shrl $0x4, %r9d
addl %r9d, %eax
jmp 0x25094
leal -0x2(%rdi), %r9d
cmpl %r8d, %r9d
jle 0x25094
movl -0x4(%rcx,%rdi,4), %edi
andl $0xf, %edi
cmpl $0x5, %edi
jne 0x25094
movl %r9d, %edi
movl (%rcx,%rdi,4), %ecx
movl %ecx, %edi
andl $0xf, %edi
cmpl $0x4, %edi
jne 0x25094
shrl $0x4, %ecx
addl %ecx, %eax
addq $0x5, %rsi
movq %rsi, (%rdx)
jmp 0x25239
movw $0x1, (%rbx)
xorl %r14d, %r14d
movq %r14, 0x8(%rbx)
movq %r14, 0x20(%rbx)
jmp 0x25246
addq $0xb, %rsi
movq %rsi, (%rdx)
movzwl 0x10(%r15), %eax
andl $0x1, %eax
jmp 0x25239
leal -0x41(%rcx), %edx
cmpl $0x8, %edx
ja 0x25171
leaq 0x720f8(%rip), %rsi     # 0x971d4
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
movb $0x1, (%r8)
incq %rax
movq $0x0, 0x8(%r8)
addq $0x8, %r8
movl $0x1, %esi
movq %rax, %rdi
movq %r8, %rdx
callq 0x2706e
jmp 0x25243
addq $0x10, %rsi
movq %rsi, (%rdx)
movzwl 0x10(%r15), %eax
andl $0x2, %eax
jmp 0x25239
addq $0xa, %rsi
movq %rsi, (%rdx)
movzwl 0x10(%r15), %eax
andl $0x4, %eax
jmp 0x25239
cmpl $0x73, %ecx
je 0x25176
cmpl $0x5a, %ecx
jne 0x2518a
movb $0x1, (%r8)
incq %rax
movq $0x0, 0x8(%r8)
addq $0x8, %r8
movq %rax, %rdi
movq %r8, %rsi
jmp 0x24f90
addq $0xb, %rsi
movq %rsi, (%rdx)
movzwl 0x10(%r15), %eax
andl $0x8, %eax
jmp 0x25239
cmpl $0x53, %ecx
jne 0x2518a
movb $0x0, (%r8)
movq %rax, %rdi
movq %r8, %rbx
callq 0x2e8bf
jmp 0x24af9
leaq 0x72ec3(%rip), %rsi     # 0x98054
leaq 0x72f36(%rip), %rdx     # 0x980ce
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
jmp 0x25246
addq $0xc, %rsi
movq %rsi, (%rdx)
movzwl 0x10(%r15), %eax
andl $0x10, %eax
jmp 0x25239
addq $0xd, %rsi
movq %rsi, (%rdx)
movzwl 0x10(%r15), %eax
andl $0x20, %eax
jmp 0x25239
addq $0xa, %rsi
movq %rsi, (%rdx)
movzwl 0x10(%r15), %eax
andl $0x40, %eax
jmp 0x25239
addq $0xa, %rsi
movq %rsi, (%rdx)
movzwl 0x10(%r15), %eax
andl $0x80, %eax
jmp 0x25239
addq $0xe, %rsi
movq %rsi, (%rdx)
movzwl 0x10(%r15), %eax
andl $0x100, %eax            # imm = 0x100
jmp 0x25239
addq $0xb, %rsi
movq %rsi, (%rdx)
movzwl 0x10(%r15), %eax
andl $0x200, %eax            # imm = 0x200
jmp 0x25239
addq $0x8, %rsi
movq %rsi, (%rdx)
movzwl 0x10(%r15), %eax
andl $0x400, %eax            # imm = 0x400
jmp 0x25239
addq $0x12, %rsi
movq %rsi, (%rdx)
movzwl 0x10(%r15), %eax
andl $0x800, %eax            # imm = 0x800
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x20(%r11)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq