#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*/ fprintf(int /*<<< orphan*/, char *);
int run_all_tests();
int /*<<< orphan*/ stderr;
int main(int argc, const char *argv[]) {
  int ret;
  fprintf(stderr, "Start testing...\n");
  ret = run_all_tests();
  if (ret != 0) {
    fprintf(stderr, "Tests failed.\n");
  } else {
    fprintf(stderr, "Tests succeeded.\n");
  }
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <run_all_tests@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1179 <main+0x59>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
jmp    118e <main+0x6e>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%r14
mov    (%r14),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <run_all_tests@plt>
mov    %eax,%ebx
test   %eax,%eax
mov    (%r14),%edi
lea    0xed2(%rip),%rax
lea    0xebc(%rip),%rsi
cmove  %rax,%rsi
call   1030 <fprintf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Start testing...\0A\00"
@.str.1 = [15 x i8] c"Tests failed.\0A\00"
@.str.2 = [18 x i8] c"Tests succeeded.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @run_all_tests()
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %18
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Start testing...\0A\00"
@.str.1 = [15 x i8] c"Tests failed.\0A\00"
@.str.2 = [18 x i8] c"Tests succeeded.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @run_all_tests()
%6 = icmp eq i32 %5, 0
%7 = load i32, i32* @stderr
%8 = select i1 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 @fprintf(i32 %7, i8* %8)
ret i32 %5
}