// File: chiku[P]cmatrix/test/doctest.h
// Function: doctest::skipPathFromFilename(char const*)
const char* skipPathFromFilename(const char* file) {
#ifndef DOCTEST_CONFIG_DISABLE
    if(getContextOptions()->no_path_in_filenames) {
        auto back    = std::strrchr(file, '\\');
        auto forward = std::strrchr(file, '/');
        if(back || forward) {
            if(back > forward)
                forward = back;
            return forward + 1;
        }
    } else {
        const auto prefixes = getContextOptions()->strip_file_prefixes;
        const char separator = DOCTEST_CONFIG_OPTIONS_FILE_PREFIX_SEPARATOR;
        String::size_type longest_match = 0U;
        for(String::size_type pos = 0U; pos < prefixes.size(); ++pos)
        {
            const auto prefix_start = pos;
            pos = std::min(prefixes.find(separator, prefix_start), prefixes.size());
            
            const auto prefix_size = pos - prefix_start;
            if(prefix_size > longest_match)
            {
                // TODO under DOCTEST_MSVC: does the comparison need strnicmp() to work with drive letter capitalization?
                if(0 == std::strncmp(prefixes.c_str() + prefix_start, file, prefix_size))
                {
                    longest_match = prefix_size;
                }
            }
        }
        return &file[longest_match];
    }
#endif // DOCTEST_CONFIG_DISABLE
    return file;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
callq 0x3c910
testb $0x1, 0x7c(%rax)
je 0x3c7d4
movq -0x10(%rbp), %rdi
movl $0x5c, %esi
callq 0x64e0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2f, %esi
callq 0x64e0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3c7ac
cmpq $0x0, -0x20(%rbp)
je 0x3c7cf
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jbe 0x3c7be
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x3c8f6
jmp 0x3c8ee
callq 0x3c910
movq %rax, %rsi
addq $0x80, %rsi
leaq -0x38(%rbp), %rdi
callq 0x3b320
movb $0x3a, -0x39(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x68(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3b5b0
movl %eax, %ecx
movl -0x68(%rbp), %eax
cmpl %ecx, %eax
jae 0x3c8d5
movl -0x44(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %edx
leaq -0x38(%rbp), %rdi
movl $0x3a, %esi
callq 0x3b8a0
movl %eax, -0x6c(%rbp)
jmp 0x3c836
movl -0x6c(%rbp), %eax
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3b5b0
movl %eax, -0x60(%rbp)
leaq -0x4c(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x52b10
movq %rax, -0x78(%rbp)
jmp 0x3c85b
movq -0x78(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
subl -0x48(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x40(%rbp), %eax
jbe 0x3c8c5
leaq -0x38(%rbp), %rdi
callq 0x52af0
movq %rax, -0x80(%rbp)
jmp 0x3c884
movq -0x80(%rbp), %rdi
movl -0x48(%rbp), %eax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x64(%rbp), %eax
movl %eax, %edx
callq 0x61b0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x3c8c3
movl -0x64(%rbp), %eax
movl %eax, -0x40(%rbp)
jmp 0x3c8c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3b220
jmp 0x3c903
jmp 0x3c8c5
jmp 0x3c8c7
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x3c7fe
movq -0x10(%rbp), %rax
movl -0x40(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3b220
jmp 0x3c8f6
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x67c0
nopl (%rax)