// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/hts.c
// Function: parse_tabbed_text
static int
parse_tabbed_text(char *columns, int column_len,
                  const unsigned char *u, const unsigned char *ulim,
                  int *complete)
{
    const char *str  = (const char *) u;
    const char *slim = (const char *) ulim;
    const char *s;
    int ncolumns = 0;

    enum { digit = 1, leading_sign = 2, cigar_operator = 4, other = 8 };
    unsigned seen = 0;
    *complete = 0;

    for (s = str; s < slim; s++)
        if (*s >= ' ') {
            if (isdigit_c(*s))
                seen |= digit;
            else if ((*s == '+' || *s == '-') && s == str)
                seen |= leading_sign;
            else if (strchr(BAM_CIGAR_STR, *s) && s > str && isdigit_c(s[-1]))
                seen |= cigar_operator;
            else
                seen |= other;
        }
        else if (*s == '\t' || *s == '\r' || *s == '\n') {
            size_t len = s - str;
            char type;

            if (seen == digit || seen == (leading_sign|digit)) type = 'i';
            else if (seen == (digit|cigar_operator)) type = 'C';
            else if (len == 1)
                switch (str[0]) {
                case '*': type = 'C'; break;
                case '+': case '-': case '.': type = 's'; break;
                default: type = 'Z'; break;
                }
            else if (len >= 5 && str[2] == ':' && str[4] == ':') type = 'O';
            else type = 'Z';

            columns[ncolumns++] = type;
            if (*s != '\t' || ncolumns >= column_len - 1) {
                *complete = 1; // finished the line or more columns than needed
                break;
            }

            str = s + 1;
            seen = 0;
        }
        else return -1;

    columns[ncolumns] = '\0';
    return ncolumns;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rcx, 0x20(%rsp)
movl $0x0, (%rcx)
xorl %eax, %eax
cmpq %rdx, %rsi
jae 0x1248e
movq %rsi, %r12
xorl %r15d, %r15d
movq %rsi, %r14
xorl %eax, %eax
movq %rsi, %r13
movq %rdx, 0x8(%rsp)
movsbq (%r12), %rbp
cmpq $0x20, %rbp
jl 0x123b0
movq %rax, 0x10(%rsp)
callq 0x4510
movq (%rax), %rbx
testb $0x8, 0x1(%rbx,%rbp,2)
jne 0x1240d
movzbl %bpl, %eax
cmpl $0x2d, %eax
movq %r13, %rcx
je 0x1236e
cmpl $0x2b, %eax
jne 0x12377
cmpq %rcx, %r12
je 0x1241d
movl $0xb, %edx
leaq 0x846a3(%rip), %rdi     # 0x96a26
movl %ebp, %esi
callq 0x4550
testq %rax, %rax
setne %al
cmpq %r13, %r12
seta %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x123aa
movzbl -0x1(%r12), %eax
testb $0x8, 0x1(%rbx,%rax,2)
jne 0x12426
orl $0x8, %r15d
jmp 0x12411
cmpb $0xd, %bpl
ja 0x124a9
movzbl %bpl, %ecx
movl $0x2600, %esi           # imm = 0x2600
btl %ecx, %esi
jae 0x124a9
movl %r15d, %ecx
andl $-0x3, %ecx
movb $0x69, %r8b
cmpl $0x1, %ecx
je 0x1244b
movb $0x43, %r8b
cmpl $0x5, %r15d
je 0x1244b
movq %r14, %rsi
subq %r13, %rsi
movq %rsi, %rcx
decq %rcx
je 0x1242c
cmpq $0x5, %rsi
jb 0x12408
cmpb $0x3a, 0x2(%r13)
jne 0x12408
movb $0x4f, %r8b
cmpb $0x3a, 0x4(%r13)
je 0x1244b
movb $0x5a, %r8b
jmp 0x1244b
orl $0x1, %r15d
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rax
jmp 0x12470
orl $0x2, %r15d
movq %r12, %r13
jmp 0x12411
orl $0x4, %r15d
jmp 0x12411
movb (%r13), %cl
addb $-0x2a, %cl
movb $0x5a, %r8b
cmpb $0x5, %cl
jae 0x1244b
shlb $0x3, %cl
movabsq $0x73735a7343, %r8      # imm = 0x73735A7343
shrq %cl, %r8
leal 0x1(%rax), %ecx
movslq %eax, %rdi
movq 0x18(%rsp), %rsi
movb %r8b, (%rsi,%rdi)
cmpb $0x9, (%r12)
jne 0x12481
cmpl $0x15, %eax
jg 0x12481
leaq 0x1(%r12), %r13
xorl %r15d, %r15d
movl %ecx, %eax
incq %r12
incq %r14
cmpq %rdx, %r12
jne 0x1233a
jmp 0x1248e
movq 0x20(%rsp), %rax
movl $0x1, (%rax)
movl %ecx, %eax
movslq %eax, %rdx
movq 0x18(%rsp), %rcx
movb $0x0, (%rcx,%rdx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1249a