// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test-regidx.c
// Function: test_custom_payload
void test_custom_payload(void)
{
    // Init index with no file name, we will insert the regions manually
    regidx_t *idx = regidx_init(NULL,custom_parse,custom_free,sizeof(char*),NULL);
    if ( !idx ) error("init failed\n");

    // Insert regions
    char *line;
    line = "1 10000000 10000000 1:10000000-10000000"; if ( regidx_insert(idx,line)!=0 ) error("insert failed: %s\n", line);
    line = "1 20000000 20000001 1:20000000-20000001"; if ( regidx_insert(idx,line)!=0 ) error("insert failed: %s\n", line);
    line = "1 20000002 20000002 1:20000002-20000002"; if ( regidx_insert(idx,line)!=0 ) error("insert failed: %s\n", line);
    line = "1 30000000 30000000 1:30000000-30000000"; if ( regidx_insert(idx,line)!=0 ) error("insert failed: %s\n", line);
    line = "1 8000000000 8000000000 1:8000000000-8000000000"; if ( regidx_insert(idx,line)!=0 ) error("insert failed: %s\n", line);

    // Test
    regitr_t *itr = regitr_init(idx);
    hts_pos_t from, to;

    from = to = 10000000;
    if ( !regidx_overlap(idx,"1",from-1,to-1,itr) ) error("query failed: 1:%"PRIhts_pos"-%"PRIhts_pos"\n",from,to);
    if ( strcmp("1:10000000-10000000",regitr_payload(itr,char*)) ) error("query failed: 1:%"PRIhts_pos"-%"PRIhts_pos" vs %s\n", from,to,regitr_payload(itr,char*));
    if ( !regidx_overlap(idx,"1",from-2,to-1,itr) ) error("query failed: 1:%"PRIhts_pos"-%"PRIhts_pos"\n",from-1,to);
    if ( !regidx_overlap(idx,"1",from-2,to+3,itr) ) error("query failed: 1:%"PRIhts_pos"-%"PRIhts_pos"\n",from-1,to+2);
    if ( regidx_overlap(idx,"1",from-2,to-2,itr) ) error("query failed: 1:%"PRIhts_pos"-%"PRIhts_pos"\n",from-1,to-1);

    from = to = 20000000;
    if ( !regidx_overlap(idx,"1",from-1,to-1,itr) ) error("query failed: 1:%"PRIhts_pos"-%"PRIhts_pos"\n",from,to);

    from = to = 20000002;
    if ( !regidx_overlap(idx,"1",from-1,to-1,itr) ) error("query failed: 1:%"PRIhts_pos"-%"PRIhts_pos"\n",from,to);

    from = to = 30000000;
    if ( !regidx_overlap(idx,"1",from-1,to-1,itr) ) error("query failed: 1:%"PRIhts_pos"-%"PRIhts_pos"\n",from,to);

    from = to = 8000000000;
    if ( !regidx_overlap(idx,"1",from-1,to-1,itr) ) error("query failed: 1:%"PRIhts_pos"-%"PRIhts_pos"\n",from,to);

    // This shouldn't bring anything back
    from &= 0xffffffffU;
    to   &= 0xffffffffU;
    if ( regidx_overlap(idx,"1",from-1,to-1,itr) ) error("query should not succeed: 1:%"PRIhts_pos"-%"PRIhts_pos"\n",from,to);

    // Clean up
    regitr_destroy(itr);
    regidx_destroy(idx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq -0x433(%rip), %rsi      # 0x5e5c
leaq -0x303(%rip), %rdx      # 0x5f93
movl $0x8, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
callq 0x92c7
testq %rax, %rax
je 0x64b2
movq %rax, %rbx
leaq 0x8de09(%rip), %rsi     # 0x940c1
movq %rax, %rdi
callq 0x8743
testl %eax, %eax
jne 0x64c0
leaq 0x8de1a(%rip), %rsi     # 0x940e9
movq %rbx, %rdi
callq 0x8743
testl %eax, %eax
jne 0x64d0
leaq 0x8de2b(%rip), %rsi     # 0x94111
movq %rbx, %rdi
callq 0x8743
testl %eax, %eax
jne 0x64e0
leaq 0x8de3c(%rip), %rsi     # 0x94139
movq %rbx, %rdi
callq 0x8743
testl %eax, %eax
jne 0x64f0
leaq 0x8de4d(%rip), %rsi     # 0x94161
movq %rbx, %rdi
callq 0x8743
testl %eax, %eax
jne 0x6500
movq %rbx, %rdi
callq 0x9df9
movq %rax, %r14
leaq 0x90d6e(%rip), %rsi     # 0x970a4
movl $0x98967f, %edx         # imm = 0x98967F
movl $0x98967f, %ecx         # imm = 0x98967F
movq %rbx, %rdi
movq %rax, %r8
callq 0x96b7
testl %eax, %eax
je 0x6515
movq 0x10(%r14), %rax
movq (%rax), %r15
leaq 0x8dd74(%rip), %rdi     # 0x940d5
movq %r15, %rsi
callq 0x46d0
testl %eax, %eax
jne 0x6523
leaq 0x90d2c(%rip), %rsi     # 0x970a4
movl $0x98967e, %edx         # imm = 0x98967E
movl $0x98967f, %ecx         # imm = 0x98967F
movq %rbx, %rdi
movq %r14, %r8
callq 0x96b7
testl %eax, %eax
je 0x653e
leaq 0x90d08(%rip), %rsi     # 0x970a4
movl $0x98967e, %edx         # imm = 0x98967E
movl $0x989683, %ecx         # imm = 0x989683
movq %rbx, %rdi
movq %r14, %r8
callq 0x96b7
testl %eax, %eax
je 0x6551
leaq 0x90ce4(%rip), %rsi     # 0x970a4
movl $0x98967e, %edx         # imm = 0x98967E
movl $0x98967e, %ecx         # imm = 0x98967E
movq %rbx, %rdi
movq %r14, %r8
callq 0x96b7
testl %eax, %eax
jne 0x6564
leaq 0x90cc0(%rip), %rsi     # 0x970a4
movl $0x1312cff, %edx        # imm = 0x1312CFF
movl $0x1312cff, %ecx        # imm = 0x1312CFF
movq %rbx, %rdi
movq %r14, %r8
callq 0x96b7
testl %eax, %eax
je 0x6577
leaq 0x90c9c(%rip), %rsi     # 0x970a4
movl $0x1312d01, %edx        # imm = 0x1312D01
movl $0x1312d01, %ecx        # imm = 0x1312D01
movq %rbx, %rdi
movq %r14, %r8
callq 0x96b7
testl %eax, %eax
je 0x658a
leaq 0x90c78(%rip), %rsi     # 0x970a4
movl $0x1c9c37f, %edx        # imm = 0x1C9C37F
movl $0x1c9c37f, %ecx        # imm = 0x1C9C37F
movq %rbx, %rdi
movq %r14, %r8
callq 0x96b7
testl %eax, %eax
je 0x659d
movabsq $0x1dcd64fff, %r15      # imm = 0x1DCD64FFF
leaq 0x90c4a(%rip), %rsi     # 0x970a4
movq %rbx, %rdi
movq %r15, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0x96b7
testl %eax, %eax
je 0x65b0
movl $0xdcd64fff, %r15d      # imm = 0xDCD64FFF
leaq 0x90c24(%rip), %rsi     # 0x970a4
movl $0xdcd64fff, %edx       # imm = 0xDCD64FFF
movl $0xdcd64fff, %ecx       # imm = 0xDCD64FFF
movq %rbx, %rdi
movq %r14, %r8
callq 0x96b7
testl %eax, %eax
jne 0x65bc
movq %r14, %rdi
callq 0x9e69
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x91ad
leaq 0x8db4b(%rip), %rdi     # 0x94004
xorl %eax, %eax
callq 0x6141
leaq 0x8db55(%rip), %rdi     # 0x9401c
leaq 0x8dbf3(%rip), %rsi     # 0x940c1
jmp 0x650e
leaq 0x8db45(%rip), %rdi     # 0x9401c
leaq 0x8dc0b(%rip), %rsi     # 0x940e9
jmp 0x650e
leaq 0x8db35(%rip), %rdi     # 0x9401c
leaq 0x8dc23(%rip), %rsi     # 0x94111
jmp 0x650e
leaq 0x8db25(%rip), %rdi     # 0x9401c
leaq 0x8dc3b(%rip), %rsi     # 0x94139
jmp 0x650e
leaq 0x8db15(%rip), %rdi     # 0x9401c
leaq 0x8dc53(%rip), %rsi     # 0x94161
xorl %eax, %eax
callq 0x6141
leaq 0x8dc75(%rip), %rdi     # 0x94191
movl $0x989680, %esi         # imm = 0x989680
jmp 0x654a
leaq 0x8dc80(%rip), %rdi     # 0x941aa
movl $0x989680, %esi         # imm = 0x989680
movl $0x989680, %edx         # imm = 0x989680
movq %r15, %rcx
xorl %eax, %eax
callq 0x6141
leaq 0x8dc4c(%rip), %rdi     # 0x94191
movl $0x98967f, %esi         # imm = 0x98967F
movl $0x989680, %edx         # imm = 0x989680
jmp 0x65cc
leaq 0x8dc39(%rip), %rdi     # 0x94191
movl $0x98967f, %esi         # imm = 0x98967F
movl $0x989682, %edx         # imm = 0x989682
jmp 0x65cc
leaq 0x8dc26(%rip), %rdi     # 0x94191
movl $0x98967f, %esi         # imm = 0x98967F
movl $0x98967f, %edx         # imm = 0x98967F
jmp 0x65cc
leaq 0x8dc13(%rip), %rdi     # 0x94191
movl $0x1312d00, %esi        # imm = 0x1312D00
movl $0x1312d00, %edx        # imm = 0x1312D00
jmp 0x65cc
leaq 0x8dc00(%rip), %rdi     # 0x94191
movl $0x1312d02, %esi        # imm = 0x1312D02
movl $0x1312d02, %edx        # imm = 0x1312D02
jmp 0x65cc
leaq 0x8dbed(%rip), %rdi     # 0x94191
movl $0x1c9c380, %esi        # imm = 0x1C9C380
movl $0x1c9c380, %edx        # imm = 0x1C9C380
jmp 0x65cc
incq %r15
leaq 0x8dbd7(%rip), %rdi     # 0x94191
jmp 0x65c6
incq %r15
leaq 0x8dc03(%rip), %rdi     # 0x941c9
movq %r15, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x6141