// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/test-regidx.c
// Function: test_explicit
void test_explicit(char *tgt, char *qry, char *exp)
{
    regidx_t *idx = regidx_init(NULL,regidx_parse_reg,NULL,0,NULL);

    char *beg = tgt, *end, *exp_ori = exp;
    kstring_t str = {0,0,0};
    while ( *beg )
    {
        end = tgt;
        while ( *end && *end!=';' ) end++;
        str.l = 0;
        kputsn(beg, end-beg, &str);
        debug("insert: %s\n", str.s);
        if ( regidx_insert(idx,str.s)!=0 ) error("insert failed: %s\n", str.s);
        beg = *end ? end + 1 : end;
    }

    beg = qry;
    while ( *beg )
    {
        end = qry;
        while ( *end && *end!=';' ) end++;
        str.l = 0;
        kputsn(beg, end-beg, &str);
        beg = *end ? end + 1 : end;

        char *chr_beg, *chr_end;
        hts_pos_t reg_beg, reg_end;
        if ( regidx_parse_reg(str.s, &chr_beg, &chr_end, &reg_beg, &reg_end, NULL, NULL)!=0 ) error("could not parse: %s in %s\n", str.s, qry);
        chr_end[1] = 0;
        int hit = regidx_overlap(idx,chr_beg,reg_beg,reg_end,NULL);
        if ( *exp=='1' )
        {
            if ( !hit )
            {
                error("query failed, there should be a hit .. %s:%"PRIhts_pos"-%"PRIhts_pos"\n",chr_beg, reg_beg+1, reg_end+1);
            }
            else
            {
                debug("ok: overlap found for %s:%"PRIhts_pos"-%"PRIhts_pos"\n",chr_beg,reg_beg+1,reg_end+1);
            }
        }
        else if ( *exp=='0' )
        {
            if ( hit )
            {
                error("query failed, there should be no hit .. %s:%"PRIhts_pos"-%"PRIhts_pos"\n",chr_beg,reg_beg+1,reg_end+1);
            }
            else
            {
                debug("ok: no overlap found for %s:%"PRIhts_pos"-%"PRIhts_pos"\n",chr_beg,reg_beg+1,reg_end+1);
            }
        }
        else error("could not parse: %s\n", exp_ori);
        exp++;
    }

    free(str.s);
    regidx_destroy(idx);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, 0x28(%rsp)
movq %rsi, %rbp
movq %rdi, %rbx
leaq 0x2b0b(%rip), %rsi      # 0x9023
xorl %edi, %edi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x88ba
movq %rax, %r15
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r13
andq $0x0, 0x10(%r13)
movaps %xmm0, (%r13)
xorl %r12d, %r12d
movq %rbx, %rdi
cmpb $0x0, (%rdi)
je 0x65a8
movq %rbx, %rsi
subq %rdi, %rsi
movq %rbx, %r14
movzbl (%r14), %eax
testl %eax, %eax
je 0x6564
cmpl $0x3b, %eax
je 0x6564
incq %r14
incq %rsi
jmp 0x654f
andq $0x0, 0x30(%rsp)
movq %r13, %rdx
callq 0x6717
movq 0x40(%rsp), %r12
leaq 0x6ddb6(%rip), %rdi     # 0x74334
movq %r12, %rsi
xorl %eax, %eax
callq 0x5de0
movq %r15, %rdi
movq %r12, %rsi
callq 0x7f92
testl %eax, %eax
jne 0x66cd
cmpb $0x1, (%r14)
sbbq $-0x1, %r14
movq %r14, %rdi
jmp 0x6541
leaq 0x10(%rsp), %r13
movq %rbp, %rdi
movq 0x28(%rsp), %r14
cmpb $0x0, (%rdi)
je 0x66ae
movq %rbp, %rsi
subq %rdi, %rsi
movq %rbp, %rbx
movzbl (%rbx), %eax
testl %eax, %eax
je 0x65db
cmpl $0x3b, %eax
je 0x65db
incq %rbx
incq %rsi
jmp 0x65c7
andq $0x0, 0x30(%rsp)
leaq 0x30(%rsp), %rdx
callq 0x6717
cmpb $0x1, (%rbx)
sbbq $-0x1, %rbx
movq 0x40(%rsp), %r12
andq $0x0, (%rsp)
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x50(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq %r13, %r8
xorl %r9d, %r9d
callq 0x9023
testl %eax, %eax
jne 0x66d9
movq 0x50(%rsp), %rax
movb $0x0, 0x1(%rax)
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
callq 0x8c4c
movzbl (%r14), %ecx
cmpl $0x30, %ecx
je 0x667c
cmpl $0x31, %ecx
jne 0x66f6
movq 0x18(%rsp), %rdx
incq %rdx
movq 0x10(%rsp), %rcx
incq %rcx
movq 0x20(%rsp), %rsi
testl %eax, %eax
je 0x6709
leaq 0x6dd14(%rip), %rdi     # 0x7438e
jmp 0x669c
movq 0x18(%rsp), %rdx
incq %rdx
movq 0x10(%rsp), %rcx
incq %rcx
movq 0x20(%rsp), %rsi
testl %eax, %eax
jne 0x66ed
leaq 0x6dd48(%rip), %rdi     # 0x743e4
xorl %eax, %eax
callq 0x5de0
incq %r14
movq %rbx, %rdi
jmp 0x65b5
movq %r12, %rdi
callq 0x45d0
movq %r15, %rdi
callq 0x87b0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6d948(%rip), %rdi     # 0x7401c
movq %r12, %rsi
jmp 0x6702
leaq 0x6dc60(%rip), %rdi     # 0x74340
movq %r12, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x5d48
leaq 0x6dcbc(%rip), %rdi     # 0x743b0
jmp 0x6710
leaq 0x6dd0c(%rip), %rdi     # 0x74409
movq 0x28(%rsp), %rsi
xorl %eax, %eax
callq 0x5d48
leaq 0x6dc4b(%rip), %rdi     # 0x7435b
xorl %eax, %eax
callq 0x5d48