LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./sortlib.hpp
// Function: baobao::TestClass* baobao::internal::unguarded_insert_sort_limit<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, 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:
leaq 0x20(%rdi), %rcx
cmpq %rsi, %rcx
jae 0x9242
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl (%rcx), %r8d
movl (%rdi), %r10d
cmpl %r10d, %r8d
jge 0x91fa
movl %r8d, -0x20(%rsp)
movl 0x24(%rdi), %r9d
movl %r9d, -0x1c(%rsp)
movl $0x2, %r11d
movl 0x20(%rdi,%r11,4), %ebx
movl %ebx, -0x20(%rsp,%r11,4)
incq %r11
cmpq $0x8, %r11
jne 0x912f
movl %r10d, (%rcx)
movl 0x4(%rdi), %r10d
movl %r10d, 0x24(%rdi)
movl $0x2, %r10d
movl (%rdi,%r10,4), %r11d
movl %r11d, 0x20(%rdi,%r10,4)
incq %r10
cmpq $0x8, %r10
jne 0x9153
movl -0x20(%rdi), %ebp
cmpl %ebp, %r8d
setl %r10b
jge 0x91fe
testl %edx, %edx
movl $0x1, %ebx
cmovlel %edx, %ebx
movq %rdi, %r11
cmpl $0x2, %edx
jl 0x91d4
leaq -0x20(%rdi), %r12
movq %rdi, %r14
movq %r12, %r11
movl %edx, %r15d
leal -0x1(%r15), %edx
movl %ebp, (%r14)
movl -0x1c(%r14), %r10d
movl %r10d, 0x4(%r14)
movq $-0x18, %r10
movl (%r14,%r10), %ebp
movl %ebp, 0x20(%r14,%r10)
addq $0x4, %r10
jne 0x91aa
movl -0x20(%r11), %ebp
cmpl %ebp, %r8d
setl %r10b
jge 0x9201
leaq -0x20(%r11), %r12
addq $-0x20, %r14
cmpl $0x2, %r15d
jg 0x918e
decl %ebx
movl %r8d, (%r11)
movl %r9d, 0x4(%r11)
movl $0x2, %eax
movl -0x20(%rsp,%rax,4), %edx
movl %edx, (%r11,%rax,4)
incq %rax
cmpq $0x8, %rax
jne 0x91e2
movq %rcx, %rax
movl %ebx, %edx
jmp 0x9220
incl %edx
jmp 0x9225
movq %rdi, %r11
movl %r8d, (%r11)
movl %r9d, 0x4(%r11)
movl $0x2, %r8d
movl -0x20(%rsp,%r8,4), %r9d
movl %r9d, (%r11,%r8,4)
incq %r8
cmpq $0x8, %r8
jne 0x920e
testb %r10b, %r10b
jne 0x9239
addq $0x20, %rcx
addq $0x20, %rdi
cmpq %rsi, %rcx
jb 0x910c
movq %rsi, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
movq %rdx, %rax
subq %rsi, %rax
cmpq $0x9, %rax
jl 0x9d0f
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x10, %rax
jne 0x9ca7
leaq -0x8(%r15), %r12
movq -0x10(%r15), %rsi
movq -0x8(%r15), %rdx
movq (%r15), %rcx
movq %r14, %rdi
jmp 0x9ce9
movq (%r15), %rax
leaq -0x8(%r15), %r12
movq -0x8(%r15), %rcx
movq %rax, %rdi
subq %rcx, %rdi
movq -0x18(%r15), %rsi
movq -0x10(%r15), %rdx
movq %rdx, %r8
subq %rsi, %r8
cmpq %r8, %rdi
jle 0x9cdd
movq %r14, %rdi
callq 0x6e52
movq -0x8(%r15), %rax
movq %rax, -0x10(%r15)
jmp 0x9cee
movq %r14, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movq %rax, %rcx
callq 0x6e52
movq (%r15), %rax
movq %rax, -0x8(%r15)
movq %r12, %rax
subq %rbx, %rax
movq %r12, %r15
cmpq $0x8, %rax
jg 0x9c8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
movq %rcx, %rax
subq %rdx, %rax
cmpq $0x9, %rax
jl 0x9f6e
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq $0x10, %rax
jne 0x9ef5
leaq -0x8(%r12), %r13
movq -0x10(%r12), %rdx
movq -0x8(%r12), %rcx
movq (%r12), %r8
movq %r15, %rdi
movq %r14, %rsi
jmp 0x9f44
movq (%r12), %r8
leaq -0x8(%r12), %r13
movq -0x8(%r12), %rax
movq %r8, %rsi
subq %rax, %rsi
movq -0x18(%r12), %rdx
movq -0x10(%r12), %rcx
movq %rcx, %rdi
subq %rdx, %rdi
cmpq %rdi, %rsi
jle 0x9f38
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %r8
callq 0x7784
movq -0x8(%r12), %rax
movq %rax, -0x10(%r12)
jmp 0x9f49
movq %r15, %rdi
movq %r14, %rsi
movq %rcx, %rdx
movq %rax, %rcx
callq 0x7784
movq (%r12), %rax
movq %rax, -0x8(%r12)
movq %r13, %rax
subq %rbx, %rax
movq %r13, %r12
cmpq $0x8, %rax
jg 0x9ed4
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
subq %rdi, %rsi
movq %rsi, %r15
sarq $0x5, %r15
cmpq $0x2, %r15
jl 0xa770
movq %rdi, %r14
sarq %rsi
movq %rsi, %rdi
callq 0x2030
movq %rax, %rbx
addq $0x8, %rax
xorl %ecx, %ecx
movq %r14, %rdx
movq %rdx, (%rax)
movq %rcx, -0x8(%rax)
incq %rcx
addq $0x10, %rax
addq $0x20, %rdx
cmpq %rcx, %r15
jne 0xa670
movq %r15, %rsi
shlq $0x4, %rsi
addq %rbx, %rsi
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0xa77a
leaq 0x8(%rbx), %rax
movq %r15, %rcx
movq (%rax), %rdx
subq %r14, %rdx
sarq $0x5, %rdx
movq %rdx, -0x8(%rax)
addq $0x10, %rax
decq %rcx
jne 0xa6a5
xorl %eax, %eax
movq %rax, %rdi
shlq $0x4, %rdi
cmpq $0x0, (%rbx,%rdi)
je 0xa75c
leaq (%rbx,%rdi), %rcx
movq 0x8(%rcx), %r8
movl (%r8), %edx
movl 0x4(%r8), %esi
movq 0x18(%r8), %r9
movq %r9, 0x20(%rsp)
movups 0x8(%r8), %xmm0
movaps %xmm0, 0x10(%rsp)
movq (%rbx,%rdi), %rdi
cmpq %rax, %rdi
jbe 0xa73a
shlq $0x4, %rdi
movq 0x8(%rbx,%rdi), %r8
movq 0x8(%rcx), %r9
movl (%r8), %r10d
movl %r10d, (%r9)
movl 0x4(%r8), %r10d
movl %r10d, 0x4(%r9)
movl $0x2, %r10d
movl (%r8,%r10,4), %r11d
movl %r11d, (%r9,%r10,4)
incq %r10
cmpq $0x8, %r10
jne 0xa71c
movq $0x0, (%rcx)
leaq (%rbx,%rdi), %rcx
jmp 0xa6f2
movq 0x8(%rcx), %rdi
movl %edx, (%rdi)
movl %esi, 0x4(%rdi)
movaps 0x10(%rsp), %xmm0
movups %xmm0, 0x8(%rdi)
movq 0x20(%rsp), %rdx
movq %rdx, 0x18(%rdi)
movq $0x0, (%rcx)
incq %rax
cmpq %r15, %rax
jne 0xa6be
movq %rbx, %rdi
callq 0x21d0
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
xorl %edx, %edx
cmpq %rsi, %rdi
jae 0xb709
xorl %r8d, %r8d
movl $0x80000000, %eax       # imm = 0x80000000
movq %rdi, %rcx
movl (%rcx), %r9d
xorl %eax, %r9d
movl $0x0, %edx
cmpl $0x100, %r9d            # imm = 0x100
jb 0xb6f1
xorl %edx, %edx
movl %r9d, %r10d
addl $0x8, %edx
shrl $0x8, %r10d
cmpl $0xffff, %r9d           # imm = 0xFFFF
movl %r10d, %r9d
ja 0xb6de
cmpl %edx, %r8d
cmoval %r8d, %edx
addq $0x20, %rcx
movl %edx, %r8d
cmpq %rsi, %rcx
jb 0xb6c5
jmp 0xb709
// File: /workspace/github_cpp_makefile_star2_O1/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 $0x18, %rsp
movq %rdi, %rbp
leaq 0x20(%rdi), %rax
movl $0x1, %r13d
movq %rdi, %r15
movq %rsi, 0x10(%rsp)
cmpq %rsi, %rax
jae 0xbd80
movq %rdx, %r8
subq %rbp, %r8
sarq $0x5, %r8
movl $0x1, %ebx
movq %rbp, %r15
movq %rbp, (%rsp)
movq %r8, 0x8(%rsp)
movq %rax, %r13
movslq %ebx, %rax
cmpq %rax, %r8
jle 0xbd79
movq %rax, %r12
shlq $0x5, %r12
leaq (%r15,%r12), %rsi
movq %rsi, %r14
testl %eax, %eax
jle 0xbd19
leaq -0x20(%r15), %rcx
movl (%r13), %eax
movq %rsi, %r14
movq %r14, %rdi
subq %rcx, %rdi
sarq $0x6, %rdi
shlq $0x5, %rdi
leaq (%rcx,%rdi), %rdx
cmpl %eax, (%rcx,%rdi)
jl 0xbd0d
movq %rdx, %r14
jmp 0xbd10
movq %rdx, %rcx
leaq -0x20(%r14), %rdx
cmpq %rdx, %rcx
jb 0xbcf1
subq %r15, %r14
shrq $0x5, %r14
cmpl %r14d, %ebx
je 0xbd36
movslq %r14d, %rax
shlq $0x5, %rax
movl (%r15,%rax), %eax
cmpl (%r13), %eax
je 0xbd67
movq %r15, %rdi
movq %r13, %rdx
callq 0xccd6
movq %r13, %r15
subq %r12, %r15
movslq %r14d, %rdi
shlq $0x5, %rdi
addq %r15, %rdi
addq $0x40, %rbp
movq %r13, %rsi
movq %rbp, %rdx
callq 0xccd6
movq 0x8(%rsp), %r8
incl %ebx
leaq 0x20(%r13), %rax
movq %r13, %rbp
cmpq 0x10(%rsp), %rax
jb 0xbcc5
movslq %ebx, %r13
movq (%rsp), %rbp
shlq $0x5, %r13
leaq (%r15,%r13), %rdx
movq %rbp, %rdi
movq %r15, %rsi
callq 0xccd6
addq %rbp, %r13
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 $0x58, %rsp
movq %rsi, %rax
subq %rdi, %rax
movq %rax, 0x18(%rsp)
shrq $0x5, %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0x8(%rsp)
leaq 0x20(%rdi), %rax
cmpq %rsi, %rax
jae 0xbe48
movq 0x8(%rsp), %rcx
addq $0x28, %rcx
movl -0x20(%rax), %edx
movl (%rax), %edi
cmpl %edx, %edi
jge 0xbe3b
movl -0x1c(%rax), %r10d
movq -0x8(%rax), %r8
movq %r8, 0x50(%rsp)
movups -0x18(%rax), %xmm0
movaps %xmm0, 0x40(%rsp)
movl %edi, -0x20(%rax)
movl 0x4(%rax), %edi
movl %edi, -0x1c(%rax)
leaq 0x8(%rax), %rdi
movq $-0x18, %r8
movl 0x18(%rcx,%r8), %r9d
movl %r9d, -0x8(%rcx,%r8)
addq $0x4, %r8
jne 0xbe14
movl %edx, (%rax)
movl %r10d, 0x4(%rax)
movq 0x50(%rsp), %rdx
movq %rdx, 0x10(%rdi)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rdi)
addq $0x40, %rax
addq $0x40, %rcx
cmpq %rsi, %rax
jb 0xbde1
movq %rsi, 0x30(%rsp)
cmpl $0x3, 0x20(%rsp)
jl 0xbf00
movq 0x18(%rsp), %rax
sarq $0x5, %rax
movq %rax, 0x38(%rsp)
movl $0x2, %eax
movslq %eax, %rcx
movq %rcx, 0x28(%rsp)
addl %eax, %eax
movl %eax, 0x14(%rsp)
movslq %eax, %r14
movq 0x8(%rsp), %r12
movq 0x38(%rsp), %rcx
movq %rcx, %rax
cmpq %r14, %rcx
jl 0xbed4
movq %r14, %rbx
shlq $0x5, %rbx
movq 0x28(%rsp), %r13
movq %r13, %r15
shlq $0x6, %r15
shlq $0x5, %r13
movq 0x18(%rsp), %rbp
subq %rbx, %rbp
movq 0x8(%rsp), %r12
leaq (%r12,%r13), %rsi
leaq (%r12,%r15), %rdx
movq %r12, %rdi
callq 0xcba0
movq %rbp, %rax
sarq $0x5, %rax
addq %rbx, %r12
subq %rbx, %rbp
cmpq %r14, %rax
jge 0xbeb2
movq 0x28(%rsp), %rsi
cmpq %rsi, %rax
jle 0xbef2
shlq $0x5, %rsi
addq %r12, %rsi
movq %r12, %rdi
movq 0x30(%rsp), %rdx
callq 0xcba0
movl 0x14(%rsp), %eax
cmpl 0x20(%rsp), %eax
jl 0xbe6b
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rdi, %r14
movq %rsi, %rax
subq %rdi, %rax
movq %rdx, %rcx
subq %rsi, %rcx
cmpq %rcx, %rax
jge 0xcc49
cmpq %r14, %rsi
je 0xcccc
movq %rbx, %r15
cmpq %rbx, %rsi
jae 0xcc07
leaq -0x20(%rsi), %rcx
movl (%r14), %eax
movq %rbx, %r15
movq %r15, %rdi
subq %rcx, %rdi
sarq $0x6, %rdi
shlq $0x5, %rdi
leaq (%rcx,%rdi), %rdx
cmpl %eax, (%rcx,%rdi)
jl 0xcbfb
movq %rdx, %r15
jmp 0xcbfe
movq %rdx, %rcx
leaq -0x20(%r15), %rdx
cmpq %rdx, %rcx
jb 0xcbdf
movq %r15, %r12
subq %rsi, %r12
je 0xcc20
movq %r14, %rdi
movq %r15, %rdx
callq 0xccd6
addq %r12, %r14
movq %r15, %rsi
cmpq %rbx, %rsi
je 0xcc3f
addq $0x20, %r14
movq %r14, %rax
movq %rax, %r14
cmpq %rsi, %rax
je 0xcc3f
movl (%rsi), %ecx
leaq 0x20(%r14), %rax
cmpl (%r14), %ecx
jge 0xcc2c
cmpq %rbx, %rsi
jne 0xcbc4
jmp 0xcccc
leaq -0x20(%r14), %r12
cmpq %rsi, %rbx
je 0xcccc
movq %rsi, %r15
cmpq %r14, %rsi
jbe 0xcc8e
movl -0x20(%rbx), %eax
movq %r12, %rcx
movq %rsi, %r15
movq %r15, %rdi
subq %rcx, %rdi
sarq $0x6, %rdi
shlq $0x5, %rdi
leaq (%rcx,%rdi), %rdx
cmpl (%rcx,%rdi), %eax
jl 0xcc7f
movq %rdx, %rcx
jmp 0xcc85
movq %rdx, %r15
movq %rcx, %rdx
leaq -0x20(%r15), %rdi
cmpq %rdi, %rdx
jb 0xcc63
movq %r15, %r13
subq %rsi, %r13
je 0xcca7
movq %r15, %rdi
movq %rbx, %rdx
callq 0xccd6
addq %r13, %rbx
movq %r15, %rsi
cmpq %r14, %rsi
je 0xccc7
addq $-0x20, %rbx
movq %rbx, %rax
movq %rax, %rbx
cmpq %rsi, %rax
je 0xccc7
leaq -0x20(%rbx), %rax
movl -0x20(%rbx), %ecx
cmpl -0x20(%rsi), %ecx
jge 0xccb3
cmpq %r14, %rsi
jne 0xcc4d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xcd1c
testq %rbx, %rbx
jle 0xcd3b
movq %r14, %rdi
movq %r12, %rsi
callq 0xcd47
shlq $0x5, %rbx
addq %r12, %rbx
movq %r12, %r14
jmp 0xcce7
testq %rax, %rax
jle 0xcd3b
shlq $0x5, %rax
movq %r12, %rbx
subq %rax, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xcd47
movq %r12, %r15
jmp 0xcce7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpq %rdx, %rsi
jae 0xce23
movq %rsi, %rax
cmpq %rsi, %rdi
je 0xcdc9
movl (%rdi), %r8d
cmpl %r8d, (%rax)
jge 0xcdf4
movl (%rax), %r8d
movl %r8d, (%rcx)
movl 0x4(%rax), %r8d
movl %r8d, 0x4(%rcx)
movl $0x2, %r8d
movl (%rax,%r8,4), %r9d
movl %r9d, (%rcx,%r8,4)
incq %r8
cmpq $0x8, %r8
jne 0xcddd
addq $0x20, %rax
jmp 0xce1a
movl %r8d, (%rcx)
movl 0x4(%rdi), %r8d
movl %r8d, 0x4(%rcx)
movl $0x2, %r8d
movl (%rdi,%r8,4), %r9d
movl %r9d, (%rcx,%r8,4)
incq %r8
cmpq $0x8, %r8
jne 0xce05
addq $0x20, %rdi
addq $0x20, %rcx
cmpq %rdx, %rax
jb 0xcdbc
cmpq %rdi, %rcx
sete %al
cmpq %rsi, %rdi
setae %dl
orb %al, %dl
jne 0xce63
leaq 0x20(%rdi), %rax
movl (%rdi), %edx
movl %edx, (%rcx)
movl 0x4(%rdi), %edx
movl %edx, 0x4(%rcx)
movl $0x2, %edx
movl (%rdi,%rdx,4), %r8d
movl %r8d, (%rcx,%rdx,4)
incq %rdx
cmpq $0x8, %rdx
jne 0xce46
addq $0x20, %rcx
movq %rax, %rdi
cmpq %rsi, %rax
jb 0xce33
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
cmpq %rdx, %rsi
jae 0xcf39
movq %rsi, %rax
cmpq %rsi, %rdi
je 0xce7e
movl (%rax), %r8d
cmpl (%rdi), %r8d
jge 0xcecd
movl (%rcx), %r8d
movl 0x4(%rcx), %r9d
movq 0x18(%rcx), %r10
movq %r10, -0x10(%rsp)
movups 0x8(%rcx), %xmm0
movaps %xmm0, -0x20(%rsp)
movl (%rax), %r10d
movl %r10d, (%rcx)
movl 0x4(%rax), %r10d
movl %r10d, 0x4(%rcx)
leaq 0x8(%rax), %r10
movl $0x2, %r11d
movl (%rax,%r11,4), %ebx
movl %ebx, (%rcx,%r11,4)
incq %r11
cmpq $0x8, %r11
jne 0xceaf
movl %r8d, (%rax)
movl %r9d, 0x4(%rax)
addq $0x20, %rax
jmp 0xcf1a
movl (%rcx), %r8d
movl 0x4(%rcx), %r9d
movq 0x18(%rcx), %r10
movq %r10, -0x10(%rsp)
movups 0x8(%rcx), %xmm0
movaps %xmm0, -0x20(%rsp)
movl (%rdi), %r10d
movl %r10d, (%rcx)
movl 0x4(%rdi), %r10d
movl %r10d, 0x4(%rcx)
leaq 0x8(%rdi), %r10
movl $0x2, %r11d
movl (%rdi,%r11,4), %ebx
movl %ebx, (%rcx,%r11,4)
incq %r11
cmpq $0x8, %r11
jne 0xcefe
movl %r8d, (%rdi)
movl %r9d, 0x4(%rdi)
addq $0x20, %rdi
movq -0x10(%rsp), %r8
movq %r8, 0x10(%r10)
movaps -0x20(%rsp), %xmm0
movups %xmm0, (%r10)
addq $0x20, %rcx
cmpq %rdx, %rax
jb 0xce71
cmpq %rdi, %rcx
sete %al
cmpq %rsi, %rdi
sete %dl
orb %al, %dl
jne 0xcfb4
subq %rdi, %rsi
sarq $0x5, %rsi
movl (%rcx), %eax
movl 0x4(%rcx), %edx
movq 0x18(%rcx), %r8
movq %r8, -0x10(%rsp)
movups 0x8(%rcx), %xmm0
movaps %xmm0, -0x20(%rsp)
movl (%rdi), %r8d
movl %r8d, (%rcx)
movl 0x4(%rdi), %r8d
movl %r8d, 0x4(%rcx)
leaq 0x8(%rdi), %r8
movl $0x2, %r9d
movl (%rdi,%r9,4), %r10d
movl %r10d, (%rcx,%r9,4)
incq %r9
cmpq $0x8, %r9
jne 0xcf7f
addq $0x20, %rcx
movl %eax, (%rdi)
movl %edx, 0x4(%rdi)
addq $0x20, %rdi
movq -0x10(%rsp), %rax
movq %rax, 0x10(%r8)
movaps -0x20(%rsp), %xmm0
movups %xmm0, (%r8)
decq %rsi
jne 0xcf50
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %rbx
addq $-0x20, %rdx
leaq -0x20(%rsi), %r8
leaq -0x20(%rcx), %rax
cmpq %rdi, %r8
jb 0xd090
cmpq %rsi, %rdx
jb 0xcfda
movl (%rdx), %r9d
cmpl (%r8), %r9d
jge 0xd027
movl (%rax), %r9d
movl -0x1c(%rcx), %r10d
movq -0x8(%rcx), %r11
movq %r11, -0x8(%rsp)
movups -0x18(%rcx), %xmm0
movaps %xmm0, -0x18(%rsp)
movl (%r8), %r11d
movl %r11d, (%rax)
movl 0x4(%r8), %r11d
movl %r11d, -0x1c(%rcx)
leaq 0x8(%r8), %r11
movq $-0x18, %rbx
movl 0x20(%r8,%rbx), %ebp
movl %ebp, (%rcx,%rbx)
addq $0x4, %rbx
jne 0xd00c
movl %r9d, (%r8)
movl %r10d, 0x4(%r8)
addq $-0x20, %r8
jmp 0xd071
movl (%rax), %r9d
movl -0x1c(%rcx), %r10d
movq -0x8(%rcx), %r11
movq %r11, -0x8(%rsp)
movups -0x18(%rcx), %xmm0
movaps %xmm0, -0x18(%rsp)
movl (%rdx), %r11d
movl %r11d, (%rax)
movl 0x4(%rdx), %r11d
movl %r11d, -0x1c(%rcx)
leaq 0x8(%rdx), %r11
movq $-0x18, %rbx
movl 0x20(%rdx,%rbx), %ebp
movl %ebp, (%rcx,%rbx)
addq $0x4, %rbx
jne 0xd059
movl %r9d, (%rdx)
movl %r10d, 0x4(%rdx)
addq $-0x20, %rdx
movq -0x8(%rsp), %r9
movq %r9, 0x10(%r11)
movaps -0x18(%rsp), %xmm0
movups %xmm0, (%r11)
addq $-0x20, %rax
addq $-0x20, %rcx
jmp 0xcfc4
cmpq %rax, %rdx
sete %cl
cmpq %rsi, %rdx
setb %dil
orb %cl, %dil
jne 0xd10e
leaq -0x20(%rax), %rcx
movl (%rax), %edi
movl 0x4(%rax), %r8d
movq 0x18(%rax), %r9
movq %r9, -0x8(%rsp)
movups 0x8(%rax), %xmm0
movaps %xmm0, -0x18(%rsp)
movl (%rdx), %r9d
movl %r9d, (%rax)
movl 0x4(%rdx), %r9d
movl %r9d, 0x4(%rax)
leaq 0x8(%rdx), %r9
movl $0x2, %r10d
movl (%rdx,%r10,4), %r11d
movl %r11d, (%rax,%r10,4)
incq %r10
cmpq $0x8, %r10
jne 0xd0d6
movl %edi, (%rdx)
movl %r8d, 0x4(%rdx)
leaq -0x20(%rdx), %rdi
movq -0x8(%rsp), %rax
movq %rax, 0x10(%r9)
movaps -0x18(%rsp), %xmm0
movups %xmm0, (%r9)
movq %rdi, %rdx
movq %rcx, %rax
cmpq %rsi, %rdi
jae 0xd0a2
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
movl (%rsi), %eax
movslq %eax, %r11
movq %r11, %rax
shlq $0x5, %rax
addq %rdi, %rax
movl (%rdx), %ebx
xorl %r9d, %r9d
testl %ebx, %ebx
sete %r10b
testl %r11d, %r11d
setg %bpl
cmpq %rcx, %rax
setb %r11b
andb %bpl, %r11b
cmpb $0x1, %r11b
jne 0xd7f1
movq %rax, %r11
testl %ebx, %ebx
sete %r15b
movl (%rdi), %ebp
movl (%r11), %r14d
cmpl %ebp, %r14d
setge %r12b
jg 0xd7b8
andb %r12b, %r15b
jne 0xd7b8
movl %r14d, (%r8)
movl 0x4(%r11), %ebp
movl %ebp, 0x4(%r8)
movl $0x2, %r14d
movl (%r11,%r14,4), %ebp
movl %ebp, (%r8,%r14,4)
incq %r14
cmpq $0x8, %r14
jne 0xd7a1
addq $0x20, %r11
jmp 0xd7dd
movl %ebp, (%r8)
movl 0x4(%rdi), %ebp
movl %ebp, 0x4(%r8)
movl $0x2, %r14d
movl (%rdi,%r14,4), %ebp
movl %ebp, (%r8,%r14,4)
incq %r14
cmpq $0x8, %r14
jne 0xd7c8
addq $0x20, %rdi
cmpq %rax, %rdi
setb %bpl
jae 0xd7f4
addq $0x20, %r8
cmpq %rcx, %r11
jb 0xd777
jmp 0xd7f4
movq %rax, %r11
testb %bpl, %bpl
je 0xd844
movq %rax, %rdx
subq %rdi, %rdx
shrq $0x5, %rdx
movl %edx, (%rsi)
cmpq %rdi, %rax
jbe 0xd853
leaq -0x20(%rax), %rdx
leaq -0x20(%rcx), %rsi
movl -0x20(%rax), %r8d
movl %r8d, -0x20(%rcx)
movl -0x1c(%rax), %r8d
movl %r8d, -0x1c(%rcx)
movq $-0x18, %r8
movl (%rax,%r8), %r9d
movl %r9d, (%rcx,%r8)
addq $0x4, %r8
jne 0xd829
movq %rsi, %rcx
movq %rdx, %rax
cmpq %rdx, %rdi
jb 0xd80a
jmp 0xd853
movb %r10b, %r9b
subq %r11, %rcx
shrq $0x5, %rcx
movl %ecx, (%rsi)
movl %r9d, (%rdx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./grailsort.hpp
// Function: void Mrrl::grail_SmartMergeWithoutBuffer<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, int*, int*, baobao::TestClass*, std::less<baobao::TestClass>)
void grail_SmartMergeWithoutBuffer(RandomAccessIterator beg, int *alen1, int *atype, RandomAccessIterator end, Comp compare) {
    int ftype;

    if (beg == end) return;
    RandomAccessIterator mid = beg + *alen1;
    ftype = !*atype;
    if ((mid - beg) && grail_cmp(*(mid - 1), *mid, compare) - ftype >= 0) {
        while (mid - beg) {
            RandomAccessIterator p = (ftype ? grail_BinSearchLeft(mid, end, beg, compare) : grail_BinSearchRight(mid, end, beg, compare));
            if (p > mid) {
                grail_rotate(beg, mid, p);
                beg += p - mid;
                mid = p;
            }
            if (mid == end) {
                *alen1 = (int)(mid - beg);
                return;
            }
            do {
                beg++;
            } while ((mid - beg) && grail_cmp(*beg, *mid, compare) - ftype < 0);
        }
    }
    *alen1 = (int)(end - beg); *atype = ftype;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
cmpq %rcx, %rdi
je 0xdb9c
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %r12
movslq (%rsi), %rsi
movq 0x10(%rsp), %rdi
movl (%rdi), %ebx
testl %ebx, %ebx
sete 0xf(%rsp)
testq %rsi, %rsi
je 0xdb88
testl %ebx, %ebx
sete %al
shlq $0x5, %rsi
movl -0x20(%r12,%rsi), %ecx
movl (%r12,%rsi), %edx
cmpl %ecx, %edx
setge %cl
jg 0xdb88
andb %cl, %al
jne 0xdb88
addq %r12, %rsi
cmpq %r12, %rsi
je 0xdb83
movq %r14, %r13
testl %ebx, %ebx
je 0xdae4
cmpq %r14, %rsi
jae 0xdb1c
leaq -0x20(%rsi), %rcx
movl (%r12), %eax
movq %r14, %r13
movq %r13, %rdi
subq %rcx, %rdi
sarq $0x6, %rdi
shlq $0x5, %rdi
leaq (%rcx,%rdi), %rdx
cmpl (%rcx,%rdi), %eax
jl 0xdad3
movq %rdx, %rcx
jmp 0xdad9
movq %rdx, %r13
movq %rcx, %rdx
leaq -0x20(%r13), %rdi
cmpq %rdi, %rdx
jb 0xdab7
jmp 0xdb1c
cmpq %r14, %rsi
jae 0xdb1c
leaq -0x20(%rsi), %rcx
movl (%r12), %eax
movq %r14, %r13
movq %r13, %rdi
subq %rcx, %rdi
sarq $0x6, %rdi
shlq $0x5, %rdi
leaq (%rcx,%rdi), %rdx
cmpl %eax, (%rcx,%rdi)
jl 0xdb10
movq %rdx, %r13
jmp 0xdb13
movq %rdx, %rcx
leaq -0x20(%r13), %rdx
cmpq %rdx, %rcx
jb 0xdaf4
movq %r13, %rbp
subq %rsi, %rbp
jbe 0xdb35
movq %r12, %rdi
movq %r13, %rdx
callq 0xccd6
addq %rbp, %r12
movq %r13, %rsi
cmpq %r14, %rsi
je 0xdb6b
addq $0x20, %r12
movq %r12, %rax
movq %rax, %r12
cmpq %rsi, %rax
je 0xdb78
testl %ebx, %ebx
sete %cl
movl (%r12), %edi
movl (%rsi), %r8d
cmpl %edi, %r8d
setge %dl
leaq 0x20(%r12), %rax
cmpl %r8d, %edi
jl 0xdb41
andb %dl, %cl
jne 0xdb41
jmp 0xdb78
movq %rsi, %rax
subq %r12, %rax
shrq $0x5, %rax
movl %eax, (%r15)
cmpq %r14, %rsi
jne 0xda97
jmp 0xdb9c
movq 0x10(%rsp), %rdi
xorl %eax, %eax
movb 0xf(%rsp), %cl
movb %cl, %al
subq %r12, %r14
shrq $0x5, %r14
movl %r14d, (%r15)
movl %eax, (%rdi)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./grailsort.hpp
// Function: void Mrrl::grail_sort<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void grail_sort(RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{
    typedef typename std::iterator_traits<RandomAccessIterator>::value_type value_type;
    int L = 1;
    while (L * L < end - beg) L *= 2;
    value_type * ExtBuf = new value_type[L];
    if (ExtBuf == NULL)
    {
        grail_sort_buffer(beg, end, compare);
    }
    else
    {
        grail_commonSort(beg, end, ExtBuf, L, compare);
        delete[] ExtBuf;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rax
subq %rdi, %rax
sarq $0x5, %rax
movl $0x1, %ecx
movl %ecx, %r15d
movl %ecx, %edx
imull %edx, %edx
leal (%r15,%r15), %ecx
cmpq %rdx, %rax
jg 0xdbc9
movl %r15d, %r12d
shlq $0x5, %r12
movq %r12, %rdi
callq 0x2030
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20d0
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movl %r15d, %ecx
callq 0xb93c
movq %r13, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x21d0
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./wikisort.hpp
// Function: baobao::TestClass* FindLastForward<baobao::TestClass*, baobao::TestClass, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass const&, std::less<baobao::TestClass>, unsigned long)
RandomAccessIterator FindLastForward(RandomAccessIterator first, RandomAccessIterator last,
                                     const T & value, Comparison compare, std::size_t unique) {
    std::size_t size = std::distance(first, last);
    if (size == 0) return first;

    std::size_t skip = std::max(size / unique, (std::size_t)1);

    RandomAccessIterator index;
    for (index = first + skip ; !compare(value, *(index - 1)) ; index += skip) {
        if (index >= last - skip) {
            return std::upper_bound(index, last, value, compare);
        }
    }
    return std::upper_bound(index - skip, index, value, compare);
}

// Assembly:
movq %rsi, %r10
subq %rdi, %r10
je 0x1194c
movq %rdx, %r8
movq %r10, %r9
sarq $0x5, %r9
movq %r9, %rax
xorl %edx, %edx
divq %rcx
cmpq %rcx, %r9
movl $0x1, %ecx
cmovaeq %rax, %rcx
movl (%r8), %eax
movq %rcx, %rdx
shlq $0x5, %rdx
subq %rdx, %rsi
cmpl -0x20(%rdi,%rdx), %eax
jl 0x11920
addq %rdx, %rdi
subq %rdx, %r10
cmpq %rsi, %rdi
jb 0x118dd
sarq $0x5, %r10
testq %r10, %r10
jle 0x1194c
movq %r10, %rcx
shrq %rcx
movq %rcx, %rdx
shlq $0x5, %rdx
cmpl (%rdi,%rdx), %eax
jl 0x11916
notq %rcx
addq %r10, %rcx
addq %rdx, %rdi
addq $0x20, %rdi
movq %rcx, %r10
testq %rcx, %rcx
jg 0x118fa
jmp 0x1194c
testq %rcx, %rcx
jle 0x1194c
movq %rcx, %rdx
shrq %rdx
movq %rdx, %rsi
shlq $0x5, %rsi
cmpl (%rdi,%rsi), %eax
jl 0x11944
notq %rdx
addq %rcx, %rdx
addq %rsi, %rdi
addq $0x20, %rdi
movq %rdx, %rcx
testq %rdx, %rdx
jg 0x11928
movq %rdi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./wikisort.hpp
// Function: baobao::TestClass* FindFirstBackward<baobao::TestClass*, baobao::TestClass, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass const&, std::less<baobao::TestClass>, unsigned long)
RandomAccessIterator FindFirstBackward(RandomAccessIterator first, RandomAccessIterator last,
                                       const T & value, Comparison compare, std::size_t unique) {
    std::size_t size = std::distance(first, last);
    if (size == 0) return first;

    std::size_t skip = std::max(size / unique, (std::size_t)1);

    RandomAccessIterator index;
    for (index = last - skip ; index > first && !compare(*(index - 1), value) ; index -= skip) {
        if (index < first + skip) {
            return std::lower_bound(first, index, value, compare);
        }
    }
    return std::lower_bound(index, index + skip, value, compare);
}

// Assembly:
movq %rsi, %r10
subq %rdi, %r10
je 0x11a16
movq %rdx, %r8
movq %r10, %r9
sarq $0x5, %r9
movq %r9, %rax
xorl %edx, %edx
divq %rcx
cmpq %rcx, %r9
movl $0x1, %ecx
cmovaeq %rax, %rcx
movl (%r8), %eax
shlq $0x5, %rcx
leaq (%rdi,%rcx), %rdx
movq %rcx, %r9
negq %r9
leaq (%rsi,%r9), %r11
cmpq %rdi, %r11
jbe 0x119d8
cmpl %eax, -0x20(%rsi,%r9)
jl 0x119d8
subq %rcx, %r10
movq %r11, %rsi
cmpq %rdx, %r11
jae 0x1198b
sarq $0x5, %r10
testq %r10, %r10
jle 0x11a16
movq %r10, %rcx
shrq %rcx
movq %rcx, %rdx
shlq $0x5, %rdx
cmpl %eax, (%rdi,%rdx)
jge 0x119ce
notq %rcx
addq %r10, %rcx
addq %rdx, %rdi
addq $0x20, %rdi
movq %rcx, %r10
testq %rcx, %rcx
jg 0x119b2
jmp 0x11a16
subq %rcx, %rsi
sarq $0x5, %rcx
testq %rcx, %rcx
jle 0x11a13
movl (%r8), %eax
movq %rsi, %rdi
movq %rcx, %rdx
shrq %rdx
movq %rdx, %rsi
shlq $0x5, %rsi
cmpl %eax, (%rdi,%rsi)
jge 0x11a09
notq %rdx
addq %rcx, %rdx
addq %rsi, %rdi
addq $0x20, %rdi
movq %rdx, %rcx
testq %rdx, %rdx
jg 0x119ed
jmp 0x11a16
movq %rsi, %rdi
movq %rdi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./wikisort.hpp
// Function: void Wiki::MergeInternal<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void MergeInternal(RandomAccessIterator first1, RandomAccessIterator last1,
                       RandomAccessIterator first2, RandomAccessIterator last2,
                       RandomAccessIterator buffer, Comparison compare) {
        // whenever we find a value to add to the final array, swap it with the value that's already in that spot
        // when this algorithm is finished, 'buffer' will contain its original contents, but in a different order
        RandomAccessIterator A_index = buffer;
        RandomAccessIterator B_index = first2;
        RandomAccessIterator A_last = buffer + std::distance(first1, last1);
        RandomAccessIterator B_last = last2;
        RandomAccessIterator insert_index = first1;

        if (last2 - first2 > 0 && last1 - first1 > 0) {
            while (true) {
                if (!compare(*B_index, *A_index)) {
                    std::iter_swap(insert_index, A_index);
                    ++A_index;
                    ++insert_index;
                    if (A_index == A_last) break;
                } else {
                    std::iter_swap(insert_index, B_index);
                    ++B_index;
                    ++insert_index;
                    if (B_index == B_last) break;
                }
            }
        }

        // BlockSwap
        std::swap_ranges(A_index, A_last, insert_index);
    }

// Assembly:
movq %rsi, %r9
movq %rdi, %rax
subq %rdi, %r9
leaq (%r8,%r9), %rsi
movq %rcx, %rdi
subq %rdx, %rdi
testq %rdi, %rdi
setle %dil
testq %r9, %r9
setle %r9b
orb %dil, %r9b
jne 0x11b24
pushq %rbx
movl (%rdx), %edi
leaq 0x8(%rax), %r10
cmpl (%r8), %edi
jl 0x11ab9
movl (%rax), %edi
movl 0x4(%rax), %r9d
movq 0x10(%r10), %r11
movq %r11, -0x10(%rsp)
movups (%r10), %xmm0
movaps %xmm0, -0x20(%rsp)
movl (%r8), %r10d
movl %r10d, (%rax)
movl 0x4(%r8), %r10d
movl %r10d, 0x4(%rax)
leaq 0x8(%r8), %r10
movl $0x2, %r11d
movl (%r8,%r11,4), %ebx
movl %ebx, (%rax,%r11,4)
incq %r11
cmpq $0x8, %r11
jne 0x11a80
movl %edi, (%r8)
movl %r9d, 0x4(%r8)
movq -0x10(%rsp), %rdi
movq %rdi, 0x10(%r10)
movaps -0x20(%rsp), %xmm0
movups %xmm0, (%r10)
addq $0x20, %r8
addq $0x20, %rax
cmpq %rsi, %r8
jne 0x11a45
jmp 0x11b23
movl (%rax), %edi
movl 0x4(%rax), %r9d
movq 0x10(%r10), %r11
movq %r11, -0x10(%rsp)
movups (%r10), %xmm0
movaps %xmm0, -0x20(%rsp)
movl (%rdx), %r10d
movl %r10d, (%rax)
movl 0x4(%rdx), %r10d
movl %r10d, 0x4(%rax)
leaq 0x8(%rdx), %r10
movl $0x2, %r11d
movl (%rdx,%r11,4), %ebx
movl %ebx, (%rax,%r11,4)
incq %r11
cmpq $0x8, %r11
jne 0x11ae9
movl %edi, (%rdx)
movl %r9d, 0x4(%rdx)
movq -0x10(%rsp), %rdi
movq %rdi, 0x10(%r10)
movaps -0x20(%rsp), %xmm0
movups %xmm0, (%r10)
addq $0x20, %rdx
addq $0x20, %rax
cmpq %rcx, %rdx
jne 0x11a45
popq %rbx
movq %r8, %rdi
movq %rax, %rdx
jmp 0x5d23
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./wikisort.hpp
// Function: void InsertionSort<baobao::TestClass*, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, std::less<baobao::TestClass>)
void InsertionSort(BidirectionalIterator first, BidirectionalIterator last, Comparison compare) {
    typedef typename std::iterator_traits<BidirectionalIterator>::value_type T;
    if (first == last) return;

    for (BidirectionalIterator cur = first + 1 ; cur != last ; ++cur) {
        BidirectionalIterator sift = cur;
        BidirectionalIterator sift_1 = cur - 1;

        // Compare first so we can avoid 2 moves for
        // an element already positioned correctly.
        if (compare(*sift, *sift_1)) {
            T tmp = *sift;
            do {
                *sift-- = *sift_1;
            } while (sift != first && compare(tmp, *--sift_1));
            *sift = tmp;
        }
    }
}

// Assembly:
cmpq %rsi, %rdi
je 0x11ce4
leaq 0x20(%rdi), %rax
cmpq %rsi, %rax
je 0x11ce4
pushq %rbx
leaq -0x18(%rsp), %rcx
movq %rdi, %rdx
movl (%rax), %r8d
cmpl (%rdx), %r8d
jge 0x11cd2
movl %r8d, -0x20(%rsp)
movl 0x24(%rdx), %r8d
movl %r8d, -0x1c(%rsp)
movl $0x2, %r8d
movl 0x20(%rdx,%r8,4), %r9d
movl %r9d, -0x20(%rsp,%r8,4)
incq %r8
cmpq $0x8, %r8
jne 0x11c4f
movl -0x20(%rsp), %r9d
movq %rax, %r11
movq %rdx, %r10
movq %r11, %r8
movl (%r10), %r11d
movl %r11d, (%r8)
movl 0x4(%r10), %r11d
movl %r11d, 0x4(%r8)
movl $0x2, %r11d
movl (%r10,%r11,4), %ebx
movl %ebx, 0x20(%r10,%r11,4)
incq %r11
cmpq $0x8, %r11
jne 0x11c84
leaq -0x20(%r8), %r11
cmpq %rdi, %r11
je 0x11cae
leaq -0x20(%r10), %rbx
cmpl -0x20(%r10), %r9d
movq %rbx, %r10
jl 0x11c6d
jmp 0x11cb1
movq %rdi, %r11
movl -0x20(%rsp), %r9d
movl %r9d, (%r11)
movl -0x1c(%rsp), %r9d
movl %r9d, -0x1c(%r8)
movups (%rcx), %xmm0
movups %xmm0, -0x18(%r8)
movq 0x10(%rcx), %r9
movq %r9, -0x8(%r8)
addq $0x20, %rax
addq $0x20, %rdx
cmpq %rsi, %rax
jne 0x11c2f
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./wikisort.hpp
// Function: baobao::TestClass* FindFirstForward<baobao::TestClass*, baobao::TestClass, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass const&, std::less<baobao::TestClass>, unsigned long)
RandomAccessIterator FindFirstForward(RandomAccessIterator first, RandomAccessIterator last,
                                      const T & value, Comparison compare, std::size_t unique) {
    std::size_t size = std::distance(first, last);
    if (size == 0) return first;

    std::size_t skip = std::max(size / unique, (std::size_t)1);

    RandomAccessIterator index;
    for (index = first + skip ; compare(*(index - 1), value) ; index += skip) {
        if (index >= last - skip) {
            return std::lower_bound(index, last, value, compare);
        }
    }
    return std::lower_bound(index - skip, index, value, compare);
}

// Assembly:
movq %rsi, %r10
subq %rdi, %r10
je 0x11d8b
movq %rdx, %r8
movq %r10, %r9
sarq $0x5, %r9
movq %r9, %rax
xorl %edx, %edx
divq %rcx
cmpq %rcx, %r9
movl $0x1, %ecx
cmovaeq %rax, %rcx
movl (%r8), %eax
movq %rcx, %rdx
shlq $0x5, %rdx
subq %rdx, %rsi
cmpl %eax, -0x20(%rdi,%rdx)
jge 0x11d5f
addq %rdx, %rdi
subq %rdx, %r10
cmpq %rsi, %rdi
jb 0x11d1c
sarq $0x5, %r10
testq %r10, %r10
jle 0x11d8b
movq %r10, %rcx
shrq %rcx
movq %rcx, %rdx
shlq $0x5, %rdx
cmpl %eax, (%rdi,%rdx)
jge 0x11d55
notq %rcx
addq %r10, %rcx
addq %rdx, %rdi
addq $0x20, %rdi
movq %rcx, %r10
testq %rcx, %rcx
jg 0x11d39
jmp 0x11d8b
testq %rcx, %rcx
jle 0x11d8b
movq %rcx, %rdx
shrq %rdx
movq %rdx, %rsi
shlq $0x5, %rsi
cmpl %eax, (%rdi,%rsi)
jge 0x11d83
notq %rdx
addq %rcx, %rdx
addq %rsi, %rdi
addq $0x20, %rdi
movq %rdx, %rcx
testq %rdx, %rdx
jg 0x11d67
movq %rdi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/Baobaobear[P]sort/./wikisort.hpp
// Function: baobao::TestClass* FindLastBackward<baobao::TestClass*, baobao::TestClass, std::less<baobao::TestClass>>(baobao::TestClass*, baobao::TestClass*, baobao::TestClass const&, std::less<baobao::TestClass>, unsigned long)
RandomAccessIterator FindLastBackward(RandomAccessIterator first, RandomAccessIterator last,
                                      const T & value, Comparison compare, std::size_t unique) {
    std::size_t size = std::distance(first, last);
    if (size == 0) return first;

    std::size_t skip = std::max(size / unique, (std::size_t)1);

    RandomAccessIterator index;
    for (index = last - skip ; index > first && compare(value, *(index - 1)) ; index -= skip) {
        if (index < first + skip) {
            return std::upper_bound(first, index, value, compare);
        }
    }
    return std::upper_bound(index, index + skip, value, compare);
}

// Assembly:
movq %rsi, %r10
subq %rdi, %r10
je 0x11e55
movq %rdx, %r8
movq %r10, %r9
sarq $0x5, %r9
movq %r9, %rax
xorl %edx, %edx
divq %rcx
cmpq %rcx, %r9
movl $0x1, %ecx
cmovaeq %rax, %rcx
movl (%r8), %eax
shlq $0x5, %rcx
leaq (%rdi,%rcx), %rdx
movq %rcx, %r9
negq %r9
leaq (%rsi,%r9), %r11
cmpq %rdi, %r11
jbe 0x11e17
cmpl -0x20(%rsi,%r9), %eax
jge 0x11e17
subq %rcx, %r10
movq %r11, %rsi
cmpq %rdx, %r11
jae 0x11dca
sarq $0x5, %r10
testq %r10, %r10
jle 0x11e55
movq %r10, %rcx
shrq %rcx
movq %rcx, %rdx
shlq $0x5, %rdx
cmpl (%rdi,%rdx), %eax
jl 0x11e0d
notq %rcx
addq %r10, %rcx
addq %rdx, %rdi
addq $0x20, %rdi
movq %rcx, %r10
testq %rcx, %rcx
jg 0x11df1
jmp 0x11e55
subq %rcx, %rsi
sarq $0x5, %rcx
testq %rcx, %rcx
jle 0x11e52
movl (%r8), %eax
movq %rsi, %rdi
movq %rcx, %rdx
shrq %rdx
movq %rdx, %rsi
shlq $0x5, %rsi
cmpl (%rdi,%rsi), %eax
jl 0x11e48
notq %rdx
addq %rcx, %rdx
addq %rsi, %rdi
addq $0x20, %rdi
movq %rdx, %rcx
testq %rdx, %rdx
jg 0x11e2c
jmp 0x11e55
movq %rsi, %rdi
movq %rdi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/rurban[P]dgnlib/dgndump.c
// Function: Usage()
static void Usage()

{
    printf( "Usage: dgndump [-e xmin ymin xmax ymax] [-s] [-r n] filename.dgn\n" );
    printf( "\n" );
    printf( "  -e xmin ymin xmax ymax: only get elements within extents.\n" );
    printf( "  -s: produce summary report of element types and levels.\n");
    printf( "  -r n: report raw binary contents of elements of type n.\n");

    exit( 1 );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xd40d(%rip), %rdi      # 0x10123
callq 0x2470
movl $0xa, %edi
callq 0x2400
leaq 0xd438(%rip), %rdi      # 0x10164
callq 0x2470
leaq 0xd468(%rip), %rdi      # 0x101a0
callq 0x2470
leaq 0xd496(%rip), %rdi      # 0x101da
callq 0x2470
movl $0x1, %edi
callq 0x2380
nop
// File: /workspace/github_cpp_makefile_star2_O1/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLCalloc
void *CPLCalloc( size_t nCount, size_t nSize )

{
    void        *pReturn;

    if( nSize * nCount == 0 )
        return NULL;
    
    pReturn = VSICalloc( nCount, nSize );
    if( pReturn == NULL )
    {
        CPLError( CE_Fatal, CPLE_OutOfMemory,
                  "CPLCalloc(): Out of memory allocating %d bytes.\n",
                  nSize * nCount );
    }

    return pReturn;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
imulq %rdi, %r14
testq %r14, %r14
je 0x2d8e
callq 0x700e
movq %rax, %rbx
testq %rax, %rax
jne 0x2d90
leaq 0xd4f8(%rip), %rdx      # 0x10270
movl $0x4, %edi
movl $0x2, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x46dc
jmp 0x2d90
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/rurban[P]dgnlib/cpl_conv.cpp
// Function: CPLMalloc
void *CPLMalloc( size_t nSize )

{
    void        *pReturn;

    CPLVerifyConfiguration();

    if( nSize == 0 )
        return NULL;

    if( (ssize_t)nSize < 0 )
    {
        CPLError( CE_Failure, CPLE_AppDefined,
                  "CPLMalloc(%ld): Silly size requested.\n",
                  (long)nSize );
        return NULL;
    }
    
    pReturn = VSIMalloc( nSize );
    if( pReturn == NULL )
    {
        CPLError( CE_Fatal, CPLE_OutOfMemory,
                  "CPLMalloc(): Out of memory allocating %ld bytes.\n",
                  (long)nSize );
    }

    return pReturn;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2dcc
movq %rdi, %r14
js 0x2dd0
movq %r14, %rdi
callq 0x7013
movq %rax, %rbx
testq %rax, %rax
jne 0x2ded
leaq 0xd508(%rip), %rdx      # 0x102c8
movl $0x4, %edi
movl $0x2, %esi
jmp 0x2de3
xorl %ebx, %ebx
jmp 0x2ded
leaq 0xd4ca(%rip), %rdx      # 0x102a1
xorl %ebx, %ebx
movl $0x3, %edi
movl $0x1, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x46dc
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq