// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: sam_parse1
int sam_parse1(kstring_t *s, sam_hdr_t *h, bam1_t *b)
{
#define _read_token(_p) (_p); do { char *tab = strchr((_p), '\t'); if (!tab) goto err_ret; *tab = '\0'; (_p) = tab + 1; } while (0)

#if HTS_ALLOW_UNALIGNED != 0 && ULONG_MAX == 0xffffffffffffffff

// Macro that operates on 64-bits at a time.
#define COPY_MINUS_N(to,from,n,l,failed)                        \
    do {                                                        \
        uint64_u *from8 = (uint64_u *)(from);                   \
        uint64_u *to8 = (uint64_u *)(to);                       \
        uint64_t uflow = 0;                                     \
        size_t l8 = (l)>>3, i;                                  \
        for (i = 0; i < l8; i++) {                              \
            to8[i] = from8[i] - (n)*0x0101010101010101UL;       \
            uflow |= to8[i];                                    \
        }                                                       \
        for (i<<=3; i < (l); ++i) {                             \
            to[i] = from[i] - (n);                              \
            uflow |= to[i];                                     \
        }                                                       \
        failed = (uflow & 0x8080808080808080UL) > 0;            \
    } while (0)

#else

// Basic version which operates a byte at a time
#define COPY_MINUS_N(to,from,n,l,failed) do {                \
        uint8_t uflow = 0;                                   \
        for (i = 0; i < (l); ++i) {                          \
            (to)[i] = (from)[i] - (n);                       \
            uflow |= (uint8_t) (to)[i];                      \
        }                                                    \
        failed = (uflow & 0x80) > 0;                         \
    } while (0)

#endif

#define _get_mem(type_t, x, b, l) if (possibly_expand_bam_data((b), (l)) < 0) goto err_ret; *(x) = (type_t*)((b)->data + (b)->l_data); (b)->l_data += (l)
#define _parse_err(cond, ...) do { if (cond) { hts_log_error(__VA_ARGS__); goto err_ret; } } while (0)
#define _parse_warn(cond, ...) do { if (cond) { hts_log_warning(__VA_ARGS__); } } while (0)

    uint8_t *t;

    char *p = s->s, *q;
    int i, overflow = 0;
    char logbuf[40];
    hts_pos_t cigreflen;
    bam1_core_t *c = &b->core;

    b->l_data = 0;
    memset(c, 0, 32);

    // qname
    q = _read_token(p);

    _parse_warn(p - q <= 1, "empty query name");
    _parse_err(p - q > 255, "query name too long");
    // resize large enough for name + extranul
    if (possibly_expand_bam_data(b, (p - q) + 4) < 0) goto err_ret;
    memcpy(b->data + b->l_data, q, p-q); b->l_data += p-q;

    c->l_extranul = (4 - (b->l_data & 3)) & 3;
    memcpy(b->data + b->l_data, "\0\0\0\0", c->l_extranul);
    b->l_data += c->l_extranul;

    c->l_qname = p - q + c->l_extranul;

    // flag
    c->flag = parse_sam_flag(p, &p, &overflow);
    if (*p++ != '\t') goto err_ret; // malformated flag

    // chr
    q = _read_token(p);
    if (strcmp(q, "*")) {
        _parse_err(h->n_targets == 0, "no SQ lines present in the header");
        c->tid = bam_name2id(h, q);
        _parse_err(c->tid < -1, "failed to parse header");
        _parse_warn(c->tid < 0, "unrecognized reference name %s; treated as unmapped", hts_strprint(logbuf, sizeof logbuf, '"', q, SIZE_MAX));
    } else c->tid = -1;

    // pos
    c->pos = hts_str2uint(p, &p, 62, &overflow) - 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 = hts_str2uint(p, &p, 8, &overflow);
    if (*p++ != '\t') goto err_ret;
    // cigar
    if (*p != '*') {
        uint32_t *cigar = NULL;
        int old_l_data = b->l_data;
        int n_cigar = bam_parse_cigar(p, &p, b);
        if (n_cigar < 1 || *p++ != '\t') goto err_ret;
        cigar = (uint32_t *)(b->data + old_l_data);

        // can't use bam_endpos() directly as some fields not yet set up
        cigreflen = (!(c->flag&BAM_FUNMAP))? bam_cigar2rlen(c->n_cigar, cigar) : 1;
        if (cigreflen == 0) cigreflen = 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);
        cigreflen = 1;
    }
    _parse_err(HTS_POS_MAX - cigreflen <= c->pos,
               "read ends beyond highest supported position");
    c->bin = hts_reg2bin(c->pos, c->pos + cigreflen, 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_err(c->mtid < -1, "failed to parse header");
        _parse_warn(c->mtid < 0, "unrecognized mate reference name %s; treated as unmapped", hts_strprint(logbuf, sizeof logbuf, '"', q, SIZE_MAX));
    }
    // mpos
    c->mpos = hts_str2uint(p, &p, 62, &overflow) - 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 = hts_str2int(p, &p, 63, &overflow);
    if (*p++ != '\t') goto err_ret;
    _parse_err(overflow, "number outside allowed range");
    // seq
    q = _read_token(p);
    if (strcmp(q, "*")) {
        _parse_err(p - q - 1 > INT32_MAX, "read sequence is too long");
        c->l_qseq = p - q - 1;
        hts_pos_t ql = bam_cigar2qlen(c->n_cigar, (uint32_t*)(b->data + c->l_qname));
        _parse_err(c->n_cigar && ql != c->l_qseq, "CIGAR and query sequence are of different length");
        i = (c->l_qseq + 1) >> 1;
        _get_mem(uint8_t, &t, b, i);

        unsigned int lqs2 = c->l_qseq&~1, i;
        for (i = 0; i < lqs2; i+=2)
            t[i>>1] = (seq_nt16_table[(unsigned char)q[i]] << 4) | seq_nt16_table[(unsigned char)q[i+1]];
        for (; i < c->l_qseq; ++i)
            t[i>>1] = seq_nt16_table[(unsigned char)q[i]] << ((~i&1)<<2);
    } else c->l_qseq = 0;
    // qual
    _get_mem(uint8_t, &t, b, c->l_qseq);
    if (p[0] == '*' && (p[1] == '\t' || p[1] == '\0')) {
        memset(t, 0xff, c->l_qseq);
        p += 2;
    } else {
        int failed = 0;
        _parse_err(s->l - (p - s->s) < c->l_qseq
                   || (p[c->l_qseq] != '\t' && p[c->l_qseq] != '\0'),
                   "SEQ and QUAL are of different length");
        COPY_MINUS_N(t, p, 33, c->l_qseq, failed);
        _parse_err(failed, "invalid QUAL character");
        p += c->l_qseq + 1;
    }

    // aux
    if (aux_parse(p, s->s + s->l, b, 0, NULL) < 0)
        goto err_ret;

    if (bam_tag2cigar(b, 1, 1) < 0)
        return -2;
    return 0;

#undef _parse_warn
#undef _parse_err
#undef _get_mem
#undef _read_token
err_ret:
    return -2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq 0x10(%rdi), %r13
movq %r13, (%rsp)
xorl %eax, %eax
movl %eax, 0xc(%rsp)
movl %eax, 0x40(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movups %xmm0, 0x10(%rdx)
movq %r13, %rdi
movl $0x9, %esi
callq 0x4190
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
testq %rax, %rax
je 0x289d6
movb $0x0, (%rax)
incq %rax
movq %rax, (%rsp)
subq %r13, %rax
cmpq $0x1, %rax
jg 0x2812e
leaq 0x72846(%rip), %rsi     # 0x9a961
leaq 0x7284a(%rip), %rdx     # 0x9a96c
movl $0x3, %edi
xorl %eax, %eax
callq 0x14378
movq (%rsp), %rax
subq %r13, %rax
cmpq $0x100, %rax            # imm = 0x100
jl 0x2815c
leaq 0x7281d(%rip), %rsi     # 0x9a961
leaq 0x72832(%rip), %rdx     # 0x9a97d
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
jmp 0x289d6
addq $0x4, %rax
movslq 0x40(%r14), %rsi
addq %rax, %rsi
setae %al
testq $-0x80000000, %rsi      # imm = 0x80000000
sete %cl
testb %al, %cl
jne 0x28188
callq 0x4050
movl $0xc, (%rax)
jmp 0x289d6
movl 0x44(%r14), %eax
cmpq %rax, %rsi
jbe 0x281a1
movq %r14, %rdi
callq 0x23476
testl %eax, %eax
js 0x289d6
movslq 0x40(%r14), %rdi
addq 0x38(%r14), %rdi
movq (%rsp), %rdx
subq %r13, %rdx
movq %r13, %rsi
callq 0x43c0
movl (%rsp), %eax
subl %r13d, %eax
addl 0x40(%r14), %eax
movl %eax, 0x40(%r14)
movslq %eax, %rdi
negb %al
andb $0x3, %al
movb %al, 0xf(%r14)
addq 0x38(%r14), %rdi
movzbl %al, %edx
xorl %esi, %esi
callq 0x4260
movzbl 0xf(%r14), %eax
addl %eax, 0x40(%r14)
movq (%rsp), %rdi
subl %r13d, %eax
addl %edi, %eax
movw %ax, 0x12(%r14)
movb (%rdi), %dl
leal -0x31(%rdx), %eax
cmpb $0x8, %al
ja 0x28240
leal -0x30(%rdx), %eax
movb $0x1, %cl
cmpb $0x9, %al
ja 0x2825a
leaq 0x4(%rdi), %rsi
xorl %r8d, %r8d
xorl %eax, %eax
leaq (%rax,%rax,4), %rax
movzbl %dl, %edx
leaq (%rdx,%rax,2), %rax
addq $-0x30, %rax
cmpl $0x3, %r8d
setne %dl
je 0x2825e
movb 0x1(%rdi,%r8), %dl
leal -0x30(%rdx), %r9d
incq %r8
cmpb $0x9, %r9b
jbe 0x28211
addq %r8, %rdi
jmp 0x28263
cmpb $0x30, %dl
jne 0x28256
cmpb $0x9, 0x1(%rdi)
jne 0x2833f
incq %rdi
movq %rdi, (%rsp)
xorl %eax, %eax
jmp 0x282c4
xorl %eax, %eax
jmp 0x28263
movq %rsi, %rdi
movl %edx, %ecx
testb %cl, %cl
jne 0x282c0
movzbl (%rdi), %ecx
leal -0x3a(%rcx), %edx
cmpl $-0xa, %edx
jb 0x282c0
addl $-0x30, %ecx
cmpl $0x9, %ecx
ja 0x282c0
cmpq $0x1999, %rax           # imm = 0x1999
jb 0x28289
jne 0x282a4
cmpl $0x6, %ecx
jae 0x282a4
leaq (%rax,%rax,4), %rax
movl %ecx, %ecx
leaq (%rcx,%rax,2), %rax
movzbl 0x1(%rdi), %ecx
incq %rdi
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x2827a
jmp 0x282c0
movzbl 0x1(%rdi), %eax
incq %rdi
addl $-0x30, %eax
cmpl $0xa, %eax
jb 0x282a4
movl $0x1, 0xc(%rsp)
movl $0xffff, %eax           # imm = 0xFFFF
movq %rdi, (%rsp)
movw %ax, 0x10(%r14)
movq (%rsp), %rax
leaq 0x1(%rax), %r13
movq %r13, (%rsp)
cmpb $0x9, (%rax)
jne 0x289d6
movq %r13, %rdi
movl $0x9, %esi
callq 0x4190
testq %rax, %rax
je 0x289d6
movb $0x0, (%rax)
incq %rax
movq %rax, (%rsp)
leaq 0x7348b(%rip), %rsi     # 0x9b790
movq %r13, %rdi
callq 0x46c0
testl %eax, %eax
je 0x28366
cmpl $0x0, (%r12)
je 0x28370
movq %r12, %rdi
movq %r13, %rsi
callq 0x8bc32
movl %eax, 0x8(%r14)
cmpl $-0x2, %eax
jg 0x28383
leaq 0x7262e(%rip), %rsi     # 0x9a961
leaq 0x72679(%rip), %rdx     # 0x9a9b3
jmp 0x2814b
movq %rsp, %rsi
xorl %edx, %edx
callq 0x4130
cmpq $0x10000, %rax          # imm = 0x10000
jb 0x282c4
movl $0x1, 0xc(%rsp)
movw $0xffff, %ax            # imm = 0xFFFF
jmp 0x282c4
movl $0xffffffff, 0x8(%r14)  # imm = 0xFFFFFFFF
jmp 0x283c2
leaq 0x725ea(%rip), %rsi     # 0x9a961
leaq 0x72613(%rip), %rdx     # 0x9a991
jmp 0x2814b
testl %eax, %eax
jns 0x283c2
leaq 0x10(%rsp), %rdi
movl $0x28, %esi
movl $0x22, %edx
movq %r13, %rcx
movq $-0x1, %r8
callq 0x36ea0
leaq 0x725b5(%rip), %rsi     # 0x9a961
leaq 0x72617(%rip), %rdx     # 0x9a9ca
movl $0x3, %edi
movq %rax, %rcx
xorl %eax, %eax
callq 0x14378
movq (%rsp), %rcx
xorl %edx, %edx
cmpb $0x2b, (%rcx)
sete %dl
leaq (%rcx,%rdx), %rax
movb (%rcx,%rdx), %r8b
leal -0x30(%r8), %esi
cmpb $0x9, %sil
ja 0x2841b
leaq (%rcx,%rdx), %rsi
addq $0x12, %rsi
xorl %edi, %edi
xorl %ecx, %ecx
leaq (%rcx,%rcx,4), %rcx
movzbl %r8b, %edx
leaq (%rdx,%rcx,2), %rcx
addq $-0x30, %rcx
cmpl $0x11, %edi
setne %dl
je 0x28421
movb 0x1(%rax,%rdi), %r8b
leal -0x30(%r8), %r9d
incq %rdi
cmpb $0x9, %r9b
jbe 0x283ec
addq %rdi, %rax
jmp 0x28424
movb $0x1, %dl
xorl %ecx, %ecx
jmp 0x28424
movq %rsi, %rax
testb %dl, %dl
jne 0x2848d
movzbl (%rax), %edx
leal -0x3a(%rdx), %esi
cmpl $-0xa, %esi
jb 0x2848d
addl $-0x30, %edx
cmpl $0x9, %edx
ja 0x2848d
movabsq $0x666666666666666, %rsi # imm = 0x666666666666666
cmpq %rsi, %rcx
jb 0x28451
jne 0x2846c
cmpl $0x4, %edx
jae 0x2846c
leaq (%rcx,%rcx,4), %rcx
movl %edx, %edx
leaq (%rdx,%rcx,2), %rcx
movzbl 0x1(%rax), %edx
incq %rax
addl $-0x30, %edx
cmpl $0xa, %edx
jb 0x28445
jmp 0x2848d
movzbl 0x1(%rax), %ecx
incq %rax
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x2846c
movl $0x1, 0xc(%rsp)
movabsq $0x3fffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFFF
movq %rax, (%rsp)
decq %rcx
movq %rcx, (%r14)
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
cmpb $0x9, (%rax)
jne 0x289d6
testq %rcx, %rcx
jns 0x284d6
cmpl $0x0, 0x8(%r14)
js 0x284d6
leaq 0x724a6(%rip), %rsi     # 0x9a961
leaq 0x7253c(%rip), %rdx     # 0x9a9fe
movl $0x3, %edi
xorl %eax, %eax
callq 0x14378
movl $0xffffffff, 0x8(%r14)  # imm = 0xFFFFFFFF
cmpl $0x0, 0x8(%r14)
jns 0x284e2
orb $0x4, 0x10(%r14)
movq %rsp, %r13
movq (%r13), %rdi
leaq 0xc(%rsp), %rcx
movq %r13, %rsi
movl $0x8, %edx
callq 0x28b04
movb %al, 0xe(%r14)
movq (%r13), %rax
leaq 0x1(%rax), %rdi
movq %rdi, (%r13)
cmpb $0x9, (%rax)
jne 0x289d6
cmpb $0x2a, (%rdi)
jne 0x2856a
testb $0x4, 0x10(%r14)
jne 0x2853a
leaq 0x7243a(%rip), %rsi     # 0x9a961
leaq 0x7250e(%rip), %rdx     # 0x9aa3c
movl $0x3, %edi
xorl %eax, %eax
callq 0x14378
orb $0x4, 0x10(%r14)
movq (%rsp), %rdi
movl $0x9, %esi
callq 0x4190
testq %rax, %rax
je 0x289d6
movb $0x0, (%rax)
incq %rax
movq %rax, (%rsp)
movl $0x1, %eax
jmp 0x285f0
movslq 0x40(%r14), %r13
movq %rsp, %rsi
movq %r14, %rdx
callq 0x28c19
testq %rax, %rax
jle 0x285d8
movq (%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%rsp)
cmpb $0x9, (%rax)
jne 0x285d8
movl $0x1, %eax
testb $0x4, 0x10(%r14)
jne 0x285de
movslq 0x14(%r14), %rdx
testq %rdx, %rdx
jle 0x285dc
addq 0x38(%r14), %r13
xorl %esi, %esi
xorl %eax, %eax
movl (%r13,%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
addq %rdi, %rax
incq %rsi
cmpq %rsi, %rdx
jne 0x285ac
jmp 0x285de
xorl %ecx, %ecx
jmp 0x285e8
xorl %eax, %eax
cmpq $0x1, %rax
adcq $0x0, %rax
movb $0x1, %cl
testb %cl, %cl
je 0x289d6
movabsq $0x7fffffff7fffffff, %rcx # imm = 0x7FFFFFFF7FFFFFFF
subq %rax, %rcx
movq (%r14), %rdi
cmpq %rdi, %rcx
jle 0x28656
leaq (%rax,%rdi), %r8
decq %r8
movl $0x1249, %esi           # imm = 0x1249
movl $0xe, %eax
movl $0x6, %r9d
movl $0xc, %edx
movq %rdi, %r10
movl %eax, %ecx
sarq %cl, %r10
movq %r8, %r11
sarq %cl, %r11
cmpq %r11, %r10
je 0x28669
addq $0x3, %rax
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
movl %edx, %ecx
shll %cl, %r10d
addl %r10d, %esi
decl %r9d
addl $-0x3, %edx
cmpl $0x1, %r9d
ja 0x28621
xorl %esi, %esi
jmp 0x2866c
leaq 0x72304(%rip), %rsi     # 0x9a961
leaq 0x7240c(%rip), %rdx     # 0x9aa70
jmp 0x2814b
addl %r10d, %esi
movw %si, 0xc(%r14)
movq (%rsp), %r13
movq %r13, %rdi
movl $0x9, %esi
callq 0x4190
testq %rax, %rax
je 0x289d6
movb $0x0, (%rax)
incq %rax
movq %rax, (%rsp)
leaq 0x76160(%rip), %rsi     # 0x9e7fc
movq %r13, %rdi
callq 0x46c0
testl %eax, %eax
je 0x28714
leaq 0x730e1(%rip), %rsi     # 0x9b790
movq %r13, %rdi
callq 0x46c0
testl %eax, %eax
je 0x2871e
movq %r12, %rdi
movq %r13, %rsi
callq 0x8bc32
movl %eax, 0x1c(%r14)
cmpl $-0x2, %eax
jle 0x2832c
testl %eax, %eax
jns 0x28726
leaq 0x10(%rsp), %rdi
movl $0x28, %esi
movl $0x22, %edx
movq %r13, %rcx
movq $-0x1, %r8
callq 0x36ea0
leaq 0x72265(%rip), %rsi     # 0x9a961
leaq 0x72399(%rip), %rdx     # 0x9aa9c
movl $0x3, %edi
movq %rax, %rcx
xorl %eax, %eax
callq 0x14378
jmp 0x28726
movl 0x8(%r14), %eax
movl %eax, 0x1c(%r14)
jmp 0x28726
movl $0xffffffff, 0x1c(%r14) # imm = 0xFFFFFFFF
movq %rsp, %r12
movq (%r12), %rdi
leaq 0xc(%rsp), %rcx
movq %r12, %rsi
movl $0x3e, %edx
callq 0x28b04
decq %rax
movq %rax, 0x20(%r14)
movq (%r12), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r12)
cmpb $0x9, (%rcx)
jne 0x289d6
testq %rax, %rax
jns 0x28789
cmpl $0x0, 0x1c(%r14)
js 0x28789
leaq 0x721f3(%rip), %rsi     # 0x9a961
leaq 0x72360(%rip), %rdx     # 0x9aad5
movl $0x3, %edi
xorl %eax, %eax
callq 0x14378
movl $0xffffffff, 0x1c(%r14) # imm = 0xFFFFFFFF
movq %rsp, %r13
movq (%r13), %rdi
leaq 0xc(%rsp), %rcx
movq %r13, %rsi
movl $0x3f, %edx
callq 0x28d88
movq %rax, 0x28(%r14)
movq (%r13), %rbp
leaq 0x1(%rbp), %r12
movq %r12, (%r13)
cmpb $0x9, (%rbp)
jne 0x289d6
cmpl $0x0, 0xc(%rsp)
je 0x287d6
leaq 0x72197(%rip), %rsi     # 0x9a961
leaq 0x72341(%rip), %rdx     # 0x9ab12
jmp 0x2814b
movq %r12, %rdi
movl $0x9, %esi
callq 0x4190
testq %rax, %rax
je 0x289d6
movb $0x0, (%rax)
incq %rax
movq %rax, (%rsp)
leaq 0x72f93(%rip), %rsi     # 0x9b790
movq %r12, %rdi
callq 0x46c0
testl %eax, %eax
je 0x28834
movq %r12, %rax
notq %rax
addq (%rsp), %rax
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
jl 0x288d2
leaq 0x72139(%rip), %rsi     # 0x9a961
leaq 0x72300(%rip), %rdx     # 0x9ab2f
jmp 0x2814b
movl $0x0, 0x18(%r14)
movslq 0x18(%r14), %rsi
movq %r14, %rdi
callq 0x28ac4
testl %eax, %eax
js 0x289d6
movslq 0x40(%r14), %rdi
movslq 0x18(%r14), %rdx
leal (%rdx,%rdi), %eax
addq 0x38(%r14), %rdi
movl %eax, 0x40(%r14)
movq (%rsp), %rax
cmpb $0x2a, (%rax)
jne 0x28938
movzbl 0x1(%rax), %ecx
cmpl $0x9, %ecx
je 0x28881
testl %ecx, %ecx
jne 0x28938
movl $0xff, %esi
callq 0x4260
movq (%rsp), %rdi
addq $0x2, %rdi
movq %rdi, (%rsp)
movq 0x10(%r15), %rsi
addq (%r15), %rsi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x28ed8
testl %eax, %eax
js 0x289d6
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x23fae
movl %eax, %ebx
sarl $0x1f, %ebx
andl $-0x2, %ebx
jmp 0x289d6
movl %eax, 0x18(%r14)
movslq 0x14(%r14), %rdx
xorl %ecx, %ecx
testq %rdx, %rdx
jle 0x28919
movzwl 0x12(%r14), %esi
addq 0x38(%r14), %rsi
movl $0x3c1a7, %edi          # imm = 0x3C1A7
xorl %r8d, %r8d
movl (%rsi,%r8,4), %r9d
leal (%r9,%r9), %r10d
btl %r10d, %edi
movl $0x0, %r10d
sbbl %r10d, %r10d
shrl $0x4, %r9d
andl %r10d, %r9d
addq %r9, %rcx
incq %r8
cmpq %r8, %rdx
jne 0x288f2
testl %edx, %edx
je 0x2896e
movslq %eax, %rdx
cmpq %rdx, %rcx
je 0x2896e
leaq 0x72035(%rip), %rsi     # 0x9a961
leaq 0x71e71(%rip), %rdx     # 0x9a7a4
jmp 0x2814b
movq (%r15), %rcx
subq %rax, %rcx
addq 0x10(%r15), %rcx
cmpq %rdx, %rcx
jb 0x289e7
movzbl (%rax,%rdx), %ecx
testl %ecx, %ecx
je 0x2895c
cmpl $0x9, %ecx
jne 0x289e7
cmpl $0x8, %edx
jae 0x28a41
xorl %ecx, %ecx
xorl %edx, %edx
jmp 0x28a89
leal 0x1(%rax), %r13d
sarl %r13d
movslq %r13d, %rsi
movq %r14, %rdi
callq 0x28ac4
testl %eax, %eax
js 0x289d6
movslq 0x40(%r14), %rax
addl %eax, %r13d
addq 0x38(%r14), %rax
movl %r13d, 0x40(%r14)
movl 0x18(%r14), %edx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
andq %rdx, %rcx
je 0x289fa
xorl %edx, %edx
leaq 0x6ff06(%rip), %rsi     # 0x988b0
movq %rax, %rdi
movzbl 0x1(%rbp,%rdx), %r8d
movb (%rsi,%r8), %r8b
shlb $0x4, %r8b
movzbl 0x2(%rbp,%rdx), %r9d
orb (%rsi,%r9), %r8b
movb %r8b, (%rdi)
addq $0x2, %rdx
incq %rdi
cmpq %rcx, %rdx
jb 0x289ad
jmp 0x289fc
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x71f73(%rip), %rsi     # 0x9a961
leaq 0x72154(%rip), %rdx     # 0x9ab49
jmp 0x2814b
xorl %edx, %edx
cmpl 0x18(%r14), %edx
jae 0x2883c
movl %edx, %esi
shlb $0x2, %dl
leaq 0x6fe9e(%rip), %rdi     # 0x988b0
movzbl (%r12,%rsi), %ecx
movb (%rdi,%rcx), %r8b
movl %edx, %ecx
notb %cl
andb $0x4, %cl
shlb %cl, %r8b
movl %esi, %ecx
shrl %ecx
movb %r8b, (%rax,%rcx)
incq %rsi
movl 0x18(%r14), %ecx
addb $0x4, %dl
cmpq %rcx, %rsi
jb 0x28a12
jmp 0x2883c
sarl $0x3, %edx
cmpl $0x1, %edx
adcl $0x0, %edx
movslq %edx, %rsi
xorl %edx, %edx
movabsq $-0x2121212121212121, %r8 # imm = 0xDEDEDEDEDEDEDEDF
xorl %ecx, %ecx
movq (%rax,%rdx), %r9
addq %r8, %r9
movq %r9, (%rdi,%rdx)
orq %r9, %rcx
addq $0x8, %rdx
decq %rsi
jne 0x28a5b
jmp 0x28a89
movq (%rsp), %rax
movb (%rax,%rdx), %al
addb $-0x21, %al
movb %al, (%rdi,%rdx)
movzbl %al, %eax
orq %rax, %rcx
incq %rdx
movslq 0x18(%r14), %rax
cmpq %rax, %rdx
jb 0x28a74
movabsq $-0x7f7f7f7f7f7f7f80, %rdx # imm = 0x8080808080808080
testq %rdx, %rcx
je 0x28ab4
leaq 0x71eb9(%rip), %rsi     # 0x9a961
leaq 0x720bf(%rip), %rdx     # 0x9ab6e
jmp 0x2814b
movq (%rsp), %rcx
leaq (%rcx,%rax), %rdi
incq %rdi
jmp 0x28893