// File: /workspace/github_c_makefile_star2_O3/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 $0x18, %rsp
movb (%rdi), %r15b
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %r15b, %r15b
je 0x2053b
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
movq %rcx, 0x8(%rsp)
movq %r8, (%rsp)
callq 0x4510
movq %rax, %r12
movq (%rax), %rcx
movq %rbx, %rax
movzbl %r15b, %edx
testb $0x20, 0x1(%rcx,%rdx,2)
je 0x2040b
movb 0x1(%rax), %r15b
incq %rax
testb %r15b, %r15b
jne 0x203ef
jmp 0x2053b
cmpb $0x23, %r15b
je 0x2053b
movq %rax, 0x10(%rsp)
movq %rax, %rbp
movzbl %r15b, %edx
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0x20434
movb 0x1(%rbp), %r15b
incq %rbp
testb %r15b, %r15b
jne 0x2041d
movq %rbp, 0x10(%rsp)
movq %rax, (%r14)
leaq -0x1(%rbp), %rax
movq %rax, (%r13)
cmpb $0x0, (%rbp)
je 0x204de
incq %rbp
leaq 0x10(%rsp), %r14
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x19927
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq (%r14), %r14
cmpq %r14, %rbp
je 0x204ff
testq %rax, %rax
je 0x20519
decq %rax
movq %rax, (%rcx)
cmpb $0x0, (%r14)
je 0x204f4
cmpb $0x0, 0x1(%r14)
je 0x204f4
incq %r14
leaq 0x10(%rsp), %r13
xorl %ebp, %ebp
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x19927
movq (%rsp), %rcx
movq %rax, (%rcx)
movq (%r13), %rcx
cmpq %rcx, %r14
je 0x204cd
movzbl (%rcx), %ecx
testq %rcx, %rcx
je 0x2050f
movq (%r12), %rdx
testb $0x20, 0x1(%rdx,%rcx,2)
jne 0x2050f
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rsp), %rcx
movq %rax, (%rcx)
jmp 0x2053b
movq 0x8(%rsp), %rax
movq $0x0, (%rax)
movabsq $0x800000000, %rax      # imm = 0x800000000
movq (%rsp), %rcx
movq %rax, (%rcx)
xorl %ebp, %ebp
jmp 0x2053b
leaq 0x76ad2(%rip), %rsi     # 0x96fd8
leaq 0x76adc(%rip), %rdx     # 0x96fe9
jmp 0x20527
testq %rax, %rax
je 0x20519
decq %rax
jmp 0x204f4
leaq 0x76ab8(%rip), %rsi     # 0x96fd8
leaq 0x76adf(%rip), %rdx     # 0x97006
movl $0x1, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x13de5
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq