// File: /workspace/github_c_makefile_star2_O2/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 -0x3d8(%rip), %rsi      # 0x5abc
leaq -0x2e8(%rip), %rdx      # 0x5bb3
pushq $0x8
popq %rcx
xorl %edi, %edi
xorl %r8d, %r8d
callq 0x88ba
testq %rax, %rax
je 0x60b5
movq %rax, %rbx
leaq 0x6e206(%rip), %rsi     # 0x740c1
movq %rax, %rdi
callq 0x7f92
testl %eax, %eax
jne 0x60c3
leaq 0x6e217(%rip), %rsi     # 0x740e9
movq %rbx, %rdi
callq 0x7f92
testl %eax, %eax
jne 0x60d3
leaq 0x6e228(%rip), %rsi     # 0x74111
movq %rbx, %rdi
callq 0x7f92
testl %eax, %eax
jne 0x60e3
leaq 0x6e239(%rip), %rsi     # 0x74139
movq %rbx, %rdi
callq 0x7f92
testl %eax, %eax
jne 0x60f3
leaq 0x6e24a(%rip), %rsi     # 0x74161
movq %rbx, %rdi
callq 0x7f92
testl %eax, %eax
jne 0x6103
movq %rbx, %rdi
callq 0x918c
movq %rax, %r14
leaq 0x710e9(%rip), %rsi     # 0x77022
movl $0x98967f, %edx         # imm = 0x98967F
movl $0x98967f, %ecx         # imm = 0x98967F
movq %rbx, %rdi
movq %rax, %r8
callq 0x8c4c
testl %eax, %eax
je 0x6118
movq 0x10(%r14), %rax
movq (%rax), %r15
leaq 0x6e171(%rip), %rdi     # 0x740d5
movq %r15, %rsi
callq 0x46d0
testl %eax, %eax
jne 0x6126
leaq 0x710a7(%rip), %rsi     # 0x77022
movl $0x98967e, %edx         # imm = 0x98967E
movl $0x98967f, %ecx         # imm = 0x98967F
movq %rbx, %rdi
movq %r14, %r8
callq 0x8c4c
testl %eax, %eax
je 0x6141
leaq 0x71083(%rip), %rsi     # 0x77022
movl $0x98967e, %edx         # imm = 0x98967E
movl $0x989683, %ecx         # imm = 0x989683
movq %rbx, %rdi
movq %r14, %r8
callq 0x8c4c
testl %eax, %eax
je 0x6154
leaq 0x7105f(%rip), %rsi     # 0x77022
movl $0x98967e, %edx         # imm = 0x98967E
movl $0x98967e, %ecx         # imm = 0x98967E
movq %rbx, %rdi
movq %r14, %r8
callq 0x8c4c
testl %eax, %eax
jne 0x6167
leaq 0x7103b(%rip), %rsi     # 0x77022
movl $0x1312cff, %edx        # imm = 0x1312CFF
movl $0x1312cff, %ecx        # imm = 0x1312CFF
movq %rbx, %rdi
movq %r14, %r8
callq 0x8c4c
testl %eax, %eax
je 0x617a
leaq 0x71017(%rip), %rsi     # 0x77022
movl $0x1312d01, %edx        # imm = 0x1312D01
movl $0x1312d01, %ecx        # imm = 0x1312D01
movq %rbx, %rdi
movq %r14, %r8
callq 0x8c4c
testl %eax, %eax
je 0x618d
leaq 0x70ff3(%rip), %rsi     # 0x77022
movl $0x1c9c37f, %edx        # imm = 0x1C9C37F
movl $0x1c9c37f, %ecx        # imm = 0x1C9C37F
movq %rbx, %rdi
movq %r14, %r8
callq 0x8c4c
testl %eax, %eax
je 0x61a0
movabsq $0x1dcd64fff, %r15      # imm = 0x1DCD64FFF
leaq 0x70fc5(%rip), %rsi     # 0x77022
movq %rbx, %rdi
movq %r15, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0x8c4c
testl %eax, %eax
je 0x61b3
movl $0xdcd64fff, %r15d      # imm = 0xDCD64FFF
leaq 0x70f9f(%rip), %rsi     # 0x77022
movl $0xdcd64fff, %edx       # imm = 0xDCD64FFF
movl $0xdcd64fff, %ecx       # imm = 0xDCD64FFF
movq %rbx, %rdi
movq %r14, %r8
callq 0x8c4c
testl %eax, %eax
jne 0x61bf
movq %r14, %rdi
callq 0x91ec
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x87b0
leaq 0x6df48(%rip), %rdi     # 0x74004
xorl %eax, %eax
callq 0x5d48
leaq 0x6df52(%rip), %rdi     # 0x7401c
leaq 0x6dff0(%rip), %rsi     # 0x740c1
jmp 0x6111
leaq 0x6df42(%rip), %rdi     # 0x7401c
leaq 0x6e008(%rip), %rsi     # 0x740e9
jmp 0x6111
leaq 0x6df32(%rip), %rdi     # 0x7401c
leaq 0x6e020(%rip), %rsi     # 0x74111
jmp 0x6111
leaq 0x6df22(%rip), %rdi     # 0x7401c
leaq 0x6e038(%rip), %rsi     # 0x74139
jmp 0x6111
leaq 0x6df12(%rip), %rdi     # 0x7401c
leaq 0x6e050(%rip), %rsi     # 0x74161
xorl %eax, %eax
callq 0x5d48
leaq 0x6e072(%rip), %rdi     # 0x74191
movl $0x989680, %esi         # imm = 0x989680
jmp 0x614d
leaq 0x6e07d(%rip), %rdi     # 0x741aa
movl $0x989680, %esi         # imm = 0x989680
movl $0x989680, %edx         # imm = 0x989680
movq %r15, %rcx
xorl %eax, %eax
callq 0x5d48
leaq 0x6e049(%rip), %rdi     # 0x74191
movl $0x98967f, %esi         # imm = 0x98967F
movl $0x989680, %edx         # imm = 0x989680
jmp 0x61cf
leaq 0x6e036(%rip), %rdi     # 0x74191
movl $0x98967f, %esi         # imm = 0x98967F
movl $0x989682, %edx         # imm = 0x989682
jmp 0x61cf
leaq 0x6e023(%rip), %rdi     # 0x74191
movl $0x98967f, %esi         # imm = 0x98967F
movl $0x98967f, %edx         # imm = 0x98967F
jmp 0x61cf
leaq 0x6e010(%rip), %rdi     # 0x74191
movl $0x1312d00, %esi        # imm = 0x1312D00
movl $0x1312d00, %edx        # imm = 0x1312D00
jmp 0x61cf
leaq 0x6dffd(%rip), %rdi     # 0x74191
movl $0x1312d02, %esi        # imm = 0x1312D02
movl $0x1312d02, %edx        # imm = 0x1312D02
jmp 0x61cf
leaq 0x6dfea(%rip), %rdi     # 0x74191
movl $0x1c9c380, %esi        # imm = 0x1C9C380
movl $0x1c9c380, %edx        # imm = 0x1C9C380
jmp 0x61cf
incq %r15
leaq 0x6dfd4(%rip), %rdi     # 0x74191
jmp 0x61c9
incq %r15
leaq 0x6e000(%rip), %rdi     # 0x741c9
movq %r15, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x5d48