// File: /workspace/github_c_makefile_star2_O3/TheDiamondProject[P]lib68/libUnit/unit.c
// Function: start_tests
int start_tests(void)
{
	ssize_t failed_test_count = 0;
	ssize_t test_count = 0;

    for (int i = 0; i < suite_count; ++i) {
        struct suite *s = test_suites[i];
        printf(
            "\x1b[31m❯\x1b[1;33m❯\x1b[0;32m❯ "
            "\x1b[36mStarting test suite \"\x1b[96m%s\x1b[36m\"\x1b[0m\n",
            s->name
        );

        // Give a summary about the test suite.
        printf(
            "\tTest suite contains %zu test case%s.\n",
            s->count, s->count == 1 ? "" : "s"
        );

        for (int j = 0; j < s->count; ++j) {
            struct test_case *tc = s->cases[j];
            tc->imp(s, tc);

            failed_test_count += tc->failed;
            test_count++;

            printf(
                "\t%s \x1b[0mTest case \"\x1b[1m%s\x1b[0m\" %s.\n",
                tc->failed == 0 ? "\x1b[0;32m✔" : "\x1b[0;31m×",
                tc->name,
                tc->failed == 0 ? "passed" : "failed"
            );
        }

        printf(
			"\t\x1b[1m%ld\x1b[0m tests run with "
			"\x1b[1m%ld\x1b[0m passed and \x1b[1m%d\x1b[0m failed.\n\n",
			s->count, 
			s->count - s->failed, 
			s->failed
		);
    }

    printf(
		"\x1b[1m%zu\x1b[0m tests run across \x1b[1m%zu\x1b[0m suites with "
		"\x1b[1m%zu\x1b[0m passed and \x1b[1m%zu\x1b[0m failed.\n\n",
		test_count, suite_count,
		test_count - failed_test_count, 
		failed_test_count
	);

    // Return 0 if there were no failed tests, otherwise return 1.
    return (failed_test_count >= 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x10393f(%rip), %rdx    # 0x108058
testq %rdx, %rdx
jle 0x481f
leaq 0x10ba(%rip), %r13      # 0x57e3
xorl %ecx, %ecx
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0x103929(%rip), %rax    # 0x108060
movq %rcx, -0x38(%rbp)
movq (%rax,%rcx,8), %r12
movq (%r12), %rsi
leaq 0x1004(%rip), %rdi      # 0x574e
xorl %eax, %eax
callq 0x3040
movq 0x8(%r12), %rsi
cmpq $0x1, %rsi
leaq 0x991(%rip), %rdx       # 0x50f2
leaq 0x10e5(%rip), %rax      # 0x584d
cmoveq %rax, %rdx
leaq 0x1025(%rip), %rdi      # 0x5798
xorl %eax, %eax
callq 0x3040
movq 0x8(%r12), %rsi
testq %rsi, %rsi
jle 0x47ed
movq %r14, -0x30(%rbp)
xorl %r14d, %r14d
movq 0x20(%r12), %rax
movq (%rax,%r14,8), %r15
movq %r12, %rdi
movq %r15, %rsi
callq *0x10(%r15)
movslq 0x8(%r15), %rax
addq %rax, %rbx
testq %rax, %rax
leaq 0x103f(%rip), %rsi      # 0x57ee
cmoveq %r13, %rsi
movq (%r15), %rdx
leaq 0x1042(%rip), %rcx      # 0x57ff
leaq 0x1034(%rip), %rax      # 0x57f8
cmoveq %rax, %rcx
leaq 0xff0(%rip), %rdi       # 0x57bf
xorl %eax, %eax
callq 0x3040
incq %r14
movq 0x8(%r12), %rsi
cmpq %r14, %rsi
jg 0x478b
movq -0x30(%rbp), %rax
addq %r14, %rax
movq %rax, %r14
movslq 0x18(%r12), %rcx
movq %rsi, %rdx
subq %rcx, %rdx
leaq 0x1007(%rip), %rdi      # 0x5806
xorl %eax, %eax
callq 0x3040
movq -0x38(%rbp), %rcx
incq %rcx
movq 0x103844(%rip), %rdx    # 0x108058
cmpq %rcx, %rdx
jg 0x4730
jmp 0x4824
xorl %r14d, %r14d
xorl %ebx, %ebx
movq %r14, %rcx
subq %rbx, %rcx
leaq 0x101d(%rip), %rdi      # 0x584e
movq %r14, %rsi
movq %rbx, %r8
xorl %eax, %eax
callq 0x3040
xorl %eax, %eax
testq %rbx, %rbx
setg %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq