// File: /workspace/github_cpp_makefile_star2_O3/AndreRenaud[P]simple_uart/./acutest.h
// Function: acutest_colored_printf_
acutest_colored_printf_(int color, const char* fmt, ...)
{
    va_list args;
    char buffer[256];
    int n;

    va_start(args, fmt);
    vsnprintf(buffer, sizeof(buffer), fmt, args);
    va_end(args);
    buffer[sizeof(buffer)-1] = '\0';

    if(!acutest_colorize_) {
        return printf("%s", buffer);
    }

#if defined ACUTEST_UNIX_
    {
        const char* col_str;
        switch(color) {
            case ACUTEST_COLOR_RED_:                col_str = "\033[0;31m"; break;
            case ACUTEST_COLOR_GREEN_:              col_str = "\033[0;32m"; break;
            case ACUTEST_COLOR_YELLOW_:             col_str = "\033[0;33m"; break;
            case ACUTEST_COLOR_RED_INTENSIVE_:      col_str = "\033[1;31m"; break;
            case ACUTEST_COLOR_GREEN_INTENSIVE_:    col_str = "\033[1;32m"; break;
            case ACUTEST_COLOR_YELLOW_INTENSIVE_:   col_str = "\033[1;33m"; break;
            case ACUTEST_COLOR_DEFAULT_INTENSIVE_:  col_str = "\033[1m"; break;
            default:                                col_str = "\033[0m"; break;
        }
        printf("%s", col_str);
        n = printf("%s", buffer);
        printf("\033[0m");
        return n;
    }
#elif defined ACUTEST_WIN_
    {
        HANDLE h;
        CONSOLE_SCREEN_BUFFER_INFO info;
        WORD attr;

        h = GetStdHandle(STD_OUTPUT_HANDLE);
        GetConsoleScreenBufferInfo(h, &info);

        switch(color) {
            case ACUTEST_COLOR_RED_:                attr = FOREGROUND_RED; break;
            case ACUTEST_COLOR_GREEN_:              attr = FOREGROUND_GREEN; break;
            case ACUTEST_COLOR_YELLOW_:             attr = FOREGROUND_RED | FOREGROUND_GREEN; break;
            case ACUTEST_COLOR_RED_INTENSIVE_:      attr = FOREGROUND_RED | FOREGROUND_INTENSITY; break;
            case ACUTEST_COLOR_GREEN_INTENSIVE_:    attr = FOREGROUND_GREEN | FOREGROUND_INTENSITY; break;
            case ACUTEST_COLOR_DEFAULT_INTENSIVE_:  attr = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY; break;
            case ACUTEST_COLOR_YELLOW_INTENSIVE_:   attr = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY; break;
            default:                                attr = 0; break;
        }
        if(attr != 0)
            SetConsoleTextAttribute(h, attr);
        n = printf("%s", buffer);
        SetConsoleTextAttribute(h, info.wAttributes);
        return n;
    }
#else
    n = printf("%s", buffer);
    return n;
#endif
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rsi, %r10
movl %edi, %ebx
leaq 0x120(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x2cdf
movaps %xmm0, 0x150(%rsp)
movaps %xmm1, 0x160(%rsp)
movaps %xmm2, 0x170(%rsp)
movaps %xmm3, 0x180(%rsp)
movaps %xmm4, 0x190(%rsp)
movaps %xmm5, 0x1a0(%rsp)
movaps %xmm6, 0x1b0(%rsp)
movaps %xmm7, 0x1c0(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rsp, %rcx
movq %rax, (%rcx)
leaq 0x1f0(%rsp), %rax
movq %rax, 0x8(%rcx)
movq %rsi, 0x10(%rcx)
leaq 0x20(%rsp), %r14
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdi
movq %r10, %rdx
callq 0x20d0
movb $0x0, 0xff(%r14)
cmpl $0x0, 0x875d(%rip)      # 0xb480
je 0x2d3e
decl %ebx
cmpl $0xc, %ebx
ja 0x2d55
movl %ebx, %eax
leaq 0x43b3(%rip), %rcx      # 0x70e8
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x2d5c
leaq 0x4c1a(%rip), %rdi      # 0x795f
leaq 0x20(%rsp), %rsi
xorl %eax, %eax
callq 0x2180
movl %eax, %ebx
jmp 0x2d8c
leaq 0x4bfc(%rip), %rsi      # 0x7958
leaq 0x4bfc(%rip), %rbx      # 0x795f
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2180
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2180
movl %eax, %ebx
leaq 0x4bd3(%rip), %rdi      # 0x7958
xorl %eax, %eax
callq 0x2180
movl %ebx, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r14
retq