// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: sam_parse1
int sam_parse1(kstring_t *s, bam_hdr_t *h, bam1_t *b)
{
#define _read_token(_p) (_p); for (; *(_p) && *(_p) != '\t'; ++(_p)); if (*(_p) != '\t') goto err_ret; *(_p)++ = 0
#define _read_token_aux(_p) (_p); for (; *(_p) && *(_p) != '\t'; ++(_p)); *(_p)++ = 0 // this is different in that it does not test *(_p)=='\t'
#define _get_mem(type_t, _x, _s, _l) ks_resize((_s), (_s)->l + (_l)); *(_x) = (type_t*)((_s)->s + (_s)->l); (_s)->l += (_l)
#define _parse_err(cond, msg) do { if ((cond) && hts_verbose >= 1) { fprintf(stderr, "[E::%s] " msg "\n", __func__); goto err_ret; } } while (0)
#define _parse_warn(cond, msg) if ((cond) && hts_verbose >= 2) fprintf(stderr, "[W::%s] " msg "\n", __func__)

    uint8_t *t;
    char *p = s->s, *q;
    int i;
    kstring_t str;
    bam1_core_t *c = &b->core;

    str.l = b->l_data = 0;
    str.s = (char*)b->data; str.m = b->m_data;
    memset(c, 0, 32);
    if (h->cigar_tab == 0) {
        h->cigar_tab = (int8_t*) malloc(128);
        for (i = 0; i < 128; ++i)
            h->cigar_tab[i] = -1;
        for (i = 0; BAM_CIGAR_STR[i]; ++i)
            h->cigar_tab[(int)BAM_CIGAR_STR[i]] = i;
    }
    // qname
    q = _read_token(p);
    _parse_warn(p - q <= 1, "empty query name");
    _parse_err(p - q > 255, "query name too long");
    kputsn_(q, p - q, &str);
    c->l_qname = p - q;
    // flag
    c->flag = strtol(p, &p, 0);
    if (*p++ != '\t') goto err_ret; // malformated flag
    // chr
    q = _read_token(p);
    if (strcmp(q, "*")) {
        _parse_err(h->n_targets == 0, "missing SAM header");
        c->tid = bam_name2id(h, q);
        _parse_warn(c->tid < 0, "urecognized reference name; treated as unmapped");
    } else c->tid = -1;
    // pos
    c->pos = strtol(p, &p, 10) - 1;
    if (*p++ != '\t') goto err_ret;
    if (c->pos < 0 && c->tid >= 0) {
        _parse_warn(1, "mapped query cannot have zero coordinate; treated as unmapped");
        c->tid = -1;
    }
    if (c->tid < 0) c->flag |= BAM_FUNMAP;
    // mapq
    c->qual = strtol(p, &p, 10);
    if (*p++ != '\t') goto err_ret;
    // cigar
    if (*p != '*') {
        uint32_t *cigar;
        size_t n_cigar = 0;
        for (q = p; *p && *p != '\t'; ++p)
            if (!isdigit_c(*p)) ++n_cigar;
        if (*p++ != '\t') goto err_ret;
        _parse_err(n_cigar == 0, "no CIGAR operations");
        _parse_err(n_cigar >= 65536, "too many CIGAR operations");
        c->n_cigar = n_cigar;
        _get_mem(uint32_t, &cigar, &str, c->n_cigar * sizeof(uint32_t));
        for (i = 0; i < c->n_cigar; ++i, ++q) {
            int op;
            cigar[i] = strtol(q, &q, 10)<<BAM_CIGAR_SHIFT;
            op = (uint8_t)*q >= 128? -1 : h->cigar_tab[(int)*q];
            _parse_err(op < 0, "unrecognized CIGAR operator");
            cigar[i] |= op;
        }
        // can't use bam_endpos() directly as some fields not yet set up
        i = (!(c->flag&BAM_FUNMAP))? bam_cigar2rlen(c->n_cigar, cigar) : 1;
    } else {
        _parse_warn(!(c->flag&BAM_FUNMAP), "mapped query must have a CIGAR; treated as unmapped");
        c->flag |= BAM_FUNMAP;
        q = _read_token(p);
        i = 1;
    }
    c->bin = hts_reg2bin(c->pos, c->pos + i, 14, 5);
    // mate chr
    q = _read_token(p);
    if (strcmp(q, "=") == 0) {
        c->mtid = c->tid;
    } else if (strcmp(q, "*") == 0) {
        c->mtid = -1;
    } else {
        c->mtid = bam_name2id(h, q);
        _parse_warn(c->mtid < 0, "urecognized mate reference name; treated as unmapped");
    }
    // mpos
    c->mpos = strtol(p, &p, 10) - 1;
    if (*p++ != '\t') goto err_ret;
    if (c->mpos < 0 && c->mtid >= 0) {
        _parse_warn(1, "mapped mate cannot have zero coordinate; treated as unmapped");
        c->mtid = -1;
    }
    // tlen
    c->isize = strtol(p, &p, 10);
    if (*p++ != '\t') goto err_ret;
    // seq
    q = _read_token(p);
    if (strcmp(q, "*")) {
        c->l_qseq = p - q - 1;
        i = bam_cigar2qlen(c->n_cigar, (uint32_t*)(str.s + c->l_qname));
        _parse_err(c->n_cigar && i != c->l_qseq, "CIGAR and query sequence are of different length");
        i = (c->l_qseq + 1) >> 1;
        _get_mem(uint8_t, &t, &str, i);
        memset(t, 0, i);
        for (i = 0; i < c->l_qseq; ++i)
            t[i>>1] |= seq_nt16_table[(int)q[i]] << ((~i&1)<<2);
    } else c->l_qseq = 0;
    // qual
    q = _read_token_aux(p);
    _get_mem(uint8_t, &t, &str, c->l_qseq);
    if (strcmp(q, "*")) {
        _parse_err(p - q - 1 != c->l_qseq, "SEQ and QUAL are of different length");
        for (i = 0; i < c->l_qseq; ++i) t[i] = q[i] - 33;
    } else memset(t, 0xff, c->l_qseq);
    // aux
    // Note that (like the bam1_core_t fields) this aux data in b->data is
    // stored in host endianness; so there is no byte swapping needed here.
    while (p < s->s + s->l) {
        uint8_t type;
        q = _read_token_aux(p); // FIXME: can be accelerated for long 'B' arrays
        _parse_err(p - q - 1 < 6, "incomplete aux field");
        kputsn_(q, 2, &str);
        q += 3; type = *q++; ++q; // q points to value
        if (type == 'A' || type == 'a' || type == 'c' || type == 'C') {
            kputc_('A', &str);
            kputc_(*q, &str);
        } else if (type == 'i' || type == 'I') {
            if (*q == '-') {
                long x = strtol(q, &q, 10);
                if (x >= INT8_MIN) {
                    kputc_('c', &str); kputc_(x, &str);
                } else if (x >= INT16_MIN) {
                    int16_t y = x;
                    kputc_('s', &str); kputsn_((char*)&y, 2, &str);
                } else {
                    int32_t y = x;
                    kputc_('i', &str); kputsn_(&y, 4, &str);
                }
            } else {
                unsigned long x = strtoul(q, &q, 10);
                if (x <= UINT8_MAX) {
                    kputc_('C', &str); kputc_(x, &str);
                } else if (x <= UINT16_MAX) {
                    uint16_t y = x;
                    kputc_('S', &str); kputsn_(&y, 2, &str);
                } else {
                    uint32_t y = x;
                    kputc_('I', &str); kputsn_(&y, 4, &str);
                }
            }
        } else if (type == 'f') {
            float x;
            x = strtod(q, &q);
            kputc_('f', &str); kputsn_(&x, 4, &str);
        } else if (type == 'd') {
            double x;
            x = strtod(q, &q);
            kputc_('d', &str); kputsn_(&x, 8, &str);
        } else if (type == 'Z' || type == 'H') {
            kputc_(type, &str);kputsn_(q, p - q, &str); // note that this include the trailing NULL
        } else if (type == 'B') {
            int32_t n;
            char *r;
            _parse_err(p - q - 1 < 3, "incomplete B-typed aux field");
            type = *q++; // q points to the first ',' following the typing byte
            for (r = q, n = 0; *r; ++r)
                if (*r == ',') ++n;
            kputc_('B', &str); kputc_(type, &str); kputsn_(&n, 4, &str);
            // FIXME: to evaluate which is faster: a) aligned array and then memmove(); b) unaligned array; c) kputsn_()
            if (type == 'c')      while (q + 1 < p) { int8_t   x = strtol(q + 1, &q, 0); kputc_(x, &str); }
            else if (type == 'C') while (q + 1 < p) { uint8_t  x = strtoul(q + 1, &q, 0); kputc_(x, &str); }
            else if (type == 's') while (q + 1 < p) { int16_t  x = strtol(q + 1, &q, 0); kputsn_(&x, 2, &str); }
            else if (type == 'S') while (q + 1 < p) { uint16_t x = strtoul(q + 1, &q, 0); kputsn_(&x, 2, &str); }
            else if (type == 'i') while (q + 1 < p) { int32_t  x = strtol(q + 1, &q, 0); kputsn_(&x, 4, &str); }
            else if (type == 'I') while (q + 1 < p) { uint32_t x = strtoul(q + 1, &q, 0); kputsn_(&x, 4, &str); }
            else if (type == 'f') while (q + 1 < p) { float    x = strtod(q + 1, &q);    kputsn_(&x, 4, &str); }
            else _parse_err(1, "unrecognized type");
        } else _parse_err(1, "unrecognized type");
    }
    b->data = (uint8_t*)str.s; b->l_data = str.l; b->m_data = str.m;
    return 0;

#undef _parse_warn
#undef _parse_err
#undef _get_mem
#undef _read_token_aux
#undef _read_token
err_ret:
    b->data = (uint8_t*)str.s; b->l_data = str.l; b->m_data = str.m;
    return -2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r9
movq %rsi, %r12
movq %rdi, %rbx
movq 0x10(%rdi), %r13
movl $0x0, 0x20(%rdx)
movq $0x0, 0x40(%rsp)
movq 0x28(%rdx), %rax
movq %rax, 0x30(%rsp)
movq %rax, 0x50(%rsp)
movslq 0x24(%rdx), %r15
movq %r15, 0x48(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdx)
movups %xmm0, (%rdx)
cmpq $0x0, 0x18(%rsi)
movq %rdx, (%rsp)
jne 0x15e75
movl $0x80, %edi
callq 0x4700
movq %rax, 0x18(%r12)
xorl %eax, %eax
movq 0x18(%r12), %rcx
movb $-0x1, (%rcx,%rax)
incq %rax
cmpq $0x80, %rax
jne 0x15e3e
xorl %eax, %eax
leaq 0x3b581(%rip), %rcx     # 0x513dc
movq (%rsp), %r9
movsbq (%rax,%rcx), %rdx
movq 0x18(%r12), %rsi
movb %al, (%rsi,%rdx)
incq %rax
cmpq $0xa, %rax
jne 0x15e5f
movq %rbx, 0x28(%rsp)
movabsq $0x100000000, %rcx      # imm = 0x100000000
movq %r13, 0x8(%rsp)
leaq 0x1(%r13), %r14
movl $0x1000000, %ebx        # imm = 0x1000000
movl $0x1, %eax
movq %rcx, %rbp
movzbl -0x1(%r14), %edx
testl %edx, %edx
je 0x164b5
cmpl $0x9, %edx
je 0x15ebe
incq %r14
addq %rcx, %rbp
addq $0x1000000, %rbx        # imm = 0x1000000
incq %rax
jmp 0x15e9a
movq %r14, 0x20(%rsp)
movb $0x0, -0x1(%r14)
cmpq $0x2, %rax
setl %dl
leaq 0x4c67a(%rip), %rcx     # 0x62550
movl (%rcx), %ecx
cmpl $0x2, %ecx
setge %sil
andb %dl, %sil
cmpb $0x1, %sil
je 0x1603c
cmpq $0x100, %rax            # imm = 0x100
setge %al
testl %ecx, %ecx
setg %cl
andb %al, %cl
cmpb $0x1, %cl
je 0x16046
sarq $0x20, %rbp
cmpq %r15, %rbp
jbe 0x15f75
leaq -0x1(%rbp), %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, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
movq %rcx, %r15
shrq $0x20, %r15
orq %rcx, %r15
incq %r15
movq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x48d0
testq %rax, %rax
je 0x16035
movq %rax, 0x50(%rsp)
movq %r15, 0x48(%rsp)
movq %rax, %rdi
jmp 0x15f7a
movq 0x30(%rsp), %rdi
movq %rdi, 0x30(%rsp)
movq %r13, %rsi
movq %rbp, %rdx
callq 0x4420
movq %rbp, 0x40(%rsp)
shrl $0x18, %ebx
movq (%rsp), %r13
movb %bl, 0xb(%r13)
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4760
movq %r13, %r9
movw %ax, 0xc(%r13)
movq (%r15), %rax
cmpb $0x9, (%rax)
jne 0x164b5
leaq 0x1(%rax), %rsi
movq %rsi, 0x8(%rsp)
leaq 0x2(%rax), %r14
movzbl -0x1(%r14), %ecx
testl %ecx, %ecx
je 0x164b5
cmpl $0x9, %ecx
je 0x15fe4
incq %r14
jmp 0x15fcd
movq %r14, 0x20(%rsp)
movb $0x0, -0x1(%r14)
cmpb $0x2a, (%rsi)
jne 0x15ff9
cmpb $0x0, 0x2(%rax)
je 0x16054
cmpl $0x0, (%r12)
jne 0x16010
leaq 0x4c549(%rip), %rax     # 0x62550
cmpl $0x0, (%rax)
jg 0x163b9
movq %r12, %rdi
callq 0x146cf
movq (%rsp), %rbx
movl %eax, (%rbx)
testl %eax, %eax
jns 0x1605e
leaq 0x4c527(%rip), %rax     # 0x62550
cmpl $0x2, (%rax)
jl 0x1605e
callq 0x4ef0
jmp 0x1605e
xorl %ebp, %ebp
jmp 0x15f8f
callq 0x4ed1
jmp 0x15f05
callq 0x4eb2
movq (%rsp), %r9
jmp 0x164b5
movl $0xffffffff, (%r9)      # imm = 0xFFFFFFFF
movq %r9, %rbx
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x4760
decl %eax
movl %eax, 0x4(%rbx)
movq (%r15), %rcx
leaq 0x1(%rcx), %r14
movq %r14, (%r15)
cmpb $0x9, (%rcx)
movq %rbx, %r9
jne 0x164b5
movl (%r9), %ecx
testl %eax, %eax
js 0x1609b
testl %ecx, %ecx
jns 0x160bb
jmp 0x160b6
testl %ecx, %ecx
js 0x160b6
leaq 0x4c4aa(%rip), %rax     # 0x62550
cmpl $0x2, (%rax)
jge 0x165fb
movl $0xffffffff, (%r9)      # imm = 0xFFFFFFFF
orb $0x4, 0xc(%r9)
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x4760
movq (%rsp), %r9
movq 0x8(%r9), %rcx
movzbl %al, %eax
shll $0x10, %eax
movq %rcx, %rdx
andq $-0xff0001, %rdx        # imm = 0xFF00FFFF
orq %rax, %rdx
movq %rdx, 0x8(%r9)
movq (%r15), %r13
cmpb $0x9, (%r13)
jne 0x164b5
leaq 0x1(%r13), %r14
movb (%r14), %al
cmpb $0x2a, %al
jne 0x1614f
movabsq $0x400000000, %r14      # imm = 0x400000000
btq $0x22, %rcx
jb 0x16129
leaq 0x4c430(%rip), %rax     # 0x62550
cmpl $0x2, (%rax)
jge 0x163f2
orq %r14, %rdx
movq %rdx, 0x8(%r9)
addq $0x2, %r13
movzbl -0x1(%r13), %eax
testl %eax, %eax
je 0x164b5
cmpl $0x9, %eax
je 0x162fa
incq %r13
jmp 0x16134
movq %rdx, 0x30(%rsp)
movq %r14, 0x8(%rsp)
addq $0x2, %r13
xorl %r15d, %r15d
testb %al, %al
je 0x16189
movzbl %al, %ebx
cmpl $0x9, %ebx
je 0x16189
callq 0x4580
movq (%rax), %rax
movb 0x1(%rax,%rbx,2), %al
andb $0x8, %al
cmpb $0x1, %al
adcq $0x0, %r15
movb (%r13), %al
incq %r13
jmp 0x16160
movq %r13, 0x20(%rsp)
cmpb $0x9, %al
movq (%rsp), %r9
movq 0x30(%rsp), %rsi
jne 0x164b5
testq %r15, %r15
sete %cl
leaq 0x4c3a4(%rip), %rax     # 0x62550
movl (%rax), %eax
testl %eax, %eax
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x16609
testl %eax, %eax
setg %al
cmpq $0x10000, %r15          # imm = 0x10000
setae %cl
andb %al, %cl
cmpb $0x1, %cl
je 0x16613
movabsq $0x1000000000000, %rcx  # imm = 0x1000000000000
movq %r15, %rax
shlq $0x30, %rax
decq %rcx
andq %rcx, %rsi
orq %rax, %rsi
movq %rsi, 0x8(%r9)
movzwl %r15w, %eax
leaq (,%rax,4), %rsi
addq %rbp, %rsi
leaq 0x40(%rsp), %r15
movq %r15, %rdi
callq 0x16d59
movq (%rsp), %r9
movq (%r15), %rdx
movq 0x10(%r15), %rax
movq %rax, 0x30(%rsp)
leaq (%rax,%rdx), %rbx
movq 0x8(%r9), %rcx
movq %rcx, %rax
shrq $0x30, %rax
leaq (%rdx,%rax,4), %rdx
movq %rdx, (%r15)
je 0x162b0
xorl %r15d, %r15d
leaq 0x8(%rsp), %rbp
movq %r14, %rdi
movq %rbp, %rsi
movl $0xa, %edx
callq 0x4760
shll $0x4, %eax
movl %eax, (%rbx,%r15,4)
movq 0x8(%rsp), %r14
movsbq (%r14), %rcx
testq %rcx, %rcx
js 0x16272
movq 0x18(%r12), %rdx
movsbl (%rdx,%rcx), %ecx
jmp 0x16277
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %ecx, %ecx
movq (%rsp), %r9
jns 0x1628f
leaq 0x4c2ca(%rip), %rdx     # 0x62550
cmpl $0x0, (%rdx)
jg 0x1661d
orl %eax, %ecx
movl %ecx, (%rbx,%r15,4)
incq %r15
incq %r14
movq %r14, 0x8(%rsp)
movq 0x8(%r9), %rcx
movq %rcx, %rax
shrq $0x30, %rax
cmpq %rax, %r15
jb 0x16242
movl $0x1, %edx
btq $0x22, %rcx
jb 0x16309
xorl %edx, %edx
movabsq $0x1000000000000, %rsi  # imm = 0x1000000000000
cmpq %rsi, %rcx
jb 0x16309
xorl %esi, %esi
xorl %edx, %edx
movl (%rbx,%rsi,4), %edi
leal (%rdi,%rdi), %ecx
movl $0x3c1a7, %r8d          # imm = 0x3C1A7
shrl %cl, %r8d
shll $0x1e, %r8d
sarl $0x1f, %r8d
shrl $0x4, %edi
andl %r8d, %edi
addl %edi, %edx
incq %rsi
cmpq %rsi, %rax
jne 0x162d1
jmp 0x16309
movq %r13, 0x20(%rsp)
movb $0x0, -0x1(%r13)
movl $0x1, %edx
movslq 0x4(%r9), %r8
movslq %edx, %rax
leaq (%r8,%rax), %r9
decq %r9
movl $0x1249, %esi           # imm = 0x1249
movl $0xe, %eax
movl $0x6, %r10d
movl $0xc, %edx
xorl %edi, %edi
movq %r8, %r11
movl %eax, %ecx
sarq %cl, %r11
movq %r9, %rbx
sarq %cl, %rbx
cmpq %rbx, %r11
je 0x16361
addq $0x3, %rax
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movl %edx, %ecx
shll %cl, %r11d
addl %r11d, %esi
decl %r10d
addl $-0x3, %edx
cmpl $0x1, %r10d
ja 0x1632e
jmp 0x16367
addl %r11d, %esi
movzwl %si, %edi
movq (%rsp), %r9
movw %di, 0x8(%r9)
movq %r13, 0x8(%rsp)
leaq 0x1(%r13), %r14
movzbl -0x1(%r14), %eax
testl %eax, %eax
je 0x164b5
cmpl $0x9, %eax
je 0x16390
incq %r14
jmp 0x16379
movq %r14, 0x20(%rsp)
movb $0x0, -0x1(%r14)
movzbl (%r13), %eax
cmpl $0x2a, %eax
je 0x163c3
cmpl $0x3d, %eax
jne 0x163ca
cmpb $0x0, 0x1(%r13)
jne 0x163ca
movl (%r9), %eax
movl %eax, 0x14(%r9)
jmp 0x16426
callq 0x4f0f
jmp 0x1604b
cmpb $0x0, 0x1(%r13)
je 0x1641e
movq %r12, %rdi
movq %r13, %rsi
movq %r9, %rbx
callq 0x146cf
movl %eax, 0x14(%rbx)
testl %eax, %eax
jns 0x16429
leaq 0x4c16a(%rip), %rax     # 0x62550
cmpl $0x2, (%rax)
jl 0x16429
callq 0x4faa
jmp 0x16429
movq 0x4bbcf(%rip), %rax     # 0x61fc8
movq (%rax), %rdi
leaq 0x3b127(%rip), %rsi     # 0x5152a
leaq 0x3aff7(%rip), %rdx     # 0x51401
xorl %eax, %eax
callq 0x4770
movq (%rsp), %r9
movq 0x8(%r9), %rdx
jmp 0x16129
movl $0xffffffff, 0x14(%r9)  # imm = 0xFFFFFFFF
movq %r9, %rbx
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x4760
decl %eax
movl %eax, 0x18(%rbx)
movq (%r15), %rcx
leaq 0x1(%rcx), %r14
movq %r14, (%r15)
cmpb $0x9, (%rcx)
movq %rbx, %r9
jne 0x164b5
testl %eax, %eax
jns 0x16478
cmpl $0x0, 0x14(%r9)
js 0x16478
leaq 0x4c0e9(%rip), %rax     # 0x62550
cmpl $0x2, (%rax)
jge 0x16c57
movl $0xffffffff, 0x14(%r9)  # imm = 0xFFFFFFFF
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x4760
movq (%rsp), %r9
movl %eax, 0x1c(%r9)
movq (%r15), %rbp
cmpb $0x9, (%rbp)
jne 0x164b5
xorl %r12d, %r12d
movzbl 0x1(%rbp,%r12), %eax
testl %eax, %eax
je 0x164b5
cmpl $0x9, %eax
je 0x164e3
incq %r12
jmp 0x164a1
movq 0x50(%rsp), %rax
movq %rax, 0x28(%r9)
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
movq 0x40(%rsp), %rbx
movl %ebx, 0x20(%r9)
movl 0x48(%rsp), %ecx
movl %ecx, 0x24(%r9)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%r12,%rbp), %r13
addq $0x2, %r13
movq %r13, 0x20(%rsp)
movb $0x0, -0x1(%r13)
cmpb $0x2a, 0x1(%rbp)
movq 0x30(%rsp), %r11
jne 0x1650a
cmpb $0x0, 0x2(%rbp)
je 0x16627
movl %r12d, 0x10(%r9)
movq 0x8(%r9), %rax
movq %rax, %rcx
shrq $0x30, %rcx
je 0x1657f
movabsq $0x1000000000000, %rdx  # imm = 0x1000000000000
movl %eax, %esi
shrl $0x18, %esi
addq %rsi, %r11
xorl %r8d, %r8d
movl $0x3c1a7, %r9d          # imm = 0x3C1A7
xorl %r10d, %r10d
movl %r10d, %edi
movl (%r11,%r8,4), %esi
leal (%rsi,%rsi), %r10d
btl %r10d, %r9d
movl $0x0, %r10d
sbbl %r10d, %r10d
shrl $0x4, %esi
andl %r10d, %esi
leal (%rsi,%rdi), %r10d
incq %r8
cmpq %r8, %rcx
jne 0x16539
cmpq %rdx, %rax
jb 0x1657f
addl %edi, %esi
cmpl %r12d, %esi
je 0x1657f
leaq 0x4bfda(%rip), %rax     # 0x62550
cmpl $0x0, (%rax)
jg 0x16c79
leal 0x1(%r12), %eax
sarl %eax
movslq %eax, %r15
leaq 0x40(%rsp), %rbx
movq (%rbx), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0x16d59
movq (%rbx), %rax
movq 0x10(%rbx), %r14
addq %rax, %r14
addq %r15, %rax
movq %rax, (%rbx)
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x42d0
movq (%rsp), %r9
cmpl $0x0, 0x10(%r9)
jle 0x1662f
xorl %eax, %eax
leaq 0x3a433(%rip), %rdx     # 0x50a00
xorl %esi, %esi
movsbq 0x1(%rbp,%rsi), %rcx
movb (%rdx,%rcx), %dil
movl %eax, %ecx
notb %cl
andb $0x4, %cl
shlb %cl, %dil
movl %esi, %ecx
shrl %ecx
orb %dil, (%r14,%rcx)
incq %rsi
movslq 0x10(%r9), %rcx
addb $0x4, %al
cmpq %rcx, %rsi
jl 0x165cf
jmp 0x1662f
callq 0x4f2e
movq (%rsp), %r9
jmp 0x160af
callq 0x4f8b
jmp 0x1604b
callq 0x4f6c
jmp 0x1604b
callq 0x4f4d
jmp 0x1604b
movl $0x0, 0x10(%r9)
leaq (%r12,%rbp), %rax
addq $0x3, %rax
movq %r13, 0x8(%rsp)
xorl %r15d, %r15d
movzbl -0x1(%rax), %ecx
testl %ecx, %ecx
je 0x16654
cmpl $0x9, %ecx
je 0x16654
incq %rax
incq %r15
jmp 0x1663f
movq %rax, 0x20(%rsp)
movb $0x0, -0x1(%rax)
movslq 0x10(%r9), %rsi
leaq 0x40(%rsp), %r14
addq (%r14), %rsi
movq %r14, %rdi
callq 0x16d59
movq (%rsp), %r9
movq (%r14), %rbx
movq 0x10(%r14), %rsi
leaq (%rsi,%rbx), %rdi
movslq 0x10(%r9), %rdx
addq %rdx, %rbx
movq %rbx, (%r14)
cmpb $0x2a, (%r13)
jne 0x16699
cmpb $0x0, 0x3(%rbp,%r12)
je 0x166cf
cmpq %r15, %rdx
je 0x166ae
leaq 0x4beab(%rip), %rax     # 0x62550
cmpl $0x0, (%rax)
jg 0x16c65
testl %edx, %edx
jle 0x166e3
xorl %eax, %eax
movb (%r13), %cl
addb $-0x21, %cl
movb %cl, (%rdi,%rax)
incq %rax
movslq 0x10(%r9), %rcx
incq %r13
cmpq %rcx, %rax
jl 0x166b4
jmp 0x166e3
movq %rsi, %r14
movl $0xff, %esi
callq 0x42d0
movq %r14, %rsi
movq (%rsp), %r9
movq 0x20(%rsp), %r13
movq 0x28(%rsp), %rcx
movq 0x10(%rcx), %rax
addq (%rcx), %rax
cmpq %rax, %r13
jae 0x16c4c
leaq 0x40(%rsp), %r12
leaq 0x3af68(%rip), %rax     # 0x51671
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rbx
movq %r13, %r14
xorl %r15d, %r15d
movzbl (%r14,%r15), %eax
testl %eax, %eax
je 0x1672c
cmpl $0x9, %eax
je 0x1672c
incq %r15
jmp 0x16719
leaq (%r14,%r15), %r13
incq %r13
movq %r13, 0x20(%rsp)
movb $0x0, -0x1(%r13)
cmpq $0x5, %r15
jg 0x16753
leaq 0x4be06(%rip), %rax     # 0x62550
cmpl $0x0, (%rax)
jg 0x16c6f
movq %r14, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x16cbb
movzbl 0x3(%r14), %edi
leaq 0x5(%r14), %rbp
movq %rbp, 0x8(%rsp)
leal -0x41(%rdi), %eax
cmpl $0x22, %eax
ja 0x167bb
movabsq $0x500000005, %rcx      # imm = 0x500000005
btq %rax, %rcx
jae 0x167bb
movl $0x41, %edi
movq %r12, %rsi
callq 0x16dc8
movsbl (%rbp), %edi
movq %r12, %rsi
callq 0x16dc8
movq 0x10(%rbx), %rax
addq (%rbx), %rax
cmpq %rax, %r13
movq (%rsp), %r9
jb 0x16713
jmp 0x16c42
movl %edi, %eax
andb $-0x21, %al
cmpb $0x49, %al
jne 0x167ef
cmpb $0x2d, (%rbp)
leaq 0x8(%rsp), %rsi
movq %rbp, %rdi
movl $0xa, %edx
jne 0x1682c
callq 0x4760
movq %rax, %r14
cmpq $-0x80, %rax
jl 0x1687a
movl $0x63, %edi
jmp 0x16841
cmpl $0x59, %edi
leaq 0x8(%rsp), %rsi
jle 0x16851
cmpl $0x5a, %edi
je 0x16863
cmpl $0x64, %edi
je 0x168c3
cmpl $0x66, %edi
jne 0x16944
movq %rbp, %rdi
callq 0x4400
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
movl $0x66, %edi
jmp 0x16a17
callq 0x4180
movq %rax, %r14
cmpq $0xff, %rax
ja 0x16894
movl $0x43, %edi
movq %r12, %rsi
callq 0x16dc8
movl %r14d, %edi
jmp 0x1679a
cmpl $0x42, %edi
je 0x168ed
cmpl $0x48, %edi
jne 0x16944
movq %r12, %rsi
callq 0x16dc8
addl $-0x4, %r15d
movq %rbp, %rdi
movl %r15d, %esi
jmp 0x16a29
cmpq $-0x8000, %r14          # imm = 0x8000
jb 0x16a01
movw %r14w, 0x18(%rsp)
movl $0x73, %edi
jmp 0x168ac
cmpq $0xffff, %r14           # imm = 0xFFFF
ja 0x16a0d
movw %r14w, 0x18(%rsp)
movl $0x53, %edi
movq %r12, %rsi
callq 0x16dc8
leaq 0x18(%rsp), %rdi
movl $0x2, %esi
jmp 0x16a29
movq %rbp, %rdi
callq 0x4400
movsd %xmm0, 0x18(%rsp)
movl $0x64, %edi
movq %r12, %rsi
callq 0x16dc8
leaq 0x18(%rsp), %rdi
movl $0x8, %esi
jmp 0x16a29
movl $0x4, %eax
subq %r15, %rax
cmpq $-0x3, %rax
jl 0x1690b
leaq 0x4bc4e(%rip), %rax     # 0x62550
cmpl $0x0, (%rax)
jg 0x16c99
leaq (%r14,%r15), %rax
movq %rax, 0x38(%rsp)
leaq 0x6(%r14), %rbp
movq %rbp, 0x8(%rsp)
movzbl 0x5(%r14), %r14d
movl $0x0, 0x18(%rsp)
xorl %eax, %eax
movq %rbp, %rcx
movzbl (%rcx), %edx
cmpl $0x2c, %edx
je 0x1693d
testl %edx, %edx
jne 0x1693f
jmp 0x16959
incl %eax
incq %rcx
jmp 0x1692f
leaq 0x4bc05(%rip), %rax     # 0x62550
cmpl $0x0, (%rax)
jle 0x167a2
jmp 0x16c83
movl %eax, 0x18(%rsp)
movl $0x42, %edi
movq %r12, %rsi
callq 0x16dc8
movl %r14d, %edi
movq %r12, %rsi
callq 0x16dc8
leaq 0x18(%rsp), %rdi
movl $0x4, %esi
movq %r12, %rdx
callq 0x16cbb
cmpl $0x62, %r14d
jle 0x16a36
cmpl $0x68, %r14d
jg 0x16aa3
cmpl $0x63, %r14d
je 0x16b63
cmpl $0x66, %r14d
jne 0x16b49
cmpq $0x7, %r15
movq 0x28(%rsp), %rbx
leaq 0x8(%rsp), %r14
movq 0x38(%rsp), %r15
jb 0x167a2
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0x4400
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x14(%rsp)
leaq 0x14(%rsp), %rdi
movl $0x4, %esi
movq %r12, %rdx
callq 0x16cbb
movq 0x8(%rsp), %rbp
cmpq %r15, %rbp
jb 0x169c8
jmp 0x167a2
movl %r14d, 0x18(%rsp)
movl $0x69, %edi
jmp 0x16a17
movl %r14d, 0x18(%rsp)
movl $0x49, %edi
movq %r12, %rsi
callq 0x16dc8
leaq 0x18(%rsp), %rdi
movl $0x4, %esi
movq %r12, %rdx
callq 0x16cbb
jmp 0x167a2
cmpl $0x43, %r14d
je 0x16b06
cmpl $0x49, %r14d
je 0x16bf4
cmpl $0x53, %r14d
jne 0x16b49
cmpq $0x7, %r15
movq 0x28(%rsp), %rbx
leaq 0x8(%rsp), %r14
movq 0x38(%rsp), %r15
jb 0x167a2
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4180
movw %ax, 0x14(%rsp)
leaq 0x14(%rsp), %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x16cbb
movq 0x8(%rsp), %rbp
cmpq %r15, %rbp
jb 0x16a6d
jmp 0x167a2
cmpl $0x69, %r14d
je 0x16ba6
cmpl $0x73, %r14d
jne 0x16b49
cmpq $0x7, %r15
movq 0x28(%rsp), %rbx
leaq 0x8(%rsp), %r14
movq 0x38(%rsp), %r15
jb 0x167a2
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4760
movw %ax, 0x14(%rsp)
leaq 0x14(%rsp), %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0x16cbb
movq 0x8(%rsp), %rbp
cmpq %r15, %rbp
jb 0x16ad0
jmp 0x167a2
cmpq $0x7, %r15
movq 0x28(%rsp), %rbx
leaq 0x8(%rsp), %r14
movq 0x38(%rsp), %r15
jb 0x167a2
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4180
movzbl %al, %edi
movq %r12, %rsi
callq 0x16dc8
movq 0x8(%rsp), %rbp
cmpq %r15, %rbp
jb 0x16b1f
jmp 0x167a2
leaq 0x4ba00(%rip), %rax     # 0x62550
cmpl $0x0, (%rax)
movq 0x28(%rsp), %rbx
jle 0x167a2
jmp 0x16c8d
cmpq $0x7, %r15
movq 0x28(%rsp), %rbx
leaq 0x8(%rsp), %r14
movq 0x38(%rsp), %r15
jb 0x167a2
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4760
movsbl %al, %edi
movq %r12, %rsi
callq 0x16dc8
movq 0x8(%rsp), %rbp
cmpq %r15, %rbp
jb 0x16b7c
jmp 0x167a2
cmpq $0x7, %r15
movq 0x28(%rsp), %rbx
leaq 0x8(%rsp), %r14
movq 0x38(%rsp), %r15
jb 0x167a2
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4760
movl %eax, 0x14(%rsp)
leaq 0x14(%rsp), %rdi
movl $0x4, %esi
movq %r12, %rdx
callq 0x16cbb
movq 0x8(%rsp), %rbp
cmpq %r15, %rbp
jb 0x16bbf
jmp 0x167a2
cmpq $0x7, %r15
movq 0x28(%rsp), %rbx
leaq 0x8(%rsp), %r14
movq 0x38(%rsp), %r15
jb 0x167a2
incq %rbp
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4180
movl %eax, 0x14(%rsp)
leaq 0x14(%rsp), %rdi
movl $0x4, %esi
movq %r12, %rdx
callq 0x16cbb
movq 0x8(%rsp), %rbp
cmpq %r15, %rbp
jb 0x16c0d
jmp 0x167a2
movq 0x40(%rsp), %rbx
movq 0x50(%rsp), %rsi
movq %rsi, 0x28(%r9)
xorl %eax, %eax
jmp 0x164c8
callq 0x4fc9
movq (%rsp), %r9
jmp 0x16470
callq 0x5007
jmp 0x1604b
callq 0x5045
jmp 0x1604b
callq 0x4fe8
jmp 0x1604b
callq 0x5026
jmp 0x1604b
leaq 0x3aa03(%rip), %rax     # 0x51697
movq %rax, 0x30(%rsp)
movq 0x4b328(%rip), %rax     # 0x61fc8
movq (%rax), %rdi
leaq 0x3a757(%rip), %rdx     # 0x51401
movq 0x30(%rsp), %rsi
xorl %eax, %eax
callq 0x4770
jmp 0x1604b