// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %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
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x60b7
movq -0x38(%rbp), %rax
movq $0x0, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x631b
movq 0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %esi
movsbl 0x78(%rax), %edx
callq 0x5ac0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x48(%rcx), %rcx
cmpl (%rcx), %eax
jae 0x611a
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rax
movl (%rax), %esi
addl $0x1, %esi
movq -0x48(%rbp), %rax
movl (%rax), %edx
movq -0x10(%rbp), %rcx
leaq 0xe7302(%rip), %rdi     # 0xed415
movb $0x0, %al
callq 0x5c70
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x40(%rbp), %rcx
movq 0x48(%rcx), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x41b0
movq -0x68(%rbp), %rcx
addq %rax, %rcx
addq $-0x1, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x48(%rcx), %rcx
cmpl 0x4(%rcx), %eax
jae 0x619a
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x4(%rax), %esi
addl $0x1, %esi
movq -0x48(%rbp), %rax
movl (%rax), %edx
movq -0x10(%rbp), %rcx
leaq 0xe7282(%rip), %rdi     # 0xed415
movb $0x0, %al
callq 0x5c70
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x40(%rbp), %rcx
movq 0x48(%rcx), %rcx
movslq 0x4(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4340
cvttsd2si %xmm0, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
cmpq -0x58(%rbp), %rax
jne 0x61ef
movq -0x58(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0xe7259(%rip), %rdi     # 0xed441
movb $0x0, %al
callq 0x5c70
movq -0x48(%rbp), %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x48(%rcx), %rcx
cmpl 0x8(%rcx), %eax
jae 0x6228
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x8(%rax), %esi
addl $0x1, %esi
movq -0x48(%rbp), %rax
movl (%rax), %edx
movq -0x10(%rbp), %rcx
leaq 0xe71f4(%rip), %rdi     # 0xed415
movb $0x0, %al
callq 0x5c70
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x40(%rbp), %rcx
movq 0x48(%rcx), %rcx
movslq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4340
cvttsd2si %xmm0, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
cmpq -0x58(%rbp), %rax
jne 0x627d
movq -0x58(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0xe71cb(%rip), %rdi     # 0xed441
movb $0x0, %al
callq 0x5c70
movq -0x40(%rbp), %rax
movl 0x70(%rax), %eax
subl $0x1, %eax
movslq %eax, %rdx
movq -0x28(%rbp), %rax
movq (%rax), %rcx
subq %rdx, %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movl 0x74(%rax), %eax
subl $0x1, %eax
movslq %eax, %rdx
movq -0x30(%rbp), %rax
movq (%rax), %rcx
subq %rdx, %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jge 0x6314
cmpl $0x0, 0x10bc7c(%rip)    # 0x111f44
jne 0x62e6
movq 0x106d0f(%rip), %rax    # 0x10cfe0
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xe718a(%rip), %rsi     # 0xed469
movb $0x0, %al
callq 0x46d0
movl $0x1, 0x10bc54(%rip)    # 0x111f44
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x60(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)