// File: /workspace/github_c_makefile_star2_O1/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 0x87c3f(%rip), %rdi     # 0x14d8bc
xorl %eax, %eax
callq 0x114c1e
movq %rax, %r15
movl $0x50, %edx
subq 0x10(%rax), %rdx
movq %rax, %rdi
movl $0x3d, %esi
callq 0x115408
movq %r15, %rdi
movl $0xa, %esi
callq 0x115381
movl $0x20, %esi
xorl %edi, %edi
callq 0xc8315
movq %rax, %r13
movq %rax, %rdi
callq 0xc340f
movl $0x20, %esi
xorl %edi, %edi
callq 0xc8315
movq %rax, 0x20(%rsp)
movq %rax, %rdi
callq 0xc340f
movl $0x1, %ebp
movl $0x186a0, %r14d         # imm = 0x186A0
callq 0xd340
movq %rax, %rbx
leaq 0x88916(%rip), %r12     # 0x14e60a
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 0x114c1e
movq %r13, %rdi
movq %rax, %rsi
callq 0xc38f0
decq %r14
jne 0xc5cf4
movq %r13, 0x28(%rsp)
callq 0xd340
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
mulsd 0x7c5f9(%rip), %xmm0    # 0x142338
divsd 0x72329(%rip), %xmm0    # 0x138070
divsd 0x87a01(%rip), %xmm0    # 0x14d750
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7c55d(%rip), %xmm0    # 0x1422c0
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x87b61(%rip), %rsi     # 0x14d8d6
movq %r15, 0x38(%rsp)
movq %r15, %rdi
xorl %eax, %eax
callq 0x1157cb
movl $0x1, %ebp
movl $0x186a0, %r15d         # imm = 0x186A0
callq 0xd340
movq %rax, 0x30(%rsp)
leaq 0x8886a(%rip), %r12     # 0x14e60a
leaq 0xe3079(%rip), %r13     # 0x1a8e20
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 0x114c1e
movq %rax, %rbx
testq %rax, %rax
je 0xc5dda
movq (%rbx), %rdi
callq 0x1123e1
jmp 0xc5ddc
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 0xc5e4e
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbx, %rdx
je 0xc5e4e
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbx, %rdx
je 0xc5e4e
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbx, %rdx
jne 0xc5ea7
movq (%rax,%rcx), %r14
testq %r14, %r14
jne 0xc5e7a
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %rbx, %rsi
callq 0xf3f85
movq %rax, %r14
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x12128c
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x40(%rsp), %xmm0
movupd %xmm0, (%rsp)
movq %r14, %rdi
movq 0x20(%rsp), %rsi
callq 0xf7857
decq %r15
jne 0xc5da7
jmp 0xc5eac
xorl %r14d, %r14d
jmp 0xc5e52
callq 0xd340
subq 0x30(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x7c472(%rip), %xmm0    # 0x142338
divsd 0x721a2(%rip), %xmm0    # 0x138070
divsd 0x8787a(%rip), %xmm0    # 0x14d750
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7c3d6(%rip), %xmm0    # 0x1422c0
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x87a06(%rip), %rsi     # 0x14d902
movq 0x38(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x1157cb
callq 0xd340
movq %rax, %rbx
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0xc3a52
callq 0xd340
subq %rbx, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x7c3fe(%rip), %xmm0    # 0x142338
divsd 0x7212e(%rip), %xmm0    # 0x138070
divsd 0x87806(%rip), %xmm0    # 0x14d750
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7c362(%rip), %xmm0    # 0x1422c0
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x879b8(%rip), %rsi     # 0x14d928
movq %r15, %rdi
xorl %eax, %eax
callq 0x1157cb
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 0xc5fe5
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbp, %rdx
je 0xc5fe5
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbp, %rdx
je 0xc5fe5
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbp, %rdx
jne 0xc635a
movq (%rax,%rcx), %rbx
testq %rbx, %rbx
jne 0xc6015
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %rbp, %rsi
callq 0xf3f85
movq %rax, %rbx
leaq 0xe2e16(%rip), %rdi     # 0x1a8e20
movq %rbp, %rsi
movq %rax, %rdx
callq 0x12128c
xorl %r14d, %r14d
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
xorl %edx, %edx
movq $-0x1, %rcx
movl $0x1, %r8d
callq 0xf914f
callq 0xd340
subq %r12, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x7c2ec(%rip), %xmm0    # 0x142338
divsd 0x7201c(%rip), %xmm0    # 0x138070
divsd 0x876f4(%rip), %xmm0    # 0x14d750
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7c250(%rip), %xmm0    # 0x1422c0
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x877c1(%rip), %rsi     # 0x14d843
movq %r15, %rdi
xorl %eax, %eax
callq 0x1157cb
movl $0x20, %esi
xorl %edi, %edi
callq 0xc8315
movq %rax, %rbp
movl $0x20, %esi
movq %rax, %rdi
callq 0xc8366
movabsq $0x3cc9acead7f9ac2e, %rax # imm = 0x3CC9ACEAD7F9AC2E
movq %rax, (%rbp)
movl $0x186a0, %esi          # imm = 0x186A0
movq %rbp, %rdi
callq 0xbf5e2
movq 0x8(%rbp), %rax
movq %r14, (%rax,%r14,8)
incq %r14
cmpq $0x186a0, %r14          # imm = 0x186A0
jne 0xc60c3
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 0xc60f6
callq 0xd340
movq %rax, %rbx
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0xc3b73
callq 0xd340
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
mulsd 0x7c1c6(%rip), %xmm0    # 0x142338
divsd 0x71ef6(%rip), %xmm0    # 0x138070
divsd 0x875ce(%rip), %xmm0    # 0x14d750
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7c12a(%rip), %xmm0    # 0x1422c0
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x877a7(%rip), %rsi     # 0x14d94f
movq %r15, %rdi
xorl %eax, %eax
callq 0x1157cb
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 0xc621d
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbx, %rdx
je 0xc621d
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbx, %rdx
je 0xc621d
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbx, %rdx
jne 0xc6361
movq (%rax,%rcx), %r14
testq %r14, %r14
movq 0x28(%rsp), %r13
jne 0xc6252
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %rbx, %rsi
callq 0xf3f85
movq %rax, %r14
leaq 0xe2bd9(%rip), %rdi     # 0x1a8e20
movq %rbx, %rsi
movq %rax, %rdx
callq 0x12128c
movq %r14, %rdi
movq 0x20(%rsp), %rbx
movq %rbx, %rsi
movq %rbp, %rdx
callq 0xf9848
callq 0xd340
subq %r12, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x7c0bb(%rip), %xmm0    # 0x142338
divsd 0x71deb(%rip), %xmm0    # 0x138070
divsd 0x874c3(%rip), %xmm0    # 0x14d750
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7c01f(%rip), %xmm0    # 0x1422c0
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
leaq 0x875e0(%rip), %rsi     # 0x14d893
movq %r15, %rdi
xorl %eax, %eax
callq 0x1157cb
movq %r13, %rdi
movq %rbx, %rsi
callq 0xfe9cd
testl %eax, %eax
je 0xc62f5
leaq 0x72374(%rip), %rdi     # 0x138647
leaq 0x8769f(%rip), %rsi     # 0x14d979
leaq 0x876c5(%rip), %rdx     # 0x14d9a6
leaq 0x87528(%rip), %rcx     # 0x14d810
movl $0xe01, %r8d            # imm = 0xE01
xorl %eax, %eax
callq 0xc8053
leaq -0x6e5b(%rip), %rdi     # 0xbf4a1
movq %rbp, %rsi
callq 0xc8352
testq %r13, %r13
je 0xc6318
leaq -0x2e49(%rip), %rdi     # 0xc34c7
movq %r13, %rsi
callq 0xc8352
leaq -0x2e58(%rip), %rdi     # 0xc34c7
movq 0x20(%rsp), %rsi
callq 0xc8352
movl $0x50, %edx
movq %r15, %rdi
movl $0x3d, %esi
callq 0x115408
movq %r15, %rdi
movl $0xa, %esi
callq 0x115381
movq %r15, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0xc5fe9
xorl %r14d, %r14d
jmp 0xc6221