// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x80(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x4250
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movl $0x9, %esi
callq 0x4170
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
jne 0x396a9
jmp 0x3a33d
movq -0x88(%rbp), %rax
movb $0x0, (%rax)
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x396c4
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
cmpq $0x1, %rax
jg 0x396ef
movl $0x3, %edi
leaq 0xb87ab(%rip), %rsi     # 0xf1e8c
leaq 0xb87af(%rip), %rdx     # 0xf1e97
movb $0x0, %al
callq 0x1b030
jmp 0x396f1
jmp 0x396f3
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
cmpq $0xff, %rax
jle 0x39725
movl $0x1, %edi
leaq 0xb877a(%rip), %rsi     # 0xf1e8c
leaq 0xb878f(%rip), %rdx     # 0xf1ea8
movb $0x0, %al
callq 0x1b030
jmp 0x3a33d
jmp 0x39727
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rax
subq %rax, %rsi
addq $0x4, %rsi
callq 0x3a350
cmpl $0x0, %eax
jge 0x39749
jmp 0x3a33d
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x20(%rbp), %rax
movslq 0x40(%rax), %rax
addq %rax, %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rax
subq %rax, %rdx
callq 0x43b0
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rax
subq %rax, %rdx
movq -0x20(%rbp), %rax
movslq 0x40(%rax), %rcx
addq %rdx, %rcx
movl %ecx, 0x40(%rax)
movq -0x20(%rbp), %rax
movl 0x40(%rax), %ecx
andl $0x3, %ecx
movl $0x4, %eax
subl %ecx, %eax
andl $0x3, %eax
movb %al, %cl
movq -0x80(%rbp), %rax
movb %cl, 0xf(%rax)
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x20(%rbp), %rax
movslq 0x40(%rax), %rax
addq %rax, %rdi
movq -0x80(%rbp), %rax
movzbl 0xf(%rax), %eax
movl %eax, %edx
leaq 0xb80c6(%rip), %rsi     # 0xf1890
callq 0x43b0
movq -0x80(%rbp), %rax
movzbl 0xf(%rax), %ecx
movq -0x20(%rbp), %rax
addl 0x40(%rax), %ecx
movl %ecx, 0x40(%rax)
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movq -0x80(%rbp), %rcx
movzbl 0xf(%rcx), %ecx
addq %rcx, %rax
movw %ax, %cx
movq -0x80(%rbp), %rax
movw %cx, 0x12(%rax)
movq -0x30(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x3a3d0
movw %ax, %cx
movq -0x80(%rbp), %rax
movw %cx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movsbl (%rax), %eax
cmpl $0x9, %eax
je 0x3983a
jmp 0x3a33d
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movl $0x9, %esi
callq 0x4170
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0x39866
jmp 0x3a33d
movq -0x90(%rbp), %rax
movb $0x0, (%rax)
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rdi
leaq 0xb9439(%rip), %rsi     # 0xf2cc3
callq 0x4690
cmpl $0x0, %eax
je 0x39950
jmp 0x3989a
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x398c2
movl $0x1, %edi
leaq 0xb85dd(%rip), %rsi     # 0xf1e8c
leaq 0xb8606(%rip), %rdx     # 0xf1ebc
movb $0x0, %al
callq 0x1b030
jmp 0x3a33d
jmp 0x398c4
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x32d80
movl %eax, %ecx
movq -0x80(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x80(%rbp), %rax
cmpl $-0x1, 0x8(%rax)
jge 0x39903
movl $0x1, %edi
leaq 0xb859c(%rip), %rsi     # 0xf1e8c
leaq 0xb85e7(%rip), %rdx     # 0xf1ede
movb $0x0, %al
callq 0x1b030
jmp 0x3a33d
jmp 0x39905
jmp 0x39907
movq -0x80(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jge 0x3994c
leaq -0x70(%rbp), %rdi
movq -0x38(%rbp), %rcx
movl $0x28, %esi
movl $0x22, %edx
movq $-0x1, %r8
callq 0x4c870
movq %rax, %rcx
movl $0x3, %edi
leaq 0xb854e(%rip), %rsi     # 0xf1e8c
leaq 0xb85b0(%rip), %rdx     # 0xf1ef5
movb $0x0, %al
callq 0x1b030
jmp 0x3994e
jmp 0x3995b
movq -0x80(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x3e, %edx
leaq -0x40(%rbp), %rcx
callq 0x3a4a0
movq %rax, %rcx
subq $0x1, %rcx
movq -0x80(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movsbl (%rax), %eax
cmpl $0x9, %eax
je 0x3999b
jmp 0x3a33d
movq -0x80(%rbp), %rax
cmpq $0x0, (%rax)
jge 0x399d6
movq -0x80(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jl 0x399d6
jmp 0x399b1
movl $0x3, %edi
leaq 0xb84cf(%rip), %rsi     # 0xf1e8c
leaq 0xb8565(%rip), %rdx     # 0xf1f29
movb $0x0, %al
callq 0x1b030
movq -0x80(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq -0x80(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jge 0x399ef
movq -0x80(%rbp), %rax
movzwl 0x10(%rax), %ecx
orl $0x4, %ecx
movw %cx, 0x10(%rax)
movq -0x30(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
leaq -0x40(%rbp), %rcx
callq 0x3a4a0
movb %al, %cl
movq -0x80(%rbp), %rax
movb %cl, 0xe(%rax)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movsbl (%rax), %eax
cmpl $0x9, %eax
je 0x39a2a
jmp 0x3a33d
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
je 0x39b00
movq $0x0, -0x98(%rbp)
movq -0x20(%rbp), %rax
movl 0x40(%rax), %eax
movl %eax, -0x9c(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x30(%rbp), %rsi
callq 0x3a660
movl %eax, -0xa0(%rbp)
cmpl $0x1, -0xa0(%rbp)
jl 0x39a89
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movsbl (%rax), %eax
cmpl $0x9, %eax
je 0x39a8e
jmp 0x3a33d
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x9c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movq -0x80(%rbp), %rax
movzwl 0x10(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x39ad3
movq -0x80(%rbp), %rax
movl 0x14(%rax), %edi
movq -0x98(%rbp), %rsi
callq 0x339b0
movq %rax, -0x100(%rbp)
jmp 0x39ae1
movl $0x1, %eax
movq %rax, -0x100(%rbp)
jmp 0x39ae1
movq -0x100(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x39afb
movq $0x1, -0x78(%rbp)
jmp 0x39b8a
jmp 0x39b02
movq -0x80(%rbp), %rax
movzwl 0x10(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x39b2c
movl $0x3, %edi
leaq 0xb836e(%rip), %rsi     # 0xf1e8c
leaq 0xb8442(%rip), %rdx     # 0xf1f67
movb $0x0, %al
callq 0x1b030
jmp 0x39b2e
movq -0x80(%rbp), %rax
movzwl 0x10(%rax), %ecx
orl $0x4, %ecx
movw %cx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movl $0x9, %esi
callq 0x4170
movq %rax, -0xa8(%rbp)
cmpq $0x0, -0xa8(%rbp)
jne 0x39b69
jmp 0x3a33d
movq -0xa8(%rbp), %rax
movb $0x0, (%rax)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq $0x1, -0x78(%rbp)
jmp 0x39b8c
movabsq $0x7fffffff7fffffff, %rax # imm = 0x7FFFFFFF7FFFFFFF
subq -0x78(%rbp), %rax
movq -0x80(%rbp), %rcx
cmpq (%rcx), %rax
jg 0x39bc2
movl $0x1, %edi
leaq 0xb82dd(%rip), %rsi     # 0xf1e8c
leaq 0xb83e5(%rip), %rdx     # 0xf1f9b
movb $0x0, %al
callq 0x1b030
jmp 0x3a33d
jmp 0x39bc4
movq -0x80(%rbp), %rax
movq (%rax), %rdi
movq -0x80(%rbp), %rax
movq (%rax), %rsi
addq -0x78(%rbp), %rsi
movl $0xe, %edx
movl $0x5, %ecx
callq 0x33880
movw %ax, %cx
movq -0x80(%rbp), %rax
movw %cx, 0xc(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movl $0x9, %esi
callq 0x4170
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
jne 0x39c1c
jmp 0x3a33d
movq -0xb0(%rbp), %rax
movb $0x0, (%rax)
movq -0xb0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rdi
leaq 0xbc587(%rip), %rsi     # 0xf61c7
callq 0x4690
cmpl $0x0, %eax
jne 0x39c5d
movq -0x80(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x80(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x39d10
movq -0x38(%rbp), %rdi
leaq 0xb905b(%rip), %rsi     # 0xf2cc3
callq 0x4690
cmpl $0x0, %eax
jne 0x39c82
movq -0x80(%rbp), %rax
movl $0xffffffff, 0x1c(%rax) # imm = 0xFFFFFFFF
jmp 0x39d0e
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x32d80
movl %eax, %ecx
movq -0x80(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x80(%rbp), %rax
cmpl $-0x1, 0x1c(%rax)
jge 0x39cc1
movl $0x1, %edi
leaq 0xb81de(%rip), %rsi     # 0xf1e8c
leaq 0xb8229(%rip), %rdx     # 0xf1ede
movb $0x0, %al
callq 0x1b030
jmp 0x3a33d
jmp 0x39cc3
jmp 0x39cc5
movq -0x80(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
jge 0x39d0a
leaq -0x70(%rbp), %rdi
movq -0x38(%rbp), %rcx
movl $0x28, %esi
movl $0x22, %edx
movq $-0x1, %r8
callq 0x4c870
movq %rax, %rcx
movl $0x3, %edi
leaq 0xb8190(%rip), %rsi     # 0xf1e8c
leaq 0xb82c4(%rip), %rdx     # 0xf1fc7
movb $0x0, %al
callq 0x1b030
jmp 0x39d0c
jmp 0x39d0e
jmp 0x39d10
movq -0x30(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x3e, %edx
leaq -0x40(%rbp), %rcx
callq 0x3a4a0
movq %rax, %rcx
subq $0x1, %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movsbl (%rax), %eax
cmpl $0x9, %eax
je 0x39d51
jmp 0x3a33d
movq -0x80(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jge 0x39d8d
movq -0x80(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
jl 0x39d8d
jmp 0x39d68
movl $0x3, %edi
leaq 0xb8118(%rip), %rsi     # 0xf1e8c
leaq 0xb8285(%rip), %rdx     # 0xf2000
movb $0x0, %al
callq 0x1b030
movq -0x80(%rbp), %rax
movl $0xffffffff, 0x1c(%rax) # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x3f, %edx
leaq -0x40(%rbp), %rcx
callq 0x3a890
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movsbl (%rax), %eax
cmpl $0x9, %eax
je 0x39dca
jmp 0x3a33d
jmp 0x39dcc
cmpl $0x0, -0x40(%rbp)
je 0x39df1
movl $0x1, %edi
leaq 0xb80ae(%rip), %rsi     # 0xf1e8c
leaq 0xb8258(%rip), %rdx     # 0xf203d
movb $0x0, %al
callq 0x1b030
jmp 0x3a33d
jmp 0x39df3
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movl $0x9, %esi
callq 0x4170
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0xb8(%rbp)
jne 0x39e1f
jmp 0x3a33d
movq -0xb8(%rbp), %rax
movb $0x0, (%rax)
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rdi
leaq 0xb8e80(%rip), %rsi     # 0xf2cc3
callq 0x4690
cmpl $0x0, %eax
je 0x3a043
jmp 0x39e53
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
subq $0x1, %rax
cmpq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
jle 0x39e89
movl $0x1, %edi
leaq 0xb8016(%rip), %rsi     # 0xf1e8c
leaq 0xb81dd(%rip), %rdx     # 0xf205a
movb $0x0, %al
callq 0x1b030
jmp 0x3a33d
jmp 0x39e8b
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x80(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x80(%rbp), %rax
movl 0x14(%rax), %edi
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x80(%rbp), %rax
movzwl 0x12(%rax), %eax
cltq
addq %rax, %rsi
callq 0x33940
movq %rax, -0xc0(%rbp)
movq -0x80(%rbp), %rax
cmpl $0x0, 0x14(%rax)
je 0x39f08
movq -0xc0(%rbp), %rax
movq -0x80(%rbp), %rcx
movslq 0x18(%rcx), %rcx
cmpq %rcx, %rax
je 0x39f08
movl $0x1, %edi
leaq 0xb7f97(%rip), %rsi     # 0xf1e8c
leaq 0xb7dd3(%rip), %rdx     # 0xf1ccf
movb $0x0, %al
callq 0x1b030
jmp 0x3a33d
jmp 0x39f0a
movq -0x80(%rbp), %rax
movl 0x18(%rax), %eax
addl $0x1, %eax
sarl %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x3c(%rbp), %rsi
callq 0x3a350
cmpl $0x0, %eax
jge 0x39f30
jmp 0x3a33d
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x40(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl -0x3c(%rbp), %ecx
movq -0x20(%rbp), %rax
addl 0x40(%rax), %ecx
movl %ecx, 0x40(%rax)
movq -0x80(%rbp), %rax
movl 0x18(%rax), %eax
andl $-0x2, %eax
movl %eax, -0xc4(%rbp)
movl $0x0, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
cmpl -0xc4(%rbp), %eax
jae 0x39fe0
movq -0x38(%rbp), %rax
movl -0xc8(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0xb5b9d(%rip), %rax     # 0xefb30
movzbl (%rax,%rcx), %eax
shll $0x4, %eax
movq -0x38(%rbp), %rcx
movl -0xc8(%rbp), %edx
addl $0x1, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
leaq 0xb5b7a(%rip), %rcx     # 0xefb30
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movb %al, %dl
movq -0x28(%rbp), %rax
movl -0xc8(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0xc8(%rbp), %eax
addl $0x2, %eax
movl %eax, -0xc8(%rbp)
jmp 0x39f6e
jmp 0x39fe2
movl -0xc8(%rbp), %eax
movq -0x80(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jae 0x3a041
movq -0x38(%rbp), %rax
movl -0xc8(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0xb5b28(%rip), %rax     # 0xefb30
movzbl (%rax,%rcx), %eax
movl -0xc8(%rbp), %ecx
xorl $-0x1, %ecx
andl $0x1, %ecx
shll $0x2, %ecx
shll %cl, %eax
movb %al, %dl
movq -0x28(%rbp), %rax
movl -0xc8(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0xc8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
jmp 0x39fe2
jmp 0x3a04e
movq -0x80(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x20(%rbp), %rdi
movq -0x80(%rbp), %rax
movslq 0x18(%rax), %rsi
callq 0x3a350
cmpl $0x0, %eax
jge 0x3a069
jmp 0x3a33d
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x40(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x80(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x20(%rbp), %rax
addl 0x40(%rax), %ecx
movl %ecx, 0x40(%rax)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x3a0de
movq -0x30(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x9, %eax
je 0x3a0b7
movq -0x30(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x3a0de
movq -0x28(%rbp), %rdi
movq -0x80(%rbp), %rax
movslq 0x18(%rax), %rdx
movl $0xff, %esi
callq 0x4250
movq -0x30(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
jmp 0x3a2ec
movl $0x0, -0xcc(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rdx
movq 0x10(%rdx), %rdx
subq %rdx, %rcx
subq %rcx, %rax
movq -0x80(%rbp), %rcx
movslq 0x18(%rcx), %rcx
cmpq %rcx, %rax
jb 0x3a138
movq -0x30(%rbp), %rax
movq -0x80(%rbp), %rcx
movslq 0x18(%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x9, %eax
je 0x3a157
movq -0x30(%rbp), %rax
movq -0x80(%rbp), %rcx
movslq 0x18(%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x3a157
movl $0x1, %edi
leaq 0xb7d48(%rip), %rsi     # 0xf1e8c
leaq 0xb7f29(%rip), %rdx     # 0xf2074
movb $0x0, %al
callq 0x1b030
jmp 0x3a33d
jmp 0x3a159
jmp 0x3a15b
movq -0x30(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq $0x0, -0xe8(%rbp)
movq -0x80(%rbp), %rax
movl 0x18(%rax), %eax
sarl $0x3, %eax
cltq
movq %rax, -0xf0(%rbp)
movq $0x0, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
cmpq -0xf0(%rbp), %rax
jae 0x3a20f
movq -0xd8(%rbp), %rax
movq -0xf8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movabsq $0x2121212121212121, %rax # imm = 0x2121212121212121
subq %rax, %rdx
movq -0xe0(%rbp), %rax
movq -0xf8(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0xe0(%rbp), %rax
movq -0xf8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
orq -0xe8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf8(%rbp)
jmp 0x3a19a
movq -0xf8(%rbp), %rax
shlq $0x3, %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movq -0x80(%rbp), %rcx
movslq 0x18(%rcx), %rcx
cmpq %rcx, %rax
jae 0x3a288
movq -0x30(%rbp), %rax
movq -0xf8(%rbp), %rcx
movsbl (%rax,%rcx), %eax
subl $0x21, %eax
movb %al, %dl
movq -0x28(%rbp), %rax
movq -0xf8(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x28(%rbp), %rax
movq -0xf8(%rbp), %rcx
movzbl (%rax,%rcx), %eax
orq -0xe8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf8(%rbp)
jmp 0x3a221
movabsq $-0x7f7f7f7f7f7f7f80, %rax # imm = 0x8080808080808080
andq -0xe8(%rbp), %rax
cmpq $0x0, %rax
seta %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0xcc(%rbp)
jmp 0x3a2ad
cmpl $0x0, -0xcc(%rbp)
je 0x3a2d2
movl $0x1, %edi
leaq 0xb7bca(%rip), %rsi     # 0xf1e8c
leaq 0xb7dd0(%rip), %rdx     # 0xf2099
movb $0x0, %al
callq 0x1b030
jmp 0x3a33d
jmp 0x3a2d4
movq -0x80(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rax
addq (%rax), %rsi
movq -0x20(%rbp), %rdx
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r8d
callq 0x3ab10
cmpl $0x0, %eax
jge 0x3a316
jmp 0x3a33d
movq -0x20(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x34230
cmpl $0x0, %eax
jge 0x3a334
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x3a344
movl $0x0, -0x4(%rbp)
jmp 0x3a344
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq