// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
xorl %eax, %eax
movl %eax, %r8d
leaq 0x477d(%rip), %rsi      # 0xb060
movq %r8, %rdi
movq %r8, %rdx
movq %r8, %rcx
callq 0xa300
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x4250
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0x69e7
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x75(%rbp)
je 0x694b
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
setne %al
movb %al, -0x75(%rbp)
movb -0x75(%rbp), %al
testb $0x1, %al
jne 0x6954
jmp 0x6962
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x692a
movq $0x0, -0x50(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rax
subq %rax, %rsi
leaq -0x50(%rbp), %rdx
callq 0x6bf0
movq -0x40(%rbp), %rsi
leaq 0xe49a7(%rip), %rdi     # 0xeb334
movb $0x0, %al
callq 0x5ff0
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x9630
cmpl $0x0, %eax
je 0x69b8
movq -0x40(%rbp), %rsi
leaq 0xe466b(%rip), %rdi     # 0xeb01c
movb $0x0, %al
callq 0x5f40
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x69d2
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x69da
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x6915
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0x6bd3
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x81(%rbp)
je 0x6a2b
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
setne %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x6a37
jmp 0x6a45
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x6a04
movq $0x0, -0x50(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rax
subq %rax, %rsi
leaq -0x50(%rbp), %rdx
callq 0x6bf0
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x6a82
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x6a8d
movq -0x30(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdx
leaq -0x68(%rbp), %rcx
leaq -0x70(%rbp), %r8
xorl %eax, %eax
movl %eax, %r9d
movq $0x0, (%rsp)
callq 0xb060
cmpl $0x0, %eax
je 0x6ad9
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0xe486e(%rip), %rdi     # 0xeb340
movb $0x0, %al
callq 0x5f40
movq -0x60(%rbp), %rax
movb $0x0, 0x1(%rax)
movq -0x20(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x70(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0xa910
movl %eax, -0x74(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0x6b56
cmpl $0x0, -0x74(%rbp)
jne 0x6b32
movq -0x58(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq $0x1, %rdx
movq -0x70(%rbp), %rcx
addq $0x1, %rcx
leaq 0xe4830(%rip), %rdi     # 0xeb35b
movb $0x0, %al
callq 0x5f40
movq -0x58(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq $0x1, %rdx
movq -0x70(%rbp), %rcx
addq $0x1, %rcx
leaq 0xe4841(%rip), %rdi     # 0xeb38e
movb $0x0, %al
callq 0x5ff0
jmp 0x6bc2
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x6bae
cmpl $0x0, -0x74(%rbp)
je 0x6b8a
movq -0x58(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq $0x1, %rdx
movq -0x70(%rbp), %rcx
addq $0x1, %rcx
leaq 0xe482d(%rip), %rdi     # 0xeb3b0
movb $0x0, %al
callq 0x5f40
movq -0x58(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq $0x1, %rdx
movq -0x70(%rbp), %rcx
addq $0x1, %rcx
leaq 0xe483f(%rip), %rdi     # 0xeb3e4
movb $0x0, %al
callq 0x5ff0
jmp 0x6bc0
movq -0x38(%rbp), %rsi
leaq 0xe4850(%rip), %rdi     # 0xeb409
movb $0x0, %al
callq 0x5f40
jmp 0x6bc2
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x69ef
movq -0x40(%rbp), %rdi
callq 0x45b0
movq -0x20(%rbp), %rdi
callq 0xa1e0
addq $0xa0, %rsp
popq %rbp
retq
nop