// File: /workspace/github_c_makefile_star2_O1/johsteffens[P]beth/lib/bcore/bcore.xo.c
// Function: bcore_indexer_s_setup
BCORE_DEFINE_OBJECT_INST_P_NASC_END( bcore_indexer_s )

bcore_indexer_s* bcore_indexer_s_setup( bcore_indexer_s* o, const bcore_arr_s3_s* size_arr )
{
    // bcore_indexer.h:60:5
    
    o->size = 0;
    x_array_set_size(((x_array*)(&(o->cs_arr))),size_arr->size );
    {const bcore_indexer_cs_arr_s* __a=&(o->cs_arr );if(__a)for(sz_t __i=0;__i<__a->size;__i++){bcore_indexer_cs_s* e=&(__a->data[__i]);
    {
        e->c = o->size;
        e->s = size_arr->data[ __i ];
        o->size += e->s;
    };}}
    
    sz_t io_size = 1;
    while( io_size < size_arr->size ) io_size <<= 1;
    o->mask_bits = 0;
    while( ( ( o->size - 1 ) >> o->mask_bits ) >= io_size ) o->mask_bits++;
    
    bcore_indexer_io_s io = { 0 };
    x_array_set_size(((x_array*)(x_array_clear(((x_array*)(&(o->io_arr)))))),io_size );
    {const bcore_indexer_io_arr_s* __a=&(o->io_arr );if(__a)for(sz_t __i=0;__i<__a->size;__i++){bcore_indexer_io_s* e=&(__a->data[__i]);
    {
        sz_t c = ((s3_t)(__i)) << o->mask_bits;
        if( c >= o->size ) break;
        io.o = c - o->cs_arr.data[ io.i ].c;
        while( io.o >= o->cs_arr.data[ io.i ].s )
        {
            io.o -= o->cs_arr.data[ io.i ].s;
            io.i++;
        }
        (*(e)) = io;
    }
    
    }}return  o;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq $0x0, 0x50(%rdi)
movq 0x10(%rsi), %rdx
movq 0x28(%rdi), %r13
leaq 0x133c1a(%rip), %rsi    # 0x1a8e20
movl (%rsi), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rsi,%rax,8), %rcx
movq 0x18(%rsi,%rax,8), %rsi
andq %r13, %rsi
shlq $0x4, %rsi
leaq (%rcx,%rsi), %rax
movq (%rcx,%rsi), %rsi
movl $0x8, %ecx
cmpq %r13, %rsi
je 0x7525f
movq 0x10(%rax), %rsi
movl $0x18, %ecx
cmpq %r13, %rsi
je 0x7525f
movq 0x20(%rax), %rsi
movl $0x28, %ecx
cmpq %r13, %rsi
je 0x7525f
movq 0x30(%rax), %rsi
movl $0x38, %ecx
cmpq %r13, %rsi
jne 0x754d6
movq (%rax,%rcx), %rbp
leaq 0x28(%rbx), %r14
testq %rbp, %rbp
jne 0x75299
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %r13, %rsi
movq %rdx, %r12
callq 0xf3f85
movq %rax, %rbp
leaq 0x133b95(%rip), %rdi    # 0x1a8e20
movq %r13, %rsi
movq %rax, %rdx
callq 0x12128c
movq %r12, %rdx
movq %rbp, %rdi
movq %r14, %rsi
callq 0xf69d8
cmpq $0x0, 0x38(%rbx)
je 0x752df
movl $0x8, %eax
xorl %ecx, %ecx
movq 0x30(%rbx), %rdx
movq 0x50(%rbx), %rsi
movq %rsi, -0x8(%rdx,%rax)
movq 0x8(%r15), %rdi
movq (%rdi,%rcx,8), %rdi
movq %rdi, (%rdx,%rax)
addq %rsi, %rdi
movq %rdi, 0x50(%rbx)
incq %rcx
addq $0x10, %rax
cmpq 0x38(%rbx), %rcx
jb 0x752b2
movq 0x10(%r15), %rax
movl $0x1, %ecx
leaq 0x133b31(%rip), %r14    # 0x1a8e20
movq %rcx, %r15
addq %rcx, %rcx
cmpq %rax, %r15
jb 0x752ef
movq 0x50(%rbx), %rax
decq %rax
movb $-0x1, %cl
incb %cl
movq %rax, %rdx
sarq %cl, %rdx
cmpq %r15, %rdx
jge 0x75303
movb %cl, 0x48(%rbx)
movq 0x8(%rbx), %r13
movl (%r14), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r14,%rax,8), %rcx
movq 0x18(%r14,%rax,8), %rdx
andq %r13, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r13, %rdx
je 0x75371
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0x75371
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0x75371
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0x754dd
movq (%rax,%rcx), %rbp
leaq 0x8(%rbx), %r12
testq %rbp, %rbp
jne 0x753a5
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %r13, %rsi
callq 0xf3f85
movq %rax, %rbp
leaq 0x133a86(%rip), %rdi    # 0x1a8e20
movq %r13, %rsi
movq %rax, %rdx
callq 0x12128c
movq %rbp, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xf6359
movq (%r12), %r13
movl (%r14), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r14,%rax,8), %rcx
movq 0x18(%r14,%rax,8), %rdx
andq %r13, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r13, %rdx
je 0x75410
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0x75410
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0x75410
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0x754e4
movq (%rax,%rcx), %r14
testq %r14, %r14
jne 0x75440
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %r13, %rsi
callq 0xf3f85
movq %rax, %r14
leaq 0x1339eb(%rip), %rdi    # 0x1a8e20
movq %r13, %rsi
movq %rax, %rdx
callq 0x12128c
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xf69d8
cmpq $0x0, 0x18(%rbx)
je 0x754c4
movsbq 0x48(%rbx), %rax
movl %eax, %ecx
xorl %eax, %eax
xorl %edx, %edx
movq %rax, %rsi
shlq %cl, %rsi
movq 0x50(%rbx), %rdi
cmpq %rdi, %rsi
jge 0x754b6
movq 0x30(%rbx), %r10
movq %rdx, %r11
shlq $0x4, %r11
movq %rsi, %r8
subq (%r10,%r11), %r8
movq 0x8(%r10,%r11), %r9
cmpq %r9, %r8
jl 0x754a4
addq %r11, %r10
addq $0x18, %r10
subq %r9, %r8
incq %rdx
movq (%r10), %r9
addq $0x10, %r10
cmpq %r9, %r8
jge 0x75492
movq %rax, %r9
shlq $0x4, %r9
addq 0x10(%rbx), %r9
movq %rdx, (%r9)
movq %r8, 0x8(%r9)
cmpq %rdi, %rsi
jge 0x754c4
incq %rax
cmpq 0x18(%rbx), %rax
jb 0x75460
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x75263
xorl %ebp, %ebp
jmp 0x75375
xorl %r14d, %r14d
jmp 0x75414