// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
xorl %eax, %eax
movl %eax, %r8d
leaq -0x5f4(%rip), %rsi      # 0x5ac0
leaq -0x3ab(%rip), %rdx      # 0x5d10
movl $0x8, %ecx
movq %r8, %rdi
callq 0xa300
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x60e1
leaq 0xe4f2a(%rip), %rdi     # 0xeb004
movb $0x0, %al
callq 0x5f40
leaq 0xe4fd9(%rip), %rax     # 0xeb0c1
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9630
cmpl $0x0, %eax
je 0x6110
movq -0x10(%rbp), %rsi
leaq 0xe4f13(%rip), %rdi     # 0xeb01c
movb $0x0, %al
callq 0x5f40
leaq 0xe4fd2(%rip), %rax     # 0xeb0e9
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9630
cmpl $0x0, %eax
je 0x613f
movq -0x10(%rbp), %rsi
leaq 0xe4ee4(%rip), %rdi     # 0xeb01c
movb $0x0, %al
callq 0x5f40
leaq 0xe4fcb(%rip), %rax     # 0xeb111
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9630
cmpl $0x0, %eax
je 0x616e
movq -0x10(%rbp), %rsi
leaq 0xe4eb5(%rip), %rdi     # 0xeb01c
movb $0x0, %al
callq 0x5f40
leaq 0xe4fc4(%rip), %rax     # 0xeb139
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9630
cmpl $0x0, %eax
je 0x619d
movq -0x10(%rbp), %rsi
leaq 0xe4e86(%rip), %rdi     # 0xeb01c
movb $0x0, %al
callq 0x5f40
leaq 0xe4fbd(%rip), %rax     # 0xeb161
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9630
cmpl $0x0, %eax
je 0x61cc
movq -0x10(%rbp), %rsi
leaq 0xe4e57(%rip), %rdi     # 0xeb01c
movb $0x0, %al
callq 0x5f40
movq -0x8(%rbp), %rdi
callq 0xb300
movq %rax, -0x18(%rbp)
movq $0x989680, -0x28(%rbp)  # imm = 0x989680
movq $0x989680, -0x20(%rbp)  # imm = 0x989680
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
movq -0x18(%rbp), %r8
leaq 0xe81ad(%rip), %rsi     # 0xee3b5
callq 0xa910
cmpl $0x0, %eax
jne 0x6228
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq 0xe4f70(%rip), %rdi     # 0xeb191
movb $0x0, %al
callq 0x5f40
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rsi
leaq 0xe4e9b(%rip), %rdi     # 0xeb0d5
callq 0x46a0
cmpl $0x0, %eax
je 0x6265
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rcx
leaq 0xe4f4c(%rip), %rdi     # 0xeb1aa
movb $0x0, %al
callq 0x5f40
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
subq $0x2, %rdx
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
movq -0x18(%rbp), %r8
leaq 0xe8131(%rip), %rsi     # 0xee3b5
callq 0xa910
cmpl $0x0, %eax
jne 0x62a8
movq -0x20(%rbp), %rsi
subq $0x1, %rsi
movq -0x28(%rbp), %rdx
leaq 0xe4ef0(%rip), %rdi     # 0xeb191
movb $0x0, %al
callq 0x5f40
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
subq $0x2, %rdx
movq -0x28(%rbp), %rcx
addq $0x3, %rcx
movq -0x18(%rbp), %r8
leaq 0xe80ee(%rip), %rsi     # 0xee3b5
callq 0xa910
cmpl $0x0, %eax
jne 0x62ef
movq -0x20(%rbp), %rsi
subq $0x1, %rsi
movq -0x28(%rbp), %rdx
addq $0x2, %rdx
leaq 0xe4ea9(%rip), %rdi     # 0xeb191
movb $0x0, %al
callq 0x5f40
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
subq $0x2, %rdx
movq -0x28(%rbp), %rcx
subq $0x2, %rcx
movq -0x18(%rbp), %r8
leaq 0xe80a7(%rip), %rsi     # 0xee3b5
callq 0xa910
cmpl $0x0, %eax
je 0x6336
movq -0x20(%rbp), %rsi
subq $0x1, %rsi
movq -0x28(%rbp), %rdx
subq $0x1, %rdx
leaq 0xe4e62(%rip), %rdi     # 0xeb191
movb $0x0, %al
callq 0x5f40
movq $0x1312d00, -0x28(%rbp) # imm = 0x1312D00
movq $0x1312d00, -0x20(%rbp) # imm = 0x1312D00
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
movq -0x18(%rbp), %r8
leaq 0xe8050(%rip), %rsi     # 0xee3b5
callq 0xa910
cmpl $0x0, %eax
jne 0x6385
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq 0xe4e13(%rip), %rdi     # 0xeb191
movb $0x0, %al
callq 0x5f40
movq $0x1312d02, -0x28(%rbp) # imm = 0x1312D02
movq $0x1312d02, -0x20(%rbp) # imm = 0x1312D02
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
movq -0x18(%rbp), %r8
leaq 0xe8001(%rip), %rsi     # 0xee3b5
callq 0xa910
cmpl $0x0, %eax
jne 0x63d4
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq 0xe4dc4(%rip), %rdi     # 0xeb191
movb $0x0, %al
callq 0x5f40
movq $0x1c9c380, -0x28(%rbp) # imm = 0x1C9C380
movq $0x1c9c380, -0x20(%rbp) # imm = 0x1C9C380
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
movq -0x18(%rbp), %r8
leaq 0xe7fb2(%rip), %rsi     # 0xee3b5
callq 0xa910
cmpl $0x0, %eax
jne 0x6423
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq 0xe4d75(%rip), %rdi     # 0xeb191
movb $0x0, %al
callq 0x5f40
movabsq $0x1dcd65000, %rax      # imm = 0x1DCD65000
movq %rax, -0x28(%rbp)
movabsq $0x1dcd65000, %rax      # imm = 0x1DCD65000
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
movq -0x18(%rbp), %r8
leaq 0xe7f57(%rip), %rsi     # 0xee3b5
callq 0xa910
cmpl $0x0, %eax
jne 0x647e
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq 0xe4d1a(%rip), %rdi     # 0xeb191
movb $0x0, %al
callq 0x5f40
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
movq -0x18(%rbp), %r8
leaq 0xe7ef4(%rip), %rsi     # 0xee3b5
callq 0xa910
cmpl $0x0, %eax
je 0x64e1
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq 0xe4cef(%rip), %rdi     # 0xeb1c9
movb $0x0, %al
callq 0x5f40
movq -0x18(%rbp), %rdi
callq 0xb3e0
movq -0x8(%rbp), %rdi
callq 0xa1e0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)