// File: /workspace/github_c_makefile_star2_O3/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, 0x48(%rsp)
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x326a(%rip), %rsi      # 0x9c6d
xorl %ebp, %ebp
xorl %edi, %edi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x92d3
movq %rax, 0x28(%rsp)
cmpb $0x0, (%rbx)
je 0x6b1f
movq %rbx, %r13
xorl %ebp, %ebp
xorl %ecx, %ecx
xorl %r15d, %r15d
movzbl (%rbx,%r15), %eax
testl %eax, %eax
je 0x6a3e
cmpl $0x3b, %eax
je 0x6a3e
incq %r15
jmp 0x6a2b
movq %rbx, %r14
subq %r13, %r14
leaq (%r14,%r15), %rdx
movq %rdx, %rax
addq $0x2, %rax
je 0x6aa0
cmpq %rax, %rcx
jae 0x6ab2
movq %rcx, 0x10(%rsp)
movq %rax, %rcx
shrq %rcx
movq %rdx, 0x18(%rsp)
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %eax
cmovbeq %rcx, %rax
addq %r14, %rax
leaq (%r15,%rax), %rsi
addq $0x2, %rsi
movq %rbp, %rdi
movq %rsi, 0x20(%rsp)
callq 0x4850
movq 0x18(%rsp), %rdx
testq %rax, %rax
jne 0x6aba
jmp 0x6ada
movq %rcx, 0x10(%rsp)
callq 0x4050
movl $0x4b, (%rax)
jmp 0x6ada
movq %rcx, 0x20(%rsp)
movq %rbp, %rax
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
callq 0x43c0
addq %rbp, %r14
movb $0x0, (%r15,%r14)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x8b853(%rip), %rdi     # 0x92334
movq %rbp, %rsi
xorl %eax, %eax
callq 0x61e2
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x87cd
testl %eax, %eax
jne 0x6ce7
leaq (%rbx,%r15), %r13
cmpb $0x1, (%rbx,%r15)
sbbq $-0x1, %r13
cmpb $0x0, (%r13)
movq 0x10(%rsp), %rcx
jne 0x6a28
jmp 0x6b21
xorl %ecx, %ecx
cmpb $0x0, (%r12)
je 0x6cc6
movq 0x48(%rsp), %r14
movq %r12, %rbx
xorl %r15d, %r15d
movzbl (%r12,%r15), %eax
testl %eax, %eax
je 0x6b4a
cmpl $0x3b, %eax
je 0x6b4a
incq %r15
jmp 0x6b37
movq %r14, 0x20(%rsp)
movq %rbp, %r13
movq %r12, %rbp
subq %rbx, %rbp
leaq (%r15,%rbp), %rdx
movq %rdx, %rax
addq $0x2, %rax
je 0x6bb3
cmpq %rax, %rcx
jae 0x6bc5
movq %rcx, 0x10(%rsp)
movq %rax, %rcx
shrq %rcx
movq %rdx, %r14
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %eax
cmovbeq %rcx, %rax
addq %rbp, %rax
leaq (%r15,%rax), %rsi
addq $0x2, %rsi
movq %r13, %rdi
movq %rsi, 0x18(%rsp)
callq 0x4850
movq %r14, %rdx
movq %rax, %r14
testq %rax, %rax
jne 0x6bcd
jmp 0x6bed
movq %rcx, 0x10(%rsp)
callq 0x4050
movl $0x4b, (%rax)
jmp 0x6bed
movq %rcx, 0x18(%rsp)
movq %r13, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x43c0
addq %r14, %rbp
movb $0x0, (%r15,%rbp)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r14, %r13
leaq (%r12,%r15), %rbx
cmpb $0x1, (%r12,%r15)
sbbq $-0x1, %rbx
movq $0x0, (%rsp)
movq %r13, %rdi
leaq 0x40(%rsp), %rsi
leaq 0x50(%rsp), %rdx
leaq 0x38(%rsp), %rcx
leaq 0x30(%rsp), %r8
xorl %r9d, %r9d
callq 0x9c6d
testl %eax, %eax
movq %r13, %rbp
jne 0x6cf3
movq 0x50(%rsp), %rax
movb $0x0, 0x1(%rax)
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %rdi
xorl %r8d, %r8d
callq 0x9698
movq 0x20(%rsp), %r14
movzbl (%r14), %ecx
cmpl $0x30, %ecx
je 0x6c8e
cmpl $0x31, %ecx
jne 0x6d10
movq 0x38(%rsp), %rdx
incq %rdx
movq 0x30(%rsp), %rcx
incq %rcx
movq 0x40(%rsp), %rsi
testl %eax, %eax
je 0x6d23
leaq 0x8b702(%rip), %rdi     # 0x9238e
jmp 0x6cae
movq 0x38(%rsp), %rdx
incq %rdx
movq 0x30(%rsp), %rcx
incq %rcx
movq 0x40(%rsp), %rsi
testl %eax, %eax
jne 0x6d07
leaq 0x8b736(%rip), %rdi     # 0x923e4
xorl %eax, %eax
callq 0x61e2
incq %r14
cmpb $0x0, (%rbx)
movq 0x10(%rsp), %rcx
jne 0x6b34
movq %rbp, %rdi
callq 0x45d0
movq 0x28(%rsp), %rdi
callq 0x91b4
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8b32e(%rip), %rdi     # 0x9201c
movq %rbp, %rsi
jmp 0x6d1c
leaq 0x8b646(%rip), %rdi     # 0x92340
movq %rbp, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x6148
leaq 0x8b6a2(%rip), %rdi     # 0x923b0
jmp 0x6d2a
leaq 0x8b6f2(%rip), %rdi     # 0x92409
movq 0x48(%rsp), %rsi
xorl %eax, %eax
callq 0x6148
leaq 0x8b631(%rip), %rdi     # 0x9235b
xorl %eax, %eax
callq 0x6148