// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
leaq 0x16099e(%rip), %rax    # 0x1b2330
movq (%rax), %rax
movq %rax, -0x8(%rbp)
leaq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xbfe80
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
leaq -0x50(%rbp), %rdi
callq 0x46780
movq -0x8(%rbp), %rdi
movabsq $-0x1804b258fae5f3f6, %rsi # imm = 0xE7FB4DA7051A0C0A
leaq -0x50(%rbp), %rdx
callq 0xc0220
movq $0x64, -0x58(%rbp)
movq $0x3e8, -0x60(%rbp)     # imm = 0x3E8
movq $0x2710, -0x68(%rbp)    # imm = 0x2710
leaq -0x88(%rbp), %rdi
callq 0x92310
movq -0x8(%rbp), %rdi
movabsq $0x2cabd5fd9af9a7b7, %rsi # imm = 0x2CABD5FD9AF9A7B7
leaq -0x88(%rbp), %rdx
callq 0xc0220
movq -0x58(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x92660
leaq -0x88(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
je 0x51abe
movq $0x0, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq -0x90(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x51abc
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
cvtsi2sdq -0x60(%rbp), %xmm1
leaq -0x50(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x50f20
cvttsd2si %xmm0, %rcx
movq -0xa0(%rbp), %rax
movq %rcx, (%rax)
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x51a53
jmp 0x51abe
leaq -0xf8(%rbp), %rdi
callq 0x51500
movq -0x8(%rbp), %rdi
movabsq $0x3fe3e37538d925bc, %rsi # imm = 0x3FE3E37538D925BC
leaq -0xf8(%rbp), %rdx
callq 0xc0220
leaq -0xf8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x51630
movq $0x0, -0x100(%rbp)
leaq -0x88(%rbp), %rax
movq %rax, -0x108(%rbp)
cmpq $0x0, -0x108(%rbp)
je 0x51b87
movq $0x0, -0x110(%rbp)
movq -0x110(%rbp), %rax
movq -0x108(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x51b85
movq -0x108(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x110(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rax
movq (%rax), %rax
addq -0x100(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x110(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x110(%rbp)
jmp 0x51b25
jmp 0x51b87
movq -0x100(%rbp), %rax
cmpq -0xa8(%rbp), %rax
je 0x51bc0
leaq 0xe1e01(%rip), %rdi     # 0x13399f
leaq 0xedd54(%rip), %rsi     # 0x13f8f9
leaq 0xedd61(%rip), %rdx     # 0x13f90d
leaq 0xed45b(%rip), %rcx     # 0x13f00e
movl $0xc63, %r8d            # imm = 0xC63
movb $0x0, %al
callq 0x9cea0
movq $0x0, -0x120(%rbp)
movq -0x120(%rbp), %rax
cmpq -0x68(%rbp), %rax
jge 0x51e1a
xorl %eax, %eax
subq -0xa8(%rbp), %rax
cvtsi2sd %rax, %xmm0
movq -0xa8(%rbp), %rax
shlq %rax
cvtsi2sd %rax, %xmm1
leaq -0x50(%rbp), %rdi
callq 0x50f20
cvttsd2si %xmm0, %rax
movq %rax, -0x128(%rbp)
leaq -0x138(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x4090
movq $0x0, -0x140(%rbp)
leaq -0x88(%rbp), %rax
movq %rax, -0x148(%rbp)
cmpq $0x0, -0x148(%rbp)
je 0x51cfb
movq $0x0, -0x150(%rbp)
movq -0x150(%rbp), %rax
movq -0x148(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x51cf9
movq -0x148(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x150(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x158(%rbp)
movq -0x140(%rbp), %rax
movq -0x158(%rbp), %rcx
addq (%rcx), %rax
cmpq -0x128(%rbp), %rax
jle 0x51cca
movq -0x150(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x128(%rbp), %rax
subq -0x140(%rbp), %rax
movq %rax, -0x130(%rbp)
jmp 0x51cf9
movq -0x158(%rbp), %rax
movq (%rax), %rax
addq -0x140(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x150(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x150(%rbp)
jmp 0x51c53
jmp 0x51cfb
movq -0x128(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
leaq -0x168(%rbp), %rdx
callq 0x51880
testb $0x1, %al
jne 0x51d1e
jmp 0x51dbc
movq -0x138(%rbp), %rax
cmpq -0x168(%rbp), %rax
je 0x51d48
movq -0x128(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
leaq -0x168(%rbp), %rdx
callq 0x51880
movq -0x138(%rbp), %rax
cmpq -0x168(%rbp), %rax
je 0x51d81
leaq 0xe1c40(%rip), %rdi     # 0x13399f
leaq 0xedbbe(%rip), %rsi     # 0x13f924
leaq 0xedba0(%rip), %rdx     # 0x13f90d
leaq 0xed29a(%rip), %rcx     # 0x13f00e
movl $0xc7d, %r8d            # imm = 0xC7D
movb $0x0, %al
callq 0x9cea0
movq -0x130(%rbp), %rax
cmpq -0x160(%rbp), %rax
je 0x51dba
leaq 0xe1c07(%rip), %rdi     # 0x13399f
leaq 0xedb94(%rip), %rsi     # 0x13f933
leaq 0xedb67(%rip), %rdx     # 0x13f90d
leaq 0xed261(%rip), %rcx     # 0x13f00e
movl $0xc7e, %r8d            # imm = 0xC7E
movb $0x0, %al
callq 0x9cea0
jmp 0x51e01
cmpq $0x0, -0x128(%rbp)
jl 0x51dff
movq -0x128(%rbp), %rax
cmpq -0xa8(%rbp), %rax
jge 0x51dff
leaq 0xe1bc2(%rip), %rdi     # 0x13399f
leaq 0xedb5e(%rip), %rsi     # 0x13f942
leaq 0xedb22(%rip), %rdx     # 0x13f90d
leaq 0xed21c(%rip), %rcx     # 0x13f00e
movl $0xc82, %r8d            # imm = 0xC82
movb $0x0, %al
callq 0x9cea0
jmp 0x51e01
jmp 0x51e03
movq -0x120(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x120(%rbp)
jmp 0x51bcb
leaq -0x40(%rbp), %rdi
callq 0xc06e0
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopl (%rax)