// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/sorttest.cpp
// Function: main
int main(void)
{
    time_point t;

    std::map<int, gen_data_func_t> gen_data_fun_map;
    std::map<int, arrar_function_t> gen_data_shuffle;
    std::map<std::string, arrar_function_t> test_func_map;
    std::map<int, int> split_size_map;
    const size_t out_bound_check_size = 128;
    const int out_bound_check_head_value = 0xf0f0f0f;
    const int out_bound_check_tail_value = -0xf0f0f0f;

    init_gen_data_fun_map(gen_data_fun_map, gen_data_shuffle, split_size_map);
    init_test_func_map(test_func_map);

    int base_size = 1000;
    if (TEST_TYPE_SIMPLE)
    {
        base_size += base_size / 2;
    }
    int arr_size = base_size * base_size * 2;
    std::vector<sort_element_t> arr(arr_size + out_bound_check_size * 2);
    baobao::util::rand_seed((uint32_t)time(NULL));

#if CONSOLE_OUTPUT == 1
    printf("Begin %d\n", arr_size);

    printf(" -|");
    for (std::map<std::string, arrar_function_t>::iterator it = test_func_map.begin();
         it != test_func_map.end();
         ++it)
    {
        printf("%12s|", it->first.c_str());
    }
    puts("");
    printf("-:|");
    for (std::map<std::string, arrar_function_t>::iterator it = test_func_map.begin();
         it != test_func_map.end();
         ++it)
    {
        printf("%12s|", "-----------:");
    }
    puts("");
#endif
    std::map<std::string, std::map<int, int> > result_map;
    std::map<std::string, int > unstable_map;
    for (std::map<int, gen_data_func_t>::iterator it_test = gen_data_fun_map.begin();
         it_test != gen_data_fun_map.end();
         ++it_test)
    {
        if (CONSOLE_OUTPUT)
            printf("%2d|", it_test->first);
        for (size_t i = 0; i < out_bound_check_size; ++i)
        {
            arr[i] = out_bound_check_head_value;
            arr[arr.size() - out_bound_check_size + i] = out_bound_check_tail_value;
        }
        for (int i = 0; i < (int)arr_size; ++i)
        {
            arr[i + out_bound_check_size] = it_test->second(i, arr_size);
        }
        if (gen_data_shuffle.find(it_test->first) != gen_data_shuffle.end())
        {
            gen_data_shuffle[it_test->first](&*(arr.begin() + out_bound_check_size), arr_size);
        }
#if TEST_TYPE_SIMPLE == 0
        for (int i = 0; i < (int)arr_size; ++i)
        {
            arr[i + out_bound_check_size].index = i;
        }
#endif
        for (std::map<std::string, arrar_function_t>::iterator it = test_func_map.begin();
             it != test_func_map.end();
             ++it)
        {
            std::vector<sort_element_t> arr_c = arr;
            int res_ms = 0;
            bool correct = true;
            if (split_size_map.find(it_test->first) != split_size_map.end())
            {
                int split_cnt = split_size_map[it_test->first];
                int last_size = arr_size - split_cnt;
                std::vector<sort_element_t> arr_c2 = arr;
                t = get_time();
                for (int i = 0; i < last_size; i += split_cnt)
                {
                    it->second(&*arr_c.begin() + out_bound_check_size + i, split_cnt);
                }
                for (int i = 0; i < last_size; i += split_cnt)
                {
                    it->second(&*arr_c2.begin() + out_bound_check_size + i, split_cnt);
                }
                res_ms = (int)get_time_diff(t, get_time());

                //for (size_t i = 0; i < arr_size; i++) // avoid optimize arr_c2
                //{
                //    if (arr_c[i] < arr_c2[i] || arr_c2[i] < arr_c[i])
                //    {
                //        correct = false;
                //    }
                //}
            }
            else
            {
                t = get_time();
                it->second(&*(arr_c.begin() + out_bound_check_size), arr_size);
                res_ms = (int)get_time_diff(t, get_time());
            }
            if (CONSOLE_OUTPUT)
                printf("%12d|", (int)res_ms);

            if (split_size_map.find(it_test->first) == split_size_map.end())
            {
                for (size_t i = 0; i < out_bound_check_size; ++i)
                {
                    if (!(arr[i] == out_bound_check_head_value))
                    {
                        correct = false;
                        break;
                    }
                    if (!(arr[arr.size() - out_bound_check_size + i] == out_bound_check_tail_value))
                    {
                        correct = false;
                        break;
                    }
                }
                if (correct)
                {
                    if (!baobao::check_sorted(arr_c.begin() + out_bound_check_size, arr_c.end() - out_bound_check_size, std::less<sort_element_t>()))
                    {
                        correct = false;
                    }
#if TEST_TYPE_SIMPLE == 0
                    else
                    {
                        if (!baobao::check_sorted_stable(arr_c.begin() + out_bound_check_size, arr_c.end() - out_bound_check_size, std::less<sort_element_t>()))
                        {
                            unstable_map[it->first] = 1;
                        }
                    }
#endif
                }
            }
            if (correct)
            {
                result_map[it->first][it_test->first] = res_ms;
            }
            else
            {
                result_map[it->first][it_test->first] = -1;
            }
            fflush(stdout);
        }
        if (CONSOLE_OUTPUT)
            printf("\n");
    }

    std::vector<std::string> index_name;
    std::vector<algo_score> final_score;

    for (std::map<std::string, arrar_function_t>::iterator it_test = test_func_map.begin();
         it_test != test_func_map.end();
         ++it_test)
    {
        index_name.push_back(it_test->first);
        final_score.push_back(algo_score(0, (int)index_name.size() - 1, it_test->first));
        for (std::map<int, gen_data_func_t>::iterator it = gen_data_fun_map.begin();
             it != gen_data_fun_map.end();
             ++it)
        {
            int v = result_map[it_test->first][it->first];
            if (v >= 0)
            {
                final_score.back().score += v;
            }
            else if (v == -1)
            {
                final_score.back().score += 1000 * 1000;
            }
        }
    }

#if TEST_TYPE_SIMPLE == 0
    printf("\n%-12s||\n------------|---\n", "stable test");
    for (std::map<std::string, arrar_function_t>::iterator it_test = test_func_map.begin();
        it_test != test_func_map.end();
        ++it_test)
    {
        printf("%-12s|%s\n", it_test->first.c_str(), (unstable_map.find(it_test->first) != unstable_map.end() ? "no" : "yes"));
    }
#endif

    char test_title[16] = "";
    if (TEST_TYPE_SIMPLE == 0)
    {
        sprintf(test_title, "TestClass %d", TEST_CLASS_SIZE);
    }
    else if (TEST_TYPE_SIMPLE == 1)
    {
        sprintf(test_title, "int");
    }
    else if (TEST_TYPE_SIMPLE == 2)
    {
        sprintf(test_title, "double");
    }
    else
    {
    }
    printf("\n%-12s|", test_title);
    for (std::map<int, gen_data_func_t>::iterator it = gen_data_fun_map.begin();
         it != gen_data_fun_map.end();
         ++it)
    {
        printf("  %-3d|", it->first);
    }
    puts(" Avg |");
    printf("------------|");
    for (std::map<int, gen_data_func_t>::iterator it = gen_data_fun_map.begin();
         it != gen_data_fun_map.end();
         ++it)
    {
        printf("%5s|", "----:");
    }
    puts("----:|");
    std::sort(final_score.begin(), final_score.end());
    for (std::vector<algo_score>::iterator it_test = final_score.begin();
         it_test != final_score.end();
         ++it_test)
    {
        std::string name = it_test->name;
        printf("%-12s|", name.c_str());
        for (std::map<int, gen_data_func_t>::iterator it = gen_data_fun_map.begin();
             it != gen_data_fun_map.end();
             ++it)
        {
            int v = result_map[name][it->first];
            if (v >= 0)
            {
                printf("%5d|", v);
            }
            else if (v == -1)
            {
                printf("%5s|", "Wrong");
            }
            else if (v == -2)
            {
                printf("%5s|", "Error");
            }
            else if (v == -3)
            {
                printf("%5s|", "Time");
            }
        }
        printf("%5d|\n", (int)(it_test->score / gen_data_fun_map.size()));
    }
    printf("\n%d END\n", arr_size);
    fflush(stdout);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
leaq 0xc0(%rsp), %rcx
xorl %eax, %eax
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x168(%rsp), %r13
movl %eax, (%r13)
movq %rax, 0x8(%r13)
movq %r13, 0x10(%r13)
movq %r13, 0x18(%r13)
movq %rax, 0x20(%r13)
leaq 0x130(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x198(%rsp), %rbp
movl %eax, (%rbp)
movq %rax, 0x8(%rbp)
movq %rbp, 0x10(%rbp)
movq %rbp, 0x18(%rbp)
movq %rax, 0x20(%rbp)
leaq 0x80(%rsp), %rsi
movl $0x1, (%rsi)
leaq 0xb8(%rsp), %rdi
callq 0x4636
leaq 0xea1(%rip), %rcx       # 0x3bc4
movq %rcx, (%rax)
leaq 0x80(%rsp), %rsi
movl $0x2, (%rsi)
leaq 0xb8(%rsp), %rdi
callq 0x4636
leaq 0xe82(%rip), %rcx       # 0x3bca
movq %rcx, (%rax)
leaq 0x80(%rsp), %rsi
movl $0x3, (%rsi)
leaq 0xb8(%rsp), %rdi
callq 0x4636
leaq 0xe63(%rip), %rcx       # 0x3bd0
movq %rcx, (%rax)
leaq 0x80(%rsp), %rsi
movl $0x4, (%rsi)
leaq 0xb8(%rsp), %rdi
callq 0x4636
leaq 0xe49(%rip), %rbx       # 0x3bdb
movq %rbx, (%rax)
leaq 0x80(%rsp), %rsi
movl $0x4, (%rsi)
leaq 0x160(%rsp), %rdi
callq 0x4132
leaq 0xe27(%rip), %r14       # 0x3bde
movq %r14, (%rax)
leaq 0x80(%rsp), %rsi
movl $0x5, (%rsi)
leaq 0xb8(%rsp), %rdi
callq 0x4636
leaq 0xe0e(%rip), %rcx       # 0x3bea
movq %rcx, (%rax)
leaq 0x80(%rsp), %rsi
movl $0x5, (%rsi)
leaq 0x160(%rsp), %rdi
callq 0x4132
movq %r14, (%rax)
leaq 0x80(%rsp), %rsi
movl $0x6, (%rsi)
leaq 0xb8(%rsp), %rdi
callq 0x4636
leaq 0xddc(%rip), %r15       # 0x3bfb
movq %r15, (%rax)
leaq 0x80(%rsp), %rsi
movl $0x6, (%rsi)
leaq 0x160(%rsp), %rdi
callq 0x4132
movq %r14, (%rax)
leaq 0x80(%rsp), %rsi
movl $0x7, (%rsi)
leaq 0xb8(%rsp), %rdi
callq 0x4636
movq %r15, (%rax)
leaq 0x80(%rsp), %rsi
movl $0x8, (%rsi)
leaq 0xb8(%rsp), %rdi
callq 0x4636
leaq 0xd8b(%rip), %rcx       # 0x3c0b
movq %rcx, (%rax)
leaq 0x80(%rsp), %rsi
movl $0x9, (%rsi)
leaq 0xb8(%rsp), %rdi
callq 0x4636
movq %rbx, (%rax)
leaq 0x80(%rsp), %rsi
movl $0x9, (%rsi)
leaq 0x160(%rsp), %rdi
callq 0x4132
leaq 0xd4e(%rip), %rcx       # 0x3c11
movq %rcx, (%rax)
leaq 0x80(%rsp), %rsi
movl $0xa, (%rsi)
leaq 0xb8(%rsp), %rdi
callq 0x4636
movq %rbx, (%rax)
leaq 0x80(%rsp), %rsi
movl $0xa, (%rsi)
leaq 0x160(%rsp), %rdi
callq 0x4132
leaq 0xe7d(%rip), %rcx       # 0x3d83
movq %rcx, (%rax)
leaq 0x80(%rsp), %rsi
movl $0xb, (%rsi)
leaq 0xb8(%rsp), %rdi
callq 0x4636
movq %rbx, (%rax)
leaq 0x80(%rsp), %rsi
movl $0xb, (%rsi)
leaq 0x160(%rsp), %rdi
callq 0x4132
movq %r14, (%rax)
leaq 0x80(%rsp), %rsi
movl $0xb, (%rsi)
leaq 0x190(%rsp), %rdi
callq 0x422a
movl $0x104, (%rax)          # imm = 0x104
leaq 0x128(%rsp), %rdi
callq 0x2800
xorpd %xmm0, %xmm0
leaq 0x80(%rsp), %rdx
movapd %xmm0, 0x10(%rdx)
movapd %xmm0, (%rdx)
leaq 0xe8(%rsp), %rdi
leaq 0x1c0(%rsp), %rcx
movl $0x1e8580, %esi         # imm = 0x1E8580
callq 0x409c
xorl %edi, %edi
callq 0x2170
leaq 0x80(%rsp), %rdi
movl %eax, %esi
callq 0x45aa
callq 0x3dda
leaq 0x88(%rsp), %rcx
movl (%rcx), %edx
movl %edx, 0x8(%rax)
movq -0x8(%rcx), %rdx
movq %rdx, (%rax)
xorl %eax, %eax
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x1c8(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq 0xd0(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0xc0(%rsp), %rcx
cmpq %rcx, %rax
je 0x3570
movq 0xe8(%rsp), %rax
movq 0xf0(%rsp), %rcx
movq $-0x1000, %rdx          # imm = 0xF000
addq %rdx, %rcx
xorl %edx, %edx
movl $0xf0f0f0f, (%rax,%rdx) # imm = 0xF0F0F0F
movl $0xf0f0f0f1, (%rcx,%rdx) # imm = 0xF0F0F0F1
addq $0x20, %rdx
cmpq $0x1000, %rdx           # imm = 0x1000
jne 0x3039
movl $0x1000, %ebx           # imm = 0x1000
xorl %r14d, %r14d
movl %r14d, %edi
movl $0x1e8480, %esi         # imm = 0x1E8480
movq 0x50(%rsp), %rax
callq *0x28(%rax)
movq 0xe8(%rsp), %rcx
movl %eax, (%rcx,%rbx)
incq %r14
addq $0x20, %rbx
cmpq $0x1e8480, %r14         # imm = 0x1E8480
jne 0x305c
movq 0x50(%rsp), %rax
leaq 0x20(%rax), %r12
movq 0x170(%rsp), %rcx
movq %r13, %rax
testq %rcx, %rcx
je 0x30be
movl (%r12), %edx
movq %r13, %rax
xorl %esi, %esi
cmpl %edx, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x30a7
movq %r13, %rcx
cmpq %r13, %rax
leaq 0x30(%rsp), %rbx
je 0x30d9
movl (%r12), %ecx
cmpl 0x20(%rax), %ecx
cmovlq %r13, %rax
movq %rax, %rcx
cmpq %r13, %rcx
je 0x3105
leaq 0x160(%rsp), %rdi
movq %r12, %rsi
callq 0x4132
movq 0xe8(%rsp), %rdi
movl $0x1000, %ecx           # imm = 0x1000
addq %rcx, %rdi
movl $0x1e8480, %esi         # imm = 0x1E8480
callq *(%rax)
movq 0xe8(%rsp), %rax
movl $0x1004, %ecx           # imm = 0x1004
addq %rcx, %rax
xorl %ecx, %ecx
movl %ecx, (%rax)
incq %rcx
addq $0x20, %rax
cmpq $0x1e8480, %rcx         # imm = 0x1E8480
jne 0x3117
movq 0x140(%rsp), %r14
leaq 0x130(%rsp), %rax
cmpq %rax, %r14
movq %r12, 0x100(%rsp)
je 0x3561
leaq 0x58(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x419a
movq 0x1a0(%rsp), %rcx
movq %rbp, %rax
testq %rcx, %rcx
je 0x318a
movl (%r12), %edx
movq %rbp, %rax
xorl %esi, %esi
cmpl %edx, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x3173
movq %rbp, %rcx
cmpq %rbp, %rax
je 0x31a0
movl (%r12), %ecx
cmpl 0x20(%rax), %ecx
cmovlq %rbp, %rax
movq %rax, %rcx
cmpq %rbp, %rcx
je 0x32fd
leaq 0x190(%rsp), %rdi
movq %r12, %rsi
callq 0x422a
movslq (%rax), %r15
movq %rbx, %rdi
leaq 0xe8(%rsp), %rsi
callq 0x419a
movl $0x1e8480, %r13d        # imm = 0x1E8480
subq %r15, %r13
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x2210
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x18(%rsp)
movq %rdx, 0x8(%rsp)
imulq $0x3e8, 0x10(%rsp), %rax # imm = 0x3E8
movq %rax, 0x158(%rsp)
cmpl $0x1e847f, %r15d        # imm = 0x1E847F
jg 0x3238
movq %r15, %rbp
shlq $0x5, %rbp
movl $0x1000, %ebx           # imm = 0x1000
xorl %r12d, %r12d
movq 0x58(%rsp), %rdi
addq %rbx, %rdi
movq %r15, %rsi
callq *0x40(%r14)
addq %r15, %r12
addq %rbp, %rbx
cmpq %r13, %r12
jl 0x321e
cmpl $0x1e847f, %r15d        # imm = 0x1E847F
jg 0x326d
movslq %r13d, %r13
movq %r15, %rbp
shlq $0x5, %rbp
movl $0x1000, %ebx           # imm = 0x1000
xorl %r12d, %r12d
movq 0x30(%rsp), %rdi
addq %rbx, %rdi
movq %r15, %rsi
callq *0x40(%r14)
addq %r15, %r12
addq %rbp, %rbx
cmpq %r13, %r12
jl 0x3253
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x2210
imulq $0x3e8, 0x10(%rsp), %r13 # imm = 0x3E8
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x18(%rsp)
movq %rdx, %r15
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
leaq 0x30(%rsp), %rbx
je 0x32a8
callq 0x2180
movq 0x8(%rsp), %rcx
movq %rcx, %rax
shrq $0x3f, %rax
sarq $0x7, %rcx
addq %rax, %rcx
addq 0x158(%rsp), %rcx
cvtsi2sd %rcx, %xmm0
movq %r15, %rax
shrq $0x3f, %rax
sarq $0x7, %r15
addq %rax, %r15
addq %r13, %r15
cvtsi2sd %r15, %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
leaq 0x168(%rsp), %r13
leaq 0x198(%rsp), %rbp
jmp 0x33a0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2210
movq %rbx, %r12
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r15
movq 0x58(%rsp), %rdi
movl $0x1000, %eax           # imm = 0x1000
addq %rax, %rdi
movl $0x1e8480, %esi         # imm = 0x1E8480
callq *0x40(%r14)
movq %r15, %rax
movabsq $0x20c49ba5e353f7cf, %r15 # imm = 0x20C49BA5E353F7CF
imulq %r15
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
imulq $0x3e8, %rbx, %rax      # imm = 0x3E8
addq %rdx, %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x2210
imulq $0x3e8, 0x30(%rsp), %rcx # imm = 0x3E8
movq %r15, %rax
imulq 0x38(%rsp)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
addq %rcx, %rdx
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
subsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rbx
movq 0x100(%rsp), %r12
movq 0x1a0(%rsp), %rcx
movq %rbp, %rax
testq %rcx, %rcx
je 0x33d6
movl (%r12), %edx
movq %rbp, %rax
xorl %esi, %esi
cmpl %edx, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x33bf
movq %rbp, %rcx
cmpq %rbp, %rax
je 0x33ec
movl (%r12), %ecx
cmpl 0x20(%rax), %ecx
cmovlq %rbp, %rax
movq %rax, %rcx
movb $0x1, %r15b
cmpq %rbp, %rcx
jne 0x34de
movq 0xe8(%rsp), %rax
movq 0xf0(%rsp), %rcx
movq $-0x1000, %rdx          # imm = 0xF000
addq %rdx, %rcx
xorl %edx, %edx
cmpl $0xf0f0f0f, (%rax,%rdx) # imm = 0xF0F0F0F
jne 0x3438
cmpl $0xf0f0f0f1, (%rcx,%rdx) # imm = 0xF0F0F0F1
jne 0x3438
addq $0x20, %rdx
cmpq $0x1000, %rdx           # imm = 0x1000
jne 0x3414
movb $0x1, %r15b
jmp 0x343b
xorl %r15d, %r15d
testb %r15b, %r15b
je 0x34de
movq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
movq $-0x1000, %rdx          # imm = 0xF000
addq %rdx, %rcx
leaq 0x1020(%rax), %rsi
cmpq %rcx, %rsi
je 0x347c
movq %rsi, %rdx
movl (%rsi), %edi
addq $0x20, %rsi
cmpl -0x20(%rdx), %edi
jge 0x345f
cmpq %rcx, %rdx
je 0x347c
xorl %r15d, %r15d
jmp 0x34de
leaq 0x1020(%rax), %rdx
cmpq %rcx, %rdx
sete %dl
je 0x34c2
movl 0x1000(%rax), %esi
movl 0x1020(%rax), %edi
cmpl %esi, %edi
jl 0x34c2
addq $0x1040, %rax           # imm = 0x1040
cmpl %edi, %esi
jl 0x34ad
movl -0x3c(%rax), %esi
cmpl -0x1c(%rax), %esi
jg 0x34c2
cmpq %rcx, %rax
sete %dl
je 0x34c2
movl -0x20(%rax), %esi
movl (%rax), %edi
addq $0x20, %rax
cmpl %esi, %edi
jge 0x34a1
testb $0x1, %dl
jne 0x34de
leaq 0x20(%r14), %rsi
leaq 0x1c0(%rsp), %rdi
callq 0x4292
movl $0x1, (%rax)
leaq 0x20(%r14), %rsi
testb %r15b, %r15b
je 0x3509
leaq 0x80(%rsp), %rdi
callq 0x436a
movq %rax, %rdi
movq %r12, %rsi
callq 0x422a
cvttsd2si 0x8(%rsp), %ecx
movl %ecx, (%rax)
jmp 0x3527
leaq 0x80(%rsp), %rdi
callq 0x436a
movq %rax, %rdi
movq %r12, %rsi
callq 0x422a
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x16a9a(%rip), %rax     # 0x19fc8
movq (%rax), %rdi
callq 0x21b0
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3545
callq 0x2180
movq %r14, %rdi
callq 0x2110
movq %rax, %r14
leaq 0x130(%rsp), %rax
cmpq %rax, %r14
jne 0x314a
movq 0x50(%rsp), %rdi
callq 0x2110
jmp 0x3007
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
xorl %eax, %eax
movq %rax, 0x40(%rsp)
movq %rax, 0x20(%rsp)
movapd %xmm0, 0x10(%rsp)
movq 0x140(%rsp), %rbx
leaq 0x130(%rsp), %rax
cmpq %rax, %rbx
je 0x36dd
leaq 0x70(%rsp), %rbp
leaq 0x80(%rsp), %r14
leaq 0x20(%rbx), %r15
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x44a0
movq 0x30(%rsp), %r13
movq 0x38(%rsp), %r12
leaq 0x118(%rsp), %rax
movq %rax, 0x108(%rsp)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
addq %rsi, %rdx
leaq 0x108(%rsp), %rdi
callq 0x11f5c
subq %r13, %r12
shrq $0x5, %r12
decl %r12d
movl $0x0, 0x58(%rsp)
movl %r12d, 0x5c(%rsp)
movq %rbp, 0x60(%rsp)
movq 0x108(%rsp), %rsi
movq 0x110(%rsp), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x11f5c
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x44de
leaq 0xc0(%rsp), %r13
movq 0x60(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3654
callq 0x2180
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x366e
callq 0x2180
movq 0xd0(%rsp), %r12
cmpq %r13, %r12
je 0x36c1
movq %r14, %rdi
movq %r15, %rsi
callq 0x436a
leaq 0x20(%r12), %rsi
movq %rax, %rdi
callq 0x422a
movl (%rax), %eax
testl %eax, %eax
js 0x36a3
movq 0x18(%rsp), %rcx
addl %eax, -0x28(%rcx)
jmp 0x36a8
cmpl $-0x1, %eax
je 0x36ba
movq %r12, %rdi
callq 0x2110
movq %rax, %r12
cmpq %r13, %rax
jne 0x367b
jmp 0x36c1
movl $0xf4240, %eax          # imm = 0xF4240
jmp 0x3699
movq %rbx, %rdi
callq 0x2110
movq %rax, %rbx
leaq 0x130(%rsp), %rax
cmpq %rax, %rbx
jne 0x35b2
leaq 0x10a58(%rip), %rdi     # 0x1413c
leaq 0x10a6c(%rip), %rsi     # 0x14157
xorl %eax, %eax
callq 0x2050
movq 0x140(%rsp), %rbx
leaq 0x130(%rsp), %rax
cmpq %rax, %rbx
je 0x376b
leaq 0x1c0(%rsp), %r14
leaq 0x10a5a(%rip), %r13     # 0x14170
leaq 0x10a50(%rip), %rbp     # 0x1416d
leaq 0x10a3f(%rip), %r15     # 0x14163
leaq 0x20(%rbx), %rsi
movq 0x20(%rbx), %r12
movq %r14, %rdi
callq 0x13382
leaq 0x1c8(%rsp), %rcx
cmpq %rcx, %rax
movq %rbp, %rdx
cmoveq %r13, %rdx
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x2050
movq %rbx, %rdi
callq 0x2110
movq %rax, %rbx
leaq 0x130(%rsp), %rax
cmpq %rax, %rbx
jne 0x3724
xorpd %xmm0, %xmm0
leaq 0x1f0(%rsp), %rbx
movapd %xmm0, (%rbx)
leaq 0x109f2(%rip), %rsi     # 0x14174
movq %rbx, %rdi
movl $0x8, %edx
xorl %eax, %eax
callq 0x2070
leaq 0x109e9(%rip), %rdi     # 0x14181
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2050
movq 0xd0(%rsp), %rbx
leaq 0xc0(%rsp), %r12
cmpq %r12, %rbx
je 0x37db
leaq 0x109cb(%rip), %r14     # 0x14189
movl 0x20(%rbx), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2050
movq %rbx, %rdi
callq 0x2110
movq %rax, %rbx
cmpq %r12, %rax
jne 0x37be
leaq 0x109af(%rip), %rdi     # 0x14191
callq 0x2200
leaq 0x109aa(%rip), %rdi     # 0x14198
xorl %eax, %eax
callq 0x2050
movq 0xd0(%rsp), %rbx
cmpq %r12, %rbx
je 0x382d
leaq 0x1099d(%rip), %r14     # 0x141a6
leaq 0x1099b(%rip), %r15     # 0x141ab
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2050
movq %rbx, %rdi
callq 0x2110
movq %rax, %rbx
cmpq %r12, %rax
jne 0x3810
leaq 0x1097d(%rip), %rdi     # 0x141b1
callq 0x2200
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
cmpq %r14, %rbx
je 0x3883
movq %r14, %rax
subq %rbx, %rax
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rcx
bsrq %rcx, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x133e9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x13516
movq 0x10(%rsp), %r14
cmpq 0x18(%rsp), %r14
je 0x39a1
leaq 0x58(%rsp), %rbx
leaq 0x80(%rsp), %r12
leaq 0x10911(%rip), %r13     # 0x141b8
leaq 0x108f8(%rip), %rbp     # 0x141a6
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x11f5c
movq 0x58(%rsp), %rsi
leaq 0x108ab(%rip), %rdi     # 0x14182
xorl %eax, %eax
callq 0x2050
movq 0xd0(%rsp), %r15
leaq 0xc0(%rsp), %rax
cmpq %rax, %r15
je 0x3961
movq %r12, %rdi
movq %rbx, %rsi
callq 0x436a
leaq 0x20(%r15), %rsi
movq %rax, %rdi
callq 0x422a
movl (%rax), %esi
testl %esi, %esi
js 0x391c
movq %r13, %rdi
xorl %eax, %eax
callq 0x2050
jmp 0x3954
cmpl $-0x3, %esi
je 0x3943
cmpl $-0x2, %esi
je 0x3937
cmpl $-0x1, %esi
jne 0x3954
movq %rbp, %rdi
leaq 0x10888(%rip), %rsi     # 0x141bd
jmp 0x394d
movq %rbp, %rdi
leaq 0x10882(%rip), %rsi     # 0x141c3
jmp 0x394d
movq %rbp, %rdi
leaq 0x1087c(%rip), %rsi     # 0x141c9
xorl %eax, %eax
callq 0x2050
movq %r15, %rdi
callq 0x2110
movq %rax, %r15
jmp 0x38e6
movslq (%r14), %rax
xorl %edx, %edx
divq 0xe0(%rsp)
leaq 0x10859(%rip), %rdi     # 0x141ce
movl %eax, %esi
xorl %eax, %eax
callq 0x2050
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x3992
callq 0x2180
addq $0x28, %r14
cmpq 0x18(%rsp), %r14
jne 0x38ae
leaq 0x1082c(%rip), %rdi     # 0x141d4
movl $0x1e8480, %esi         # imm = 0x1E8480
xorl %eax, %eax
callq 0x2050
movq 0x1660d(%rip), %rax     # 0x19fc8
movq (%rax), %rdi
callq 0x21b0
leaq 0x10(%rsp), %rdi
callq 0x4522
leaq 0x30(%rsp), %rdi
callq 0x4566
leaq 0x1c0(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x4b5e
leaq 0x80(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x4ba6
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x3a0b
callq 0x2180
leaq 0x190(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x4c8e
leaq 0x128(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x4cc4
leaq 0x160(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x4d0c
leaq 0xb8(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x4d42
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x3ba3
movq %rax, %rbx
jmp 0x3b92
movq %rax, %rbx
jmp 0x3b81
jmp 0x3a90
movq %rax, %rbx
jmp 0x3b4d
jmp 0x3add
movq %rax, %rbx
jmp 0x3b08
jmp 0x3a9c
jmp 0x3afb
movq %rax, %rbx
jmp 0x3b5e
jmp 0x3add
jmp 0x3add
movq %rax, %rbx
jmp 0x3b70
jmp 0x3afb
jmp 0x3afb
jmp 0x3afb
movq %rax, %rbx
jmp 0x3ac1
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3ac1
callq 0x2180
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
jmp 0x3aef
jmp 0x3afb
jmp 0x3b14
jmp 0x3b14
jmp 0x3b14
jmp 0x3add
movq %rax, %rbx
jmp 0x3b3c
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x3afe
callq 0x2180
jmp 0x3afe
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4522
leaq 0x30(%rsp), %rdi
callq 0x4566
jmp 0x3b3c
movq %rax, %rbx
jmp 0x3b2d
jmp 0x3b1b
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3b2d
callq 0x2180
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3b3c
callq 0x2180
leaq 0x1c0(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x4b5e
leaq 0x80(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x4ba6
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x3b70
callq 0x2180
leaq 0x190(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x4c8e
leaq 0x128(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x4cc4
leaq 0x160(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x4d0c
leaq 0xb8(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x4d42
movq %rbx, %rdi
callq 0x2240
movq %rax, %rdi
callq 0x4090