#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*/ test_default();
int /*<<< orphan*/ test_file();
int /*<<< orphan*/ test_flags();
int /*<<< orphan*/ test_syslog();
int main(int argc, char *argv[]) {
  if (!test_default()) {
    printf("test_default() failed!\n");
    return 1;
  }
  if (!test_file()) {
    printf("test_file failed!\n");
    return 1;
  }
  if (!test_syslog()) {
    printf("test_syslog() failed!\n");
    return 1;
  }
  if (!test_flags()) {
    printf("test_flags() failed!\n");
    return 1;
  }
  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)
mov    $0x0,%al
call   1070 <test_default@plt>
cmp    $0x0,%eax
jne    118e <main+0x3e>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    120d <main+0xbd>
mov    $0x0,%al
call   1040 <test_file@plt>
cmp    $0x0,%eax
jne    11b6 <main+0x66>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    120d <main+0xbd>
mov    $0x0,%al
call   1060 <test_syslog@plt>
cmp    $0x0,%eax
jne    11de <main+0x8e>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    120d <main+0xbd>
mov    $0x0,%al
call   1050 <test_flags@plt>
cmp    $0x0,%eax
jne    1206 <main+0xb6>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    120d <main+0xbd>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1070 <test_default@plt>
test   %eax,%eax
je     1188 <main+0x38>
xor    %eax,%eax
call   1040 <test_file@plt>
test   %eax,%eax
je     1191 <main+0x41>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <test_syslog@plt>
test   %eax,%eax
je     119a <main+0x4a>
xor    %eax,%eax
call   1050 <test_flags@plt>
test   %eax,%eax
jne    11ab <main+0x5b>
lea    0xeb9(%rip),%rdi
jmp    11a1 <main+0x51>
lea    0xe71(%rip),%rdi
jmp    11a1 <main+0x51>
lea    0xe7f(%rip),%rdi
jmp    11a1 <main+0x51>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"test_default() failed!\0A\00"
@.str.1 = [19 x i8] c"test_file failed!\0A\00"
@.str.2 = [23 x i8] c"test_syslog() failed!\0A\00"
@.str.3 = [22 x i8] c"test_flags() failed!\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 (...) @test_default()
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %26
10: ; preds = %2
%11 = call i32 (...) @test_file()
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %26
15: ; preds = %10
%16 = call i32 (...) @test_syslog()
%17 = icmp ne i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %26
20: ; preds = %15
%21 = call i32 (...) @test_flags()
%22 = icmp ne i32 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %26
25: ; preds = %20
store i32 0, i32* %3
br label %26
26: ; preds = %25, %23, %18, %13, %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@str = [23 x i8] c"test_default() failed!\00"
@str.4 = [18 x i8] c"test_file failed!\00"
@str.5 = [22 x i8] c"test_syslog() failed!\00"
@str.6 = [21 x i8] c"test_flags() failed!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_default()
%4 = icmp eq i32 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2
%6 = tail call i32 (...) @test_file()
%7 = icmp eq i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = tail call i32 (...) @test_syslog()
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = tail call i32 (...) @test_flags()
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11, %8, %5, %2
%15 = phi i8* [ getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0), %8 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.6, i64 0, i64 0), %11 ]
%16 = tail call i32 @puts(i8* dereferenceable(1) %15)
br label %17
17: ; preds = %14, %11
%18 = phi i32 [ 0, %11 ], [ 1, %14 ]
ret i32 %18
}