// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/annot-tsv.c
// Function: parse_tab_with_payload
int parse_tab_with_payload(const char *line, char **chr_beg, char **chr_end, hts_pos_t *beg, hts_pos_t *end, void *payload, void *usr)
{
    static int beg_end_warned = 0;

    if ( line[0]=='#' )
    {
        *((cols_t**)payload) = NULL;
        return -1;
    }

    dat_t *dat = (dat_t*) usr;

    cols_t *cols = cols_split(line, NULL, dat->delim);
    *((cols_t**)payload) = cols;

    if ( cols->n < dat->core_idx[0] ) error("Expected at least %d columns, found %d: %s\n",dat->core_idx[0]+1,cols->n,line);
    *chr_beg = cols->off[ dat->core_idx[0] ];
    *chr_end = *chr_beg + strlen(*chr_beg) - 1;

    if ( cols->n < dat->core_idx[1] ) error("Expected at least %d columns, found %d: %s\n",dat->core_idx[1]+1,cols->n,line);
    char *tmp, *ptr = cols->off[ dat->core_idx[1] ];
    *beg = strtod(ptr, &tmp);
    if ( tmp==ptr ) error("Expected numeric value, found \"%s\": %s\n",ptr,line);

    if ( cols->n < dat->core_idx[2] ) error("Expected at least %d columns, found %d: %s\n",dat->core_idx[2]+1,cols->n,line);
    ptr = cols->off[ dat->core_idx[2] ];
    *end = strtod(ptr, &tmp);
    if ( tmp==ptr ) error("Expected numeric value, found \"%s\": %s\n",ptr,line);

    // NB: for indexing we leave the coordinates 1-based when 1-based, otherwise 0-coordinate would underflow. This
    // means the biggest hts coordinate will overflow, which is less common than the 0 underflow. This does not affect the output,
    // only indexing.
    // The following code will make beg+=1 for BED file (-C 01)
    (*beg) -= dat->coor_base[0] - 1;
    (*end) -= dat->coor_base[1] - 1;

    if ( *end < *beg )
    {
        if ( !beg_end_warned )
            fprintf(stderr,"Warning: the start coordinate is bigger than the end coordinate:\n\t%s\nThis message is printed only once.\n",line);
        beg_end_warned = 1;
        hts_pos_t tmp = *beg; *beg = *end; *end = tmp;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbp
cmpb $0x23, (%rdi)
jne 0x5e31
andq $0x0, (%rbp)
pushq $-0x1
popq %rax
jmp 0x5f50
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbx
movq %r8, 0x8(%rsp)
movq 0x50(%rsp), %r14
movsbl 0x78(%r14), %edx
movq %rdi, (%rsp)
xorl %esi, %esi
callq 0x5abc
movq %rax, %r12
movq %rax, (%rbp)
movl (%rax), %ebp
movq 0x48(%r14), %rax
movslq (%rax), %rsi
cmpl %esi, %ebp
jb 0x5f84
movq 0x8(%r12), %rax
movq (%rax,%rsi,8), %r14
movq %r14, (%rbx)
movq %r14, %rdi
callq 0x41d0
addq %r14, %rax
decq %rax
movq %rax, (%r13)
movq 0x50(%rsp), %r13
movq 0x48(%r13), %rax
movslq 0x4(%rax), %rsi
cmpl %esi, %ebp
jb 0x5f84
movq 0x8(%r12), %rax
movq (%rax,%rsi,8), %rbx
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4350
cvttsd2si %xmm0, %rax
movq %rax, (%r15)
cmpq %rbx, (%r14)
je 0x5f91
movl (%r12), %edx
movq 0x48(%r13), %rax
movslq 0x8(%rax), %rsi
cmpl %esi, %edx
jb 0x5fa6
movq 0x8(%r12), %rax
movq (%rax,%rsi,8), %rbx
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4350
cvttsd2si %xmm0, %rax
movq 0x8(%rsp), %r12
movq %rax, (%r12)
cmpq %rbx, (%r14)
je 0x5f91
movslq 0x70(%r13), %rax
movq (%r15), %rcx
subq %rax, %rcx
incq %rcx
movq %rcx, (%r15)
movslq 0x74(%r13), %rcx
movq (%r12), %rax
subq %rcx, %rax
incq %rax
movq %rax, (%r12)
movq (%r15), %rcx
cmpq %rcx, %rax
jge 0x5f4e
cmpb $0x0, 0x98866(%rip)     # 0x9e7a4
je 0x5f5f
movb $0x1, 0x9885d(%rip)     # 0x9e7a4
movq %rax, (%r15)
movq %rcx, (%r12)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x98072(%rip), %rax     # 0x9dfd8
movq (%rax), %rdi
leaq 0x6f2d0(%rip), %rsi     # 0x75240
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x4700
movq (%r15), %rcx
movq (%r12), %rax
jmp 0x5f40
incl %esi
leaq 0x6f25f(%rip), %rdi     # 0x751ec
movl %ebp, %edx
jmp 0x5faf
leaq 0x6f280(%rip), %rdi     # 0x75218
movq %rbx, %rsi
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x5b9e
incl %esi
leaq 0x6f23d(%rip), %rdi     # 0x751ec
movq (%rsp), %rcx
xorl %eax, %eax
callq 0x5b9e