// File: /workspace/github_c_makefile_star2_O1/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 0x61ad
movq $0x0, (%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x62d0
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 0x5ddc
movq %rax, %r12
movq %rax, (%rbp)
movl (%rax), %ebp
movq 0x48(%r14), %rax
movslq (%rax), %rsi
cmpl %esi, %ebp
jb 0x62fd
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 0x62fd
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 0x630a
movl (%r12), %edx
movq 0x48(%r13), %rax
movslq 0x8(%rax), %rsi
cmpl %esi, %edx
jb 0x631f
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 0x630a
movslq 0x70(%r13), %rax
movq (%r15), %rcx
subq %rax, %rcx
incq %rcx
movq %rcx, (%r15)
movslq 0x74(%r13), %rax
movq (%r12), %rcx
subq %rax, %rcx
incq %rcx
movq %rcx, (%r12)
cmpq (%r15), %rcx
jge 0x62ce
cmpb $0x0, 0xb34ed(%rip)     # 0xb97a4
je 0x62df
movb $0x1, 0xb34e4(%rip)     # 0xb97a4
movq (%r15), %rax
movq (%r12), %rcx
movq %rcx, (%r15)
movq %rax, (%r12)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xb2cf2(%rip), %rax     # 0xb8fd8
movq (%rax), %rdi
leaq 0x8ff50(%rip), %rsi     # 0x96240
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x4700
jmp 0x62b9
incl %esi
leaq 0x8fee6(%rip), %rdi     # 0x961ec
movl %ebp, %edx
jmp 0x6328
leaq 0x8ff07(%rip), %rdi     # 0x96218
movq %rbx, %rsi
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x5ed4
incl %esi
leaq 0x8fec4(%rip), %rdi     # 0x961ec
movq (%rsp), %rcx
xorl %eax, %eax
callq 0x5ed4