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

    bcore_arr_st_s* st_arr1 = bcore_arr_st_s_create();
    bcore_arr_st_s* st_arr2 = bcore_arr_st_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_st_s_push_st_d( st_arr1, st_s_createf( "%u", rval ) );
        }
        time = clock() - time;
        st_s_push_fa( log, "#p28.{bcore_arr_st_s_push_st_d } #<uz_t>ns\n", ( uz_t ) ( ( 1E9 * ( f3_t )time/CLOCKS_PER_SEC ) / size ) );
    }

    {
        u2_t rval = 1;
        clock_t time = clock();
        for( uz_t i = 0; i < size; i++ )
        {
            rval = bcore_xsg_u2( rval );
            bcore_array_a_push( (bcore_array*)st_arr2, sr_asm( st_s_createf( "%u", rval ) ) );
        }
        time = clock() - time;
        st_s_push_fa( log, "#p28.{bcore_array_a_push } #<uz_t>ns\n", ( uz_t ) ( ( 1E9 * ( f3_t )time/CLOCKS_PER_SEC ) / size ) );
    }

    {
        clock_t time = clock();
        bcore_arr_st_s_sort( st_arr1, 1 );
        time = clock() - time;
        st_s_push_fa( log, "#p28.{bcore_arr_st_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*)st_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_st_s_reorder( st_arr1, permutation );
        time = clock() - time;
        st_s_push_fa( log, "#p28.{bcore_arr_st_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*)st_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( st_arr1, st_arr2 ) == 0 );

//    bcore_txt_ml_to_stdout( sr_awc( st_arr1 ) );

    bcore_arr_uz_s_discard( permutation );
    bcore_arr_st_s_discard( st_arr1 );
    bcore_arr_st_s_discard( st_arr2 );

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

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
leaq 0xb38a9(%rip), %rdi     # 0x14c9cb
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 0x95be0
movq %rax, -0x10(%rbp)
callq 0x95be0
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 0x991d6
movl -0x24(%rbp), %edi
callq 0x98f60
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movl -0x24(%rbp), %esi
leaq 0xb462c(%rip), %rdi     # 0x14d7de
movb $0x0, %al
callq 0xff350
movq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x95fe0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x99188
callq 0x4300
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
cvtsi2sdq -0x30(%rbp), %xmm0
movsd 0xa5c88(%rip), %xmm1    # 0x13ee80
mulsd %xmm1, %xmm0
movsd 0x9a1c4(%rip), %xmm1    # 0x1333c8
divsd %xmm1, %xmm0
movaps 0xa5cf1(%rip), %xmm2    # 0x13ef00
movq -0x20(%rbp), %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xa5cf0(%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 0xa5bce(%rip), %xmm1    # 0x13ee18
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rcx, %rax
orq %rax, %rdx
leaq 0xb3785(%rip), %rsi     # 0x14c9e5
movb $0x0, %al
callq 0x100210
movl $0x1, -0x3c(%rbp)
callq 0x4300
movq %rax, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x992f3
movl -0x3c(%rbp), %edi
callq 0x98f60
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl -0x3c(%rbp), %esi
leaq 0xb4535(%rip), %rdi     # 0x14d7de
movb $0x0, %al
callq 0xff350
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
callq 0x99790
movq -0xa0(%rbp), %rdi
leaq -0x68(%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 0x99740
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x9927f
callq 0x4300
movq -0x48(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
cvtsi2sdq -0x48(%rbp), %xmm0
movsd 0xa5b6b(%rip), %xmm1    # 0x13ee80
movsd %xmm1, -0xe0(%rbp)
mulsd %xmm1, %xmm0
movsd 0x9a09f(%rip), %xmm1    # 0x1333c8
movsd %xmm1, -0xd8(%rbp)
divsd %xmm1, %xmm0
movq -0x20(%rbp), %xmm1
movaps 0xa5bbf(%rip), %xmm2    # 0x13ef00
movaps %xmm2, -0xd0(%rbp)
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xa5bbc(%rip), %xmm2    # 0x13ef10
movaps %xmm2, -0xc0(%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 0xa5a93(%rip), %xmm1    # 0x13ee18
movsd %xmm1, -0xa8(%rbp)
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rcx, %rax
orq %rax, %rdx
leaq 0xb366e(%rip), %rsi     # 0x14ca11
xorl %eax, %eax
movl %eax, -0xec(%rbp)
movb %al, -0xe1(%rbp)
callq 0x100210
callq 0x4300
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
movl %esi, -0xe8(%rbp)
callq 0x96250
callq 0x4300
movsd -0xe0(%rbp), %xmm5
movsd -0xd8(%rbp), %xmm2
movaps -0xd0(%rbp), %xmm4
movaps -0xc0(%rbp), %xmm3
movsd -0xa8(%rbp), %xmm1
movq %rax, %rcx
movb -0xe1(%rbp), %al
movq -0x70(%rbp), %rdx
subq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movq -0x8(%rbp), %rdi
cvtsi2sdq -0x70(%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 0xb35d2(%rip), %rsi     # 0x14ca37
callq 0x100210
callq 0x4300
movl -0xe8(%rbp), %ecx
movq %rax, %rdx
movl -0xec(%rbp), %eax
movq %rdx, -0x78(%rbp)
movq -0x18(%rbp), %rdi
movl %eax, %esi
movq $-0x1, %rdx
callq 0x98260
callq 0x4300
movsd -0xe0(%rbp), %xmm5
movsd -0xd8(%rbp), %xmm2
movaps -0xd0(%rbp), %xmm4
movaps -0xc0(%rbp), %xmm3
movsd -0xa8(%rbp), %xmm1
movq %rax, %rcx
movb -0xe1(%rbp), %al
movq -0x78(%rbp), %rdx
subq %rdx, %rcx
movq %rcx, -0x78(%rbp)
movq -0x8(%rbp), %rdi
cvtsi2sdq -0x78(%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 0xb342c(%rip), %rsi     # 0x14c952
callq 0x100210
movl -0xe8(%rbp), %esi
movq -0x20(%rbp), %rdx
leaq -0x45c(%rip), %rdi      # 0x990e0
callq 0x8e3e0
movq %rax, -0x80(%rbp)
callq 0x4300
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x96410
callq 0x4300
movsd -0xe0(%rbp), %xmm5
movsd -0xd8(%rbp), %xmm2
movaps -0xd0(%rbp), %xmm4
movaps -0xc0(%rbp), %xmm3
movsd -0xa8(%rbp), %xmm1
movq %rax, %rcx
movb -0xe1(%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 0xb3465(%rip), %rsi     # 0x14ca5e
callq 0x100210
callq 0x4300
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x982e0
callq 0x4300
movsd -0xe0(%rbp), %xmm5
movsd -0xd8(%rbp), %xmm2
movaps -0xd0(%rbp), %xmm4
movaps -0xc0(%rbp), %xmm3
movsd -0xa8(%rbp), %xmm1
movq -0x90(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rdi
cvtsi2sdq -0x90(%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 0xb32f9(%rip), %rsi     # 0x14c9a2
movb $0x0, %al
callq 0x100210
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xe0090
cmpl $0x0, %eax
je 0x996eb
leaq 0x9a2d6(%rip), %rdi     # 0x13399f
leaq 0xb33b8(%rip), %rsi     # 0x14ca88
leaq 0xb33de(%rip), %rdx     # 0x14cab5
leaq 0xb3241(%rip), %rcx     # 0x14c91f
movl $0xe01, %r8d            # imm = 0xE01
movb $0x0, %al
callq 0x9cea0
movq -0x80(%rbp), %rdi
callq 0x8d8d0
movq -0x10(%rbp), %rdi
callq 0x95c10
movq -0x18(%rbp), %rdi
callq 0x95c10
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 $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)