#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ check_arrayLogging();
int /*<<< orphan*/ check_errLogging();
int /*<<< orphan*/ check_logFormat();
int /*<<< orphan*/ check_logLogging();
int /*<<< orphan*/ check_logger();
int /*<<< orphan*/ check_ringBuffer();
int /*<<< orphan*/ check_ringBufferLogging();
int /*<<< orphan*/ check_traceLog();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("\n starting unittests...\n");
  printf("\n TESTS OF NGLOGC\n\n");
  printf("  running check_logger\n");
  check_logger();
  printf("  all tests passed\n\n");
  printf("  running check_logFormat\n");
  check_logFormat();
  printf("  all tests passed\n\n");
  printf("  running check_traceLog\n");
  check_traceLog();
  printf("  all tests passed\n\n");
  printf("  running check_errLogging\n");
  check_errLogging();
  printf("  all tests passed\n\n");
  printf("  running check_logLogging\n");
  check_logLogging();
  printf("  all tests passed\n\n");
  printf("  running check_arrayLogging\n");
  check_arrayLogging();
  printf("  all tests passed\n\n");
  printf("  running check_ringBuffer\n");
  check_ringBuffer();
  printf("  all tests passed\n\n");
  printf("  running check_ringBufferLogging\n");
  check_ringBufferLogging();
  printf("  all tests passed\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe53(%rip),%rdi
call   1040 <printf@plt>
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <check_logger@plt>
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <check_logFormat@plt>
lea    0xe4e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe72(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1090 <check_traceLog@plt>
lea    0xe2f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <check_errLogging@plt>
lea    0xe10(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   10b0 <check_logLogging@plt>
lea    0xdf1(%rip),%rdi
call   1040 <printf@plt>
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <check_arrayLogging@plt>
lea    0xdd2(%rip),%rdi
call   1040 <printf@plt>
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <check_ringBuffer@plt>
lea    0xdb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   10a0 <check_ringBufferLogging@plt>
lea    0xd94(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xe68(%rip),%rdi
call   1030 <puts@plt>
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <check_logger@plt>
lea    0xf42(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <check_logFormat@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1090 <check_traceLog@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1080 <check_errLogging@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10b0 <check_logLogging@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <check_arrayLogging@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <check_ringBuffer@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10a0 <check_ringBufferLogging@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0A starting unittests...\0A\00"
@.str.1 = [20 x i8] c"\0A TESTS OF NGLOGC\0A\0A\00"
@.str.2 = [24 x i8] c" running check_logger\0A\00"
@.str.3 = [21 x i8] c" all tests passed\0A\0A\00"
@.str.4 = [27 x i8] c" running check_logFormat\0A\00"
@.str.5 = [26 x i8] c" running check_traceLog\0A\00"
@.str.6 = [28 x i8] c" running check_errLogging\0A\00"
@.str.7 = [28 x i8] c" running check_logLogging\0A\00"
@.str.8 = [30 x i8] c" running check_arrayLogging\0A\00"
@.str.9 = [28 x i8] c" running check_ringBuffer\0A\00"
@.str.10 = [35 x i8] c" running check_ringBufferLogging\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (...) @check_logger()
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (...) @check_logFormat()
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 (...) @check_traceLog()
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 (...) @check_errLogging()
%19 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%21 = call i32 (...) @check_logLogging()
%22 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%24 = call i32 (...) @check_arrayLogging()
%25 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%27 = call i32 (...) @check_ringBuffer()
%28 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%29 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0))
%30 = call i32 (...) @check_ringBufferLogging()
%31 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"\0A starting unittests...\00"
@str.11 = [19 x i8] c"\0A TESTS OF NGLOGC\0A\00"
@str.12 = [23 x i8] c" running check_logger\00"
@str.14 = [26 x i8] c" running check_logFormat\00"
@str.16 = [25 x i8] c" running check_traceLog\00"
@str.18 = [27 x i8] c" running check_errLogging\00"
@str.20 = [27 x i8] c" running check_logLogging\00"
@str.22 = [29 x i8] c" running check_arrayLogging\00"
@str.24 = [27 x i8] c" running check_ringBuffer\00"
@str.26 = [34 x i8] c" running check_ringBufferLogging\00"
@str.27 = [20 x i8] c" all tests passed\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.11, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.12, i64 0, i64 0))
%6 = tail call i32 (...) @check_logger()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.27, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.14, i64 0, i64 0))
%9 = tail call i32 (...) @check_logFormat()
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.27, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.16, i64 0, i64 0))
%12 = tail call i32 (...) @check_traceLog()
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.27, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.18, i64 0, i64 0))
%15 = tail call i32 (...) @check_errLogging()
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.27, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.20, i64 0, i64 0))
%18 = tail call i32 (...) @check_logLogging()
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.27, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.22, i64 0, i64 0))
%21 = tail call i32 (...) @check_arrayLogging()
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.27, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.24, i64 0, i64 0))
%24 = tail call i32 (...) @check_ringBuffer()
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.27, i64 0, i64 0))
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.26, i64 0, i64 0))
%27 = tail call i32 (...) @check_ringBufferLogging()
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.27, i64 0, i64 0))
ret i32 0
}