// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/synced_bcf_reader.c
// Function: regions_parse_line
static int _regions_parse_line(char *line, int ichr, int ifrom, int ito, char **chr, char **chr_end, hts_pos_t *from, hts_pos_t *to)
{
    if (ifrom < 0 || ito < 0) return -1;
    *chr_end = NULL;

    if ( line[0]=='#' ) return 0;

    int k,l;    // index of the start and end column of the tab-delimited file
    if ( ifrom <= ito )
        k = ifrom, l = ito;
    else
        l = ifrom, k = ito;

    int i;
    char *se = line, *ss = NULL; // start and end
    char *tmp;
    for (i=0; i<=k && *se; i++)
    {
        ss = i==0 ? se++ : ++se;
        while (*se && *se!='\t') se++;
    }
    if ( i<=k ) return -1;
    if ( k==l )
    {
        *from = *to = hts_parse_decimal(ss, &tmp, 0);
        if ( tmp==ss || (*tmp && *tmp!='\t') ) return -1;
    }
    else
    {
        if ( k==ifrom )
            *from = hts_parse_decimal(ss, &tmp, 0);
        else
            *to = hts_parse_decimal(ss, &tmp, 0);
        if ( ss==tmp || (*tmp && *tmp!='\t') ) return -1;

        for (i=k; i<l && *se; i++)
        {
            ss = ++se;
            while (*se && *se!='\t') se++;
        }
        if ( i<l ) return -1;
        if ( k==ifrom )
            *to = hts_parse_decimal(ss, &tmp, 0);
        else
            *from = hts_parse_decimal(ss, &tmp, 0);
        if ( ss==tmp || (*tmp && *tmp!='\t') ) return -1;
    }

    ss = se = line;
    for (i=0; i<=ichr && *se; i++)
    {
        if ( i>0 ) ss = ++se;
        while (*se && *se!='\t') se++;
    }
    if ( i<=ichr ) return -1;
    *chr_end = se;
    *chr = ss;
    return 1;
}

// Assembly:
movl %ecx, %eax
orl %edx, %eax
js 0x232f3
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebp
movq %rdi, %r12
andq $0x0, (%r9)
movb (%rdi), %cl
xorl %eax, %eax
cmpb $0x23, %cl
je 0x2346c
movl %edx, %r14d
cmpl %ebp, %edx
movl %ebp, %r13d
cmovll %edx, %r13d
movl %ebp, %edi
cmovgl %edx, %edi
xorl %edx, %edx
pushq $-0x1
popq %rax
movq %r12, %r15
xorl %ebx, %ebx
cmpl %r13d, %edx
jg 0x232f7
testb %cl, %cl
je 0x2346c
movq %r15, %rbx
incq %r15
testl %edx, %edx
cmovneq %r15, %rbx
movzbl (%r15), %ecx
testl %ecx, %ecx
je 0x232ef
cmpl $0x9, %ecx
je 0x232ef
incq %r15
jmp 0x232dd
incl %edx
jmp 0x232c4
pushq $-0x1
popq %rax
retq
movl %esi, 0x14(%rsp)
movq %r9, 0x18(%rsp)
movq %r8, 0x20(%rsp)
cmpl %ebp, %r14d
jne 0x2339d
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xd23e
movq 0x68(%rsp), %rcx
movq %rax, (%rcx)
movq 0x60(%rsp), %rcx
movq %rax, (%rcx)
movq (%r14), %rax
cmpq %rbx, %rax
je 0x23469
movzbl (%rax), %ecx
testl %ecx, %ecx
pushq $-0x1
popq %rax
je 0x2334f
cmpl $0x9, %ecx
jne 0x2346c
xorl %esi, %esi
movq %r12, %rcx
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %r8
movl 0x14(%rsp), %r9d
cmpl %r9d, %esi
jg 0x2341a
cmpb $0x0, (%r12)
je 0x2346c
leaq 0x1(%r12), %rdx
testl %esi, %esi
cmovneq %rdx, %r12
cmovneq %rdx, %rcx
movzbl (%r12), %edx
testl %edx, %edx
je 0x23399
cmpl $0x9, %edx
je 0x23399
incq %r12
jmp 0x23386
incl %esi
jmp 0x23363
movl %edi, 0x10(%rsp)
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xd23e
cmpl %ebp, %r14d
movq 0x60(%rsp), %r8
movq %r8, %rcx
movq 0x68(%rsp), %rdx
cmovgq %rdx, %rcx
movq %rax, (%rcx)
leaq 0x8(%rsp), %rax
movq (%rax), %rax
cmpq %rax, %rbx
je 0x23469
movzbl (%rax), %ecx
cmpl $0x9, %ecx
pushq $-0x1
popq %rax
je 0x233eb
testl %ecx, %ecx
jne 0x2346c
movl 0x10(%rsp), %edi
cmpl %edi, %r13d
je 0x23424
cmpb $0x0, (%r15)
je 0x2346c
movq %r15, %rbx
incq %rbx
movq %rbx, %r15
movzbl (%r15), %ecx
testl %ecx, %ecx
je 0x23415
cmpl $0x9, %ecx
je 0x23415
incq %r15
jmp 0x23403
incl %r13d
jmp 0x233ef
movq %r12, (%r8)
movq %rcx, (%rdi)
pushq $0x1
jmp 0x2346b
leaq 0x8(%rsp), %rsi
movq %rdx, %r15
movq %r8, %r13
movq %rbx, %rdi
xorl %edx, %edx
callq 0xd23e
cmpl %ebp, %r14d
cmovgq %r13, %r15
movq %rax, (%r15)
leaq 0x8(%rsp), %rax
movq (%rax), %rax
cmpq %rax, %rbx
je 0x23469
movzbl (%rax), %ecx
cmpl $0x9, %ecx
pushq $-0x1
popq %rax
je 0x2334f
testl %ecx, %ecx
je 0x2334f
jmp 0x2346c
pushq $-0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq