// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
leaq 0x867e7(%rip), %rdi     # 0x1428fc
xorl %eax, %eax
callq 0x109ce5
movq %rax, %r15
movl $0x50, %edx
subq 0x10(%rax), %rdx
movq %rax, %rdi
movl $0x3d, %esi
callq 0x10a4d1
movq %r15, %rdi
movl $0xa, %esi
callq 0x10a448
movl $0x20, %esi
xorl %edi, %edi
callq 0xbe7b1
movq %rax, %r13
movq %rax, %rdi
callq 0xb9951
movl $0x20, %esi
xorl %edi, %edi
callq 0xbe7b1
movq %rax, 0x20(%rsp)
movq %rax, %rdi
callq 0xb9951
movl $0x1, %ebp
movl $0x186a0, %r14d         # imm = 0x186A0
callq 0xd340
movq %rax, %rbx
leaq 0x874be(%rip), %r12     # 0x14364a
movl %ebp, %eax
shrl $0x7, %eax
xorl %ebp, %eax
movl %eax, %ecx
shll $0x19, %ecx
xorl %eax, %ecx
movl %ecx, %ebp
shrl $0xc, %ebp
xorl %ecx, %ebp
movq %r12, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x109ce5
movq %r13, %rdi
movq %rax, %rsi
callq 0xb9e26
decq %r14
jne 0xbc18c
movq %r13, 0x28(%rsp)
callq 0xd340
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
mulsd 0x865b1(%rip), %xmm0    # 0x142788
divsd 0x70e91(%rip), %xmm0    # 0x12d070
divsd 0x865a9(%rip), %xmm0    # 0x142790
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7b07d(%rip), %xmm0    # 0x137278
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x86709(%rip), %rsi     # 0x142916
movq %r15, 0x38(%rsp)
movq %r15, %rdi
xorl %eax, %eax
callq 0x10a8a5
movl $0x1, %r12d
movl $0x186a0, %r15d         # imm = 0x186A0
callq 0xd340
movq %rax, 0x30(%rsp)
leaq 0x87411(%rip), %rbp     # 0x14364a
leaq 0xdfbe0(%rip), %r13     # 0x19be20
movl %r12d, %eax
shrl $0x7, %eax
xorl %r12d, %eax
movl %eax, %ecx
shll $0x19, %ecx
xorl %eax, %ecx
movl %ecx, %r12d
shrl $0xc, %r12d
xorl %ecx, %r12d
movq %rbp, %rdi
movl %r12d, %esi
xorl %eax, %eax
callq 0x109ce5
movq %rax, %rbx
testq %rax, %rax
je 0xbc279
movq (%rbx), %rdi
callq 0x1074f1
jmp 0xbc27b
xorl %eax, %eax
movq %rbx, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movq $0x2, 0x50(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rbx
movl (%r13), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r13,%rax,8), %rcx
movq 0x18(%r13,%rax,8), %rdx
andq %rbx, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %rbx, %rdx
je 0xbc2ed
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbx, %rdx
je 0xbc2ed
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbx, %rdx
je 0xbc2ed
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbx, %rdx
jne 0xbc2f6
movq (%rax,%rcx), %r14
testq %r14, %r14
jne 0xbc319
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %rbx, %rsi
callq 0xe9bc5
movq %rax, %r14
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x115fac
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x40(%rsp), %xmm0
movupd %xmm0, (%rsp)
movq %r14, %rdi
movq 0x20(%rsp), %rsi
callq 0xed355
decq %r15
jne 0xbc240
callq 0xd340
subq 0x30(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x8642a(%rip), %xmm0    # 0x142788
divsd 0x70d0a(%rip), %xmm0    # 0x12d070
divsd 0x86422(%rip), %xmm0    # 0x142790
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7aef6(%rip), %xmm0    # 0x137278
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x865ae(%rip), %rsi     # 0x142942
movq 0x38(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x10a8a5
callq 0xd340
movq %rax, %rbx
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0xb9f8d
callq 0xd340
subq %rbx, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x863b6(%rip), %xmm0    # 0x142788
divsd 0x70c96(%rip), %xmm0    # 0x12d070
divsd 0x863ae(%rip), %xmm0    # 0x142790
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7ae82(%rip), %xmm0    # 0x137278
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x86560(%rip), %rsi     # 0x142968
movq %r15, %rdi
xorl %eax, %eax
callq 0x10a8a5
callq 0xd340
movq %rax, %r12
movq 0x20(%rsp), %rax
movq (%rax), %rbp
movl (%r13), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r13,%rax,8), %rcx
movq 0x18(%r13,%rax,8), %rdx
andq %rbp, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %rbp, %rdx
je 0xbc479
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbp, %rdx
je 0xbc479
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbp, %rdx
je 0xbc479
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbp, %rdx
jne 0xbc482
movq (%rax,%rcx), %rbx
testq %rbx, %rbx
jne 0xbc4a9
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %rbp, %rsi
callq 0xe9bc5
movq %rax, %rbx
leaq 0xdf982(%rip), %rdi     # 0x19be20
movq %rbp, %rsi
movq %rax, %rdx
callq 0x115fac
xorl %r14d, %r14d
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
xorl %edx, %edx
movq $-0x1, %rcx
movl $0x1, %r8d
callq 0xeec21
callq 0xd340
subq %r12, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x862a8(%rip), %xmm0    # 0x142788
divsd 0x70b88(%rip), %xmm0    # 0x12d070
divsd 0x862a0(%rip), %xmm0    # 0x142790
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7ad74(%rip), %xmm0    # 0x137278
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x8636d(%rip), %rsi     # 0x142883
movq %r15, %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 %r14, (%rax,%r14,8)
incq %r14
cmpq $0x186a0, %r14          # imm = 0x186A0
jne 0xbc557
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 0xbc58a
callq 0xd340
movq %rax, %rbx
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0xba0ae
callq 0xd340
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
mulsd 0x86182(%rip), %xmm0    # 0x142788
divsd 0x70a62(%rip), %xmm0    # 0x12d070
divsd 0x8617a(%rip), %xmm0    # 0x142790
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7ac4e(%rip), %xmm0    # 0x137278
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x86353(%rip), %rsi     # 0x14298f
movq %r15, %rdi
xorl %eax, %eax
callq 0x10a8a5
callq 0xd340
movq %rax, %r12
movq 0x20(%rsp), %rax
movq (%rax), %rbx
movl (%r13), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r13,%rax,8), %rcx
movq 0x18(%r13,%rax,8), %rdx
andq %rbx, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %rbx, %rdx
je 0xbc6ad
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbx, %rdx
je 0xbc6ad
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbx, %rdx
je 0xbc6ad
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbx, %rdx
jne 0xbc6b6
movq (%rax,%rcx), %r14
testq %r14, %r14
jne 0xbc6dd
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %rbx, %rsi
callq 0xe9bc5
movq %rax, %r14
leaq 0xdf74e(%rip), %rdi     # 0x19be20
movq %rbx, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r14, %rdi
movq 0x20(%rsp), %r14
movq %r14, %rsi
movq %rbp, %rdx
callq 0xef2dc
callq 0xd340
subq %r12, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x86080(%rip), %xmm0    # 0x142788
divsd 0x70960(%rip), %xmm0    # 0x12d070
divsd 0x86078(%rip), %xmm0    # 0x142790
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7ab4c(%rip), %xmm0    # 0x137278
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x86195(%rip), %rsi     # 0x1428d3
movq %r15, %rdi
xorl %eax, %eax
callq 0x10a8a5
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf431d
testl %eax, %eax
je 0xbc785
leaq 0x70ee4(%rip), %rdi     # 0x12d647
leaq 0x8624f(%rip), %rsi     # 0x1429b9
leaq 0x86275(%rip), %rdx     # 0x1429e6
leaq 0x860d8(%rip), %rcx     # 0x142850
movl $0xe01, %r8d            # imm = 0xE01
xorl %eax, %eax
callq 0xbe4ef
leaq -0x6d47(%rip), %rdi     # 0xb5a45
movq %rbp, %rsi
callq 0xbe7ee
testq %rbx, %rbx
je 0xbc7a8
leaq -0x2d9c(%rip), %rdi     # 0xb9a04
movq %rbx, %rsi
callq 0xbe7ee
leaq -0x2dab(%rip), %rdi     # 0xb9a04
movq 0x20(%rsp), %rsi
callq 0xbe7ee
movl $0x50, %edx
movq %r15, %rdi
movl $0x3d, %esi
callq 0x10a4d1
movq %r15, %rdi
movl $0xa, %esi
callq 0x10a448
movq %r15, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq