// File: /workspace/github_c_makefile_star2_O1/johsteffens[P]beth/lib/bcore/bcore.xo.c
// Function: bcore_indexer_selftest
void bcore_indexer_selftest( void )
{
    // bcore_indexer.h:113:1
    BLM_INIT_LEVEL(0);
    bcore_prsg_lcg_u3_00_s prsg;BLM_T_INIT_SPUSH(bcore_prsg_lcg_u3_00_s, &prsg);;
    
    sz_t n = 100;   // containers
    sz_t m = 1000;  // container size-range
    sz_t t = 10000; // test samples
    
    bcore_arr_s3_s arr;BLM_T_INIT_SPUSH(bcore_arr_s3_s, &arr);bcore_arr_s3_s_set_size(&(arr),n );
    {const bcore_arr_s3_s* __a=&(arr );if(__a)for(sz_t __i=0;__i<__a->size;__i++){s3_t* e=&(__a->data[__i]); { (*(e)) = bcore_prsg_lcg_u3_00_s_gen_f3(&(prsg),0.0, m ); }
    
    }}bcore_indexer_s indexer;BLM_T_INIT_SPUSH(bcore_indexer_s, &indexer);bcore_indexer_s_setup(&(indexer),&(arr ));
    
    s3_t sum = 0;
    {const bcore_arr_s3_s* __a=&(arr );if(__a)for(sz_t __i=0;__i<__a->size;__i++){s3_t* e=&(__a->data[__i]); { sum += (*(e)); }
    }}ASSERT( sum == indexer.size );
    
    for(sz_t i = 0; i < t; i++ )
    {
        s3_t c = bcore_prsg_lcg_u3_00_s_gen_f3(&(prsg),-indexer.size, 2 * indexer.size );
    
        bcore_indexer_io_s io0 = { 0 };
        s3_t sum = 0;
        {const bcore_arr_s3_s* __a=&(arr );if(__a)for(sz_t __i=0;__i<__a->size;__i++){const s3_t* e=&(__a->data[__i]);
        {
            if( sum + (*(e)) > c )
            {
                io0.i = __i;
                io0.o = c - sum;
                break;
            }
            sum += (*(e));
        }
    
        }}bcore_indexer_io_s io1;
        if( bcore_indexer_s_get_io(&(indexer),c,&( io1 )) )
        {
            if( io0.i != io1.i )
            {
                bcore_indexer_s_get_io(&(indexer),c,&( io1 ));
            }
            ASSERT( io0.i == io1.i );
            ASSERT( io0.o == io1.o );
        }
        else
        {
            ASSERT( c < 0 || c >= indexer.size );
        }
    }
    
    BLM_DOWN();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movabsq $0x1c140000000001cd, %r15 # imm = 0x1C140000000001CD
leaq 0x133845(%rip), %rax    # 0x1a8dd0
movq (%rax), %rsi
leaq 0xa8(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xe0431
movq 0x8(%rsp), %rbx
movq $0x0, 0x10(%rbx)
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x5ec0a
movabsq $-0x1804b258fae5f3f6, %rsi # imm = 0xE7FB4DA7051A0C0A
movq %rbx, %rdi
movq %r14, %rdx
callq 0xe06ab
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0xc191e
movabsq $0x2cabd5fd9af9a7b7, %rsi # imm = 0x2CABD5FD9AF9A7B7
movq %rbx, %rdi
movq %r14, %rdx
callq 0xe06ab
movl $0x64, %esi
movq %r14, %rdi
callq 0xc1b08
cmpq $0x0, 0x10(%r14)
je 0x75679
xorl %eax, %eax
movq 0xccc81(%rip), %xmm0    # 0x142290
movapd 0xccc89(%rip), %xmm1    # 0x1422a0
movsd 0xcccb1(%rip), %xmm2    # 0x1422d0
movsd 0xcccc1(%rip), %xmm3    # 0x1422e8
xorpd %xmm4, %xmm4
movq 0x38(%rsp), %rcx
movq 0x18(%rsp), %rdx
imulq %r15, %rdx
incq %rdx
movq %rdx, 0x18(%rsp)
movq %rdx, %xmm5
punpckldq %xmm0, %xmm5    # xmm5 = xmm5[0],xmm0[0],xmm5[1],xmm0[1]
subpd %xmm1, %xmm5
movapd %xmm5, %xmm6
unpckhpd %xmm5, %xmm6            # xmm6 = xmm6[1],xmm5[1]
addsd %xmm5, %xmm6
mulsd %xmm2, %xmm6
mulsd %xmm3, %xmm6
addsd %xmm4, %xmm6
cvttsd2si %xmm6, %rdx
movq %rdx, (%rcx,%rax,8)
incq %rax
cmpq 0x40(%rsp), %rax
jb 0x7562b
leaq 0x50(%rsp), %r14
movq %r14, %rdi
callq 0x74d67
movabsq $0x3fe3e37538d925bc, %rsi # imm = 0x3FE3E37538D925BC
movq %rbx, %rdi
movq %r14, %rdx
callq 0xe06ab
leaq 0x30(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x751de
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x756cb
movq 0x38(%rsp), %rdx
xorl %eax, %eax
xorl %esi, %esi
addq (%rdx,%rsi,8), %rax
incq %rsi
cmpq %rsi, %rcx
jne 0x756bd
jmp 0x756cd
xorl %eax, %eax
cmpq 0xa0(%rsp), %rax
je 0x75700
leaq 0xc2f69(%rip), %rdi     # 0x138647
leaq 0xcd6bc(%rip), %rsi     # 0x142da1
leaq 0xcd6c9(%rip), %rdx     # 0x142db5
leaq 0xccdc3(%rip), %rcx     # 0x1424b6
movl $0xcba, %r8d            # imm = 0xCBA
xorl %eax, %eax
callq 0xc8053
leaq 0x20(%rsp), %r14
xorl %r13d, %r13d
movq 0xa0(%rsp), %rax
movq %rax, %rcx
negq %rcx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
addq %rax, %rax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
movq 0x18(%rsp), %rax
movq %r15, %rbx
imulq %r15, %rax
incq %rax
movq %rax, 0x18(%rsp)
subsd %xmm0, %xmm1
movq %rax, %xmm2
punpckldq 0xccb42(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0xccb4a(%rip), %xmm2    # 0x1422a0
movapd %xmm2, %xmm3
unpckhpd %xmm2, %xmm3            # xmm3 = xmm3[1],xmm2[1]
addsd %xmm2, %xmm3
mulsd 0xccb66(%rip), %xmm3    # 0x1422d0
mulsd %xmm1, %xmm3
addsd %xmm0, %xmm3
cvttsd2si %xmm3, %rbp
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x757b4
movq 0x38(%rsp), %rcx
xorl %edx, %edx
xorl %esi, %esi
xorl %r12d, %r12d
xorl %r15d, %r15d
movq %r12, %rdi
movq %rbp, %r12
subq %rsi, %r12
addq (%rcx,%rdx,8), %rsi
cmpq %rbp, %rsi
cmovgq %rdx, %r15
cmovleq %rdi, %r12
jg 0x757ba
incq %rdx
cmpq %rax, %rdx
jb 0x75790
jmp 0x757ba
xorl %r15d, %r15d
xorl %r12d, %r12d
leaq 0x50(%rsp), %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x754ec
testb %al, %al
je 0x75843
cmpq 0x20(%rsp), %r15
je 0x757e5
leaq 0x50(%rsp), %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x754ec
cmpq 0x20(%rsp), %r15
je 0x75815
leaq 0xc2e54(%rip), %rdi     # 0x138647
leaq 0xcd5d2(%rip), %rsi     # 0x142dcc
leaq 0xcd5b4(%rip), %rdx     # 0x142db5
leaq 0xcccae(%rip), %rcx     # 0x1424b6
movl $0xcd4, %r8d            # imm = 0xCD4
xorl %eax, %eax
callq 0xc8053
cmpq 0x28(%rsp), %r12
movq %rbx, %r15
je 0x7587e
leaq 0xc2e21(%rip), %rdi     # 0x138647
leaq 0xcd5ae(%rip), %rsi     # 0x142ddb
leaq 0xcd581(%rip), %rdx     # 0x142db5
leaq 0xccc7b(%rip), %rcx     # 0x1424b6
movl $0xcd5, %r8d            # imm = 0xCD5
jmp 0x75877
testq %rbp, %rbp
movq %rbx, %r15
js 0x7587e
cmpq %rbp, 0xa0(%rsp)
jle 0x7587e
leaq 0xc2deb(%rip), %rdi     # 0x138647
leaq 0xcd587(%rip), %rsi     # 0x142dea
leaq 0xcd54b(%rip), %rdx     # 0x142db5
leaq 0xccc45(%rip), %rcx     # 0x1424b6
movl $0xcd9, %r8d            # imm = 0xCD9
xorl %eax, %eax
callq 0xc8053
incq %r13
cmpq $0x2710, %r13           # imm = 0x2710
jne 0x75708
leaq 0x8(%rsp), %rdi
callq 0xe0b11
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq