#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 *);
scalar_t__ testCRCcalculation();
scalar_t__ testInterfaces();
scalar_t__ testNetwork();
scalar_t__ testTimeAdd();
scalar_t__ testTimeCompare();
scalar_t__ testTimeSubs();
int main(int argc, char *argv[]) {
  printf("Starting tests\n");
  if (testInterfaces()) {
    printf("Interface test failed\n");
    return 1;
  }
  if (testTimeCompare()) {
    printf("Time COMPARE test failed\n");
    return 1;
  }
  if (testTimeAdd()) {
    printf("Time ADD test failed\n");
    return 1;
  }
  if (testTimeSubs()) {
    printf("Time SUBSCRACT test failed\n");
    return 1;
  }
  if (testCRCcalculation()) {
    printf("CRC calculation failed\n");
    return 1;
  }
  if (testNetwork()) {
    printf("Network testing failed\n");
    return 1;
  }
  printf("All tests successfully finished.\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    0xe73(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <testInterfaces@plt>
cmp    $0x0,%rax
je     11bb <main+0x4b>
lea    0xe66(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    129b <main+0x12b>
mov    $0x0,%al
call   1030 <testTimeCompare@plt>
cmp    $0x0,%rax
je     11e4 <main+0x74>
lea    0xe54(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    129b <main+0x12b>
mov    $0x0,%al
call   1040 <testTimeAdd@plt>
cmp    $0x0,%rax
je     120d <main+0x9d>
lea    0xe45(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    129b <main+0x12b>
mov    $0x0,%al
call   1070 <testTimeSubs@plt>
cmp    $0x0,%rax
je     1236 <main+0xc6>
lea    0xe32(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    129b <main+0x12b>
mov    $0x0,%al
call   1080 <testCRCcalculation@plt>
cmp    $0x0,%rax
je     125f <main+0xef>
lea    0xe25(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    129b <main+0x12b>
mov    $0x0,%al
call   1090 <testNetwork@plt>
cmp    $0x0,%rax
je     1288 <main+0x118>
lea    0xe14(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    129b <main+0x12b>
lea    0xe14(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xe88(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <testInterfaces@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     1197 <main+0x27>
lea    0xf12(%rip),%rdi
jmp    120c <main+0x9c>
xor    %eax,%eax
call   1030 <testTimeCompare@plt>
test   %rax,%rax
je     11ac <main+0x3c>
lea    0xee4(%rip),%rdi
jmp    120c <main+0x9c>
xor    %eax,%eax
call   1050 <testTimeAdd@plt>
test   %rax,%rax
je     11c1 <main+0x51>
lea    0xeba(%rip),%rdi
jmp    120c <main+0x9c>
xor    %eax,%eax
call   1070 <testTimeSubs@plt>
test   %rax,%rax
je     11d6 <main+0x66>
lea    0xe8a(%rip),%rdi
jmp    120c <main+0x9c>
xor    %eax,%eax
call   1080 <testCRCcalculation@plt>
test   %rax,%rax
je     11eb <main+0x7b>
lea    0xe5e(%rip),%rdi
jmp    120c <main+0x9c>
xor    %eax,%eax
call   1090 <testNetwork@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
lea    0xe0e(%rip),%rax
lea    0xe28(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Starting tests\0A\00"
@.str.1 = [23 x i8] c"Interface test failed\0A\00"
@.str.2 = [26 x i8] c"Time COMPARE test failed\0A\00"
@.str.3 = [22 x i8] c"Time ADD test failed\0A\00"
@.str.4 = [28 x i8] c"Time SUBSCRACT test failed\0A\00"
@.str.5 = [24 x i8] c"CRC calculation failed\0A\00"
@.str.6 = [24 x i8] c"Network testing failed\0A\00"
@.str.7 = [34 x i8] c"All tests successfully finished.\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 ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i64 (...) @testInterfaces()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %38
11: ; preds = %2
%12 = call i64 (...) @testTimeCompare()
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %38
16: ; preds = %11
%17 = call i64 (...) @testTimeAdd()
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = 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 %38
21: ; preds = %16
%22 = call i64 (...) @testTimeSubs()
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %38
26: ; preds = %21
%27 = call i64 (...) @testCRCcalculation()
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %38
31: ; preds = %26
%32 = call i64 (...) @testNetwork()
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %38
36: ; preds = %31
%37 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %3
br label %38
38: ; preds = %36, %34, %29, %24, %19, %14, %9
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@str = [15 x i8] c"Starting tests\00"
@str.8 = [33 x i8] c"All tests successfully finished.\00"
@str.9 = [23 x i8] c"Network testing failed\00"
@str.10 = [23 x i8] c"CRC calculation failed\00"
@str.11 = [27 x i8] c"Time SUBSCRACT test failed\00"
@str.12 = [21 x i8] c"Time ADD test failed\00"
@str.13 = [25 x i8] c"Time COMPARE test failed\00"
@str.14 = [22 x i8] c"Interface test failed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = tail call i64 (...) @testInterfaces()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %24
6: ; preds = %2
%7 = tail call i64 (...) @testTimeCompare()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = tail call i64 (...) @testTimeAdd()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = tail call i64 (...) @testTimeSubs()
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %24
15: ; preds = %12
%16 = tail call i64 (...) @testCRCcalculation()
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = tail call i64 (...) @testNetwork()
%20 = icmp eq i64 %19, 0
%21 = select i1 %20, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.9, i64 0, i64 0)
%22 = xor i1 %20, true
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %18, %15, %12, %9, %6, %2
%25 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.14, i64 0, i64 0), %2 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @str.13, i64 0, i64 0), %6 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.12, i64 0, i64 0), %9 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @str.10, i64 0, i64 0), %15 ], [ %21, %18 ]
%26 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 1, %9 ], [ 1, %12 ], [ 1, %15 ], [ %23, %18 ]
%27 = tail call i32 @puts(i8* dereferenceable(1) %25)
ret i32 %26
}