// File: /workspace/github_cpp_makefile_star2_O1/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 0x2ebc9
movq %r12, %rdi
movq %r14, %rsi
cmpl $0x1, %eax
jne 0x2ecf8
callq 0x400fe
movq (%r12), %r14
movq 0x8(%r12), %r15
cmpq %r15, %r14
je 0x2ed60
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 0x5d9e7
movq %r14, %rdi
movq %r15, %rsi
callq 0x5dadb
jmp 0x2ed60
movq %r12, -0x58(%rbp)
movq %r15, %rdi
callq 0x2ab92
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 0x4019c
movq (%r14), %r13
movq 0x8(%r14), %rbx
cmpq %rbx, %r13
je 0x2ec98
movl %r15d, %r14d
movabsq $-0x340d631b7bdddcdb, %r15 # imm = 0xCBF29CE484222325
movabsq $0x100000001b3, %r12    # imm = 0x100000001B3
movq 0x8(%r13), %rcx
movq %r15, %rax
testq %rcx, %rcx
je 0x2ec63
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 0x2ec4c
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 0x40246
addq $0xb8, %r13
cmpq %rbx, %r13
jne 0x2ec37
movq -0x50(%rbp), %r15
movq -0x48(%rbp), %r14
cmpq %r14, %r15
je 0x2ed0a
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 0x3da93
cmpq $0x101, %rbx            # imm = 0x101
jl 0x2ecff
leaq 0x100(%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3def9
cmpq %r14, %r12
je 0x2ed0a
movq %r12, %rdi
callq 0x3dfad
addq $0x10, %r12
jmp 0x2ece5
callq 0x400fe
jmp 0x2ed60
movq %r15, %rdi
movq %r14, %rsi
callq 0x3def9
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 0x40276
movq -0x50(%rbp), %rbx
movq -0x48(%rbp), %r14
cmpq %r14, %rbx
je 0x2ed52
movq 0x8(%rbx), %rsi
movq %r12, %rdi
callq 0x4031a
addq $0x10, %rbx
jmp 0x2ed3b
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x2ed60
callq 0x1b4d0
movq %r12, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2ed83
jmp 0x2ed91
movq %rax, %r14
movq %r12, %rdi
callq 0x3f392
jmp 0x2eda2
movq %rax, %r14
movq -0x58(%rbp), %rdi
callq 0x3f392
jmp 0x2ed94
movq %rax, %r14
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x2eda2
callq 0x1b4d0
movq %r14, %rdi
callq 0x1b910