// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/synced_bcf_reader.c
// Function: regions_init_string
static bcf_sr_regions_t *_regions_init_string(const char *str)
{
    bcf_sr_regions_t *reg = bcf_sr_regions_alloc();
    if ( !reg ) return NULL;

    kstring_t tmp = {0,0,0};
    const char *sp = str, *ep = str;
    hts_pos_t from, to;
    while ( 1 )
    {
        tmp.l = 0;
        if ( *ep=='{' )
        {
            while ( *ep && *ep!='}' ) ep++;
            if ( !*ep )
            {
                hts_log_error("Could not parse the region, mismatching braces in: \"%s\"", str);
                goto exit_nicely;
            }
            ep++;
            kputsn(sp+1,ep-sp-2,&tmp);
        }
        else
        {
            while ( *ep && *ep!=',' && *ep!=':' ) ep++;
            kputsn(sp,ep-sp,&tmp);
        }
        if ( *ep==':' )
        {
            sp = ep+1;
            from = hts_parse_decimal(sp,(char**)&ep,0);
            if ( sp==ep )
            {
                hts_log_error("Could not parse the region(s): %s", str);
                goto exit_nicely;
            }
            if ( !*ep || *ep==',' )
            {
                _regions_add(reg, tmp.s, from, from);
                sp = ep;
                continue;
            }
            if ( *ep!='-' )
            {
                hts_log_error("Could not parse the region(s): %s", str);
                goto exit_nicely;
            }
            ep++;
            sp = ep;
            to = hts_parse_decimal(sp,(char**)&ep,0);
            if ( *ep && *ep!=',' )
            {
                hts_log_error("Could not parse the region(s): %s", str);
                goto exit_nicely;
            }
            if ( sp==ep ) to = MAX_CSI_COOR-1;
            _regions_add(reg, tmp.s, from, to);
            if ( !*ep ) break;
            sp = ep;
        }
        else if ( !*ep || *ep==',' )
        {
            if ( tmp.l ) _regions_add(reg, tmp.s, -1, -1);
            if ( !*ep ) break;
            sp = ++ep;
        }
        else
        {
            hts_log_error("Could not parse the region(s): %s", str);
            goto exit_nicely;
        }
    }
    free(tmp.s);
    return reg;

exit_nicely:
    bcf_sr_regions_destroy(reg);
    free(tmp.s);
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
callq 0x39200
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3aeb9
movq $0x0, -0x8(%rbp)
jmp 0x3b1f5
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x4240
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7b, %eax
jne 0x3af85
jmp 0x3aef3
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x51(%rbp)
je 0x3af14
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7d, %eax
setne %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x3af1d
jmp 0x3af2b
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x3aef3
movq -0x40(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x3af57
movq -0x10(%rbp), %rcx
movl $0x1, %edi
leaq 0xd751d(%rip), %rsi     # 0x112461
leaq 0xd752b(%rip), %rdx     # 0x112476
movb $0x0, %al
callq 0xa790
jmp 0x3b1db
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rax
subq %rax, %rsi
subq $0x2, %rsi
leaq -0x30(%rbp), %rdx
callq 0x3bd50
jmp 0x3afe8
jmp 0x3af87
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x52(%rbp)
je 0x3afb9
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x2c, %ecx
movb %al, -0x52(%rbp)
je 0x3afb9
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
setne %al
movb %al, -0x52(%rbp)
movb -0x52(%rbp), %al
testb $0x1, %al
jne 0x3afc2
jmp 0x3afd0
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x3af87
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rax
subq %rax, %rsi
leaq -0x30(%rbp), %rdx
callq 0x3bd50
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0x3b151
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x127d0
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x3b044
movq -0x10(%rbp), %rcx
movl $0x1, %edi
leaq 0xd7430(%rip), %rsi     # 0x112461
leaq 0xd7476(%rip), %rdx     # 0x1124ae
movb $0x0, %al
callq 0xa790
jmp 0x3b1db
movq -0x40(%rbp), %rax
cmpb $0x0, (%rax)
je 0x3b059
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x3b07b
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x48(%rbp), %rcx
callq 0x39290
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x3aed9
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x3b0aa
movq -0x10(%rbp), %rcx
movl $0x1, %edi
leaq 0xd73ca(%rip), %rsi     # 0x112461
leaq 0xd7410(%rip), %rdx     # 0x1124ae
movb $0x0, %al
callq 0xa790
jmp 0x3b1db
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x127d0
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x3b10c
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
je 0x3b10c
movq -0x10(%rbp), %rcx
movl $0x1, %edi
leaq 0xd7368(%rip), %rsi     # 0x112461
leaq 0xd73ae(%rip), %rdx     # 0x1124ae
movb $0x0, %al
callq 0xa790
jmp 0x3b1db
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x3b124
movabsq $0xffffffffffe, %rax    # imm = 0xFFFFFFFFFFE
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rcx
callq 0x39290
movq -0x40(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x3b147
jmp 0x3b1c8
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x3b1c3
movq -0x40(%rbp), %rax
cmpb $0x0, (%rax)
je 0x3b166
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x3b1a1
cmpq $0x0, -0x30(%rbp)
je 0x3b184
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq $-0x1, %rcx
movq %rcx, %rdx
callq 0x39290
movq -0x40(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x3b18f
jmp 0x3b1c8
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq %rax, -0x38(%rbp)
jmp 0x3b1c1
movq -0x10(%rbp), %rcx
movl $0x1, %edi
leaq 0xd72b0(%rip), %rsi     # 0x112461
leaq 0xd72f6(%rip), %rdx     # 0x1124ae
movb $0x0, %al
callq 0xa790
jmp 0x3b1db
jmp 0x3b1c3
jmp 0x3aed9
movq -0x20(%rbp), %rdi
callq 0x45a0
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3b1f5
movq -0x18(%rbp), %rdi
callq 0x380b0
movq -0x20(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop