// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/lib/bcore/bcore_arr.c
// Function: bcore_arr_uz_selftest
st_s* bcore_arr_uz_selftest( void )
{
    st_s* log = st_s_createf( "== bcore_arr_uz_selftest " );
    st_s_push_char_n( log, '=', 80 - log->size );
    st_s_push_char( log, '\n' );

    bcore_arr_uz_s* sz_arr1 = bcore_arr_uz_s_create();
    bcore_arr_uz_s* sz_arr2 = bcore_arr_uz_s_create();
    uz_t size = 100000;
    {
        u2_t rval = 1;
        clock_t time = clock();
        for( uz_t i = 0; i < size; i++ )
        {
            rval = bcore_xsg_u2( rval );
            bcore_arr_uz_s_push( sz_arr1, rval );
        }
        time = clock() - time;
        st_s_push_fa( log, "#p28.{bcore_arr_uz_s_push } #<uz_t>ns\n", ( uz_t ) ( ( 1E9 * ( f3_t )time/CLOCKS_PER_SEC ) / size ) );
    }

    const bcore_array_s* array_p = bcore_array_s_get_typed( TYPEOF_bcore_arr_uz_s );
    const bcore_inst_s* u2_t_p = bcore_inst_s_get_typed( TYPEOF_u2_t );

    {
        u2_t rval = 1;
        clock_t time = clock();
        for( uz_t i = 0; i < size; i++ )
        {
            rval = bcore_xsg_u2( rval );
            bcore_array_p_push( array_p, (bcore_array*)sz_arr2, sr_pwc( u2_t_p, &rval ) );
        }
        time = clock() - time;
        st_s_push_fa( log, "#p28.{bcore_array_p_push } #<uz_t>ns\n", ( uz_t ) ( ( 1E9 * ( f3_t )time/CLOCKS_PER_SEC ) / size ) );
    }

    ASSERT( bcore_compare_aware( sz_arr1, sz_arr2 ) == 0 );

    {
        clock_t time = clock();
        bcore_arr_uz_s_sort( sz_arr1, 1 );
        time = clock() - time;
        st_s_push_fa( log, "#p28.{bcore_arr_uz_s_sort } #<uz_t>ns\n", ( uz_t ) ( ( 1E9 * ( f3_t )time/CLOCKS_PER_SEC ) / size ) );
    }

    {
        clock_t time = clock();
        bcore_array_a_sort( (bcore_array*)sz_arr2, 0, -1, 1 );
        time = clock() - time;
        st_s_push_fa( log, "#p28.{bcore_array_a_sort } #<uz_t>ns\n", ( uz_t ) ( ( 1E9 * ( f3_t )time/CLOCKS_PER_SEC ) / size ) );
    }

    bcore_arr_uz_s* permutation = bcore_arr_uz_s_create_random_permutation( bcore_xsg2_u2, 1, size );

    {
        clock_t time = clock();
        bcore_arr_uz_s_reorder( sz_arr1, permutation );
        time = clock() - time;
        st_s_push_fa( log, "#p28.{bcore_arr_uz_s_reorder } #<uz_t>ns\n", ( uz_t ) ( ( 1E9 * ( f3_t )time/CLOCKS_PER_SEC ) / size ) );
    }

    {
        clock_t time = clock();
        bcore_array_a_reorder( (bcore_array*)sz_arr2, permutation );
        time = clock() - time;
        st_s_push_fa( log, "#p28.{bcore_array_a_reorder } #<uz_t>ns\n", ( uz_t ) ( ( 1E9 * ( f3_t )time/CLOCKS_PER_SEC ) / size ) );
    }

    ASSERT( bcore_compare_aware( sz_arr1, sz_arr2 ) == 0 );

//    bcore_txt_ml_to_stdout( sr_awc( sz_arr1 ) );

    bcore_arr_uz_s_discard( permutation );
    bcore_arr_uz_s_discard( sz_arr1 );
    bcore_arr_uz_s_discard( sz_arr2 );

    st_s_push_char_n( log, '=', 80 );
    st_s_push_char( log, '\n' );
    return log;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movabsq $0x3cc9acead7f9ac2e, %rbx # imm = 0x3CC9ACEAD7F9AC2E
leaq 0x86e14(%rip), %rdi     # 0x1427a6
xorl %eax, %eax
callq 0x109ce5
movq %rax, %r14
movl $0x50, %edx
subq 0x10(%rax), %rdx
movq %rax, %rdi
movl $0x3d, %esi
callq 0x10a4d1
movq %r14, %rdi
movl $0xa, %esi
callq 0x10a448
movl $0x20, %esi
xorl %edi, %edi
callq 0xbe7b1
movq %rax, %rbp
movl $0x20, %esi
movq %rax, %rdi
callq 0xbe802
movq %rbx, (%rbp)
movl $0x20, %esi
xorl %edi, %edi
callq 0xbe7b1
movq %rax, %r15
movl $0x20, %esi
movq %rax, %rdi
callq 0xbe802
movq %rbx, (%r15)
movl $0x1, %r13d
movl $0x186a0, %ebx          # imm = 0x186A0
callq 0xd340
movq %rax, %r12
movl %r13d, %eax
shrl $0x7, %eax
xorl %r13d, %eax
movl %eax, %ecx
shll $0x19, %ecx
xorl %eax, %ecx
movl %ecx, %r13d
shrl $0xc, %r13d
xorl %ecx, %r13d
movq %rbp, %rdi
movq %r13, %rsi
callq 0xb5ce7
decq %rbx
jne 0xbba11
movq %rbp, 0x28(%rsp)
callq 0xd340
subq %r12, %rax
cvtsi2sd %rax, %xmm0
mulsd 0x86d33(%rip), %xmm0    # 0x142788
divsd 0x71613(%rip), %xmm0    # 0x12d070
divsd 0x86d2b(%rip), %xmm0    # 0x142790
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7b7ff(%rip), %xmm0    # 0x137278
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x86d35(%rip), %rsi     # 0x1427c0
movq %r14, %rdi
xorl %eax, %eax
callq 0x10a8a5
leaq 0xe0384(%rip), %rdx     # 0x19be20
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
movabsq $0x3cc9acead7f9ac2e, %rbx # imm = 0x3CC9ACEAD7F9AC2E
andq %rbx, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %rbx, %rdx
je 0xbbafb
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbx, %rdx
je 0xbbafb
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbx, %rdx
je 0xbbafb
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbx, %rdx
jne 0xbbb04
movq (%rax,%rcx), %rbp
testq %rbp, %rbp
jne 0xbbb2b
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %rbx, %rsi
callq 0xe9bc5
movq %rax, %rbp
leaq 0xe0300(%rip), %rdi     # 0x19be20
movq %rbx, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r14, 0x38(%rsp)
movabsq $-0x6119581ac7eacd63, %r13 # imm = 0x9EE6A7E53815329D
leaq 0xe0927(%rip), %rax     # 0x19c468
movl (%rax), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r13, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r13, %rdx
je 0xbbb97
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0xbbb97
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0xbbb97
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0xbbba0
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0xbbbc7
movabsq $0x782b96602f424981, %rdi # imm = 0x782B96602F424981
movq %r13, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0xe08ac(%rip), %rdi     # 0x19c468
movq %r13, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0x24(%rsp), %rbx
movl $0x1, (%rbx)
movl $0x186a0, %r13d         # imm = 0x186A0
callq 0xd340
movq %rax, 0x30(%rsp)
movl $0x1, %r14d
movl 0x24(%rsp), %eax
movl %eax, %ecx
shrl $0x7, %ecx
xorl %eax, %ecx
movl %ecx, %eax
shll $0x19, %eax
xorl %ecx, %eax
movl %eax, %ecx
shrl $0xc, %ecx
xorl %eax, %ecx
movl %ecx, 0x24(%rsp)
movq %rbx, 0x40(%rsp)
movq %r12, 0x48(%rsp)
movq %r14, 0x50(%rsp)
movq %r14, 0x10(%rsp)
movupd 0x40(%rsp), %xmm0
movupd %xmm0, (%rsp)
movq %rbp, %rdi
movq %r15, %rsi
callq 0xed355
decq %r13
jne 0xbbbe8
callq 0xd340
subq 0x30(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x86b3a(%rip), %xmm0    # 0x142788
divsd 0x7141a(%rip), %xmm0    # 0x12d070
divsd 0x86b32(%rip), %xmm0    # 0x142790
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7b606(%rip), %xmm0    # 0x137278
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x86b63(%rip), %rsi     # 0x1427e7
movq 0x38(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x10a8a5
movq 0x28(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xf431d
testl %eax, %eax
je 0xbbcd0
leaq 0x71999(%rip), %rdi     # 0x12d647
leaq 0x86b58(%rip), %rsi     # 0x14280d
leaq 0x86b7e(%rip), %rdx     # 0x14283a
leaq 0x86b8d(%rip), %rcx     # 0x142850
movl $0xd92, %r8d            # imm = 0xD92
xorl %eax, %eax
callq 0xbe4ef
callq 0xd340
movq %rax, %rbx
movq %r12, %rdi
movl $0x1, %esi
callq 0xb5ebe
callq 0xd340
subq %rbx, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x86a8b(%rip), %xmm0    # 0x142788
divsd 0x7136b(%rip), %xmm0    # 0x12d070
divsd 0x86a83(%rip), %xmm0    # 0x142790
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7b557(%rip), %xmm0    # 0x137278
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x86b29(%rip), %rsi     # 0x14285c
movq %r14, %rdi
xorl %eax, %eax
callq 0x10a8a5
callq 0xd340
movq %rax, %rbp
movq (%r15), %r12
leaq 0xe00d1(%rip), %rdx     # 0x19be20
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r12, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r12, %rdx
je 0xbbda4
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r12, %rdx
je 0xbbda4
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r12, %rdx
je 0xbbda4
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r12, %rdx
jne 0xbbdad
movq (%rax,%rcx), %r13
testq %r13, %r13
jne 0xbbdd4
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %r12, %rsi
callq 0xe9bc5
movq %rax, %r13
leaq 0xe0057(%rip), %rdi     # 0x19be20
movq %r12, %rsi
movq %rax, %rdx
callq 0x115fac
xorl %ebx, %ebx
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq $-0x1, %rcx
movl $0x1, %r8d
callq 0xeec21
callq 0xd340
subq %rbp, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x86980(%rip), %xmm0    # 0x142788
divsd 0x71260(%rip), %xmm0    # 0x12d070
divsd 0x86978(%rip), %xmm0    # 0x142790
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7b44c(%rip), %xmm0    # 0x137278
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x86a45(%rip), %rsi     # 0x142883
movq %r14, %rdi
xorl %eax, %eax
callq 0x10a8a5
movl $0x20, %esi
xorl %edi, %edi
callq 0xbe7b1
movq %rax, %rbp
movl $0x20, %esi
movq %rax, %rdi
callq 0xbe802
movabsq $0x3cc9acead7f9ac2e, %rax # imm = 0x3CC9ACEAD7F9AC2E
movq %rax, (%rbp)
movl $0x186a0, %esi          # imm = 0x186A0
movq %rbp, %rdi
callq 0xb5b92
movq 0x8(%rbp), %rax
movq %rbx, (%rax,%rbx,8)
incq %rbx
cmpq $0x186a0, %rbx          # imm = 0x186A0
jne 0xbbe7f
movq $0x186a0, 0x10(%rbp)    # imm = 0x186A0
movl $0x1, %r9d
movl $0x186a0, %esi          # imm = 0x186A0
movq $-0x186a0, %rdi         # imm = 0xFFFE7960
xorl %r8d, %r8d
xorl %ecx, %ecx
movl %r9d, %eax
shrl $0x5, %eax
xorl %r9d, %eax
movl %eax, %edx
shll $0x1b, %edx
xorl %eax, %edx
movl %edx, %r9d
shrl $0x8, %r9d
xorl %edx, %r9d
addq %r9, %rcx
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
imulq %rdi, %rax
addq %r8, %rcx
addq %rax, %rcx
movq 0x8(%rbp), %rax
movq (%rax,%r8,8), %rdx
movq (%rax,%rcx,8), %r10
movq %r10, (%rax,%r8,8)
movq 0x8(%rbp), %rax
movq %rdx, (%rax,%rcx,8)
incq %r8
incq %rdi
decq %rsi
jne 0xbbeb2
callq 0xd340
movq %rax, %rbx
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0xb5fce
callq 0xd340
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
mulsd 0x8685a(%rip), %xmm0    # 0x142788
divsd 0x7113a(%rip), %xmm0    # 0x12d070
divsd 0x86852(%rip), %xmm0    # 0x142790
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7b326(%rip), %xmm0    # 0x137278
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x86945(%rip), %rsi     # 0x1428a9
movq %r14, %rdi
xorl %eax, %eax
callq 0x10a8a5
callq 0xd340
movq %rax, %r13
movq (%r15), %r12
leaq 0xdfea0(%rip), %rdx     # 0x19be20
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r12, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r12, %rdx
je 0xbbfd5
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r12, %rdx
je 0xbbfd5
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r12, %rdx
je 0xbbfd5
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r12, %rdx
jne 0xbbfde
movq (%rax,%rcx), %rbx
testq %rbx, %rbx
jne 0xbc005
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %r12, %rsi
callq 0xe9bc5
movq %rax, %rbx
leaq 0xdfe26(%rip), %rdi     # 0x19be20
movq %r12, %rsi
movq %rax, %rdx
callq 0x115fac
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0xef2dc
callq 0xd340
subq %r13, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x8675d(%rip), %xmm0    # 0x142788
divsd 0x7103d(%rip), %xmm0    # 0x12d070
divsd 0x86755(%rip), %xmm0    # 0x142790
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7b229(%rip), %xmm0    # 0x137278
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x86872(%rip), %rsi     # 0x1428d3
movq %r14, %rdi
xorl %eax, %eax
callq 0x10a8a5
movq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0xf431d
testl %eax, %eax
je 0xbc0a5
leaq 0x715c4(%rip), %rdi     # 0x12d647
leaq 0x86783(%rip), %rsi     # 0x14280d
leaq 0x867a9(%rip), %rdx     # 0x14283a
leaq 0x867b8(%rip), %rcx     # 0x142850
movl $0xdb2, %r8d            # imm = 0xDB2
xorl %eax, %eax
callq 0xbe4ef
leaq -0x6667(%rip), %rbx     # 0xb5a45
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xbe7ee
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
callq 0xbe7ee
movq %rbx, %rdi
movq %r15, %rsi
callq 0xbe7ee
movl $0x50, %edx
movq %r14, %rdi
movl $0x3d, %esi
callq 0x10a4d1
movq %r14, %rdi
movl $0xa, %esi
callq 0x10a448
movq %r14, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq