// File: ahupowerdns[P]mcounter/./ext/doctest.h
// Function: doctest::(anonymous namespace)::color_to_stream(std::ostream&, doctest::Color::Enum)
void color_to_stream(std::ostream& s, Color::Enum code) {
        static_cast<void>(s);    // for DOCTEST_CONFIG_COLORS_NONE or DOCTEST_CONFIG_COLORS_WINDOWS
        static_cast<void>(code); // for DOCTEST_CONFIG_COLORS_NONE
#ifdef DOCTEST_CONFIG_COLORS_ANSI
        if(g_no_colors ||
           (isatty(STDOUT_FILENO) == false && getContextOptions()->force_colors == false))
            return;

        auto col = "";
        // clang-format off
            switch(code) { //!OCLINT missing break in switch statement / unnecessary default statement in covered switch statement
                case Color::Red:         col = "[0;31m"; break;
                case Color::Green:       col = "[0;32m"; break;
                case Color::Blue:        col = "[0;34m"; break;
                case Color::Cyan:        col = "[0;36m"; break;
                case Color::Yellow:      col = "[0;33m"; break;
                case Color::Grey:        col = "[1;30m"; break;
                case Color::LightGrey:   col = "[0;37m"; break;
                case Color::BrightRed:   col = "[1;31m"; break;
                case Color::BrightGreen: col = "[1;32m"; break;
                case Color::BrightWhite: col = "[1;37m"; break;
                case Color::Bright: // invalid
                case Color::None:
                case Color::White:
                default:                 col = "[0m";
            }
        // clang-format on
        s << "\033" << col;
#endif // DOCTEST_CONFIG_COLORS_ANSI

#ifdef DOCTEST_CONFIG_COLORS_WINDOWS
        if(g_no_colors ||
           (_isatty(_fileno(stdout)) == false && getContextOptions()->force_colors == false))
            return;

        static struct ConsoleHelper {
            HANDLE stdoutHandle;
            WORD   origFgAttrs;
            WORD   origBgAttrs;

            ConsoleHelper() {
                stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE);
                CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
                GetConsoleScreenBufferInfo(stdoutHandle, &csbiInfo);
                origFgAttrs = csbiInfo.wAttributes & ~(BACKGROUND_GREEN | BACKGROUND_RED |
                    BACKGROUND_BLUE | BACKGROUND_INTENSITY);
                origBgAttrs = csbiInfo.wAttributes & ~(FOREGROUND_GREEN | FOREGROUND_RED |
                    FOREGROUND_BLUE | FOREGROUND_INTENSITY);
            }
        } ch;

#define DOCTEST_SET_ATTR(x) SetConsoleTextAttribute(ch.stdoutHandle, x | ch.origBgAttrs)

        // clang-format off
        switch (code) {
            case Color::White:       DOCTEST_SET_ATTR(FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE); break;
            case Color::Red:         DOCTEST_SET_ATTR(FOREGROUND_RED);                                      break;
            case Color::Green:       DOCTEST_SET_ATTR(FOREGROUND_GREEN);                                    break;
            case Color::Blue:        DOCTEST_SET_ATTR(FOREGROUND_BLUE);                                     break;
            case Color::Cyan:        DOCTEST_SET_ATTR(FOREGROUND_BLUE | FOREGROUND_GREEN);                  break;
            case Color::Yellow:      DOCTEST_SET_ATTR(FOREGROUND_RED | FOREGROUND_GREEN);                   break;
            case Color::Grey:        DOCTEST_SET_ATTR(0);                                                   break;
            case Color::LightGrey:   DOCTEST_SET_ATTR(FOREGROUND_INTENSITY);                                break;
            case Color::BrightRed:   DOCTEST_SET_ATTR(FOREGROUND_INTENSITY | FOREGROUND_RED);               break;
            case Color::BrightGreen: DOCTEST_SET_ATTR(FOREGROUND_INTENSITY | FOREGROUND_GREEN);             break;
            case Color::BrightWhite: DOCTEST_SET_ATTR(FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE); break;
            case Color::None:
            case Color::Bright: // invalid
            default:                 DOCTEST_SET_ATTR(ch.origFgAttrs);
        }
            // clang-format on
#endif // DOCTEST_CONFIG_COLORS_WINDOWS
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %fs:0x0, %rax
leaq -0x38(%rax), %rax
testb $0x1, (%rax)
jne 0x8265
movl $0x1, %edi
callq 0x67d0
cmpl $0x0, %eax
jne 0x826a
callq 0x89c0
movb 0x78(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x826a
jmp 0x8348
leaq 0x30428(%rip), %rax     # 0x38699
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
movq %rax, -0x20(%rbp)
subq $0x17, %rax
ja 0x8321
movq -0x20(%rbp), %rax
leaq 0x2fd7f(%rip), %rcx     # 0x38010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x30a6b(%rip), %rax     # 0x38d0c
movq %rax, -0x18(%rbp)
jmp 0x832c
leaq 0x30a62(%rip), %rax     # 0x38d13
movq %rax, -0x18(%rbp)
jmp 0x832c
leaq 0x30a5c(%rip), %rax     # 0x38d1a
movq %rax, -0x18(%rbp)
jmp 0x832c
leaq 0x30a56(%rip), %rax     # 0x38d21
movq %rax, -0x18(%rbp)
jmp 0x832c
leaq 0x30a50(%rip), %rax     # 0x38d28
movq %rax, -0x18(%rbp)
jmp 0x832c
leaq 0x30a4a(%rip), %rax     # 0x38d2f
movq %rax, -0x18(%rbp)
jmp 0x832c
leaq 0x30a44(%rip), %rax     # 0x38d36
movq %rax, -0x18(%rbp)
jmp 0x832c
leaq 0x30a3e(%rip), %rax     # 0x38d3d
movq %rax, -0x18(%rbp)
jmp 0x832c
leaq 0x30a38(%rip), %rax     # 0x38d44
movq %rax, -0x18(%rbp)
jmp 0x832c
leaq 0x30a32(%rip), %rax     # 0x38d4b
movq %rax, -0x18(%rbp)
jmp 0x832c
jmp 0x8321
leaq 0x30a2a(%rip), %rax     # 0x38d52
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x30a1f(%rip), %rsi     # 0x38d56
callq 0x6450
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x6450
addq $0x20, %rsp
popq %rbp
retq
nop