// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_alloc_challenge
static st_s* tbman_alloc_challenge
(
    fp_alloc alloc,
    uz_t table_size,
    uz_t cycles,
    uz_t max_alloc,
    u2_t seed,
    bl_t cleanup,
    bl_t verbose
)
{
    st_s* str = st_s_create();

    vd_t* data_table = malloc( table_size * sizeof( vd_t ) );
    uz_t* size_table = malloc( table_size * sizeof( uz_t ) );
    for( uz_t i = 0; i < table_size; i++ ) data_table[ i ] = NULL;
    for( uz_t i = 0; i < table_size; i++ ) size_table[ i ] = 0;

    u2_t rval = seed;
    uz_t alloc_attempts = 0;
    uz_t realloc_attempts = 0;
    uz_t free_attempts = 0;
    uz_t alloc_failures = 0;
    uz_t realloc_failures = 0;
    uz_t free_failures = 0;

    for( uz_t j = 0; j < cycles; j++ )
    {
        for( uz_t i = 0; i < table_size; i++ )
        {
            rval = bcore_xsg_u2( rval );
            uz_t idx = rval % table_size;

            // verify table content
            if( size_table[ idx ] > 0 )
            {
                u2_t rv = bcore_xsg_u2( idx + 1 );
                uint8_t* data = data_table[ idx ];
                uz_t sz = size_table[ idx ];
                for( uz_t i = 0; i < sz; i++ )
                {
                    rv = bcore_xsg_u2( rv );
                    if( data[ i ] != ( rv & 255 ) )
                    {
                        ERR( "data failure [%u vs %u].", ( u2_t )data[ i ], ( u2_t )( rv & 255 ) );
                    }
                }
            }

            if( data_table[ idx ] == NULL )
            {
                rval = bcore_xsg_u2( rval );
                uz_t size = pow( ( double )max_alloc, ( rval * pow( 2.0, -32 ) ) );
                data_table[ idx ] = alloc( data_table[ idx ], 0, size, &size_table[ idx ] );
                alloc_attempts++;
                alloc_failures += ( size > 0 ) && ( data_table[ idx ] == NULL );

                // set new content
                if( size_table[ idx ] > 0 )
                {
                    u2_t rv = bcore_xsg_u2( idx + 1 );
                    uint8_t* data = data_table[ idx ];
                    uz_t sz = size_table[ idx ];
                    for( uz_t i = 0; i < sz; i++ ) data[ i ] = ( ( rv = bcore_xsg_u2( rv ) ) & 255 );
                }
            }
            else
            {
                rval = bcore_xsg_u2( rval );
                if( rval & 32 )
                {
                    data_table[ idx ] = alloc( data_table[ idx ], size_table[ idx ], 0, &size_table[ idx ] ); // free
                    free_attempts++;
                    free_failures += ( data_table[ idx ] != NULL );
                }
                else
                {
                    rval = bcore_xsg_u2( rval );
                    uz_t size = pow( ( double )max_alloc, rval * pow( 2.0, -32 ) );

                    uz_t new_size = 0;

                    data_table[ idx ] = alloc( data_table[ idx ], size_table[ idx ], size, &new_size ); // realloc

                    // verify old table content (only when size > sz - stdlib realloc does not seem to retain data otherwise)
                    if( size > size_table[ idx ] )
                    {
                        if( data_table[ idx ] != NULL && size_table[ idx ] > 0 )
                        {
                            u2_t rv = bcore_xsg_u2( idx + 1 );
                            uint8_t* data = data_table[ idx ];
                            uz_t sz = size_table[ idx ];
                            for( uz_t i = 0; i < sz; i++ )
                            {
                                rv = bcore_xsg_u2( rv );
                                if( data[ i ] != ( rv & 255 ) )
                                {
                                    ERR( "data failure [%u vs %u].", ( u2_t )data[ i ], ( u2_t )( rv & 255 ) );
                                }
                            }
                        }
                    }

                    size_table[ idx ] = new_size; //( data_table[ idx ] != NULL ) ? size : 0;
                    realloc_attempts++;
                    realloc_failures += ( size > 0 ) && ( data_table[ idx ] == NULL );

                    // set new content
                    if( size_table[ idx ] > 0 )
                    {
                        u2_t rv = bcore_xsg_u2( idx + 1 );
                        uint8_t* data = data_table[ idx ];
                        uz_t sz = size_table[ idx ];
                        for( uz_t i = 0; i < sz; i++ ) data[ i ] = ( ( rv = bcore_xsg_u2( rv ) ) & 255 );
                    }
                }
            }
        }
    }

    uz_t allocated_table_size = 0;
    for( uz_t i = 0; i < table_size; i++ ) allocated_table_size += ( data_table[ i ] != NULL );

    if( verbose )
    {
        st_s_pushf( str, "cycles ............... %zu\n", cycles );
        st_s_pushf( str, "max alloc ............ %zu\n", max_alloc );
        st_s_pushf( str, "Instances\n" );
        st_s_pushf( str, "  total .............. %zu\n", table_size );
        st_s_pushf( str, "  allocated .......... %zu\n", allocated_table_size );
        st_s_pushf( str, "Alloc\n" );
        st_s_pushf( str, "  attempts  .......... %zu\n", alloc_attempts );
        st_s_pushf( str, "  failures  .......... %zu\n", alloc_failures );
        st_s_pushf( str, "Realloc\n" );
        st_s_pushf( str, "  attempts  .......... %zu\n", realloc_attempts );
        st_s_pushf( str, "  failures  .......... %zu\n", realloc_failures );
        st_s_pushf( str, "Free\n" );
        st_s_pushf( str, "  attempts  .......... %zu\n", free_attempts );
        st_s_pushf( str, "  failures  .......... %zu\n", free_failures );
    }

    // speed test
    {
        clock_t time = clock();
        for( uz_t j = 0; j < cycles; j++ )
        {
            for( uz_t i = 0; i < table_size; i++ )
            {
                rval = bcore_xsg_u2( rval );
                uz_t idx = rval % table_size;
                if( data_table[ idx ] == NULL )
                {
                    uz_t size = pow( ( double )max_alloc, rval * pow( 2.0, -32 ) );
                    data_table[ idx ] = alloc( data_table[ idx ], 0, size, &size_table[ idx ] );
                }
                else
                {
                    data_table[ idx ] = alloc( data_table[ idx ], size_table[ idx ], 0, &size_table[ idx ] ); // free
                }
            }
        }
        time = clock() - time;
        st_s_pushf( str, "speed test alloc-free: %5.3gs\n", ( double )time / ( CLOCKS_PER_SEC  * cycles  * table_size ) );
    }
    // speed test
    {
        clock_t time = clock();
        for( uz_t j = 0; j < cycles; j++ )
        {
            for( uz_t i = 0; i < table_size; i++ )
            {
                rval = bcore_xsg_u2( rval );
                uz_t idx = rval % table_size;
                rval = bcore_xsg_u2( rval );
                uz_t size = pow( ( double )max_alloc, rval * pow( 2.0, -32 ) );
                data_table[ idx ] = alloc( data_table[ idx ], size_table[ idx ], size, &size_table[ idx ] ); // realloc
            }
        }
        time = clock() - time;
        st_s_pushf( str, "speed test realloc:    %5.3gs\n", ( double )time / ( CLOCKS_PER_SEC  * cycles  * table_size ) );
    }

    // cleanup
    if( cleanup ) for( uz_t i = 0; i < table_size; i++ ) data_table[ i ] = alloc( data_table[ i ], size_table[ i ], 0, NULL );

    free( size_table );
    free( data_table );
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movl %r9d, %eax
movq %rcx, -0x1b8(%rbp)
movq %rdx, %rcx
movq -0x1b8(%rbp), %rdx
movq %rcx, -0x1b0(%rbp)
movq %rsi, %rcx
movq -0x1b0(%rbp), %rsi
movq %rcx, -0x1a8(%rbp)
movq %rdi, %r9
movq -0x1a8(%rbp), %rdi
movb %al, %cl
movb 0x10(%rbp), %al
movq %r9, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
andb $0x1, %cl
movb %cl, -0x25(%rbp)
andb $0x1, %al
movb %al, -0x26(%rbp)
movb $0x0, %al
callq 0xff2e0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
shlq $0x3, %rdi
callq 0x4150
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
shlq $0x3, %rdi
callq 0x4150
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x10ad42
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x10ad1a
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x10ad72
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x10ad4a
movl -0x24(%rbp), %eax
movl %eax, -0x54(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movq -0x90(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x10b52b
movq $0x0, -0x98(%rbp)
movq -0x98(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x10b512
movl -0x54(%rbp), %edi
callq 0x10f390
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x10(%rbp)
movq %rdx, -0xa0(%rbp)
movq -0x40(%rbp), %rax
movq -0xa0(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jbe 0x10af09
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movl %eax, %edi
callq 0x10f390
movl %eax, -0xa4(%rbp)
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xb0(%rbp)
movq -0x40(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xb8(%rbp)
movq $0x0, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
cmpq -0xb8(%rbp), %rax
jae 0x10af07
movl -0xa4(%rbp), %edi
callq 0x10f390
movl %eax, -0xa4(%rbp)
movq -0xb0(%rbp), %rax
movq -0xc0(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl -0xa4(%rbp), %ecx
andl $0xff, %ecx
cmpl %ecx, %eax
je 0x10aeee
movq -0xb0(%rbp), %rax
movq -0xc0(%rbp), %rcx
movzbl (%rax,%rcx), %r8d
movl -0xa4(%rbp), %r9d
andl $0xff, %r9d
leaq 0x4cf39(%rip), %rdi     # 0x157e0d
leaq 0x4c4c2(%rip), %rsi     # 0x15739d
movl $0xae9, %edx            # imm = 0xAE9
leaq 0x4cf3c(%rip), %rcx     # 0x157e23
movb $0x0, %al
callq 0x9cf40
jmp 0x10aef0
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
jmp 0x10ae65
jmp 0x10af09
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x10b10e
movl -0x54(%rbp), %edi
callq 0x10f390
movl %eax, -0x54(%rbp)
movaps 0x33fcf(%rip), %xmm1    # 0x13ef00
movq -0x20(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x33fce(%rip), %xmm1    # 0x13ef10
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x1c8(%rbp)
movl -0x54(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x1d0(%rbp)
movsd 0x33eaf(%rip), %xmm0    # 0x13ee20
movsd 0x4c3f7(%rip), %xmm1    # 0x157370
callq 0x4420
movsd -0x1d0(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x1c8(%rbp), %xmm0
mulsd %xmm2, %xmm1
callq 0x4420
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x33e67(%rip), %xmm1    # 0x13ee18
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq -0xa0(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq -0xc8(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0xa0(%rbp), %rsi
shlq $0x3, %rsi
addq %rsi, %rcx
xorl %esi, %esi
callq *%rax
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
xorl %eax, %eax
cmpq $0x0, -0xc8(%rbp)
movb %al, -0x1b9(%rbp)
jbe 0x10b040
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
sete %al
movb %al, -0x1b9(%rbp)
movb -0x1b9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cltq
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x40(%rbp), %rax
movq -0xa0(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jbe 0x10b109
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movl %eax, %edi
callq 0x10f390
movl %eax, -0xcc(%rbp)
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xd8(%rbp)
movq -0x40(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xe0(%rbp)
movq $0x0, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
cmpq -0xe0(%rbp), %rax
jae 0x10b107
movl -0xcc(%rbp), %edi
callq 0x10f390
movl %eax, -0xcc(%rbp)
andl $0xff, %eax
movb %al, %dl
movq -0xd8(%rbp), %rax
movq -0xe8(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0xe8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe8(%rbp)
jmp 0x10b0ba
jmp 0x10b109
jmp 0x10b4f9
movl -0x54(%rbp), %edi
callq 0x10f390
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x10b1ab
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq -0xa0(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq -0x40(%rbp), %rcx
movq -0xa0(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movq -0x40(%rbp), %rcx
movq -0xa0(%rbp), %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
xorl %edx, %edx
callq *%rax
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
addq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x10b4f7
movl -0x54(%rbp), %edi
callq 0x10f390
movl %eax, -0x54(%rbp)
movaps 0x33d43(%rip), %xmm1    # 0x13ef00
movq -0x20(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x33d42(%rip), %xmm1    # 0x13ef10
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x1d8(%rbp)
movl -0x54(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x1e0(%rbp)
movsd 0x33c23(%rip), %xmm0    # 0x13ee20
movsd 0x4c16b(%rip), %xmm1    # 0x157370
callq 0x4420
movsd -0x1e0(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x1d8(%rbp), %xmm0
mulsd %xmm2, %xmm1
callq 0x4420
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x33bdb(%rip), %xmm1    # 0x13ee18
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0xf0(%rbp)
movq $0x0, -0xf8(%rbp)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq -0xa0(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq -0x40(%rbp), %rcx
movq -0xa0(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movq -0xf0(%rbp), %rdx
leaq -0xf8(%rbp), %rcx
callq *%rax
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0xf0(%rbp), %rax
movq -0x40(%rbp), %rcx
movq -0xa0(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
jbe 0x10b3df
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x10b3dd
movq -0x40(%rbp), %rax
movq -0xa0(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jbe 0x10b3dd
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movl %eax, %edi
callq 0x10f390
movl %eax, -0xfc(%rbp)
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x108(%rbp)
movq -0x40(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x110(%rbp)
movq $0x0, -0x118(%rbp)
movq -0x118(%rbp), %rax
cmpq -0x110(%rbp), %rax
jae 0x10b3db
movl -0xfc(%rbp), %edi
callq 0x10f390
movl %eax, -0xfc(%rbp)
movq -0x108(%rbp), %rax
movq -0x118(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl -0xfc(%rbp), %ecx
andl $0xff, %ecx
cmpl %ecx, %eax
je 0x10b3c2
movq -0x108(%rbp), %rax
movq -0x118(%rbp), %rcx
movzbl (%rax,%rcx), %r8d
movl -0xfc(%rbp), %r9d
andl $0xff, %r9d
leaq 0x4ca65(%rip), %rdi     # 0x157e0d
leaq 0x4bfee(%rip), %rsi     # 0x15739d
movl $0xb1e, %edx            # imm = 0xB1E
leaq 0x4ca68(%rip), %rcx     # 0x157e23
movb $0x0, %al
callq 0x9cf40
jmp 0x10b3c4
movq -0x118(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0x10b339
jmp 0x10b3dd
jmp 0x10b3df
movq -0xf8(%rbp), %rdx
movq -0x40(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
xorl %eax, %eax
cmpq $0x0, -0xf0(%rbp)
movb %al, -0x1e1(%rbp)
jbe 0x10b42c
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
sete %al
movb %al, -0x1e1(%rbp)
movb -0x1e1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cltq
addq -0x80(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x40(%rbp), %rax
movq -0xa0(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jbe 0x10b4f5
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movl %eax, %edi
callq 0x10f390
movl %eax, -0x11c(%rbp)
movq -0x38(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x128(%rbp)
movq -0x40(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x130(%rbp)
movq $0x0, -0x138(%rbp)
movq -0x138(%rbp), %rax
cmpq -0x130(%rbp), %rax
jae 0x10b4f3
movl -0x11c(%rbp), %edi
callq 0x10f390
movl %eax, -0x11c(%rbp)
andl $0xff, %eax
movb %al, %dl
movq -0x128(%rbp), %rax
movq -0x138(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x138(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x138(%rbp)
jmp 0x10b4a6
jmp 0x10b4f5
jmp 0x10b4f7
jmp 0x10b4f9
jmp 0x10b4fb
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x10add2
jmp 0x10b514
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x10adb6
movq $0x0, -0x140(%rbp)
movq $0x0, -0x148(%rbp)
movq -0x148(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x10b58a
movq -0x38(%rbp), %rax
movq -0x148(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
addq -0x140(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x148(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x148(%rbp)
jmp 0x10b541
testb $0x1, -0x26(%rbp)
je 0x10b6be
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x4c899(%rip), %rsi     # 0x157e3c
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x4c89f(%rip), %rsi     # 0x157e58
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
leaq 0x4c8a9(%rip), %rsi     # 0x157e74
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x4c89e(%rip), %rsi     # 0x157e7f
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
movq -0x140(%rbp), %rdx
leaq 0x4c8a1(%rip), %rsi     # 0x157e9b
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
leaq 0x4c8ab(%rip), %rsi     # 0x157eb7
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
movq -0x60(%rbp), %rdx
leaq 0x4c89c(%rip), %rsi     # 0x157ebe
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
movq -0x78(%rbp), %rdx
leaq 0x4c8a2(%rip), %rsi     # 0x157eda
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
leaq 0x4c8ac(%rip), %rsi     # 0x157ef6
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
movq -0x68(%rbp), %rdx
leaq 0x4c85e(%rip), %rsi     # 0x157ebe
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
movq -0x80(%rbp), %rdx
leaq 0x4c864(%rip), %rsi     # 0x157eda
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
leaq 0x4c877(%rip), %rsi     # 0x157eff
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
movq -0x70(%rbp), %rdx
leaq 0x4c820(%rip), %rsi     # 0x157ebe
movb $0x0, %al
callq 0x100120
movq -0x30(%rbp), %rdi
movq -0x88(%rbp), %rdx
leaq 0x4c823(%rip), %rsi     # 0x157eda
movb $0x0, %al
callq 0x100120
callq 0x4300
movq %rax, -0x150(%rbp)
movq $0x0, -0x158(%rbp)
movq -0x158(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x10b892
movq $0x0, -0x160(%rbp)
movq -0x160(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x10b879
movl -0x54(%rbp), %edi
callq 0x10f390
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x10(%rbp)
movq %rdx, -0x168(%rbp)
movq -0x38(%rbp), %rax
movq -0x168(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x10b816
movaps 0x337c4(%rip), %xmm1    # 0x13ef00
movq -0x20(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x337c3(%rip), %xmm1    # 0x13ef10
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x1f0(%rbp)
movl -0x54(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x1f8(%rbp)
movsd 0x336a4(%rip), %xmm0    # 0x13ee20
movsd 0x4bbec(%rip), %xmm1    # 0x157370
callq 0x4420
movsd -0x1f8(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x1f0(%rbp), %xmm0
mulsd %xmm2, %xmm1
callq 0x4420
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x3365c(%rip), %xmm1    # 0x13ee18
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x170(%rbp)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq -0x168(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq -0x170(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x168(%rbp), %rsi
shlq $0x3, %rsi
addq %rsi, %rcx
xorl %esi, %esi
callq *%rax
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq -0x168(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x10b860
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq -0x168(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq -0x40(%rbp), %rcx
movq -0x168(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movq -0x40(%rbp), %rcx
movq -0x168(%rbp), %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
xorl %edx, %edx
callq *%rax
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq -0x168(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x10b862
movq -0x160(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x160(%rbp)
jmp 0x10b6f1
jmp 0x10b87b
movq -0x158(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x158(%rbp)
jmp 0x10b6d5
callq 0x4300
movq -0x150(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x150(%rbp)
movq -0x30(%rbp), %rdi
cvtsi2sdq -0x150(%rbp), %xmm0
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
imulq %rcx, %rax
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
movq %rax, %xmm1
movaps 0x3362c(%rip), %xmm2    # 0x13ef00
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x33630(%rip), %xmm2    # 0x13ef10
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
leaq 0x4c60b(%rip), %rsi     # 0x157f05
movb $0x1, %al
callq 0x100120
callq 0x4300
movq %rax, -0x178(%rbp)
movq $0x0, -0x180(%rbp)
movq -0x180(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x10ba8a
movq $0x0, -0x188(%rbp)
movq -0x188(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x10ba71
movl -0x54(%rbp), %edi
callq 0x10f390
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divq %rcx
movq %rdx, -0x190(%rbp)
movl -0x54(%rbp), %edi
callq 0x10f390
movl %eax, -0x54(%rbp)
movaps 0x3358b(%rip), %xmm1    # 0x13ef00
movq -0x20(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x3358a(%rip), %xmm1    # 0x13ef10
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x200(%rbp)
movl -0x54(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x208(%rbp)
movsd 0x3346b(%rip), %xmm0    # 0x13ee20
movsd 0x4b9b3(%rip), %xmm1    # 0x157370
callq 0x4420
movsd -0x208(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x200(%rbp), %xmm0
mulsd %xmm2, %xmm1
callq 0x4420
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x33423(%rip), %xmm1    # 0x13ee18
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x198(%rbp)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq -0x190(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq -0x40(%rbp), %rcx
movq -0x190(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movq -0x198(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x190(%rbp), %r8
shlq $0x3, %r8
addq %r8, %rcx
callq *%rax
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq -0x190(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x188(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x188(%rbp)
jmp 0x10b934
jmp 0x10ba73
movq -0x180(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x180(%rbp)
jmp 0x10b918
callq 0x4300
movq -0x178(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x178(%rbp)
movq -0x30(%rbp), %rdi
cvtsi2sdq -0x178(%rbp), %xmm0
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
imulq %rcx, %rax
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
movq %rax, %xmm1
movaps 0x33434(%rip), %xmm2    # 0x13ef00
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x33438(%rip), %xmm2    # 0x13ef10
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
leaq 0x4c432(%rip), %rsi     # 0x157f24
movb $0x1, %al
callq 0x100120
testb $0x1, -0x25(%rbp)
je 0x10bb68
movq $0x0, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x10bb66
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq -0x1a0(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq -0x40(%rbp), %rcx
movq -0x1a0(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
xorl %ecx, %ecx
movq %rcx, %rdx
callq *%rax
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq -0x1a0(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x1a0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1a0(%rbp)
jmp 0x10bb0a
jmp 0x10bb68
movq -0x40(%rbp), %rdi
callq 0x4200
movq -0x38(%rbp), %rdi
callq 0x4200
movq -0x30(%rbp), %rax
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
nopw (%rax,%rax)