// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
movq %rsi, %r15
movq %rdi, 0x50(%rsp)
movq 0x10(%rdi), %r12
andl $0x0, 0x20(%rdx)
andq $0x0, 0x30(%rsp)
movq 0x28(%rdx), %rax
movq %rax, 0x40(%rsp)
movslq 0x24(%rdx), %rax
movq %rax, 0x38(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdx)
movups %xmm0, (%rdx)
cmpq $0x0, 0x18(%rsi)
je 0x12540
movq %rbx, 0x8(%rsp)
movq %r12, (%rsp)
leaq 0x1(%r12), %r13
movl $0x1000000, %ebx        # imm = 0x1000000
pushq $0x1
popq %r14
pushq $-0x2
popq %rbp
movzbl -0x1(%r13), %eax
testl %eax, %eax
je 0x1263e
cmpl $0x9, %eax
je 0x12499
incq %r13
addq $0x1000000, %rbx        # imm = 0x1000000
incq %r14
jmp 0x12478
movq %r13, 0x28(%rsp)
movb $0x0, -0x1(%r13)
cmpq $0x2, %r14
setl %cl
leaq 0x45097(%rip), %rax     # 0x57548
movl (%rax), %eax
cmpl $0x2, %eax
setge %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x125fb
cmpq $0x100, %r14            # imm = 0x100
setge %cl
testl %eax, %eax
setg %al
andb %cl, %al
cmpb $0x1, %al
je 0x1261f
leaq 0x30(%rsp), %rdx
movq %r12, %rdi
movl %r14d, %esi
callq 0x131ca
shrl $0x18, %ebx
movq 0x8(%rsp), %rax
movb %bl, 0xb(%rax)
movq %rax, %rbx
leaq 0x28(%rsp), %r14
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4760
movw %ax, 0xc(%rbx)
movq (%r14), %rax
cmpb $0x9, (%rax)
jne 0x12643
leaq 0x1(%rax), %rsi
movq %rsi, (%rsp)
leaq 0x2(%rax), %r14
movzbl -0x1(%r14), %ecx
testl %ecx, %ecx
je 0x12643
cmpl $0x9, %ecx
je 0x12589
incq %r14
jmp 0x12529
movl $0x80, %edi
callq 0x46f0
movq %rax, 0x18(%r15)
xorl %eax, %eax
cmpq $0x80, %rax
je 0x12565
movq 0x18(%r15), %rcx
movb $-0x1, (%rcx,%rax)
incq %rax
jmp 0x12550
xorl %eax, %eax
leaq 0x31dd3(%rip), %rcx     # 0x44341
cmpq $0xa, %rax
je 0x1245e
movsbq (%rax,%rcx), %rdx
movq 0x18(%r15), %rsi
movb %al, (%rsi,%rdx)
incq %rax
jmp 0x1256e
movq %r14, 0x28(%rsp)
movb $0x0, -0x1(%r14)
cmpb $0x2a, (%rsi)
jne 0x125a2
cmpb $0x0, 0x2(%rax)
je 0x12669
cmpl $0x0, (%r15)
jne 0x125b8
leaq 0x44f99(%rip), %rax     # 0x57548
cmpl $0x0, (%rax)
jg 0x128c5
movq %r15, %rdi
callq 0x1118f
movl %eax, (%rbx)
testl %eax, %eax
jns 0x1266c
leaq 0x44f77(%rip), %rax     # 0x57548
cmpl $0x2, (%rax)
jl 0x1266c
movq 0x449ef(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x31dbf(%rip), %rsi     # 0x443aa
leaq 0x31d74(%rip), %rdx     # 0x44366
xorl %eax, %eax
callq 0x4770
jmp 0x1266c
movq 0x449ce(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x31d40(%rip), %rsi     # 0x4434c
leaq 0x31d53(%rip), %rdx     # 0x44366
xorl %eax, %eax
callq 0x4770
jmp 0x124dd
movq 0x449aa(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x31d41(%rip), %rsi     # 0x44371
leaq 0x31d2f(%rip), %rdx     # 0x44366
xorl %eax, %eax
callq 0x4770
movq 0x8(%rsp), %rbx
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rbx)
pshufd $0xe8, 0x30(%rsp), %xmm0 # xmm0 = mem[0,2,2,3]
movq %xmm0, 0x20(%rbx)
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
orl $-0x1, (%rbx)
leaq 0x28(%rsp), %r12
pushq $0xa
popq %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x4760
decl %eax
movl %eax, 0x4(%rbx)
movq (%r12), %rcx
leaq 0x1(%rcx), %r14
movq %r14, (%r12)
cmpb $0x9, (%rcx)
jne 0x12643
movl (%rbx), %ecx
testl %eax, %eax
js 0x126a1
testl %ecx, %ecx
jns 0x126bc
jmp 0x126b8
testl %ecx, %ecx
js 0x126b8
leaq 0x44e9c(%rip), %rax     # 0x57548
cmpl $0x2, (%rax)
jge 0x12b85
orl $-0x1, (%rbx)
orb $0x4, 0xc(%rbx)
leaq 0x28(%rsp), %r12
pushq $0xa
popq %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x4760
movq 0x8(%rbx), %rcx
movzbl %al, %eax
shll $0x10, %eax
movq %rcx, %rdx
andq $-0xff0001, %rdx        # imm = 0xFF00FFFF
orq %rax, %rdx
movq %rdx, 0x8(%rbx)
movq (%r12), %r12
cmpb $0x9, (%r12)
jne 0x12643
leaq 0x1(%r12), %r13
movb (%r13), %al
pushq $0x1
popq %r14
cmpb $0x2a, %al
jne 0x12757
movabsq $0x400000000, %rbx      # imm = 0x400000000
btq $0x22, %rcx
jb 0x1272b
leaq 0x44e26(%rip), %rax     # 0x57548
cmpl $0x2, (%rax)
jge 0x129e0
orq %rbx, %rdx
movq 0x8(%rsp), %rbx
movq %rdx, 0x8(%rbx)
addq $0x2, %r12
movzbl -0x1(%r12), %eax
testl %eax, %eax
je 0x12643
cmpl $0x9, %eax
je 0x1289f
incq %r12
jmp 0x1273b
movq %rdx, 0x18(%rsp)
movq %r13, (%rsp)
addq $0x2, %r12
xorl %ebx, %ebx
testb %al, %al
je 0x12792
movzbl %al, %r14d
cmpl $0x9, %r14d
je 0x12792
callq 0x4580
movq (%rax), %rax
movb 0x1(%rax,%r14,2), %al
andb $0x8, %al
cmpb $0x1, %al
adcq $0x0, %rbx
movb (%r12), %al
incq %r12
jmp 0x12766
movq %r12, 0x28(%rsp)
cmpb $0x9, %al
jne 0x1263e
testq %rbx, %rbx
sete %cl
leaq 0x44d9c(%rip), %rax     # 0x57548
movl (%rax), %eax
testl %eax, %eax
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x12ba9
testl %eax, %eax
setg %al
cmpq $0x10000, %rbx          # imm = 0x10000
setae %cl
andb %al, %cl
cmpb $0x1, %cl
je 0x12bbf
movq %rbx, %rax
shlq $0x30, %rax
movabsq $0xffffffffffff, %rcx   # imm = 0xFFFFFFFFFFFF
movq 0x18(%rsp), %rdx
andq %rcx, %rdx
orq %rax, %rdx
movq 0x8(%rsp), %rax
movq %rdx, 0x8(%rax)
movzwl %bx, %esi
shll $0x2, %esi
leaq 0x30(%rsp), %rbx
addq (%rbx), %rsi
movq %rbx, %rdi
callq 0x13205
movq (%rbx), %rcx
movq 0x10(%rbx), %r14
addq %rcx, %r14
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, %rdx
shrq $0x30, %rdx
leaq (%rcx,%rdx,4), %rcx
movq %rcx, (%rbx)
xorl %ebx, %ebx
movq %rax, %rdi
shrq $0x30, %rdi
cmpq %rdi, %rbx
jae 0x128ac
movq %r13, %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x4760
shll $0x4, %eax
movl %eax, (%r14,%rbx,4)
movq (%rsp), %r13
movsbq (%r13), %rdx
pushq $-0x1
popq %rcx
testq %rdx, %rdx
js 0x12870
movq 0x18(%r15), %rcx
movsbl (%rcx,%rdx), %ecx
testl %ecx, %ecx
jns 0x12884
leaq 0x44ccd(%rip), %rdx     # 0x57548
cmpl $0x0, (%rdx)
jg 0x12bd5
orl %eax, %ecx
movl %ecx, (%r14,%rbx,4)
incq %rbx
incq %r13
movq %r13, (%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
jmp 0x12836
movq %r12, 0x28(%rsp)
movb $0x0, -0x1(%r12)
jmp 0x128f2
btq $0x22, %rax
jb 0x128e9
movq %r14, %rsi
callq 0x11342
movl %eax, %r14d
movq 0x8(%rsp), %rbx
jmp 0x128f2
movq 0x44704(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x31ab8(%rip), %rsi     # 0x4438e
leaq 0x31a89(%rip), %rdx     # 0x44366
xorl %eax, %eax
callq 0x4770
jmp 0x12643
movq 0x8(%rsp), %rbx
pushq $0x1
popq %r14
movslq 0x4(%rbx), %r8
movslq %r14d, %rax
leaq (%r8,%rax), %r9
decq %r9
movl $0x1249, %edi           # imm = 0x1249
pushq $0xe
popq %rax
pushq $0xc
popq %rdx
xorl %esi, %esi
pushq $-0x1
popq %r10
cmpl $-0x3, %edx
je 0x1294d
movq %r8, %r11
movl %eax, %ecx
sarq %cl, %r11
movq %r9, %rbx
sarq %cl, %rbx
cmpq %rbx, %r11
je 0x12942
movl %r10d, %r11d
movl %edx, %ecx
shll %cl, %r11d
addq $0x3, %rax
addl %r11d, %edi
addl $-0x3, %edx
movq 0x8(%rsp), %rbx
jmp 0x12911
addl %r11d, %edi
movzwl %di, %esi
movq 0x8(%rsp), %rbx
movw %si, 0x8(%rbx)
movq %r12, (%rsp)
leaq 0x1(%r12), %r14
movzbl -0x1(%r14), %eax
testl %eax, %eax
je 0x12643
cmpl $0x9, %eax
je 0x12971
incq %r14
jmp 0x1295a
movq %r14, 0x28(%rsp)
movb $0x0, -0x1(%r14)
movzbl (%r12), %eax
cmpl $0x2a, %eax
je 0x12999
cmpl $0x3d, %eax
jne 0x129a1
cmpb $0x0, 0x1(%r12)
jne 0x129a1
movl (%rbx), %eax
movl %eax, 0x14(%rbx)
jmp 0x12a11
cmpb $0x0, 0x1(%r12)
je 0x12a0d
movq %r15, %rdi
movq %r12, %rsi
callq 0x1118f
movl %eax, 0x14(%rbx)
testl %eax, %eax
jns 0x12a11
leaq 0x44b8e(%rip), %rax     # 0x57548
cmpl $0x2, (%rax)
jl 0x12a11
movq 0x4460a(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x31afc(%rip), %rsi     # 0x444cc
leaq 0x3198f(%rip), %rdx     # 0x44366
xorl %eax, %eax
callq 0x4770
jmp 0x12a11
movq 0x445e9(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x31a9e(%rip), %rsi     # 0x4448f
leaq 0x3196e(%rip), %rdx     # 0x44366
xorl %eax, %eax
callq 0x4770
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdx
jmp 0x1272b
orl $-0x1, 0x14(%rbx)
leaq 0x28(%rsp), %r15
pushq $0xa
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4760
decl %eax
movl %eax, 0x18(%rbx)
movq (%r15), %rcx
leaq 0x1(%rcx), %r14
movq %r14, (%r15)
cmpb $0x9, (%rcx)
jne 0x12643
testl %eax, %eax
jns 0x12a5a
cmpl $0x0, 0x14(%rbx)
js 0x12a5a
leaq 0x44afb(%rip), %rax     # 0x57548
cmpl $0x2, (%rax)
jge 0x1314e
orl $-0x1, 0x14(%rbx)
leaq 0x28(%rsp), %r15
pushq $0xa
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4760
movl %eax, 0x1c(%rbx)
movq (%r15), %r12
cmpb $0x9, (%r12)
jne 0x12643
xorl %r15d, %r15d
movzbl 0x1(%r12,%r15), %eax
testl %eax, %eax
je 0x12643
cmpl $0x9, %eax
je 0x12a99
incq %r15
jmp 0x12a81
leaq (%r12,%r15), %r13
addq $0x2, %r13
movq %r13, 0x28(%rsp)
movb $0x0, -0x1(%r13)
cmpb $0x2a, 0x1(%r12)
jne 0x12abf
cmpb $0x0, 0x2(%r12)
je 0x12beb
movl %r15d, 0x10(%rbx)
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
shrq $0x30, %rdi
movl %ebx, %esi
shrl $0x18, %esi
addq 0x40(%rsp), %rsi
callq 0x11307
movabsq $0xffffffffffff, %rcx   # imm = 0xFFFFFFFFFFFF
incq %rcx
cmpq %rcx, %rbx
jb 0x12b06
movl %eax, %eax
cmpl %r15d, %eax
je 0x12b06
leaq 0x44a4b(%rip), %rax     # 0x57548
cmpl $0x0, (%rax)
jg 0x1319e
leal 0x1(%r15), %eax
sarl %eax
cltq
leaq 0x30(%rsp), %r14
movq (%r14), %rsi
addq %rax, %rsi
movq %rax, %rbx
movq %r14, %rdi
callq 0x13205
movq (%r14), %rax
movq %r14, %rcx
movq 0x10(%r14), %r14
addq %rax, %r14
movq %rbx, %rdx
addq %rbx, %rax
movq %rax, (%rcx)
xorl %ebx, %ebx
movq %r14, %rdi
xorl %esi, %esi
callq 0x42e0
leaq 0x30eb3(%rip), %rax     # 0x43a00
xorl %edx, %edx
movq 0x8(%rsp), %rcx
movslq 0x10(%rcx), %rcx
cmpq %rcx, %rdx
jge 0x12bef
movsbq 0x1(%r12,%rdx), %rcx
movb (%rax,%rcx), %sil
movl %ebx, %ecx
notb %cl
andb $0x4, %cl
shlb %cl, %sil
movl %edx, %ecx
shrl %ecx
orb %sil, (%r14,%rcx)
incq %rdx
addb $0x4, %bl
jmp 0x12b4f
movq 0x44444(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x3184d(%rip), %rsi     # 0x443e3
leaq 0x317c9(%rip), %rdx     # 0x44366
xorl %eax, %eax
callq 0x4770
jmp 0x126b5
movq 0x44420(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x31870(%rip), %rsi     # 0x4442a
jmp 0x12630
movq 0x4440a(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x31877(%rip), %rsi     # 0x44447
jmp 0x12630
movq 0x443f4(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x31884(%rip), %rsi     # 0x4446a
jmp 0x12630
andl $0x0, 0x10(%rbx)
leaq (%r12,%r15), %rax
addq $0x3, %rax
movq %r13, (%rsp)
xorl %ebx, %ebx
movzbl -0x1(%rax), %ecx
testl %ecx, %ecx
je 0x12c12
cmpl $0x9, %ecx
je 0x12c12
incq %rax
incq %rbx
jmp 0x12bfd
movq %rax, 0x28(%rsp)
movb $0x0, -0x1(%rax)
movq 0x8(%rsp), %r14
movslq 0x10(%r14), %rsi
leaq 0x30(%rsp), %rdi
addq (%rdi), %rsi
callq 0x13205
leaq 0x30(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rax), %rdi
movq %rax, %rsi
addq %rcx, %rdi
movl 0x10(%r14), %eax
movslq %eax, %rdx
addq %rdx, %rcx
movq %rcx, (%rsi)
cmpb $0x2a, (%r13)
jne 0x12c5f
cmpb $0x0, 0x3(%r12,%r15)
je 0x12c96
cmpq %rbx, %rdx
je 0x12c74
leaq 0x448dd(%rip), %rcx     # 0x57548
cmpl $0x0, (%rcx)
jg 0x13188
xorl %ecx, %ecx
movq 0x8(%rsp), %rbx
cltq
cmpq %rax, %rcx
jge 0x12ca5
movb (%r13), %al
addb $-0x21, %al
movb %al, (%rdi,%rcx)
incq %rcx
movl 0x10(%rbx), %eax
incq %r13
jmp 0x12c7b
movl $0xff, %esi
callq 0x42e0
movq 0x8(%rsp), %rbx
movq 0x28(%rsp), %r13
leaq 0x31925(%rip), %rax     # 0x445d6
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rcx
movq 0x10(%rcx), %rax
addq (%rcx), %rax
cmpq %rax, %r13
jae 0x13147
movq %r13, (%rsp)
pushq $0x4
popq %r15
movq %r13, %r12
movzbl (%r12), %eax
testl %eax, %eax
je 0x12cec
cmpl $0x9, %eax
je 0x12cec
incq %r12
decq %r15
jmp 0x12cd6
movb $0x0, (%r12)
leaq -0x5(%r15), %rax
cmpq $-0x6, %rax
jl 0x12d0b
leaq 0x44846(%rip), %rax     # 0x57548
cmpl $0x0, (%rax)
jg 0x13172
leaq 0x1(%r12), %rax
movq %rax, 0x18(%rsp)
movq %r13, %rdi
pushq $0x2
popq %rsi
leaq 0x30(%rsp), %rdx
callq 0x131ca
leaq 0x4(%r13), %rax
movq %rax, (%rsp)
movzbl 0x3(%r13), %edi
leaq 0x5(%r13), %r14
movq %r14, (%rsp)
leal -0x41(%rdi), %eax
cmpl $0x22, %eax
ja 0x12d78
movabsq $0x500000005, %rcx      # imm = 0x500000005
btq %rax, %rcx
jae 0x12d78
pushq $0x41
popq %rdi
leaq 0x30(%rsp), %r15
movq %r15, %rsi
callq 0x1327c
movsbl (%r14), %edi
movq %r15, %rsi
callq 0x1327c
movq 0x18(%rsp), %r13
jmp 0x12cb6
movl %edi, %eax
andb $-0x21, %al
cmpb $0x49, %al
jne 0x12da5
cmpb $0x2d, (%r14)
jne 0x12de6
movq %r14, %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x4760
movq %rax, %r14
cmpq $-0x80, %rax
jl 0x12e35
pushq $0x63
jmp 0x12e01
cmpl $0x42, %edi
je 0x12ec2
cmpl $0x48, %edi
je 0x12e17
cmpl $0x5a, %edi
je 0x12e17
cmpl $0x64, %edi
je 0x12e7b
cmpl $0x66, %edi
jne 0x12ea8
movq %r14, %rdi
movq %rsp, %rsi
callq 0x4400
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rsp)
pushq $0x66
jmp 0x130be
movq %r14, %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x4170
movq %rax, %r14
cmpq $0xff, %rax
ja 0x12e4c
pushq $0x43
popq %rdi
leaq 0x30(%rsp), %r15
movq %r15, %rsi
callq 0x1327c
movl %r14d, %edi
jmp 0x12d66
leaq 0x30(%rsp), %r12
movq %r12, %rsi
callq 0x1327c
negl %r15d
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rdx
jmp 0x130d7
cmpq $-0x8000, %r14          # imm = 0x8000
jb 0x130ae
movw %r14w, 0x20(%rsp)
pushq $0x73
jmp 0x12e61
cmpq $0xffff, %r14           # imm = 0xFFFF
ja 0x130b7
movw %r14w, 0x20(%rsp)
pushq $0x53
popq %rdi
leaq 0x30(%rsp), %r14
movq %r14, %rsi
callq 0x1327c
leaq 0x20(%rsp), %rdi
pushq $0x2
jmp 0x130d3
movq %r14, %rdi
movq %rsp, %rsi
callq 0x4400
movsd %xmm0, 0x20(%rsp)
pushq $0x64
popq %rdi
leaq 0x30(%rsp), %r14
movq %r14, %rsi
callq 0x1327c
leaq 0x20(%rsp), %rdi
pushq $0x8
jmp 0x130d3
leaq 0x44699(%rip), %rax     # 0x57548
cmpl $0x0, (%rax)
movq 0x18(%rsp), %r13
jle 0x12cb6
jmp 0x131b4
cmpq $-0x3, %r15
jl 0x12ed8
leaq 0x44679(%rip), %rax     # 0x57548
cmpl $0x0, (%rax)
jg 0x1312c
leaq 0x6(%r13), %r15
movq %r15, (%rsp)
movzbl 0x5(%r13), %r14d
andl $0x0, 0x20(%rsp)
xorl %eax, %eax
movq %r15, %rcx
movzbl (%rcx), %edx
cmpl $0x2c, %edx
je 0x12efd
testl %edx, %edx
jne 0x12eff
jmp 0x12f04
incl %eax
incq %rcx
jmp 0x12eef
movl %eax, 0x20(%rsp)
pushq $0x42
popq %rdi
leaq 0x30(%rsp), %r13
movq %r13, %rsi
callq 0x1327c
movl %r14d, %edi
movq %r13, %rsi
callq 0x1327c
leaq 0x20(%rsp), %rdi
pushq $0x4
popq %rsi
movq %r13, %rdx
callq 0x131ca
cmpl $0x43, %r14d
je 0x130e1
cmpl $0x49, %r14d
movq %rsp, %r13
je 0x130a4
cmpl $0x53, %r14d
je 0x13070
cmpl $0x63, %r14d
je 0x12fd2
cmpl $0x73, %r14d
je 0x1303b
cmpl $0x69, %r14d
je 0x13006
cmpl $0x66, %r14d
jne 0x13110
cmpq %r12, %r15
jae 0x12d6e
incq %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x4400
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x14(%rsp)
leaq 0x14(%rsp), %rdi
pushq $0x4
popq %rsi
leaq 0x30(%rsp), %rdx
callq 0x131ca
movq (%rsp), %r15
jmp 0x12f78
incq %r15
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x4760
movsbl %al, %edi
leaq 0x30(%rsp), %rsi
callq 0x1327c
movq (%rsp), %r15
cmpq %r12, %r15
jb 0x12fb1
jmp 0x12d6e
incq %r15
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x4760
movl %eax, 0x14(%rsp)
leaq 0x14(%rsp), %rdi
pushq $0x4
popq %rsi
leaq 0x30(%rsp), %rdx
callq 0x131ca
movq (%rsp), %r15
cmpq %r12, %r15
jb 0x12fdc
jmp 0x12d6e
incq %r15
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x4760
movw %ax, 0x14(%rsp)
leaq 0x14(%rsp), %rdi
pushq $0x2
popq %rsi
leaq 0x30(%rsp), %rdx
callq 0x131ca
movq (%rsp), %r15
cmpq %r12, %r15
jb 0x13010
jmp 0x12d6e
incq %r15
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x4170
movw %ax, 0x14(%rsp)
leaq 0x14(%rsp), %rdi
pushq $0x2
popq %rsi
leaq 0x30(%rsp), %rdx
callq 0x131ca
movq (%rsp), %r15
cmpq %r12, %r15
jb 0x13045
jmp 0x12d6e
incq %r15
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x4170
movl %eax, 0x14(%rsp)
leaq 0x14(%rsp), %rdi
pushq $0x4
popq %rsi
leaq 0x30(%rsp), %rdx
callq 0x131ca
movq (%rsp), %r15
cmpq %r12, %r15
jb 0x1307a
jmp 0x12d6e
movl %r14d, 0x20(%rsp)
pushq $0x69
jmp 0x130be
movl %r14d, 0x20(%rsp)
pushq $0x49
popq %rdi
leaq 0x30(%rsp), %r14
movq %r14, %rsi
callq 0x1327c
leaq 0x20(%rsp), %rdi
pushq $0x4
popq %rsi
movq %r14, %rdx
callq 0x131ca
jmp 0x12d6e
movq %rsp, %r14
cmpq %r12, %r15
jae 0x12d6e
incq %r15
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4170
movzbl %al, %edi
leaq 0x30(%rsp), %rsi
callq 0x1327c
movq (%rsp), %r15
jmp 0x130e4
leaq 0x44431(%rip), %rax     # 0x57548
cmpl $0x0, (%rax)
jle 0x12d6e
leaq 0x314d5(%rip), %rax     # 0x445fc
movq %rax, 0x48(%rsp)
movq 0x43e9d(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x31229(%rip), %rdx     # 0x44366
movq 0x48(%rsp), %rsi
jmp 0x12637
xorl %ebp, %ebp
jmp 0x12643
movq 0x43e7b(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x313ab(%rip), %rsi     # 0x4450a
leaq 0x31200(%rip), %rdx     # 0x44366
xorl %eax, %eax
callq 0x4770
jmp 0x12a56
movq 0x43e57(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x31435(%rip), %rsi     # 0x445b8
jmp 0x128d6
movq 0x43e41(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x313f1(%rip), %rsi     # 0x4458a
jmp 0x12630
movq 0x43e2b(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x313a1(%rip), %rsi     # 0x44550
jmp 0x12630
movq 0x43e15(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x31437(%rip), %rsi     # 0x445fc
jmp 0x128d6