// File: /workspace/github_c_makefile_star2_O1/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 %ebp, %ebp
cmpq %rdx, %rsi
jae 0x126ff
movq %rdx, %r8
movq %rsi, %r12
xorl %esi, %esi
movq %r12, %rbx
xorl %ebp, %ebp
movq %r12, %rdi
movq %rdx, 0x10(%rsp)
movsbq (%r12), %r13
cmpq $0x20, %r13
jl 0x12620
movq %rdi, %r14
movl %esi, 0xc(%rsp)
callq 0x4510
movq (%rax), %r15
testb $0x8, 0x1(%r15,%r13,2)
jne 0x12675
movzbl %r13b, %eax
cmpl $0x2d, %eax
movq %r14, %rdi
je 0x125d6
cmpl $0x2b, %eax
jne 0x125df
cmpq %rdi, %r12
je 0x12686
movl $0xb, %edx
leaq 0x8739b(%rip), %rdi     # 0x99986
movl %r13d, %esi
callq 0x4550
movq %r14, %rdi
testq %rax, %rax
setne %al
cmpq %r14, %r12
seta %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x12617
movzbl -0x1(%r12), %eax
testb $0x8, 0x1(%r15,%rax,2)
jne 0x1268f
movl 0xc(%rsp), %esi
orl $0x8, %esi
jmp 0x12696
cmpb $0xd, %r13b
ja 0x1271c
movzbl %r13b, %eax
movl $0x2600, %ecx           # imm = 0x2600
btl %eax, %ecx
jae 0x1271c
movl %esi, %ecx
andl $-0x3, %ecx
movb $0x69, %al
cmpl $0x1, %ecx
je 0x126b9
movb $0x43, %al
cmpl $0x5, %esi
je 0x126b9
movq %rbx, %rax
subq %rdi, %rax
movq %rax, %rcx
decq %rcx
je 0x1269d
cmpq $0x5, %rax
jb 0x12671
cmpb $0x3a, 0x2(%rdi)
jne 0x12671
movb $0x4f, %al
cmpb $0x3a, 0x4(%rdi)
je 0x126b9
movb $0x5a, %al
jmp 0x126b9
movl 0xc(%rsp), %esi
orl $0x1, %esi
movq 0x10(%rsp), %r8
movq %r14, %rdi
jmp 0x126f0
movl 0xc(%rsp), %esi
orl $0x2, %esi
jmp 0x12696
movl 0xc(%rsp), %esi
orl $0x4, %esi
movq 0x10(%rsp), %r8
jmp 0x126f0
movb (%rdi), %cl
addb $-0x2a, %cl
movb $0x5a, %al
cmpb $0x5, %cl
jae 0x126b9
shlb $0x3, %cl
movabsq $0x73735a7343, %rax     # imm = 0x73735A7343
shrq %cl, %rax
movslq %ebp, %rcx
movq 0x18(%rsp), %rdx
movb %al, (%rdx,%rcx)
cmpb $0x9, (%r12)
sete %cl
cmpl $0x16, %ebp
setl %al
andb %cl, %al
je 0x126df
leaq 0x1(%r12), %rdi
xorl %esi, %esi
jmp 0x126ea
movq 0x20(%rsp), %rcx
movl $0x1, (%rcx)
incl %ebp
testb %al, %al
je 0x126ff
incq %r12
incq %rbx
cmpq %r8, %r12
jne 0x1259f
movslq %ebp, %rax
movq 0x18(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x1270b