// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x49(%rbp)
je 0x2e5d2
movq -0x40(%rbp), %rax
movsbl (%rax), %edi
callq 0x2e830
cmpl $0x0, %eax
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x2e5db
jmp 0x2e5e9
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2e5ac
movq -0x40(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x2e5fe
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2e80f
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x2e616
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2e80f
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x4a(%rbp)
je 0x2e646
movq -0x48(%rbp), %rax
movsbl (%rax), %edi
callq 0x2e830
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x4a(%rbp)
movb -0x4a(%rbp), %al
testb $0x1, %al
jne 0x2e64f
jmp 0x2e65d
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2e61e
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rcx
addq $-0x1, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x2e6a8
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x30(%rbp), %rax
movabsq $0x800000000, %rcx      # imm = 0x800000000
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x2e80f
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
xorl %edx, %edx
callq 0x23070
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x2e701
movq -0x10(%rbp), %rcx
movl $0x1, %edi
leaq 0xc2a68(%rip), %rsi     # 0xf114f
leaq 0xc2a72(%rip), %rdx     # 0xf1160
movb $0x0, %al
callq 0x1b030
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x2e80f
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2e735
movq -0x10(%rbp), %rcx
movl $0x1, %edi
leaq 0xc2a34(%rip), %rsi     # 0xf114f
leaq 0xc2a5b(%rip), %rdx     # 0xf117d
movb $0x0, %al
callq 0x1b030
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x2e80f
movq -0x28(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
cmpb $0x0, (%rax)
je 0x2e756
movq -0x48(%rbp), %rax
cmpb $0x0, 0x1(%rax)
jne 0x2e769
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2e808
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
xorl %edx, %edx
callq 0x23070
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
je 0x2e7b5
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x2e7c5
movq -0x48(%rbp), %rax
movsbl (%rax), %edi
callq 0x2e830
cmpl $0x0, %eax
jne 0x2e7c5
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2e806
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2e7f6
movq -0x10(%rbp), %rcx
movl $0x1, %edi
leaq 0xc2970(%rip), %rsi     # 0xf114f
leaq 0xc2997(%rip), %rdx     # 0xf117d
movb $0x0, %al
callq 0x1b030
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x2e80f
movq -0x30(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
jmp 0x2e806
jmp 0x2e808
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)