#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*/ anvil_syslog(int /*<<< orphan*/, char *);
int /*<<< orphan*/ basename_test();
int /*<<< orphan*/ dirname_test();
int /*<<< orphan*/ mb_wc_test();
int /*<<< orphan*/ mem_test();
int /*<<< orphan*/ search_sort_test();
int /*<<< orphan*/ stdio_test();
int /*<<< orphan*/ string_test();
int libc_test() {
  anvil_syslog(0, "Testing libc...\n");
  mem_test();
  dirname_test();
  basename_test();
  string_test();
  search_sort_test();
  stdio_test();
  mb_wc_test();
  anvil_syslog(0, "done\n");
  return 0;
}


x86 assembly (clang, -O0):
<libc_test>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xe73(%rip),%rsi
call   1050 <anvil_syslog@plt>
mov    $0x0,%al
call   1030 <mem_test@plt>
mov    $0x0,%al
call   1090 <dirname_test@plt>
mov    $0x0,%al
call   1060 <basename_test@plt>
mov    $0x0,%al
call   1080 <string_test@plt>
mov    $0x0,%al
call   1040 <search_sort_test@plt>
mov    $0x0,%al
call   1070 <stdio_test@plt>
mov    $0x0,%al
call   10a0 <mb_wc_test@plt>
xor    %edi,%edi
lea    0xe45(%rip),%rsi
call   1050 <anvil_syslog@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libc_test>:
push   %rax
lea    0xe78(%rip),%rsi
xor    %edi,%edi
call   1050 <anvil_syslog@plt>
xor    %eax,%eax
call   1030 <mem_test@plt>
xor    %eax,%eax
call   1090 <dirname_test@plt>
xor    %eax,%eax
call   1060 <basename_test@plt>
xor    %eax,%eax
call   1080 <string_test@plt>
xor    %eax,%eax
call   1040 <search_sort_test@plt>
xor    %eax,%eax
call   1070 <stdio_test@plt>
xor    %eax,%eax
call   10a0 <mb_wc_test@plt>
lea    0xe4a(%rip),%rsi
xor    %edi,%edi
call   1050 <anvil_syslog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Testing libc...\0A\00"
@.str.1 = [6 x i8] c"done\0A\00"
define i32 @libc_test() {
%1 = call i32 @anvil_syslog(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @mem_test()
%3 = call i32 (...) @dirname_test()
%4 = call i32 (...) @basename_test()
%5 = call i32 (...) @string_test()
%6 = call i32 (...) @search_sort_test()
%7 = call i32 (...) @stdio_test()
%8 = call i32 (...) @mb_wc_test()
%9 = call i32 @anvil_syslog(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Testing libc...\0A\00"
@.str.1 = [6 x i8] c"done\0A\00"
define i32 @libc_test() {
%1 = tail call i32 @anvil_syslog(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @mem_test()
%3 = tail call i32 (...) @dirname_test()
%4 = tail call i32 (...) @basename_test()
%5 = tail call i32 (...) @string_test()
%6 = tail call i32 (...) @search_sort_test()
%7 = tail call i32 (...) @stdio_test()
%8 = tail call i32 (...) @mb_wc_test()
%9 = tail call i32 @anvil_syslog(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}