// File: /workspace/github_cpp_makefile_star2_O3/xelia-it[P]mustache/third-party/catch2/single_include/catch2/catch.hpp
// Function: Catch::sortTests(Catch::IConfig const&, std::vector<Catch::TestCase, std::allocator<Catch::TestCase>> const&)
std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases ) {
        switch( config.runOrder() ) {
            case RunTests::InDeclarationOrder:
                // already in declaration order
                break;

            case RunTests::InLexicographicalOrder: {
                std::vector<TestCase> sorted = unsortedTestCases;
                std::sort( sorted.begin(), sorted.end() );
                return sorted;
            }

            case RunTests::InRandomOrder: {
                seedRng( config );
                TestHasher h{ config.rngSeed() };

                using hashedTest = std::pair<TestHasher::hash_t, TestCase const*>;
                std::vector<hashedTest> indexed_tests;
                indexed_tests.reserve( unsortedTestCases.size() );

                for (auto const& testCase : unsortedTestCases) {
                    indexed_tests.emplace_back(h(testCase), &testCase);
                }

                std::sort(indexed_tests.begin(), indexed_tests.end(),
                          [](hashedTest const& lhs, hashedTest const& rhs) {
                          if (lhs.first == rhs.first) {
                              return lhs.second->name < rhs.second->name;
                          }
                          return lhs.first < rhs.first;
                });

                std::vector<TestCase> sorted;
                sorted.reserve( indexed_tests.size() );

                for (auto const& hashed : indexed_tests) {
                    sorted.emplace_back(*hashed.second);
                }

                return sorted;
            }
        }
        return unsortedTestCases;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x80(%rax)
cmpl $0x2, %eax
je 0x2eb9f
movq %r12, %rdi
movq %r14, %rsi
cmpl $0x1, %eax
jne 0x2ecce
callq 0x3fe2e
movq (%r12), %r14
movq 0x8(%r12), %r15
cmpq %r15, %r14
je 0x2ed3c
movq %r15, %rax
subq %r14, %rax
sarq $0x3, %rax
movabsq $-0x2c8590b21642c859, %rcx # imm = 0xD37A6F4DE9BD37A7
imulq %rax, %rcx
bsrq %rcx, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x5d51b
movq %r14, %rdi
movq %r15, %rsi
callq 0x5d60f
jmp 0x2ed3c
movq %r12, -0x58(%rbp)
movq %r15, %rdi
callq 0x2ab48
movq (%r15), %rax
movq %r15, %rdi
callq *0x88(%rax)
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x8(%r14), %rcx
subq (%r14), %rcx
movl %eax, %r15d
sarq $0x3, %rcx
movabsq $-0x2c8590b21642c859, %rsi # imm = 0xD37A6F4DE9BD37A7
imulq %rcx, %rsi
callq 0x3fecc
movq (%r14), %r13
movq 0x8(%r14), %rbx
cmpq %rbx, %r13
je 0x2ec6e
movl %r15d, %r14d
movabsq $-0x340d631b7bdddcdb, %r15 # imm = 0xCBF29CE484222325
movabsq $0x100000001b3, %r12    # imm = 0x100000001B3
movq 0x8(%r13), %rcx
movq %r15, %rax
testq %rcx, %rcx
je 0x2ec39
movq (%r13), %rdx
xorl %esi, %esi
movq %r15, %rdi
movsbq (%rdx,%rsi), %rax
xorq %rdi, %rax
imulq %r12, %rax
incq %rsi
movq %rax, %rdi
cmpq %rsi, %rcx
jne 0x2ec22
xorq %r14, %rax
imulq %r12, %rax
movq %rax, %rcx
shrq $0x20, %rcx
imull %eax, %ecx
movl %ecx, -0x2c(%rbp)
movq %r13, -0x60(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x3ff76
addq $0xb8, %r13
cmpq %rbx, %r13
jne 0x2ec0d
movq -0x50(%rbp), %r15
movq -0x48(%rbp), %r14
cmpq %r14, %r15
je 0x2ece0
movq %r14, %rbx
subq %r15, %rbx
movq %rbx, %rax
sarq $0x4, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3d7d9
cmpq $0x101, %rbx            # imm = 0x101
jl 0x2ecd5
leaq 0x100(%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3dbeb
cmpq %r14, %r12
je 0x2ece0
movq %r12, %rdi
callq 0x3dc9a
addq $0x10, %r12
jmp 0x2ecbb
callq 0x3fe2e
jmp 0x2ed3c
movq %r15, %rdi
movq %r14, %rsi
callq 0x3dbeb
xorps %xmm0, %xmm0
movq -0x58(%rbp), %r12
movups %xmm0, (%r12)
movq $0x0, 0x10(%r12)
movq -0x48(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x4, %rsi
movq %r12, %rdi
callq 0x3ffa6
movq -0x50(%rbp), %r14
movq -0x48(%rbp), %rbx
cmpq %rbx, %r14
je 0x2ed2f
movq 0x8(%r14), %rsi
movq %r12, %rdi
callq 0x4004a
addq $0x10, %r14
cmpq %rbx, %r14
jne 0x2ed16
movq -0x50(%rbp), %r14
testq %r14, %r14
je 0x2ed3c
movq %r14, %rdi
callq 0x1b4d0
movq %r12, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2ed5f
jmp 0x2ed6d
movq %rax, %r14
movq %r12, %rdi
callq 0x3f08c
jmp 0x2ed7e
movq %rax, %r14
movq -0x58(%rbp), %rdi
callq 0x3f08c
jmp 0x2ed70
movq %rax, %r14
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x2ed7e
callq 0x1b4d0
movq %r14, %rdi
callq 0x1b910