#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*/ log_write_ln(char *);
int test_appcycle_run();
int test_can_bus_run();
int test_nmt_run();
int test_od_run();
int test_rpdo_run();
int test_sdo_run();
int test_sdo_server_run();
int test_tpdo_run();
extern void test_run_all_tests(void) {
  int error = 0;
  error |= test_can_bus_run();
  error |= test_od_run();
  error |= test_sdo_run();
  error |= test_sdo_server_run();
  error |= test_nmt_run();
  error |= test_rpdo_run();
  error |= test_tpdo_run();
  error |= test_appcycle_run();
  if (!error) {
    log_write_ln("test: ALL OK");
  } else {
    log_write_ln("test: ERRORS");
  }
}


x86 assembly (clang, -O0):
<test_run_all_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_can_bus_run@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1090 <test_od_run@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_sdo_run@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   10a0 <test_sdo_server_run@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_nmt_run@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_rpdo_run@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_tpdo_run@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1080 <test_appcycle_run@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1222 <test_run_all_tests+0x92>
lea    0xde8(%rip),%rdi
call   10b0 <log_write_ln@plt>
jmp    122e <test_run_all_tests+0x9e>
lea    0xde4(%rip),%rdi
call   10b0 <log_write_ln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_run_all_tests>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <test_can_bus_run@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1090 <test_od_run@plt>
mov    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1030 <test_sdo_run@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   10a0 <test_sdo_server_run@plt>
mov    %eax,%ebx
or     %r14d,%ebx
or     %ebp,%ebx
xor    %eax,%eax
call   1060 <test_nmt_run@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <test_rpdo_run@plt>
mov    %eax,%r15d
or     %r14d,%r15d
xor    %eax,%eax
call   1070 <test_tpdo_run@plt>
mov    %eax,%ebp
or     %r15d,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1080 <test_appcycle_run@plt>
or     %ebp,%eax
lea    0xe08(%rip),%rax
lea    0xe0e(%rip),%rdi
cmove  %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    10b0 <log_write_ln@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"test: ALL OK\00"
@.str.1 = [13 x i8] c"test: ERRORS\00"
define void @test_run_all_tests() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_can_bus_run()
%3 = load i32, i32* %1
%4 = or i32 %3, %2
store i32 %4, i32* %1
%5 = call i32 (...) @test_od_run()
%6 = load i32, i32* %1
%7 = or i32 %6, %5
store i32 %7, i32* %1
%8 = call i32 (...) @test_sdo_run()
%9 = load i32, i32* %1
%10 = or i32 %9, %8
store i32 %10, i32* %1
%11 = call i32 (...) @test_sdo_server_run()
%12 = load i32, i32* %1
%13 = or i32 %12, %11
store i32 %13, i32* %1
%14 = call i32 (...) @test_nmt_run()
%15 = load i32, i32* %1
%16 = or i32 %15, %14
store i32 %16, i32* %1
%17 = call i32 (...) @test_rpdo_run()
%18 = load i32, i32* %1
%19 = or i32 %18, %17
store i32 %19, i32* %1
%20 = call i32 (...) @test_tpdo_run()
%21 = load i32, i32* %1
%22 = or i32 %21, %20
store i32 %22, i32* %1
%23 = call i32 (...) @test_appcycle_run()
%24 = load i32, i32* %1
%25 = or i32 %24, %23
store i32 %25, i32* %1
%26 = load i32, i32* %1
%27 = icmp ne i32 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %0
%29 = call i32 @log_write_ln(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %32
30: ; preds = %0
%31 = call i32 @log_write_ln(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %32
32: ; preds = %30, %28
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"test: ALL OK\00"
@.str.1 = [13 x i8] c"test: ERRORS\00"
define void @test_run_all_tests() {
%1 = tail call i32 (...) @test_can_bus_run()
%2 = tail call i32 (...) @test_od_run()
%3 = or i32 %2, %1
%4 = tail call i32 (...) @test_sdo_run()
%5 = or i32 %3, %4
%6 = tail call i32 (...) @test_sdo_server_run()
%7 = or i32 %5, %6
%8 = tail call i32 (...) @test_nmt_run()
%9 = or i32 %7, %8
%10 = tail call i32 (...) @test_rpdo_run()
%11 = or i32 %9, %10
%12 = tail call i32 (...) @test_tpdo_run()
%13 = or i32 %11, %12
%14 = tail call i32 (...) @test_appcycle_run()
%15 = or i32 %13, %14
%16 = icmp eq i32 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0)
%18 = tail call i32 @log_write_ln(i8* %17)
ret void
}