LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::unguarded_insert_sort<baobao::internal::indirect_sort_iter_warp<baobao::TestClass*>*, baobao::internal::indirect_sort_comp_warp<baobao::TestClass*, std::less<baobao::TestClass>>>(baobao::internal::indirect_sort_iter_warp<baobao::TestClass*>*, baobao::internal::indirect_sort_iter_warp<baobao::TestClass*>*, baobao::internal::indirect_sort_comp_warp<baobao::TestClass*, std::less<baobao::TestClass>>)
inline void unguarded_insert_sort(RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    for (RandomAccessIterator i = beg; i < end; ++i)
    {
        if (compare(*i, *(i - 1)))
        {
            typename std::iterator_traits<RandomAccessIterator>::value_type val = *i;
            RandomAccessIterator j = i - 1;
            *i = *j;
            for (;compare(val, *(j - 1)); --j)
            {
                *j = *(j - 1);
            }
            *j = val;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x20(%rdi), %r13
cmpq %r14, %r15
jae 0x8e7a
leaq -0x10(%r15), %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x8b7a
testb %al, %al
je 0x8e70
movq (%r15), %rax
movq 0x8(%r15), %rcx
movups (%r12), %xmm0
movups %xmm0, (%r15)
movq %r13, %rdx
movq 0x8(%rdx), %rsi
movl (%rcx), %edi
movl (%rsi), %esi
cmpl %esi, %edi
jl 0x8e58
jg 0x8e68
cmpq (%rdx), %rax
jae 0x8e68
leaq 0x10(%rdx), %rsi
movups (%rdx), %xmm0
movups %xmm0, (%rsi)
addq $-0x10, %rdx
jmp 0x8e45
movq %rax, 0x10(%rdx)
movq %rcx, 0x18(%rdx)
addq $0x10, %r15
addq $0x10, %r13
jmp 0x8e17
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::sort::merge_sort<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void merge_sort(RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    if (end - beg > 1)
    {
        typedef typename std::iterator_traits<RandomAccessIterator>::value_type value_type;
        value_type * buf = (value_type*)malloc((end - beg) / 2 * sizeof(value_type));
        internal::merge_sort_recursive<false>(buf, beg, end, compare);
        free(buf);
    }
}

// Assembly:
movq %rsi, %rax
subq %rdi, %rax
cmpq $0x21, %rax
jl 0x5d61
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
shrq %rax
movabsq $0x3fffffffffffffe0, %rdi # imm = 0x3FFFFFFFFFFFFFE0
andq %rax, %rdi
callq 0x21e0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5d62
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x21b0
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::merge_sort_recursive<false, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void merge_sort_recursive(RandomAccessBufferIterator buf, RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    size_t len = end - beg;
    if (len < merge_insertion_sort_threshold)
    {
        insert_sort(beg, end, compare);
        return;
    }
    RandomAccessIterator mid = beg + (len >> 1);
    merge_sort_recursive<safecopy>(buf, beg, mid, compare);
    merge_sort_recursive<safecopy>(buf, mid, end, compare);
    merge_2_part<safecopy>(buf, beg, mid, end, compare);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdx, %r15
subq %rsi, %r15
sarq $0x5, %r15
cmpq $0x1f, %r15
ja 0x5d96
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x57c0
movq %rdi, %r12
shlq $0x4, %r15
andq $-0x20, %r15
addq %r14, %r15
movq %r14, %rsi
movq %r15, %rdx
callq 0x5d62
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x5d62
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5dd9
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::insert_sort_part<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
inline void insert_sort_part(RandomAccessIterator beg, RandomAccessIterator mid, RandomAccessIterator end, Comp compare)
{
    for (RandomAccessIterator i = mid; i < end; ++i)
    {
        if (compare(*i, *(i - 1)))
        {
            typename std::iterator_traits<RandomAccessIterator>::value_type val = *i;
            RandomAccessIterator j = i - 1;
            *i = *j;
            for (;j != beg && compare(val, *(j - 1)); --j)
            {
                *j = *(j - 1);
            }
            *j = val;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x40(%rsi), %rbp
leaq 0x8(%rsp), %r12
cmpq %rbx, %r14
jae 0x5eb9
movl (%r14), %eax
cmpl -0x20(%r14), %eax
jge 0x5eaf
leaq -0x20(%r14), %r13
movq %r12, %rdi
movq %r14, %rsi
callq 0x4144
movq %r14, %rdi
movq %r13, %rsi
callq 0x4164
movq %rbp, %r13
leaq 0x20(%r13), %rdi
cmpq %r15, %rdi
je 0x5ea7
movl 0x8(%rsp), %eax
cmpl (%r13), %eax
jge 0x5ea7
movq %r13, %rsi
callq 0x4164
addq $-0x20, %r13
jmp 0x5e86
movq %r12, %rsi
callq 0x4164
addq $0x20, %r14
addq $0x20, %rbp
jmp 0x5e5b
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::sort::merge_sort_s<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void merge_sort_s(RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    if (end - beg > 1)
    {
        typedef typename std::iterator_traits<RandomAccessIterator>::value_type value_type;
        value_type * buf = new value_type[(end - beg) / 2];
        internal::merge_sort_recursive<true>(buf, beg, end, compare);
        delete[] buf;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
subq %rdi, %r15
sarq $0x5, %r15
cmpq $0x2, %r15
jl 0x60a8
movq %rsi, %rbx
movq %rdi, %r14
shlq $0x4, %r15
andq $-0x20, %r15
movq %r15, %rdi
callq 0x2030
movq %rax, %r12
xorl %r13d, %r13d
leaq (%r12,%r13), %rdi
callq 0x39d2
addq $0x20, %r13
cmpq %r13, %r15
jne 0x6077
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x60b2
movq %r12, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x21d0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::merge_sort_with_buffer<false, baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>, bool)
void merge_sort_with_buffer(RandomAccessIterator beg, RandomAccessIterator end, Comp compare, bool buffered)
{
    if (end - beg > 1)
    {
        typedef typename std::iterator_traits<RandomAccessIterator>::value_type value_type;
        if (buffered)
        {
            if ((end - beg) / 2 * sizeof(value_type) <= merge_sort_stack_buffer_size)
            {
                value_type buf[merge_sort_stack_buffer_size / sizeof(value_type)];
                merge_sort_recursive<safecopy>(buf, beg, end, compare);
            }
            else if (merge_sort_alloc_buffer)
            {
                size_t bufsize = (size_t)sqrt(end - beg + 0.1);
                value_type * buf = new value_type[bufsize];
                merge_sort_recursive_with_buffer<safecopy>(buf, bufsize, beg, end, compare);
                delete[] buf;
            }
            else
            {
                // not really in-place, uses a fixed size of buffer in stack
                value_type buf[merge_sort_stack_buffer_size / sizeof(value_type)];
                merge_sort_recursive_with_buffer<safecopy>(buf, sizeof(buf) / sizeof(value_type), beg, end, compare);
            }
        }
        else
        {
            merge_sort_recursive_with_buffer<false>((value_type*)NULL, 0, beg, end, compare);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4008, %rsp           # imm = 0x4008
movq %rsi, %rcx
subq %rdi, %rcx
movq %rcx, %rax
sarq $0x5, %rax
cmpq $0x2, %rax
jl 0x63a9
movq %rsi, %rbx
movq %rdi, %r14
testb %dl, %dl
je 0x63bb
andq $-0x40, %rcx
cmpq $0x8001, %rcx           # imm = 0x8001
ja 0x63db
xorl %r15d, %r15d
leaq (%rsp,%r15), %rdi
callq 0x39d2
addq $0x20, %r15
cmpq $0x4000, %r15           # imm = 0x4000
jne 0x6385
movq %rsp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5d62
addq $0x4008, %rsp           # imm = 0x4008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x4008, %rsp           # imm = 0x4008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6470
cvtsi2sd %rax, %xmm0
addsd 0x8c28(%rip), %xmm0     # 0xf010
sqrtsd %xmm0, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x8c1c(%rip), %xmm0     # 0xf018
cvttsd2si %xmm0, %r15
sarq $0x3f, %rcx
andq %rcx, %r15
orq %rax, %r15
movq %r15, %rax
shrq $0x3b, %rax
movq %r15, %rbp
shlq $0x5, %rbp
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %rbp, %rdi
callq 0x2030
movq %rax, %r12
testq %r15, %r15
je 0x6446
movq %r12, %r13
movq %r13, %rdi
callq 0x39d2
addq $0x20, %r13
addq $-0x20, %rbp
jne 0x6434
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x6470
movq %r12, %rdi
addq $0x4008, %rsp           # imm = 0x4008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::merge_sort_recursive_with_buffer<false, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, unsigned long, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void merge_sort_recursive_with_buffer(RandomAccessBufferIterator buf, size_t bufsize, RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    size_t len = end - beg;
    if (len < merge_insertion_sort_threshold)
    {
        insert_sort(beg, end, compare);
        return;
    }
    RandomAccessIterator mid = beg + (len >> 1);
    merge_sort_recursive_with_buffer<safecopy>(buf, bufsize, beg, mid, compare);
    merge_sort_recursive_with_buffer<safecopy>(buf, bufsize, mid, end, compare);
    merge_2_part_with_buffer<safecopy>(buf, bufsize, beg, mid, end, compare);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rcx, %r15
subq %rdx, %r15
sarq $0x5, %r15
cmpq $0x1f, %r15
ja 0x64a3
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x57c0
movq %rsi, %r12
movq %rdi, %r13
shlq $0x4, %r15
andq $-0x20, %r15
addq %r14, %r15
movq %r14, %rdx
movq %r15, %rcx
callq 0x6470
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x6470
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
movq %rbx, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x64ed
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::quick_sort_loop<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, int, std::less<baobao::TestClass>, bool)
void quick_sort_loop(RandomAccessIterator beg, RandomAccessIterator end, int deep, Comp compare, bool leftmost)
{
    if (end - beg <= qsort_insertion_sort_threshold)
    {
        if (leftmost)
        {
            q_insert_sort(beg, end, compare);
        }
        else
        {
            unguarded_q_insert_sort(beg, end, compare);
        }
        return;
    }
    if (deep <= 0)
    {
        shell_sort(beg, end, compare);
        return;
    }

    bool swaped = false;
    RandomAccessIterator l = quick_sort_partition(beg, end, compare, swaped), r = l + 1;
    if (!swaped && !compare(*(l - 1), *beg))
    {
        RandomAccessIterator i = leftmost ? insert_sort_limit(beg, l, compare, 1)
            : unguarded_insert_sort_limit(beg, l, compare, 1);
        if (i == l)
        {
            i = unguarded_insert_sort_limit(r, end, compare, 1);
        }
        if (i == end)
        {
            return;
        }
        if (i >= l)
        {
            while (r < end && util::object_equal(*r, *l, compare)) ++r;
            return quick_sort_loop(r, end, deep - 1, compare, false);
        }
    }
    while (r < end && util::object_equal(*r, *l, compare)) ++r;

    quick_sort_loop(beg, l, deep - 1, compare, leftmost);
    quick_sort_loop(r, end, deep - 1, compare, false);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rax
subq %rdi, %rax
cmpq $0x51f, %rax            # imm = 0x51F
jg 0x6f56
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
testb %cl, %cl
je 0x6f8d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3867
movl %edx, %ebp
testl %edx, %edx
jle 0x6f9c
movl %ecx, 0x4(%rsp)
leaq 0x3(%rsp), %r12
movb $0x0, (%r12)
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x70fe
movq %rax, %r13
leaq 0x20(%rax), %r15
cmpb $0x1, (%r12)
jne 0x6fb5
movl 0x4(%rsp), %r12d
jmp 0x6ffa
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7057
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5968
movl -0x20(%r13), %eax
cmpl (%r14), %eax
movl 0x4(%rsp), %r12d
jl 0x6ffa
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %r13, %rsi
testb %r12b, %r12b
je 0x6fd8
callq 0x5ba3
jmp 0x6fdd
callq 0x727a
cmpq %r13, %rax
jne 0x6ff0
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x727a
cmpq %rbx, %rax
je 0x7044
cmpq %r13, %rax
jae 0x700e
cmpq %rbx, %r15
jae 0x7022
movl (%r13), %eax
cmpl (%r15), %eax
jne 0x7022
addq $0x20, %r15
jmp 0x6ffa
cmpq %rbx, %r15
jae 0x7053
movl (%r13), %eax
cmpl (%r15), %eax
jne 0x7053
addq $0x20, %r15
jmp 0x700e
decl %ebp
movzbl %r12b, %ecx
movq %r14, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x6f1a
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x6f1a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
decl %ebp
jmp 0x7035
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: baobao::internal::indirect_sort_iter_warp<baobao::TestClass*>* baobao::internal::unguarded_insert_sort_limit<baobao::internal::indirect_sort_iter_warp<baobao::TestClass*>*, baobao::internal::indirect_sort_comp_warp<baobao::TestClass*, std::less<baobao::TestClass>>>(baobao::internal::indirect_sort_iter_warp<baobao::TestClass*>*, baobao::internal::indirect_sort_iter_warp<baobao::TestClass*>*, baobao::internal::indirect_sort_comp_warp<baobao::TestClass*, std::less<baobao::TestClass>>, int)
RandomAccessIterator unguarded_insert_sort_limit(RandomAccessIterator beg, RandomAccessIterator end, Comp compare, int limit)
{
    for (RandomAccessIterator i = beg + 1; i < end; ++i)
    {
        if (!compare(*i, *(i - 1)))
        {
            ++limit;
            continue;
        }
        typename std::iterator_traits<RandomAccessIterator>::value_type val = *i;
        RandomAccessIterator j = i - 1;
        *i = *j;
        for (; compare(val, *(j - 1)); --j)
        {
            if (--limit <= 0)
            {
                *j = val;
                return i;
            }
            *j = *(j - 1);
        }
        *j = val;
    }
    return end;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r13
leaq 0x10(%r13), %r12
cmpq %r14, %r12
jae 0x8d1b
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x8b7a
testb %al, %al
je 0x8cf2
movq 0x10(%r13), %rcx
movq 0x18(%r13), %rax
movups (%r13), %xmm0
movups %xmm0, (%r12)
leaq -0x10(%r13), %rdx
movq -0x8(%r13), %rsi
movl (%rax), %edi
movl (%rsi), %esi
cmpl %esi, %edi
jl 0x8cde
jg 0x8cf9
cmpq (%rdx), %rcx
jae 0x8cf9
cmpl $0x1, %ebx
jle 0x8d06
decl %ebx
movups (%rdx), %xmm0
movups %xmm0, (%r13)
movq %rdx, %r13
jmp 0x8cc7
incl %ebx
movq %r12, %r13
jmp 0x8c9a
movq %rcx, (%r13)
movq %rax, 0x8(%r13)
movq %r12, %r13
jmp 0x8c9a
movq %rcx, (%r13)
movq %rax, 0x8(%r13)
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r14, %r12
jmp 0x8d0e
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::tim_sort_stack_merge_13<false, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass**, baobao::TestClass**&, baobao::TestClass*, std::less<baobao::TestClass>)
void tim_sort_stack_merge_13(RandomAccessBufferIterator buf, RandomAccessIterator* run_stack, RandomAccessIterator* &stack_top, RandomAccessIterator end, Comp compare)
{
    while (stack_top - run_stack >= 2 && end - stack_top[0] > stack_top[0] - stack_top[-1])
    {
        if (stack_top - run_stack > 2 && (stack_top[0] - stack_top[-2]) * 4 / 3 >= stack_top[-1] - stack_top[-3]) // a >= c
        {
            merge_2_part<safecopy>(buf, stack_top[-3], stack_top[-2], stack_top[-1], compare);
            stack_top[-2] = stack_top[-1];
            stack_top[-1] = stack_top[0];
            --stack_top;
            while (stack_top - run_stack > 2 && (stack_top[-1] - stack_top[-2]) * 4 / 3 >= (stack_top[-2] - stack_top[-3]))
            {
                merge_2_part<safecopy>(buf, stack_top[-3], stack_top[-2], stack_top[-1], compare);
                stack_top[-2] = stack_top[-1];
                stack_top[-1] = stack_top[0];
                --stack_top;
            }
        }
        else if ((stack_top[0] - stack_top[-1]) * 4 / 3 >= (stack_top[-1] - stack_top[-2])) // 1.333 * a > b
        {
            merge_2_part<safecopy>(buf, stack_top[-2], stack_top[-1], stack_top[0], compare);
            stack_top[-1] = stack_top[0];
            --stack_top;
        }
        else
        {
            break;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rdx), %r10
pushq $0x3
popq %r13
movq %r10, %rax
subq %r15, %rax
cmpq $0x9, %rax
jl 0x782a
movq -0x8(%r10), %r8
movq (%r10), %rcx
movq %rbx, %rdx
subq %rcx, %rdx
movq %rcx, %rdi
subq %r8, %rdi
cmpq %rdi, %rdx
jle 0x782a
movq -0x10(%r10), %r9
cmpq $0x10, %rax
je 0x7771
movq %rcx, %rax
subq %r9, %rax
sarq $0x3, %rax
cqto
idivq %r13
movq -0x18(%r10), %rsi
movq %r8, %rdx
subq %rsi, %rdx
sarq $0x5, %rdx
cmpq %rdx, %rax
jge 0x77b7
sarq $0x3, %rdi
movq %rdi, %rax
cqto
idivq %r13
movq %r8, %rdx
subq %r9, %rdx
sarq $0x5, %rdx
cmpq %rdx, %rax
jl 0x782a
movq %r12, %rdi
movq %r9, %rsi
movq %r8, %rdx
callq 0x5dd9
movq (%r14), %rax
movq (%rax), %rcx
movq %rcx, -0x8(%rax)
movq (%r14), %r10
addq $-0x8, %r10
movq %r10, (%r14)
jmp 0x7719
movq %r12, %rdi
movq %r9, %rdx
movq %r8, %rcx
callq 0x5dd9
movq (%r14), %rax
movq -0x8(%rax), %rcx
movq %rcx, -0x10(%rax)
movq (%r14), %rax
movq (%rax), %rcx
movq %rcx, -0x8(%rax)
movq (%r14), %rax
leaq -0x8(%rax), %r10
movq %r10, (%r14)
movq %r10, %rcx
subq %r15, %rcx
cmpq $0x11, %rcx
jl 0x7719
movq -0x10(%rax), %rcx
movq -0x20(%rax), %rsi
movq -0x18(%rax), %r8
movq %rcx, %rax
subq %r8, %rax
sarq $0x3, %rax
cqto
idivq %r13
movq %r8, %rdx
subq %rsi, %rdx
sarq $0x5, %rdx
cmpq %rdx, %rax
jl 0x7719
movq %r12, %rdi
movq %r8, %rdx
jmp 0x77c0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::tim_sort_force_stack_merge<false, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass**, baobao::TestClass**, std::less<baobao::TestClass>)
void tim_sort_force_stack_merge(RandomAccessBufferIterator buf, RandomAccessIterator* beg, RandomAccessIterator* end, Comp compare)
{
    while (end - beg > 1)
    {
        if (end - beg > 2)
        {
            if (end[0] - end[-1] <= end[-2] - end[-3])
            {
                merge_2_part<safecopy>(buf, end[-2], end[-1], end[0], compare);
                end[-1] = end[0];
                --end;
            }
            else
            {
                merge_2_part<safecopy>(buf, end[-3], end[-2], end[-1], compare);
                end[-2] = end[-1];
                end[-1] = end[0];
                --end;
            }
        }
        else
        {
            merge_2_part<safecopy>(buf, end[-2], end[-1], end[0], compare);
            end[-1] = end[0];
            --end;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %r14, %rax
subq %rbx, %rax
cmpq $0x9, %rax
jl 0x78be
cmpq $0x10, %rax
jne 0x786b
leaq -0x8(%r14), %r12
movq -0x10(%r14), %rsi
movq -0x8(%r14), %rdx
movq (%r14), %rcx
movq %r15, %rdi
jmp 0x78ad
movq (%r14), %rax
leaq -0x8(%r14), %r12
movq -0x8(%r14), %rcx
movq %rax, %rdi
subq %rcx, %rdi
movq -0x18(%r14), %rsi
movq -0x10(%r14), %rdx
movq %rdx, %r8
subq %rsi, %r8
cmpq %r8, %rdi
jle 0x78a1
movq %r15, %rdi
callq 0x5dd9
movq -0x8(%r14), %rax
movq %rax, -0x10(%r14)
jmp 0x78b2
movq %r15, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movq %rax, %rcx
callq 0x5dd9
movq (%r14), %rax
movq %rax, -0x8(%r14)
movq %r12, %r14
jmp 0x7845
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::tim_sort_force_stack_merge_with_buffer<false, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, unsigned long, baobao::TestClass**, baobao::TestClass**, std::less<baobao::TestClass>)
void tim_sort_force_stack_merge_with_buffer(RandomAccessBufferIterator buf, size_t bufsize, RandomAccessIterator* beg, RandomAccessIterator* end, Comp compare)
{
    while (end - beg > 1)
    {
        if (end - beg > 2)
        {
            if (end[0] - end[-1] <= end[-2] - end[-3])
            {
                merge_2_part_with_buffer<safecopy>(buf, bufsize, end[-2], end[-1], end[0], compare);
                end[-1] = end[0];
                --end;
            }
            else
            {
                merge_2_part_with_buffer<safecopy>(buf, bufsize, end[-3], end[-2], end[-1], compare);
                end[-2] = end[-1];
                end[-1] = end[0];
                --end;
            }
        }
        else
        {
            merge_2_part_with_buffer<safecopy>(buf, bufsize, end[-2], end[-1], end[0], compare);
            end[-1] = end[0];
            --end;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq %r14, %rax
subq %rbx, %rax
cmpq $0x9, %rax
jl 0x7aaa
cmpq $0x10, %rax
jne 0x7a4e
leaq -0x8(%r14), %r13
movq -0x10(%r14), %rdx
movq -0x8(%r14), %rcx
movq (%r14), %r8
movq %r12, %rdi
movq %r15, %rsi
jmp 0x7a96
movq (%r14), %r8
leaq -0x8(%r14), %r13
movq -0x8(%r14), %rax
movq %r8, %rsi
subq %rax, %rsi
movq -0x18(%r14), %rdx
movq -0x10(%r14), %rcx
movq %rcx, %rdi
subq %rdx, %rdi
cmpq %rdi, %rsi
jle 0x7a8a
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %r8
callq 0x64ed
movq -0x8(%r14), %rax
movq %rax, -0x10(%r14)
jmp 0x7a9b
movq %r12, %rdi
movq %r15, %rsi
movq %rcx, %rdx
movq %rax, %rcx
callq 0x64ed
movq (%r14), %rax
movq %rax, -0x8(%r14)
movq %r13, %r14
jmp 0x7a25
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::insert_sort_part_rev<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
inline void insert_sort_part_rev(RandomAccessIterator beg, RandomAccessIterator mid, RandomAccessIterator end, Comp compare)
{
    for (RandomAccessIterator i = mid; i < end; ++i)
    {
        if (!compare(*i, *(i - 1)))
        {
            typename std::iterator_traits<RandomAccessIterator>::value_type val = *i;
            RandomAccessIterator j = i - 1;
            *i = *j;
            for (;j != beg && !compare(val, *(j - 1)); --j)
            {
                *j = *(j - 1);
            }
            *j = val;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x40(%rsi), %rbp
leaq 0x8(%rsp), %r12
cmpq %rbx, %r14
jae 0x7b32
movl (%r14), %eax
cmpl -0x20(%r14), %eax
jl 0x7b28
leaq -0x20(%r14), %r13
movq %r12, %rdi
movq %r14, %rsi
callq 0x4144
movq %r14, %rdi
movq %r13, %rsi
callq 0x4164
movq %rbp, %r13
leaq 0x20(%r13), %rdi
cmpq %r15, %rdi
je 0x7b20
movl 0x8(%rsp), %eax
cmpl (%r13), %eax
jl 0x7b20
movq %r13, %rsi
callq 0x4164
addq $-0x20, %r13
jmp 0x7aff
movq %r12, %rsi
callq 0x4164
addq $0x20, %r14
addq $0x20, %rbp
jmp 0x7ad4
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::indirect_qsort<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void indirect_qsort(RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    if (end - beg > 1)
    {
        size_t size = (size_t)(end - beg);
        indirect_sort_iter_warp<RandomAccessIterator>* ptr = new indirect_sort_iter_warp<RandomAccessIterator>[size], *ptr_beg = ptr, *ptr_end = ptr + size;
        for (size_t i = 0; i < size; ++i)
        {
            ptr[i].it = beg + i;
            ptr[i].index = i;
        }
        internal::quick_sort(ptr_beg, ptr_end, indirect_sort_comp_warp<RandomAccessIterator, Comp>(compare));
        for (size_t i = 0; i < size; ++i)
        {
            ptr[i].index = ptr[i].it - beg;
        }

        for (size_t index = 0; index < size; ++index)
        {
            if (ptr[index].index)
            {
                size_t i = index;
                typename std::iterator_traits<RandomAccessIterator>::value_type v = *ptr[i].it;
                for (; ptr[i].index > index;)
                {
                    size_t j = ptr[i].index;
                    *ptr[i].it = *ptr[j].it;
                    ptr[i].index = 0;
                    i = j;
                }
                *ptr[i].it = v;
                ptr[i].index = 0;
            }
        }
        delete[] ptr;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
subq %rdi, %rsi
movq %rsi, %r15
sarq $0x5, %r15
cmpq $0x2, %r15
jl 0x839b
movq %rdi, %r14
shrq %rsi
movq %rsi, %rdi
callq 0x2030
movq %rax, %rbx
addq $0x8, %rax
xorl %ecx, %ecx
movq %r14, %rdx
cmpq %rcx, %r15
je 0x82eb
movq %rdx, (%rax)
movq %rcx, -0x8(%rax)
incq %rcx
addq $0x20, %rdx
addq $0x10, %rax
jmp 0x82d2
movq %r15, %rsi
shlq $0x4, %rsi
addq %rbx, %rsi
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
callq 0x83aa
leaq 0x8(%rbx), %rax
movq %r15, %rcx
subq $0x1, %rcx
jb 0x8323
movq (%rax), %rdx
subq %r14, %rdx
sarq $0x5, %rdx
movq %rdx, -0x8(%rax)
addq $0x10, %rax
jmp 0x8309
xorl %r12d, %r12d
leaq 0x8(%rsp), %r14
cmpq %r15, %r12
je 0x8393
movq %r12, %rax
shlq $0x4, %rax
cmpq $0x0, (%rbx,%rax)
je 0x838e
addq %rbx, %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq 0x4144
movq %r12, %r13
shlq $0x4, %r13
leaq (%rbx,%r13), %rbp
movq (%rbx,%r13), %r13
cmpq %r12, %r13
jbe 0x837d
movq %r13, %rax
shlq $0x4, %rax
movq 0x8(%rbx,%rax), %rsi
movq 0x8(%rbp), %rdi
callq 0x4164
andq $0x0, (%rbp)
jmp 0x8350
movq 0x8(%rbp), %rdi
movq %r14, %rsi
callq 0x4164
andq $0x0, (%rbp)
incq %r12
jmp 0x832b
movq %rbx, %rdi
callq 0x21d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: baobao::internal::indirect_sort_comp_warp<baobao::TestClass*, std::less<baobao::TestClass>>::operator()(baobao::internal::indirect_sort_iter_warp<baobao::TestClass*> const&, baobao::internal::indirect_sort_iter_warp<baobao::TestClass*> const&) const
bool operator ()(const indirect_sort_iter_warp<RandomAccessIterator>& a, const indirect_sort_iter_warp<RandomAccessIterator>& b) const
    {
        if (compare(*a.it, *b.it))
        {
            return true;
        }
        else if (compare(*b.it, *a.it))
        {
            return false;
        }
        else
        {
            return a.index < b.index;
        }
    }

// Assembly:
movq 0x8(%rsi), %rax
movq 0x8(%rdx), %rcx
movl (%rax), %edi
movl (%rcx), %ecx
movb $0x1, %al
cmpl %ecx, %edi
jl 0x8b90
jle 0x8b91
xorl %eax, %eax
retq
movq (%rsi), %rax
cmpq (%rdx), %rax
setb %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::util::make_mid_pivot<baobao::internal::indirect_sort_iter_warp<baobao::TestClass*>, baobao::internal::indirect_sort_comp_warp<baobao::TestClass*, std::less<baobao::TestClass>>>(baobao::internal::indirect_sort_iter_warp<baobao::TestClass*>&, baobao::internal::indirect_sort_iter_warp<baobao::TestClass*>&, baobao::internal::indirect_sort_iter_warp<baobao::TestClass*>&, baobao::internal::indirect_sort_comp_warp<baobao::TestClass*, std::less<baobao::TestClass>>)
inline void make_mid_pivot(T& l, T& mid, T& r, Comp compare)
{
    // one swap version
    //if (compare(l, mid))
    //{
    //    if (compare(r, mid))
    //    {
    //        if (compare(l, r))
    //        {
    //            std::swap(r, mid);
    //        }
    //        else
    //        {
    //            std::swap(l, mid);
    //        }
    //    }
    //}
    //else if (compare(mid, l))
    //{
    //    if (compare(mid, r))
    //    {
    //        if (compare(l, r))
    //        {
    //            std::swap(l, mid);
    //        }
    //        else
    //        {
    //            std::swap(r, mid);
    //        }
    //    }
    //}

    // insert sort version
    if (compare(r, mid))
    {
        if (compare(mid, l))
        {
            std::swap(l, r); // optional
            return;
        }
        std::swap(mid, r);
    }
    if (compare(mid, l))
    {
        std::swap(mid, l);
        if (compare(r, mid))
            std::swap(mid, r);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq %rcx, %rdi
movq %rdx, %rsi
movq %r14, %rdx
callq 0x8b7a
testb %al, %al
je 0x8ee8
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x8b7a
testb %al, %al
je 0x8ed2
movups (%r12), %xmm0
movaps %xmm0, (%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%r12)
jmp 0x8f35
movups (%r14), %xmm0
movaps %xmm0, (%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%r14)
movaps (%rsp), %xmm0
movups %xmm0, (%rbx)
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x8b7a
testb %al, %al
je 0x8f3c
movups (%r14), %xmm0
movaps %xmm0, (%rsp)
movups (%r12), %xmm0
movups %xmm0, (%r14)
movaps (%rsp), %xmm0
movups %xmm0, (%r12)
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x8b7a
testb %al, %al
je 0x8f3c
movups (%r14), %xmm0
movaps %xmm0, (%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%r14)
movaps (%rsp), %xmm0
movups %xmm0, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./sortlib.hpp
// Function: void baobao::internal::radix_sort_msd_in_place<baobao::TestClass*, baobao::internal::radix_get_index<baobao::TestClass, unsigned int>, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::internal::radix_get_index<baobao::TestClass, unsigned int>, std::less<baobao::TestClass>)
void radix_sort_msd_in_place(RandomAccessIterator beg, RandomAccessIterator end, RadixIndexFunc get_index, Comp compare)
{
    uint32_t max_offset = 0;
    for (RandomAccessIterator i = beg; i < end; ++i)
    {
        uint32_t offset = radix_get_max_offset(get_index(*i));
        if (max_offset < offset)
            max_offset = offset;
    }
    radix_sort_msd_in_place(beg, end, get_index, max_offset, compare);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
movl $0x80000000, %r15d      # imm = 0x80000000
movq %rdi, %r12
cmpq %rbx, %r12
jae 0x8f7d
movl (%r12), %edi
xorl %r15d, %edi
callq 0x8f92
cmpl %eax, %ebp
cmovbel %eax, %ebp
addq $0x20, %r12
jmp 0x8f61
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8fa5
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./grailsort.hpp
// Function: baobao::TestClass* Mrrl::grail_FindKeys<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
RandomAccessIterator grail_FindKeys(RandomAccessIterator beg, RandomAccessIterator end, RandomAccessIterator nkeys, Comp compare)
{
    RandomAccessIterator h0 = beg, u = beg + 1; // first key is always here
    int h = 1;
    while (u < end && h < nkeys - beg)
    {
        int r = (int)(grail_BinSearchLeft(h0, h0 + h, u, compare) - h0);
        if (r == h || grail_not_eq(*u, *(h0 + r), compare)) {
            grail_rotate(h0, h0 + h, u);
            h0 = u - h;
            grail_rotate(h0 + r, u, u + 1);
            ++h;
        }
        ++u;
    }
    grail_rotate(beg, h0, h0 + h);
    return beg + h;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x20(%rsp)
movq %rdi, %r13
subq %rdi, %rdx
sarq $0x5, %rdx
movq %rdx, 0x18(%rsp)
pushq $0x1
popq %r14
movq $0x0, (%rsp)
movq %rdi, %r12
movq %rdi, 0x8(%rsp)
movl %r14d, %r14d
movq %r14, %rax
shlq $0x5, %rax
movq %rax, 0x10(%rsp)
leaq (%rax,%r13), %rbx
movq %r12, %rbp
addq $0x20, %r12
cmpq 0x20(%rsp), %r12
jae 0x9551
cmpq %r14, 0x18(%rsp)
jle 0x9551
movq %r13, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x9fbf
subq %r13, %rax
shrq $0x5, %rax
movslq %eax, %r15
cmpl %eax, %r14d
je 0x950b
movq %r15, %rax
shlq $0x5, %rax
movl (%r13,%rax), %eax
cmpl (%r12), %eax
je 0x94c7
leaq 0x20(%rbp), %r12
movq %r13, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x9ff3
movq (%rsp), %rbx
leaq (%rbx,%rbp), %r13
shlq $0x5, %r15
addq %rbp, %r15
addq %rbx, %r15
addq $0x40, %rbp
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x9ff3
incl %r14d
addq $-0x20, %rbx
movq %rbx, (%rsp)
jmp 0x94b4
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x9ff3
movq 0x10(%rsp), %rax
addq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./grailsort.hpp
// Function: void Mrrl::grail_LazyStableSort<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void grail_LazyStableSort(RandomAccessIterator beg, RandomAccessIterator end, Comp compare) {
    int L = (int)(end - beg);
    for (RandomAccessIterator m = beg + 1; m < end; m += 2) {
        if (compare(*m, *(m - 1))) grail_swap1(m - 1, m);
    }
    for (int h = 2; h < L; h *= 2) {
        RandomAccessIterator p0 = beg;
        while (end - p0 >= 2 * h) {
            grail_MergeWithoutBuffer(p0, p0 + h, p0 + h + h, compare);
            p0 += 2 * h;
        }
        if (end - p0 > h) grail_MergeWithoutBuffer(p0, p0 + h, end, compare);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rsi, %rax
subq %rdi, %rax
movq %rax, 0x18(%rsp)
shrq $0x5, %rax
movq %rax, 0x28(%rsp)
movq %rdi, 0x20(%rsp)
leaq 0x20(%rdi), %r15
cmpq %rbx, %r15
jae 0x95c9
movl (%r15), %eax
cmpl -0x20(%r15), %eax
jge 0x95c3
leaq -0x20(%r15), %rdi
movq %r15, %rsi
callq 0xa092
addq $0x40, %r15
jmp 0x95a9
movq %rbx, 0x10(%rsp)
pushq $0x2
popq %rax
cmpl 0x28(%rsp), %eax
jge 0x964d
leal (%rax,%rax), %ecx
movl %ecx, 0xc(%rsp)
movslq %ecx, %rbx
movslq %eax, %r13
movq %rbx, %rbp
shlq $0x5, %rbp
movq %r13, %r15
shlq $0x5, %r15
movq %r13, 0x30(%rsp)
shlq $0x6, %r13
movq 0x18(%rsp), %r14
movq 0x20(%rsp), %r12
movq %r14, %rcx
sarq $0x5, %rcx
cmpq %rbx, %rcx
jl 0x9629
leaq (%r12,%r15), %rsi
leaq (%r12,%r13), %rdx
movq %r12, %rdi
callq 0x9ee4
addq %rbp, %r12
subq %rbp, %r14
jmp 0x9605
movl 0xc(%rsp), %ebx
movl %ebx, %eax
cmpq 0x30(%rsp), %rcx
jle 0x95d1
addq %r12, %r15
movq %r12, %rdi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
callq 0x9ee4
movl %ebx, %eax
jmp 0x95d1
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./grailsort.hpp
// Function: void Mrrl::grail_MergeWithoutBuffer<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void grail_MergeWithoutBuffer(RandomAccessIterator beg, RandomAccessIterator mid, RandomAccessIterator end, Comp compare) {
    if (mid - beg < end - mid) {
        while (mid - beg) {
            RandomAccessIterator p = grail_BinSearchLeft(mid, end, beg, compare);
            if (p != mid) {
                grail_rotate(beg, mid, p);
                beg += p - mid;
                mid = p;
            }
            if (mid == end) break;
            do {
                ++beg;
            } while ((mid - beg) && grail_lesseq(*beg, *mid, compare));
        }
    }
    else {
        while (end - mid) {
            RandomAccessIterator p = grail_BinSearchRight(beg, mid, end - 1, compare);
            if (p != mid) {
                grail_rotate(p, mid, end);
                end -= mid - p;
                mid = p;
            }
            if (beg == mid) break;
            do {
                --end;
            } while ((end - mid) && grail_lesseq(*(mid - 1), *(end - 1), compare));
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rax
subq %rdi, %rax
movq %rdx, %rcx
subq %rsi, %rcx
cmpq %rcx, %rax
jge 0x9f5f
cmpq %r14, %r15
je 0x9fb5
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x9fbf
movq %rax, %r13
subq %r15, %r13
je 0x9f3d
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x9ff3
addq %r13, %r14
movq %r12, %r15
cmpq %rbx, %r15
je 0x9fb5
addq $0x20, %r14
movq %r14, %rax
movq %rax, %r14
cmpq %r15, %rax
je 0x9f07
movl (%r15), %ecx
leaq 0x20(%r14), %rax
cmpl (%r14), %ecx
jge 0x9f49
jmp 0x9f07
cmpq %r15, %rbx
je 0x9fb5
leaq -0x20(%rbx), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0xa9a1
movq %rax, %r13
subq %r15, %r13
je 0x9f92
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x9ff3
addq %r13, %rbx
movq %r12, %r15
cmpq %r14, %r15
je 0x9fb5
addq $-0x20, %rbx
movq %rbx, %rax
movq %rax, %rbx
cmpq %r15, %rax
je 0x9f5f
leaq -0x20(%rbx), %rax
movl -0x20(%rbx), %ecx
cmpl -0x20(%r15), %ecx
jge 0x9f9e
jmp 0x9f5f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./grailsort.hpp
// Function: baobao::TestClass* Mrrl::grail_BinSearchLeft<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
RandomAccessIterator grail_BinSearchLeft(RandomAccessIterator beg, RandomAccessIterator end, RandomAccessIterator key, Comp compare)
{
    RandomAccessIterator a = beg - 1, b = end, c;
    while (a < b - 1)
    {
        c = a + ((b - a) >> 1);
        if (compare(*c, *key)) a = c;
        else b = c;
    }
    return b;
}

// Assembly:
movq %rsi, %rax
addq $-0x20, %rdi
leaq -0x20(%rax), %rcx
cmpq %rcx, %rdi
jae 0x9ff2
movq %rax, %rsi
subq %rdi, %rsi
sarq $0x6, %rsi
shlq $0x5, %rsi
leaq (%rdi,%rsi), %rcx
movl (%rdi,%rsi), %esi
cmpl (%rdx), %esi
jl 0x9fed
movq %rcx, %rax
jmp 0x9fc6
movq %rcx, %rdi
jmp 0x9fc6
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./grailsort.hpp
// Function: void Mrrl::grail_rotate<baobao::TestClass*>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass*)
void grail_rotate(RandomAccessIterator beg, RandomAccessIterator mid, RandomAccessIterator end)
{
    while (true)
    {
        if (mid - beg <= end - mid)
        {
            if (mid - beg > 0)
            {
                swap_2_part_with_same_length(beg, mid);
                RandomAccessIterator m = mid;
                mid += mid - beg;
                beg = m;
            }
            else
                break;
        }
        else
        {
            if (end - mid > 0)
            {
                swap_2_part_with_same_length(mid - (end - mid), mid);
                RandomAccessIterator m = mid;
                mid -= end - mid;
                end = m;
            }
            else
                break;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq %rbx, %r12
subq %r14, %rbx
sarq $0x5, %rbx
movq %r15, %rax
subq %r12, %rax
sarq $0x5, %rax
cmpq %rax, %rbx
jg 0xa039
testq %rbx, %rbx
jle 0xa058
movq %r14, %rdi
movq %r12, %rsi
callq 0xa064
shlq $0x5, %rbx
addq %r12, %rbx
movq %r12, %r14
jmp 0xa004
testq %rax, %rax
jle 0xa058
shlq $0x5, %rax
movq %r12, %rbx
subq %rax, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xa064
movq %r12, %r15
jmp 0xa004
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./grailsort.hpp
// Function: void Mrrl::grail_MergeLeftWithXBuf<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void grail_MergeLeftWithXBuf(RandomAccessIterator beg, RandomAccessIterator mid, RandomAccessIterator end, RandomAccessIterator M, Comp compare) {
    RandomAccessIterator p0 = beg, p1 = mid;
    while (p1 < end) {
        if (p0 == mid || compare(*p1, *p0)) *M++ = *p1++;
        else *M++ = *p0++;
    }
    if (M != p0) while (p0 < mid) *M++ = *p0++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %r13
cmpq %r12, %r13
jae 0xa118
cmpq %rbx, %r15
je 0xa0fa
movl (%r13), %eax
cmpl (%r15), %eax
jge 0xa103
movq %r13, %rsi
addq $0x20, %r13
jmp 0xa10a
movq %r15, %rsi
addq $0x20, %r15
movq %r14, %rdi
callq 0x4164
addq $0x20, %r14
jmp 0xa0e7
cmpq %r15, %r14
je 0xa13d
cmpq %rbx, %r15
jae 0xa13d
leaq 0x20(%r15), %r12
leaq 0x20(%r14), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x4164
movq %r13, %r14
movq %r12, %r15
jmp 0xa11d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./grailsort.hpp
// Function: void Mrrl::grail_MergeLeft<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void grail_MergeLeft(RandomAccessIterator beg, RandomAccessIterator mid, RandomAccessIterator end, RandomAccessIterator M, Comp compare) {
    RandomAccessIterator p0 = beg, p1 = mid;
    while (p1 < end) {
        if (p0 == mid || compare(*p1, *p0)) {
            grail_swap1(M++, p1++);
        } else {
            grail_swap1(M++, p0++);
        }
    }
    if (M != p0) grail_swapN(M, p0, mid - p0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %r13
cmpq %r12, %r13
jae 0xa190
cmpq %rbx, %r15
je 0xa172
movl (%r13), %eax
cmpl (%r15), %eax
jge 0xa17b
movq %r13, %rsi
addq $0x20, %r13
jmp 0xa182
movq %r15, %rsi
addq $0x20, %r15
movq %r14, %rdi
callq 0xa092
addq $0x20, %r14
jmp 0xa15f
cmpq %r15, %r14
je 0xa1b3
subq %r15, %rbx
sarq $0x5, %rbx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xa23a
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./grailsort.hpp
// Function: void Mrrl::grail_MergeRight<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void grail_MergeRight(RandomAccessIterator beg, RandomAccessIterator mid, RandomAccessIterator end, RandomAccessIterator M, Comp compare) {
    RandomAccessIterator p0 = M - 1, p2 = end - 1, p1 = mid - 1;
    while (p1 >= beg) {
        if (p2 < mid || compare(*p2, *p1)) {
            grail_swap1(p0--, p1--);
        } else {
            grail_swap1(p0--, p2--);
        }
    }
    if (p2 != p0) while (p2 >= mid) grail_swap1(p0--, p2--);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
addq $-0x20, %r15
leaq -0x20(%rsi), %r13
addq $-0x20, %r14
cmpq %r12, %r13
jb 0xa20b
cmpq %rbx, %r15
jb 0xa1f1
movl (%r15), %eax
cmpl (%r13), %eax
jge 0xa1fa
movq %r13, %rsi
addq $-0x20, %r13
jmp 0xa201
movq %r15, %rsi
addq $-0x20, %r15
movq %r14, %rdi
callq 0xa092
jmp 0xa1da
cmpq %r15, %r14
je 0xa230
cmpq %rbx, %r15
jb 0xa230
leaq -0x20(%r14), %r12
leaq -0x20(%r15), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0xa092
movq %r12, %r14
movq %r13, %r15
jmp 0xa210
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Baobaobear[P]sort/./grailsort.hpp
// Function: void Mrrl::grail_SmartMergeWithXBuf<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, int*, int*, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void grail_SmartMergeWithXBuf(RandomAccessIterator beg, int *alen1, int *atype, RandomAccessIterator end, RandomAccessIterator lkeys, Comp compare) {
    RandomAccessIterator p0 = lkeys, p1 = beg, p2 = beg + *alen1, q1 = p2, q2 = end;
    int ftype = !*atype;  // 1 if inverted
    while (p1 < q1 && p2 < q2) {
        if (grail_cmp(*p1, *p2, compare) - ftype < 0)
            *p0++ = *p1++;
        else *p0++ = *p2++;
    }
    if (p1 < q1) {
        *alen1 = (int)(q1 - p1);
        while (p1 < q1) *--q2 = *--q1;
    }
    else {
        *alen1 = (int)(q2 - p2);
        *atype = ftype;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbp
movq %rcx, %rbx
movq %rdi, %r14
movq %rsi, 0x8(%rsp)
movslq (%rsi), %r13
shlq $0x5, %r13
addq %rdi, %r13
movq %rdx, 0x10(%rsp)
movl (%rdx), %r12d
movq %r13, %r15
cmpq %r13, %r14
jae 0xa750
cmpq %rbx, %r15
jae 0xa750
testl %r12d, %r12d
sete %cl
movl (%r14), %eax
movl (%r15), %edx
cmpl %edx, %eax
setl %dl
setle %al
andb %cl, %al
orb %dl, %al
movq %r14, %rsi
jne 0xa72c
movq %r15, %rsi
movzbl %al, %eax
movl %eax, %ecx
shll $0x5, %ecx
addq %rcx, %r14
xorb $0x1, %al
movzbl %al, %eax
shll $0x5, %eax
addq %rax, %r15
movq %rbp, %rdi
callq 0x4164
addq $0x20, %rbp
jmp 0xa702
cmpq %r13, %r14
jae 0xa780
movq %r13, %rax
subq %r14, %rax
shrq $0x5, %rax
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
addq $-0x20, %rbx
cmpq %r13, %r14
jae 0xa79d
addq $-0x20, %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4164
jmp 0xa766
xorl %eax, %eax
testl %r12d, %r12d
sete %al
subq %r15, %rbx
shrq $0x5, %rbx
movq 0x8(%rsp), %rcx
movl %ebx, (%rcx)
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq