// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
leaq 0xb3f83(%rip), %rdi     # 0x14c875
movb $0x0, %al
callq 0xff350
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl $0x50, %edx
subq 0x10(%rax), %rdx
movl $0x3d, %esi
callq 0xffca0
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0xffba0
callq 0x8d8a0
movq %rax, -0x10(%rbp)
callq 0x8d8a0
movq %rax, -0x18(%rbp)
movq $0x186a0, -0x20(%rbp)   # imm = 0x186A0
movl $0x1, -0x24(%rbp)
callq 0x4300
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x98989
movl -0x24(%rbp), %edi
callq 0x98f60
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x8dc30
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x98958
callq 0x4300
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
cvtsi2sdq -0x30(%rbp), %xmm0
movsd 0xa64d5(%rip), %xmm1    # 0x13ee80
mulsd %xmm1, %xmm0
movsd 0x9aa11(%rip), %xmm1    # 0x1333c8
divsd %xmm1, %xmm0
movaps 0xa653e(%rip), %xmm2    # 0x13ef00
movq -0x20(%rbp), %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xa653d(%rip), %xmm2    # 0x13ef10
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rdx
movq %rdx, %rcx
sarq $0x3f, %rcx
movsd 0xa641b(%rip), %xmm1    # 0x13ee18
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rcx, %rax
orq %rax, %rdx
leaq 0xb3e7c(%rip), %rsi     # 0x14c88f
movb $0x0, %al
callq 0x100210
movabsq $0x3cc9acead7f9ac2e, %rdi # imm = 0x3CC9ACEAD7F9AC2E
callq 0x98f90
movq %rax, -0x40(%rbp)
movabsq $-0x6119581ac7eacd63, %rdi # imm = 0x9EE6A7E53815329D
callq 0x99000
movq %rax, -0x48(%rbp)
movl $0x1, -0x4c(%rbp)
callq 0x4300
movq %rax, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x98ad2
movl -0x4c(%rbp), %edi
callq 0x98f60
movl %eax, -0x4c(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x48(%rbp), %rsi
leaq -0x78(%rbp), %rdi
leaq -0x4c(%rbp), %rdx
callq 0x990b0
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
leaq -0x78(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x99070
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x98a58
callq 0x4300
movq -0x58(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
cvtsi2sdq -0x58(%rbp), %xmm0
movsd 0xa638c(%rip), %xmm1    # 0x13ee80
mulsd %xmm1, %xmm0
movsd 0x9a8c8(%rip), %xmm1    # 0x1333c8
divsd %xmm1, %xmm0
movaps 0xa63f5(%rip), %xmm2    # 0x13ef00
movq -0x20(%rbp), %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xa63f4(%rip), %xmm2    # 0x13ef10
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rdx
movq %rdx, %rcx
sarq $0x3f, %rcx
movsd 0xa62d2(%rip), %xmm1    # 0x13ee18
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rcx, %rax
orq %rax, %rdx
leaq 0xb3d5a(%rip), %rsi     # 0x14c8b6
movb $0x0, %al
callq 0x100210
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xe0090
cmpl $0x0, %eax
je 0x98b9e
leaq 0x9ae23(%rip), %rdi     # 0x13399f
leaq 0xb3d59(%rip), %rsi     # 0x14c8dc
leaq 0xb3d7f(%rip), %rdx     # 0x14c909
leaq 0xb3d8e(%rip), %rcx     # 0x14c91f
movl $0xd92, %r8d            # imm = 0xD92
movb $0x0, %al
callq 0x9cea0
callq 0x4300
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
movl %esi, -0xf8(%rbp)
callq 0x8e090
callq 0x4300
movq -0x80(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
cvtsi2sdq -0x80(%rbp), %xmm0
movsd 0xa62a3(%rip), %xmm1    # 0x13ee80
movsd %xmm1, -0xf0(%rbp)
mulsd %xmm1, %xmm0
movsd 0x9a7d7(%rip), %xmm1    # 0x1333c8
movsd %xmm1, -0xe8(%rbp)
divsd %xmm1, %xmm0
movq -0x20(%rbp), %xmm1
movaps 0xa62f7(%rip), %xmm2    # 0x13ef00
movaps %xmm2, -0xe0(%rbp)
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xa62f4(%rip), %xmm2    # 0x13ef10
movaps %xmm2, -0xd0(%rbp)
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rdx
movq %rdx, %rcx
sarq $0x3f, %rcx
movsd 0xa61cb(%rip), %xmm1    # 0x13ee18
movsd %xmm1, -0xb8(%rbp)
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rcx, %rax
orq %rax, %rdx
leaq 0xb3cc0(%rip), %rsi     # 0x14c92b
xorl %eax, %eax
movl %eax, -0xfc(%rbp)
movb %al, -0xf1(%rbp)
callq 0x100210
callq 0x4300
movl -0xf8(%rbp), %ecx
movq %rax, %rdx
movl -0xfc(%rbp), %eax
movq %rdx, -0x88(%rbp)
movq -0x18(%rbp), %rdi
movl %eax, %esi
movq $-0x1, %rdx
callq 0x98260
callq 0x4300
movsd -0xf0(%rbp), %xmm5
movsd -0xe8(%rbp), %xmm2
movaps -0xe0(%rbp), %xmm4
movaps -0xd0(%rbp), %xmm3
movsd -0xb8(%rbp), %xmm1
movq %rax, %rcx
movb -0xf1(%rbp), %al
movq -0x88(%rbp), %rdx
subq %rdx, %rcx
movq %rcx, -0x88(%rbp)
movq -0x8(%rbp), %rdi
cvtsi2sdq -0x88(%rbp), %xmm0
mulsd %xmm5, %xmm0
divsd %xmm2, %xmm0
movq -0x20(%rbp), %xmm2
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
divsd %xmm2, %xmm0
movaps %xmm0, %xmm2
cvttsd2si %xmm2, %rdx
movq %rdx, %rsi
sarq $0x3f, %rsi
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rsi, %rcx
orq %rcx, %rdx
leaq 0xb3c0c(%rip), %rsi     # 0x14c952
callq 0x100210
movl -0xf8(%rbp), %esi
movq -0x20(%rbp), %rdx
leaq 0x384(%rip), %rdi       # 0x990e0
callq 0x8e3e0
movq %rax, -0x90(%rbp)
callq 0x4300
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x8e2e0
callq 0x4300
movsd -0xf0(%rbp), %xmm5
movsd -0xe8(%rbp), %xmm2
movaps -0xe0(%rbp), %xmm4
movaps -0xd0(%rbp), %xmm3
movsd -0xb8(%rbp), %xmm1
movq %rax, %rcx
movb -0xf1(%rbp), %al
movq -0x98(%rbp), %rdx
subq %rdx, %rcx
movq %rcx, -0x98(%rbp)
movq -0x8(%rbp), %rdi
cvtsi2sdq -0x98(%rbp), %xmm0
mulsd %xmm5, %xmm0
divsd %xmm2, %xmm0
movq -0x20(%rbp), %xmm2
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
divsd %xmm2, %xmm0
movaps %xmm0, %xmm2
cvttsd2si %xmm2, %rdx
movq %rdx, %rsi
sarq $0x3f, %rsi
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rsi, %rcx
orq %rcx, %rdx
leaq 0xb3b59(%rip), %rsi     # 0x14c978
callq 0x100210
callq 0x4300
movq %rax, -0xa0(%rbp)
movq -0x18(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x982e0
callq 0x4300
movsd -0xf0(%rbp), %xmm5
movsd -0xe8(%rbp), %xmm2
movaps -0xe0(%rbp), %xmm4
movaps -0xd0(%rbp), %xmm3
movsd -0xb8(%rbp), %xmm1
movq -0xa0(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0x8(%rbp), %rdi
cvtsi2sdq -0xa0(%rbp), %xmm0
mulsd %xmm5, %xmm0
divsd %xmm2, %xmm0
movq -0x20(%rbp), %xmm2
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
divsd %xmm2, %xmm0
movaps %xmm0, %xmm2
cvttsd2si %xmm2, %rdx
movq %rdx, %rcx
sarq $0x3f, %rcx
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rcx, %rax
orq %rax, %rdx
leaq 0xb3ad0(%rip), %rsi     # 0x14c9a2
movb $0x0, %al
callq 0x100210
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xe0090
cmpl $0x0, %eax
je 0x98f14
leaq 0x9aaad(%rip), %rdi     # 0x13399f
leaq 0xb39e3(%rip), %rsi     # 0x14c8dc
leaq 0xb3a09(%rip), %rdx     # 0x14c909
leaq 0xb3a18(%rip), %rcx     # 0x14c91f
movl $0xdb2, %r8d            # imm = 0xDB2
movb $0x0, %al
callq 0x9cea0
movq -0x90(%rbp), %rdi
callq 0x8d8d0
movq -0x10(%rbp), %rdi
callq 0x8d8d0
movq -0x18(%rbp), %rdi
callq 0x8d8d0
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
movl $0x50, %edx
callq 0xffca0
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0xffba0
movq -0x8(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq