// File: /workspace/github_c_makefile_star2_O1/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 0x328e(%rip), %rsi      # 0x9c86
xorl %ebp, %ebp
xorl %edi, %edi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x92c7
movq %rax, 0x28(%rsp)
cmpb $0x0, (%rbx)
je 0x6b14
movq %rbx, %r13
xorl %ebp, %ebp
xorl %ecx, %ecx
xorl %r15d, %r15d
movzbl (%rbx,%r15), %eax
testl %eax, %eax
je 0x6a33
cmpl $0x3b, %eax
je 0x6a33
incq %r15
jmp 0x6a20
movq %rbx, %r14
subq %r13, %r14
leaq (%r14,%r15), %rdx
movq %rdx, %rax
addq $0x2, %rax
je 0x6a95
cmpq %rax, %rcx
jae 0x6aa7
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 0x6aaf
jmp 0x6acf
movq %rcx, 0x10(%rsp)
callq 0x4050
movl $0x4b, (%rax)
jmp 0x6acf
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 0x8d85e(%rip), %rdi     # 0x94334
movq %rbp, %rsi
xorl %eax, %eax
callq 0x61db
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x8743
testl %eax, %eax
jne 0x6cdc
leaq (%rbx,%r15), %r13
cmpb $0x1, (%rbx,%r15)
sbbq $-0x1, %r13
cmpb $0x0, (%r13)
movq 0x10(%rsp), %rcx
jne 0x6a1d
jmp 0x6b16
xorl %ecx, %ecx
cmpb $0x0, (%r12)
je 0x6cbb
movq 0x48(%rsp), %r14
movq %r12, %rbx
xorl %r15d, %r15d
movzbl (%r12,%r15), %eax
testl %eax, %eax
je 0x6b3f
cmpl $0x3b, %eax
je 0x6b3f
incq %r15
jmp 0x6b2c
movq %r14, 0x20(%rsp)
movq %rbp, %r13
movq %r12, %rbp
subq %rbx, %rbp
leaq (%r15,%rbp), %rdx
movq %rdx, %rax
addq $0x2, %rax
je 0x6ba8
cmpq %rax, %rcx
jae 0x6bba
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 0x6bc2
jmp 0x6be2
movq %rcx, 0x10(%rsp)
callq 0x4050
movl $0x4b, (%rax)
jmp 0x6be2
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 0x9c86
testl %eax, %eax
movq %r13, %rbp
jne 0x6ce8
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 0x96b7
movq 0x20(%rsp), %r14
movzbl (%r14), %ecx
cmpl $0x30, %ecx
je 0x6c83
cmpl $0x31, %ecx
jne 0x6d05
movq 0x38(%rsp), %rdx
incq %rdx
movq 0x30(%rsp), %rcx
incq %rcx
movq 0x40(%rsp), %rsi
testl %eax, %eax
je 0x6d18
leaq 0x8d70d(%rip), %rdi     # 0x9438e
jmp 0x6ca3
movq 0x38(%rsp), %rdx
incq %rdx
movq 0x30(%rsp), %rcx
incq %rcx
movq 0x40(%rsp), %rsi
testl %eax, %eax
jne 0x6cfc
leaq 0x8d741(%rip), %rdi     # 0x943e4
xorl %eax, %eax
callq 0x61db
incq %r14
cmpb $0x0, (%rbx)
movq 0x10(%rsp), %rcx
jne 0x6b29
movq %rbp, %rdi
callq 0x45d0
movq 0x28(%rsp), %rdi
callq 0x91ad
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8d339(%rip), %rdi     # 0x9401c
movq %rbp, %rsi
jmp 0x6d11
leaq 0x8d651(%rip), %rdi     # 0x94340
movq %rbp, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x6141
leaq 0x8d6ad(%rip), %rdi     # 0x943b0
jmp 0x6d1f
leaq 0x8d6fd(%rip), %rdi     # 0x94409
movq 0x48(%rsp), %rsi
xorl %eax, %eax
callq 0x6141
leaq 0x8d63c(%rip), %rdi     # 0x9435b
xorl %eax, %eax
callq 0x6141