#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*/ puts(char *);
int test1();
int test2();
int test3();
int test4();
int test5();
int test6();
int main() {
  int result = 0;
  result |= test1();
  result |= test2();
  result |= test3();
  result |= test4();
  result |= test5();
  result |= test6();
  if (result) {
    puts("Test result:  FAILED");
  } else {
    puts("Tests result: SUCCESS");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1060 <test1@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1090 <test2@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test3@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1080 <test4@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <test5@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <test6@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11ef <main+0x7f>
lea    0xe1b(%rip),%rdi
call   1030 <puts@plt>
jmp    11fb <main+0x8b>
lea    0xe1f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1060 <test1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1090 <test2@plt>
mov    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1050 <test3@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1080 <test4@plt>
mov    %eax,%ebx
or     %r14d,%ebx
or     %ebp,%ebx
xor    %eax,%eax
call   1040 <test5@plt>
mov    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1070 <test6@plt>
or     %ebp,%eax
lea    0xe5a(%rip),%rax
lea    0xe3e(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Test result: FAILED\00"
@.str.1 = [22 x i8] c"Tests result: SUCCESS\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @test1()
%4 = load i32, i32* %2
%5 = or i32 %4, %3
store i32 %5, i32* %2
%6 = call i32 (...) @test2()
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = call i32 (...) @test3()
%10 = load i32, i32* %2
%11 = or i32 %10, %9
store i32 %11, i32* %2
%12 = call i32 (...) @test4()
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = call i32 (...) @test5()
%16 = load i32, i32* %2
%17 = or i32 %16, %15
store i32 %17, i32* %2
%18 = call i32 (...) @test6()
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %0
%24 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %27
25: ; preds = %0
%26 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Test result: FAILED\00"
@.str.1 = [22 x i8] c"Tests result: SUCCESS\00"
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = or i32 %2, %1
%4 = tail call i32 (...) @test3()
%5 = or i32 %3, %4
%6 = tail call i32 (...) @test4()
%7 = or i32 %5, %6
%8 = tail call i32 (...) @test5()
%9 = or i32 %7, %8
%10 = tail call i32 (...) @test6()
%11 = or i32 %9, %10
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
%14 = tail call i32 @puts(i8* dereferenceable(1) %13)
ret i32 0
}