// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/tbx.c
// Function: get_intv
static inline int get_intv(tbx_t *tbx, kstring_t *str, tbx_intv_t *intv, int is_add)
{
    if (tbx_parse1(&tbx->conf, str->l, str->s, intv) == 0) {
        int c = *intv->se;
        *intv->se = '\0';
        if ((tbx->conf.preset&0xffff) == TBX_GAF){
            intv->tid = 0;
        } else {
            intv->tid = get_tid(tbx, intv->ss, is_add);
        }
        *intv->se = c;
        if (intv->tid < 0) return -2;  // get_tid out of memory
        return (intv->beg >= 0 && intv->end >= 0)? 0 : -1;
    } else {
        char *type = NULL;
        switch (tbx->conf.preset&0xffff)
        {
            case TBX_SAM: type = "TBX_SAM"; break;
            case TBX_VCF: type = "TBX_VCF"; break;
            case TBX_GAF: type = "TBX_GAF"; break;
            case TBX_UCSC: type = "TBX_UCSC"; break;
            default: type = "TBX_GENERIC"; break;
        }
        if (hts_is_utf16_text(str))
            hts_log_error("Failed to parse %s: offending line appears to be encoded as UTF-16", type);
        else
            hts_log_error("Failed to parse %s: was wrong -p [type] used?\nThe offending line was: \"%s\"",
                type, str->s);
        return -1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq (%rsi), %rsi
movq 0x10(%r14), %rdx
movq %rbx, %rcx
callq 0x9d32e
testl %eax, %eax
je 0x9dc20
movl (%r12), %eax
decl %eax
cmpw $0x2, %ax
ja 0x9dcc5
movzwl %ax, %eax
leaq 0x1c0bc(%rip), %rcx     # 0xb9cd0
movslq (%rcx,%rax,4), %rbx
addq %rcx, %rbx
jmp 0x9dccc
movq 0x18(%rbx), %rax
movb (%rax), %r13b
movb $0x0, (%rax)
xorl %r15d, %r15d
cmpw $0x3, (%r12)
je 0x9dd44
movq 0x10(%rbx), %rsi
cmpq $0x0, 0x20(%r12)
jne 0x9dc55
movq %rsi, %r14
callq 0x63f8
movq %r14, %rsi
movq %rax, 0x20(%r12)
movq 0x20(%r12), %r14
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %r14, %r14
je 0x9dd44
testl %ebp, %ebp
je 0x9dd1a
leaq 0x14(%rsp), %r12
movq %r14, %rdi
movq %rsi, 0x8(%rsp)
movq %r12, %rdx
callq 0x6836
cmpl $0x0, (%r12)
js 0x9dd44
movl %eax, %ebp
je 0x9dd35
movq 0x8(%rsp), %rdi
callq 0x4930
movq %rax, %r12
testq %rax, %rax
je 0x9dd26
movq 0x18(%r14), %rax
movl %ebp, %ecx
movq %r12, (%rax,%rcx,8)
movl 0x4(%r14), %eax
decl %eax
movq 0x20(%r14), %rdx
movq %rax, (%rdx,%rcx,8)
jmp 0x9dd30
leaq 0x1c13e(%rip), %rbx     # 0xb9e0a
movq %r14, %rdi
callq 0xafe2
testl %eax, %eax
je 0x9dcf7
leaq 0x1c137(%rip), %rsi     # 0xb9e16
leaq 0x1c139(%rip), %rdx     # 0xb9e1f
movl $0x1, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x9774
jmp 0x9dd65
movq 0x10(%r14), %r8
leaq 0x1c114(%rip), %rsi     # 0xb9e16
leaq 0x1c159(%rip), %rdx     # 0xb9e62
movl $0x1, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x9774
jmp 0x9dd65
movq %r14, %rdi
callq 0x6470
movl %eax, %ebp
jmp 0x9dd35
movq %r14, %rdi
movl %ebp, %esi
callq 0x6a29
testq %r12, %r12
je 0x9dd44
cmpl (%r14), %ebp
je 0x9dd44
movq 0x20(%r14), %rax
movl %ebp, %ecx
movl (%rax,%rcx,8), %r15d
movl %r15d, 0x20(%rbx)
movq 0x18(%rbx), %rax
movb %r13b, (%rax)
cmpl $0x0, 0x20(%rbx)
js 0x9dd79
cmpq $0x0, (%rbx)
js 0x9dd65
movq 0x8(%rbx), %rax
sarq $0x3f, %rax
jmp 0x9dd6a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x9dd6a