// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/regidx.c
// Function: regidx_parse_tab
int regidx_parse_tab(const char *line, char **chr_beg, char **chr_end, hts_pos_t *beg, hts_pos_t *end, void *payload, void *usr)
{
    char *ss = (char*) line;
    while ( *ss && isspace_c(*ss) ) ss++;
    if ( !*ss ) return -1;      // skip blank lines
    if ( *ss=='#' ) return -1;  // skip comments

    char *se = ss;
    while ( *se && !isspace_c(*se) ) se++;

    *chr_beg = ss;
    *chr_end = se-1;

    if ( !*se )
    {
        // just the chromosome name
        *beg = 0;
        *end = MAX_COOR_0;
        return 0;
    }

    ss = se+1;
    *beg = hts_parse_decimal(ss, &se, 0);
    if ( ss==se ) { hts_log_error("Could not parse tab line: %s", line); return -2; }
    if ( *beg==0 ) { hts_log_error("Could not parse tab line, expected 1-based coordinate: %s", line); return -2; }
    (*beg)--;

    if ( !se[0] || !se[1] )
        *end = *beg;
    else
    {
        ss = se+1;
        *end = hts_parse_decimal(ss, &se, 0);
        if ( ss==se || (*se && !isspace_c(*se)) ) *end = *beg;
        else if ( *end==0 ) { hts_log_error("Could not parse tab line, expected 1-based coordinate: %s", line); return -2; }
        else (*end)--;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movb (%rdi), %r15b
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testb %r15b, %r15b
je 0x20e87
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
movq %rcx, 0x20(%rsp)
movq %r8, 0x8(%rsp)
callq 0x4510
movq (%rax), %rax
leaq 0x1(%rbx), %rbp
movzbl %r15b, %ecx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x20d18
movb (%rbp), %r15b
incq %rbp
testb %r15b, %r15b
jne 0x20cfc
jmp 0x20e87
testb %r15b, %r15b
je 0x20e87
cmpl $0x23, %ecx
je 0x20e87
leaq -0x1(%rbp), %rax
movq %rax, 0x10(%rsp)
movb (%rax), %r15b
movq %rax, %r14
testb %r15b, %r15b
je 0x20d72
movq %rax, 0x18(%rsp)
callq 0x4510
movq (%rax), %rcx
movzbl %r15b, %edx
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0x20d67
movq %rbp, 0x10(%rsp)
movb (%rbp), %r15b
incq %rbp
testb %r15b, %r15b
jne 0x20d48
decq %rbp
movq %rbp, %r14
movq 0x18(%rsp), %rax
movq %rax, (%r13)
leaq -0x1(%r14), %rax
movq %rax, (%r12)
cmpb $0x0, (%r14)
je 0x20e24
incq %r14
leaq 0x10(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x19e86
movq 0x20(%rsp), %rbp
movq %rax, (%rbp)
movq (%r12), %r12
cmpq %r12, %r14
je 0x20e47
testq %rax, %rax
je 0x20e64
decq %rax
movq %rax, (%rbp)
cmpb $0x0, (%r12)
je 0x20e3a
cmpb $0x0, 0x1(%r12)
je 0x20e3a
incq %r12
leaq 0x10(%rsp), %r15
xorl %r14d, %r14d
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x19e86
movq %rax, %r13
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq (%r15), %rax
cmpq %rax, %r12
je 0x20e1b
movzbl (%rax), %r15d
testq %r15, %r15
je 0x20e57
callq 0x4510
movq 0x8(%rsp), %rcx
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r15,2)
jne 0x20e57
movq (%rbp), %rax
movq %rax, (%rcx)
jmp 0x20e87
movq 0x20(%rsp), %rax
movq $0x0, (%rax)
movabsq $0x800000000, %rax      # imm = 0x800000000
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
xorl %r14d, %r14d
jmp 0x20e87
leaq 0x790c1(%rip), %rsi     # 0x99f0f
leaq 0x790cb(%rip), %rdx     # 0x99f20
jmp 0x20e72
testq %r13, %r13
je 0x20e64
decq %r13
movq %r13, (%rcx)
jmp 0x20e42
leaq 0x790a4(%rip), %rsi     # 0x99f0f
leaq 0x790cb(%rip), %rdx     # 0x99f3d
movl $0x1, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x14378
movl $0xfffffffe, %r14d      # imm = 0xFFFFFFFE
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq