// File: /workspace/github_c_makefile_star2_O3/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 -0x42a(%rip), %rsi      # 0x5e6c
leaq -0x2fd(%rip), %rdx      # 0x5fa0
movl $0x8, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
callq 0x92d3
testq %rax, %rax
je 0x64b9
movq %rax, %rbx
leaq 0x8be02(%rip), %rsi     # 0x920c1
movq %rax, %rdi
callq 0x87cd
testl %eax, %eax
jne 0x64c7
leaq 0x8be13(%rip), %rsi     # 0x920e9
movq %rbx, %rdi
callq 0x87cd
testl %eax, %eax
jne 0x64d7
leaq 0x8be24(%rip), %rsi     # 0x92111
movq %rbx, %rdi
callq 0x87cd
testl %eax, %eax
jne 0x64e7
leaq 0x8be35(%rip), %rsi     # 0x92139
movq %rbx, %rdi
callq 0x87cd
testl %eax, %eax
jne 0x64f7
leaq 0x8be46(%rip), %rsi     # 0x92161
movq %rbx, %rdi
callq 0x87cd
testl %eax, %eax
jne 0x6507
movq %rbx, %rdi
callq 0x9def
movq %rax, %r14
leaq 0x8ed6a(%rip), %rsi     # 0x950a7
movl $0x98967f, %edx         # imm = 0x98967F
movl $0x98967f, %ecx         # imm = 0x98967F
movq %rbx, %rdi
movq %rax, %r8
callq 0x9698
testl %eax, %eax
je 0x651c
movq 0x10(%r14), %rax
movq (%rax), %r15
leaq 0x8bd6d(%rip), %rdi     # 0x920d5
movq %r15, %rsi
callq 0x46d0
testl %eax, %eax
jne 0x652a
leaq 0x8ed28(%rip), %rsi     # 0x950a7
movl $0x98967e, %edx         # imm = 0x98967E
movl $0x98967f, %ecx         # imm = 0x98967F
movq %rbx, %rdi
movq %r14, %r8
callq 0x9698
testl %eax, %eax
je 0x6545
leaq 0x8ed04(%rip), %rsi     # 0x950a7
movl $0x98967e, %edx         # imm = 0x98967E
movl $0x989683, %ecx         # imm = 0x989683
movq %rbx, %rdi
movq %r14, %r8
callq 0x9698
testl %eax, %eax
je 0x6558
leaq 0x8ece0(%rip), %rsi     # 0x950a7
movl $0x98967e, %edx         # imm = 0x98967E
movl $0x98967e, %ecx         # imm = 0x98967E
movq %rbx, %rdi
movq %r14, %r8
callq 0x9698
testl %eax, %eax
jne 0x656b
leaq 0x8ecbc(%rip), %rsi     # 0x950a7
movl $0x1312cff, %edx        # imm = 0x1312CFF
movl $0x1312cff, %ecx        # imm = 0x1312CFF
movq %rbx, %rdi
movq %r14, %r8
callq 0x9698
testl %eax, %eax
je 0x657e
leaq 0x8ec98(%rip), %rsi     # 0x950a7
movl $0x1312d01, %edx        # imm = 0x1312D01
movl $0x1312d01, %ecx        # imm = 0x1312D01
movq %rbx, %rdi
movq %r14, %r8
callq 0x9698
testl %eax, %eax
je 0x6591
leaq 0x8ec74(%rip), %rsi     # 0x950a7
movl $0x1c9c37f, %edx        # imm = 0x1C9C37F
movl $0x1c9c37f, %ecx        # imm = 0x1C9C37F
movq %rbx, %rdi
movq %r14, %r8
callq 0x9698
testl %eax, %eax
je 0x65a4
movabsq $0x1dcd64fff, %r15      # imm = 0x1DCD64FFF
leaq 0x8ec46(%rip), %rsi     # 0x950a7
movq %rbx, %rdi
movq %r15, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0x9698
testl %eax, %eax
je 0x65b7
movl $0xdcd64fff, %r15d      # imm = 0xDCD64FFF
leaq 0x8ec20(%rip), %rsi     # 0x950a7
movl $0xdcd64fff, %edx       # imm = 0xDCD64FFF
movl $0xdcd64fff, %ecx       # imm = 0xDCD64FFF
movq %rbx, %rdi
movq %r14, %r8
callq 0x9698
testl %eax, %eax
jne 0x65c3
movq %r14, %rdi
callq 0x9e57
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x91b4
leaq 0x8bb44(%rip), %rdi     # 0x92004
xorl %eax, %eax
callq 0x6148
leaq 0x8bb4e(%rip), %rdi     # 0x9201c
leaq 0x8bbec(%rip), %rsi     # 0x920c1
jmp 0x6515
leaq 0x8bb3e(%rip), %rdi     # 0x9201c
leaq 0x8bc04(%rip), %rsi     # 0x920e9
jmp 0x6515
leaq 0x8bb2e(%rip), %rdi     # 0x9201c
leaq 0x8bc1c(%rip), %rsi     # 0x92111
jmp 0x6515
leaq 0x8bb1e(%rip), %rdi     # 0x9201c
leaq 0x8bc34(%rip), %rsi     # 0x92139
jmp 0x6515
leaq 0x8bb0e(%rip), %rdi     # 0x9201c
leaq 0x8bc4c(%rip), %rsi     # 0x92161
xorl %eax, %eax
callq 0x6148
leaq 0x8bc6e(%rip), %rdi     # 0x92191
movl $0x989680, %esi         # imm = 0x989680
jmp 0x6551
leaq 0x8bc79(%rip), %rdi     # 0x921aa
movl $0x989680, %esi         # imm = 0x989680
movl $0x989680, %edx         # imm = 0x989680
movq %r15, %rcx
xorl %eax, %eax
callq 0x6148
leaq 0x8bc45(%rip), %rdi     # 0x92191
movl $0x98967f, %esi         # imm = 0x98967F
movl $0x989680, %edx         # imm = 0x989680
jmp 0x65d3
leaq 0x8bc32(%rip), %rdi     # 0x92191
movl $0x98967f, %esi         # imm = 0x98967F
movl $0x989682, %edx         # imm = 0x989682
jmp 0x65d3
leaq 0x8bc1f(%rip), %rdi     # 0x92191
movl $0x98967f, %esi         # imm = 0x98967F
movl $0x98967f, %edx         # imm = 0x98967F
jmp 0x65d3
leaq 0x8bc0c(%rip), %rdi     # 0x92191
movl $0x1312d00, %esi        # imm = 0x1312D00
movl $0x1312d00, %edx        # imm = 0x1312D00
jmp 0x65d3
leaq 0x8bbf9(%rip), %rdi     # 0x92191
movl $0x1312d02, %esi        # imm = 0x1312D02
movl $0x1312d02, %edx        # imm = 0x1312D02
jmp 0x65d3
leaq 0x8bbe6(%rip), %rdi     # 0x92191
movl $0x1c9c380, %esi        # imm = 0x1C9C380
movl $0x1c9c380, %edx        # imm = 0x1C9C380
jmp 0x65d3
incq %r15
leaq 0x8bbd0(%rip), %rdi     # 0x92191
jmp 0x65cd
incq %r15
leaq 0x8bbfc(%rip), %rdi     # 0x921c9
movq %r15, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x6148