// File: 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
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0xe0(%rbp)
movq %rdi, %rax
movq %rax, -0xd8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x80(%rax), %rax
callq *%rax
movl %eax, %ecx
movl %ecx, -0xcc(%rbp)
testl %eax, %eax
je 0x69b37
jmp 0x69b16
movl -0xcc(%rbp), %eax
subl $0x1, %eax
je 0x69b3c
jmp 0x69b23
movl -0xcc(%rbp), %eax
subl $0x2, %eax
je 0x69bb9
jmp 0x69dec
jmp 0x69dec
movq -0xe0(%rbp), %rdi
movb $0x0, -0x19(%rbp)
movq -0x18(%rbp), %rsi
callq 0x918d0
movq -0xe0(%rbp), %rdi
callq 0x8d310
movq -0xe0(%rbp), %rdi
movq %rax, -0x28(%rbp)
callq 0x8d340
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x919c0
jmp 0x69b7f
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x69bb4
jmp 0x69ba8
movq -0xe0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x8d630
jmp 0x69e0c
movq -0xe0(%rbp), %rdi
callq 0x8d630
jmp 0x69dfc
movq -0x10(%rbp), %rdi
callq 0x64ff0
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x88(%rax), %rax
callq *%rax
movl %eax, %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x69e20
leaq -0x60(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x91a00
movq -0x18(%rbp), %rdi
callq 0x8d5e0
movq -0xe8(%rbp), %rdi
movq %rax, %rsi
callq 0x91a20
jmp 0x69c09
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x91b20
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rdi
callq 0x91b50
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x91b80
testb $0x1, %al
jne 0x69c3e
jmp 0x69cae
leaq -0x70(%rbp), %rdi
callq 0x91bc0
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x69e40
movl %eax, -0xec(%rbp)
jmp 0x69c60
movl -0xec(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x84(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x91be0
jmp 0x69c90
jmp 0x69c92
leaq -0x70(%rbp), %rdi
callq 0x91c60
jmp 0x69c2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x69de1
leaq -0x60(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x91c80
movq -0xf8(%rbp), %rdi
movq %rax, -0x98(%rbp)
callq 0x91cb0
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x69f30
jmp 0x69ced
movq -0xe0(%rbp), %rdi
movb $0x0, -0xa2(%rbp)
callq 0x91ce0
leaq -0x60(%rbp), %rdi
callq 0x91e00
movq -0xe0(%rbp), %rdi
movq %rax, %rsi
callq 0x91d00
jmp 0x69d1a
leaq -0x60(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x91c80
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x91cb0
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x91e20
testb $0x1, %al
jne 0x69d64
jmp 0x69dba
leaq -0xb8(%rbp), %rdi
callq 0x91e60
movq -0xe0(%rbp), %rdi
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x91e80
jmp 0x69d90
jmp 0x69d92
leaq -0xb8(%rbp), %rdi
callq 0x91ef0
jmp 0x69d4b
movq -0xe0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x8d630
jmp 0x69de1
movb $0x1, -0xa2(%rbp)
testb $0x1, -0xa2(%rbp)
jne 0x69dd6
movq -0xe0(%rbp), %rdi
callq 0x8d630
leaq -0x60(%rbp), %rdi
callq 0x91f10
jmp 0x69dfc
leaq -0x60(%rbp), %rdi
callq 0x91f10
jmp 0x69e0c
movq -0xe0(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x918d0
movq -0xd8(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x52c90
nopw %cs:(%rax,%rax)