// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq $0x0, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rax
cmpq 0x103dde(%rip), %rax    # 0x109058
jge 0x53d0
movq 0x103dd9(%rip), %rax    # 0x109060
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rsi
leaq 0x14ad(%rip), %rdi      # 0x674e
movb $0x0, %al
callq 0x3040
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0xe33(%rip), %rdx       # 0x60f2
leaq 0x1587(%rip), %rax      # 0x684d
cmpq $0x1, %rcx
cmoveq %rax, %rdx
leaq 0x14c3(%rip), %rdi      # 0x6798
movb $0x0, %al
callq 0x3040
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x5392
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq *%rax
movq -0x30(%rbp), %rax
movslq 0x8(%rax), %rax
addq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x14a9(%rip), %rsi      # 0x67ee
leaq 0x1497(%rip), %rax      # 0x67e3
cmpl $0x0, %ecx
cmoveq %rax, %rsi
movq -0x30(%rbp), %rax
movq (%rax), %rdx
movq -0x30(%rbp), %rax
movl 0x8(%rax), %edi
leaq 0x1497(%rip), %rcx      # 0x67ff
leaq 0x1489(%rip), %rax      # 0x67f8
cmpl $0x0, %edi
cmoveq %rax, %rcx
leaq 0x1442(%rip), %rdi      # 0x67bf
movb $0x0, %al
callq 0x3040
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x52e3
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x20(%rbp), %rax
movslq 0x18(%rax), %rax
subq %rax, %rdx
movq -0x20(%rbp), %rax
movl 0x18(%rax), %ecx
leaq 0x144b(%rip), %rdi      # 0x6806
movb $0x0, %al
callq 0x3040
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x526f
movq -0x10(%rbp), %rsi
movq 0x103c7d(%rip), %rdx    # 0x109058
movq -0x10(%rbp), %rcx
subq -0x8(%rbp), %rcx
movq -0x8(%rbp), %r8
leaq 0x1460(%rip), %rdi      # 0x684e
movb $0x0, %al
callq 0x3040
cmpq $0x1, -0x8(%rbp)
setge %al
andb $0x1, %al
movzbl %al, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)