// File: /workspace/github_c_makefile_star2_O0/morozov312[P]documentary/thirdparty/ctest.h
// Function: ctest_main
__attribute__((no_sanitize_address)) int ctest_main(int argc, const char *argv[])
{
    static int total = 0;
    static int num_ok = 0;
    static int num_fail = 0;
    static int num_skip = 0;
    static int idx = 1;
    static ctest_filter_func filter = suite_all;

#ifdef CTEST_SEGFAULT
    signal(SIGSEGV, sighandler);
#endif

    if (argc == 2) {
        suite_name = argv[1];
        filter = suite_filter;
    }
#ifdef CTEST_NO_COLORS
    color_output = 0;
#else
    color_output = isatty(1);
#endif
    uint64_t t1 = getCurrentTime();

    struct ctest* ctest_begin = &CTEST_IMPL_TNAME(suite, test);
    struct ctest* ctest_end = &CTEST_IMPL_TNAME(suite, test);
    // find begin and end of section by comparing magics
    while (1) {
        struct ctest* t = ctest_begin-1;
        if (t->magic != CTEST_IMPL_MAGIC) break;
        ctest_begin--;
    }
    while (1) {
        struct ctest* t = ctest_end+1;
        if (t->magic != CTEST_IMPL_MAGIC) break;
        ctest_end++;
    }
    ctest_end++;    // end after last one

    static struct ctest* test;
    for (test = ctest_begin; test != ctest_end; test++) {
        if (test == &CTEST_IMPL_TNAME(suite, test)) continue;
        if (filter(test)) total++;
    }

    for (test = ctest_begin; test != ctest_end; test++) {
        if (test == &CTEST_IMPL_TNAME(suite, test)) continue;
        if (filter(test)) {
            ctest_errorbuffer[0] = 0;
            ctest_errorsize = MSG_SIZE-1;
            ctest_errormsg = ctest_errorbuffer;
            printf("TEST %d/%d %s:%s ", idx, total, test->ssname, test->ttname);
            fflush(stdout);
            if (test->skip) {
                color_print(ANSI_BYELLOW, "[SKIPPED]");
                num_skip++;
            } else {
                int result = setjmp(ctest_err);
                if (result == 0) {
                    if (test->setup && *test->setup) (*test->setup)(test->data);
                    if (test->data)
                        test->run(test->data);
                    else
                        test->run();
                    if (test->teardown && *test->teardown) (*test->teardown)(test->data);
                    // if we got here it's ok
#ifdef CTEST_COLOR_OK
                    color_print(ANSI_BGREEN, "[OK]");
#else
                    printf("[OK]\n");
#endif
                    num_ok++;
                } else {
                    color_print(ANSI_BRED, "[FAIL]");
                    num_fail++;
                }
                if (ctest_errorsize != MSG_SIZE-1) printf("%s", ctest_errorbuffer);
            }
            idx++;
        }
    }
    uint64_t t2 = getCurrentTime();

    const char* color = (num_fail) ? ANSI_BRED : ANSI_GREEN;
    char results[80];
    snprintf(results, sizeof(results), "RESULTS: %d tests (%d ok, %d failed, %d skipped) ran in %" PRIu64 " ms", total, num_ok, num_fail, num_skip, (t2 - t1)/1000);
    color_print(color, results);
    return num_fail;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x4(%rbp)
jne 0x2ba5
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x6a11(%rip)      # 0x95a8
leaq 0x3d2(%rip), %rax       # 0x2f70
movq %rax, 0x6583(%rip)      # 0x9128
movl $0x1, %edi
callq 0x2080
movl %eax, 0x657b(%rip)      # 0x9130
callq 0x2fc0
movq %rax, -0x18(%rbp)
leaq 0x656f(%rip), %rax      # 0x9134
movq %rax, -0x20(%rbp)
leaq 0x6564(%rip), %rax      # 0x9134
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $-0x38, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpl $0xdeadbeef, 0x34(%rax) # imm = 0xDEADBEEF
je 0x2bef
jmp 0x2bfd
movq -0x20(%rbp), %rax
addq $-0x38, %rax
movq %rax, -0x20(%rbp)
jmp 0x2bd4
jmp 0x2bff
movq -0x28(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpl $0xdeadbeef, 0x34(%rax) # imm = 0xDEADBEEF
je 0x2c1a
jmp 0x2c28
movq -0x28(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x28(%rbp)
jmp 0x2bff
movq -0x28(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, 0x6971(%rip)      # 0x95b0
movq 0x696a(%rip), %rax      # 0x95b0
cmpq -0x28(%rbp), %rax
je 0x2c98
leaq 0x64e1(%rip), %rax      # 0x9134
cmpq %rax, 0x6956(%rip)      # 0x95b0
jne 0x2c5e
jmp 0x2c84
movq 0x64c3(%rip), %rax      # 0x9128
movq 0x6944(%rip), %rdi      # 0x95b0
callq *%rax
cmpl $0x0, %eax
je 0x2c82
movl 0x691f(%rip), %eax      # 0x9598
addl $0x1, %eax
movl %eax, 0x6916(%rip)      # 0x9598
jmp 0x2c84
movq 0x6925(%rip), %rax      # 0x95b0
addq $0x38, %rax
movq %rax, 0x691a(%rip)      # 0x95b0
jmp 0x2c3f
movq -0x20(%rbp), %rax
movq %rax, 0x690d(%rip)      # 0x95b0
movq 0x6906(%rip), %rax      # 0x95b0
cmpq -0x28(%rbp), %rax
je 0x2ec4
leaq 0x6479(%rip), %rax      # 0x9134
cmpq %rax, 0x68ee(%rip)      # 0x95b0
jne 0x2cc9
jmp 0x2ead
movq 0x6458(%rip), %rax      # 0x9128
movq 0x68d9(%rip), %rdi      # 0x95b0
callq *%rax
cmpl $0x0, %eax
je 0x2eab
movb $0x0, 0x68d7(%rip)      # 0x95c0
movq $0xfff, 0x78cc(%rip) # imm = 0xFFF
leaq 0x68c5(%rip), %rax      # 0x95c0
movq %rax, 0x78c6(%rip)      # 0xa5c8
movl 0x6418(%rip), %esi      # 0x9120
movl 0x688a(%rip), %edx      # 0x9598
movq 0x689b(%rip), %rax      # 0x95b0
movq (%rax), %rcx
movq 0x6891(%rip), %rax      # 0x95b0
movq 0x8(%rax), %r8
leaq 0x34d9(%rip), %rdi      # 0x6203
movb $0x0, %al
callq 0x20f0
movq 0x62a0(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
callq 0x21e0
movq 0x6869(%rip), %rax      # 0x95b0
cmpl $0x0, 0x30(%rax)
je 0x2d74
leaq 0x34c1(%rip), %rdi      # 0x6215
leaq 0x34c3(%rip), %rsi      # 0x621e
callq 0x3000
movl 0x683e(%rip), %eax      # 0x95a4
addl $0x1, %eax
movl %eax, 0x6835(%rip)      # 0x95a4
jmp 0x2e9c
leaq 0x6755(%rip), %rdi      # 0x94d0
callq 0x2170
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x2e56
movq 0x681c(%rip), %rax      # 0x95b0
cmpq $0x0, 0x20(%rax)
je 0x2dc7
movq 0x680e(%rip), %rax      # 0x95b0
movq 0x20(%rax), %rax
cmpq $0x0, (%rax)
je 0x2dc7
movq 0x67fd(%rip), %rax      # 0x95b0
movq 0x20(%rax), %rax
movq (%rax), %rax
movq 0x67ef(%rip), %rcx      # 0x95b0
movq 0x18(%rcx), %rdi
callq *%rax
movq 0x67e2(%rip), %rax      # 0x95b0
cmpq $0x0, 0x18(%rax)
je 0x2df1
movq 0x67d4(%rip), %rax      # 0x95b0
movq 0x10(%rax), %rcx
movq 0x67c9(%rip), %rax      # 0x95b0
movq 0x18(%rax), %rdi
movb $0x0, %al
callq *%rcx
jmp 0x2dfd
movq 0x67b8(%rip), %rcx      # 0x95b0
movb $0x0, %al
callq *0x10(%rcx)
movq 0x67ac(%rip), %rax      # 0x95b0
cmpq $0x0, 0x28(%rax)
je 0x2e37
movq 0x679e(%rip), %rax      # 0x95b0
movq 0x28(%rax), %rax
cmpq $0x0, (%rax)
je 0x2e37
movq 0x678d(%rip), %rax      # 0x95b0
movq 0x28(%rax), %rax
movq (%rax), %rax
movq 0x677f(%rip), %rcx      # 0x95b0
movq 0x18(%rcx), %rdi
callq *%rax
leaq 0x33ea(%rip), %rdi      # 0x6228
movb $0x0, %al
callq 0x20f0
movl 0x6751(%rip), %eax      # 0x959c
addl $0x1, %eax
movl %eax, 0x6748(%rip)      # 0x959c
jmp 0x2e78
leaq 0x33d1(%rip), %rdi      # 0x622e
leaq 0x33d3(%rip), %rsi      # 0x6237
callq 0x3000
movl 0x6731(%rip), %eax      # 0x95a0
addl $0x1, %eax
movl %eax, 0x6728(%rip)      # 0x95a0
cmpq $0xfff, 0x773d(%rip) # imm = 0xFFF
je 0x2e9a
leaq 0x3be9(%rip), %rdi      # 0x6a75
leaq 0x672d(%rip), %rsi      # 0x95c0
movb $0x0, %al
callq 0x20f0
jmp 0x2e9c
movl 0x627e(%rip), %eax      # 0x9120
addl $0x1, %eax
movl %eax, 0x6275(%rip)      # 0x9120
jmp 0x2ead
movq 0x66fc(%rip), %rax      # 0x95b0
addq $0x38, %rax
movq %rax, 0x66f1(%rip)      # 0x95b0
jmp 0x2ca3
callq 0x2fc0
movq %rax, -0x48(%rbp)
movl 0x66cd(%rip), %edx      # 0x95a0
leaq 0x3364(%rip), %rax      # 0x623e
leaq 0x334d(%rip), %rcx      # 0x622e
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x50(%rbp)
leaq -0xa0(%rbp), %rdi
movl 0x669f(%rip), %ecx      # 0x9598
movl 0x669c(%rip), %r8d      # 0x959c
movl 0x6699(%rip), %r9d      # 0x95a0
movl 0x6696(%rip), %r10d     # 0x95a4
movq -0x48(%rbp), %rax
subq -0x18(%rbp), %rax
movl $0x3e8, %esi            # imm = 0x3E8
xorl %edx, %edx
divq %rsi
movl $0x50, %esi
leaq 0x331a(%rip), %rdx      # 0x6246
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x2100
movq -0x50(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3000
movl 0x664e(%rip), %eax      # 0x95a0
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)