// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/regidx.c
// Function: regidx_parse_reg
int regidx_parse_reg(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 && *se!=':' ) se++;

    *chr_beg = ss;
    *chr_end = se-1;

    if ( !*se )
    {
        *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 reg line: %s", line); return -2; }
    if ( *beg==0 ) { hts_log_error("Could not parse reg line, expected 1-based coordinate: %s", line); return -2; }
    (*beg)--;

    if ( !se[0] || !se[1] )
        *end = se[0]=='-' ? MAX_COOR_0 : *beg;
    else
    {
        ss = se+1;
        *end = hts_parse_decimal(ss, &se, 0);
        if ( ss==se ) *end = *beg;
        else if ( *end==0 ) { hts_log_error("Could not parse reg line, expected 1-based coordinate: %s", line); return -2; }
        else (*end)--;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %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 0x2f732
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 0x2f73b
jmp 0x2f749
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2f70c
movq -0x40(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x2f75e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f96f
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x2f776
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f96f
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 0x2f79f
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
setne %al
movb %al, -0x4a(%rbp)
movb -0x4a(%rbp), %al
testb $0x1, %al
jne 0x2f7a8
jmp 0x2f7b6
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2f77e
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 0x2f801
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x30(%rbp), %rax
movabsq $0x800000000, %rcx      # imm = 0x800000000
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x2f96f
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 0x2f85a
movq -0x10(%rbp), %rcx
movl $0x1, %edi
leaq 0xc1977(%rip), %rsi     # 0xf11b7
leaq 0xc1981(%rip), %rdx     # 0xf11c8
movb $0x0, %al
callq 0x1b030
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x2f96f
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2f88e
movq -0x10(%rbp), %rcx
movl $0x1, %edi
leaq 0xc1943(%rip), %rsi     # 0xf11b7
leaq 0xc196a(%rip), %rdx     # 0xf11e5
movb $0x0, %al
callq 0x1b030
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x2f96f
movq -0x28(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
cmpb $0x0, (%rax)
je 0x2f8af
movq -0x48(%rbp), %rax
cmpb $0x0, 0x1(%rax)
jne 0x2f8e6
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x2f8cb
movabsq $0x800000000, %rax      # imm = 0x800000000
movq %rax, -0x58(%rbp)
jmp 0x2f8d6
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2f968
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
jne 0x2f925
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2f966
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2f956
movq -0x10(%rbp), %rcx
movl $0x1, %edi
leaq 0xc1878(%rip), %rsi     # 0xf11b7
leaq 0xc189f(%rip), %rdx     # 0xf11e5
movb $0x0, %al
callq 0x1b030
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x2f96f
movq -0x30(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
jmp 0x2f966
jmp 0x2f968
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)