#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*/ printf(char *);
int /*<<< orphan*/ testCheck(char *);
int /*<<< orphan*/ testCheckDebug(int);
int /*<<< orphan*/ testCheckMem(int);
int /*<<< orphan*/ testDebug();
int /*<<< orphan*/ testDump();
int /*<<< orphan*/ testLogError();
int /*<<< orphan*/ testLogInfo();
int /*<<< orphan*/ testLogWarning();
int /*<<< orphan*/ testSentinel(int);
int main() {
  printf("\n== TEST DEBUG ==\n");
  testDebug();
  printf("\n== TEST DUMP ==\n");
  testDump();
  printf("\n== TEST LOG_ERROR ==\n");
  testLogError();
  printf("\n== TEST LOG_WARN ==\n");
  testLogWarning();
  printf("\n== TEST LOG_INFO ==\n");
  testLogInfo();
  printf("\n== TEST CHECK FAIL ==\n");
  testCheck("none-existing-file");
  printf("\n== TEST CHECK OK ==\n");
  testCheck("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/albertdahlin/libc/refs/heads/master/"
            "debug/test.c");
  printf("\n== TEST SENTINEL FAIL ==\n");
  testSentinel(10);
  printf("\n== TEST SENTINEL OK ==\n");
  testSentinel(1);
  printf("\n== TEST CHECK_MEM FAIL ==\n");
  testCheckMem(2);
  printf("\n== TEST CHECK_MEM OK ==\n");
  testCheckMem(1);
  printf("\n== TEST CHECK_DEBUG FAIL ==\n");
  testCheckDebug(2);
  printf("\n== TEST CHECK_DEBUG OK ==\n");
  testCheckDebug(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe4a(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10a0 <testDebug@plt>
lea    0xe4a(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1060 <testDump@plt>
lea    0xe49(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1040 <testLogError@plt>
lea    0xe4d(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1090 <testLogWarning@plt>
lea    0xe50(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1030 <testLogInfo@plt>
lea    0xe53(%rip),%rdi
call   1070 <printf@plt>
lea    0xe5f(%rip),%rdi
call   10b0 <testCheck@plt>
lea    0xe66(%rip),%rdi
call   1070 <printf@plt>
lea    0xe70(%rip),%rdi
call   10b0 <testCheck@plt>
lea    0xeef(%rip),%rdi
call   1070 <printf@plt>
mov    $0xa,%edi
call   10c0 <testSentinel@plt>
lea    0xef4(%rip),%rdi
call   1070 <printf@plt>
mov    $0x1,%edi
call   10c0 <testSentinel@plt>
lea    0xef7(%rip),%rdi
call   1070 <printf@plt>
mov    $0x2,%edi
call   1080 <testCheckMem@plt>
lea    0xefd(%rip),%rdi
call   1070 <printf@plt>
mov    $0x1,%edi
call   1080 <testCheckMem@plt>
lea    0xf01(%rip),%rdi
call   1070 <printf@plt>
mov    $0x2,%edi
call   1050 <testCheckDebug@plt>
lea    0xf09(%rip),%rdi
call   1070 <printf@plt>
mov    $0x1,%edi
call   1050 <testCheckDebug@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef6(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10a0 <testDebug@plt>
lea    0xef5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <testDump@plt>
lea    0xef3(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <testLogError@plt>
lea    0xef6(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1090 <testLogWarning@plt>
lea    0xef8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <testLogInfo@plt>
lea    0xefa(%rip),%rdi
call   1040 <puts@plt>
lea    0xded(%rip),%rdi
call   10b0 <testCheck@plt>
lea    0xef9(%rip),%rdi
call   1040 <puts@plt>
lea    0xde8(%rip),%rdi
call   10b0 <testCheck@plt>
lea    0xef6(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   10c0 <testSentinel@plt>
lea    0xefa(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10c0 <testSentinel@plt>
lea    0xefc(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   1080 <testCheckMem@plt>
lea    0xf01(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1080 <testCheckMem@plt>
lea    0xf04(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   1060 <testCheckDebug@plt>
lea    0xf0b(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1060 <testCheckDebug@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0A== TEST DEBUG ==\0A\00"
@.str.1 = [18 x i8] c"\0A== TEST DUMP ==\0A\00"
@.str.2 = [23 x i8] c"\0A== TEST LOG_ERROR ==\0A\00"
@.str.3 = [22 x i8] c"\0A== TEST LOG_WARN ==\0A\00"
@.str.4 = [22 x i8] c"\0A== TEST LOG_INFO ==\0A\00"
@.str.5 = [24 x i8] c"\0A== TEST CHECK FAIL ==\0A\00"
@.str.6 = [19 x i8] c"none-existing-file\00"
@.str.7 = [22 x i8] c"\0A== TEST CHECK OK ==\0A\00"
@.str.8 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/albertdahlin/libc/refs/heads/master/debug/test.c\00"
@.str.9 = [27 x i8] c"\0A== TEST SENTINEL FAIL ==\0A\00"
@.str.10 = [25 x i8] c"\0A== TEST SENTINEL OK ==\0A\00"
@.str.11 = [28 x i8] c"\0A== TEST CHECK_MEM FAIL ==\0A\00"
@.str.12 = [26 x i8] c"\0A== TEST CHECK_MEM OK ==\0A\00"
@.str.13 = [30 x i8] c"\0A== TEST CHECK_DEBUG FAIL ==\0A\00"
@.str.14 = [28 x i8] c"\0A== TEST CHECK_DEBUG OK ==\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @testDebug()
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @testDump()
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @testLogError()
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (...) @testLogWarning()
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (...) @testLogInfo()
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 @testCheck(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%15 = call i32 @testCheck(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.8, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%17 = call i32 @testSentinel(i32 10)
%18 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
%19 = call i32 @testSentinel(i32 1)
%20 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
%21 = call i32 @testCheckMem(i32 2)
%22 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0))
%23 = call i32 @testCheckMem(i32 1)
%24 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0))
%25 = call i32 @testCheckDebug(i32 2)
%26 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
%27 = call i32 @testCheckDebug(i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str.6 = [19 x i8] c"none-existing-file\00"
@.str.8 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/albertdahlin/libc/refs/heads/master/debug/test.c\00"
@str = [18 x i8] c"\0A== TEST DEBUG ==\00"
@str.15 = [17 x i8] c"\0A== TEST DUMP ==\00"
@str.16 = [22 x i8] c"\0A== TEST LOG_ERROR ==\00"
@str.17 = [21 x i8] c"\0A== TEST LOG_WARN ==\00"
@str.18 = [21 x i8] c"\0A== TEST LOG_INFO ==\00"
@str.19 = [23 x i8] c"\0A== TEST CHECK FAIL ==\00"
@str.20 = [21 x i8] c"\0A== TEST CHECK OK ==\00"
@str.21 = [26 x i8] c"\0A== TEST SENTINEL FAIL ==\00"
@str.22 = [24 x i8] c"\0A== TEST SENTINEL OK ==\00"
@str.23 = [27 x i8] c"\0A== TEST CHECK_MEM FAIL ==\00"
@str.24 = [25 x i8] c"\0A== TEST CHECK_MEM OK ==\00"
@str.25 = [29 x i8] c"\0A== TEST CHECK_DEBUG FAIL ==\00"
@str.26 = [27 x i8] c"\0A== TEST CHECK_DEBUG OK ==\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @testDebug()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.15, i64 0, i64 0))
%4 = tail call i32 (...) @testDump()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
%6 = tail call i32 (...) @testLogError()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.17, i64 0, i64 0))
%8 = tail call i32 (...) @testLogWarning()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.18, i64 0, i64 0))
%10 = tail call i32 (...) @testLogInfo()
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.19, i64 0, i64 0))
%12 = tail call i32 @testCheck(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.20, i64 0, i64 0))
%14 = tail call i32 @testCheck(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.8, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.21, i64 0, i64 0))
%16 = tail call i32 @testSentinel(i32 10)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.22, i64 0, i64 0))
%18 = tail call i32 @testSentinel(i32 1)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.23, i64 0, i64 0))
%20 = tail call i32 @testCheckMem(i32 2)
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.24, i64 0, i64 0))
%22 = tail call i32 @testCheckMem(i32 1)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.25, i64 0, i64 0))
%24 = tail call i32 @testCheckDebug(i32 2)
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.26, i64 0, i64 0))
%26 = tail call i32 @testCheckDebug(i32 1)
ret i32 0
}