#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 DoRSATest();
int DoSSLTest();
int md5Test();
int /*<<< orphan*/ printf(char *, char *);
int sha256Test();
int main(int argc, char *argv[]) {
  int ret = 0, r1;
  ret |= r1 = DoSSLTest();
  printf("SSL Test %s\r\n", r1 ? "ERROR" : "OK");
  ret |= r1 = sha256Test();
  printf("SHA256 Test %s\r\n", r1 ? "ERROR" : "OK");
  ret |= r1 = md5Test();
  printf("MD5 Test %s\r\n", r1 ? "ERROR" : "OK");
  ret |= r1 = DoRSATest();
  printf("RSA Test %s\r\n", r1 ? "ERROR" : "OK");
  printf("All tests done %s\r\n", ret ? "with ERROR" : "OK");
  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)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1070 <DoSSLTest@plt>
mov    %eax,-0x18(%rbp)
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%ecx
lea    0xe87(%rip),%rsi
lea    0xec9(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe64(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <sha256Test@plt>
mov    %eax,-0x18(%rbp)
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%ecx
lea    0xe53(%rip),%rsi
lea    0xe95(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe41(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <md5Test@plt>
mov    %eax,-0x18(%rbp)
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%ecx
lea    0xe1f(%rip),%rsi
lea    0xe61(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe1e(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <DoRSATest@plt>
mov    %eax,-0x18(%rbp)
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%ecx
lea    0xdeb(%rip),%rsi
lea    0xe2d(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xdf8(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%ecx
lea    0xdc7(%rip),%rsi
lea    0xe04(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xde2(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <DoSSLTest@plt>
mov    %eax,%ebx
test   %eax,%eax
lea    0xea5(%rip),%r15
lea    0xee7(%rip),%r14
mov    %r14,%rsi
cmove  %r15,%rsi
lea    0xe82(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <sha256Test@plt>
or     %eax,%ebx
test   %eax,%eax
mov    %r14,%rsi
cmove  %r15,%rsi
lea    0xe75(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <md5Test@plt>
or     %eax,%ebx
test   %eax,%eax
mov    %r14,%rsi
cmove  %r15,%rsi
lea    0xe68(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <DoRSATest@plt>
mov    %eax,%ebp
test   %eax,%eax
cmove  %r15,%r14
lea    0xe5b(%rip),%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
or     %ebp,%ebx
lea    0xe6c(%rip),%rsi
cmove  %r15,%rsi
lea    0xe4d(%rip),%rdi
call   1050 <printf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"SSL Test %s\0D\0A\00"
@.str.1 = [6 x i8] c"ERROR\00"
@.str.2 = [3 x i8] c"OK\00"
@.str.3 = [17 x i8] c"SHA256 Test %s\0D\0A\00"
@.str.4 = [14 x i8] c"MD5 Test %s\0D\0A\00"
@.str.5 = [14 x i8] c"RSA Test %s\0D\0A\00"
@.str.6 = [20 x i8] c"All tests done %s\0D\0A\00"
@.str.7 = [11 x i8] c"with ERROR\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = call i32 (...) @DoSSLTest()
store i32 %8, i32* %7
%9 = load i32, i32* %6
%10 = or i32 %9, %8
store i32 %10, i32* %6
%11 = load i32, i32* %7
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = call i32 (...) @sha256Test()
store i32 %16, i32* %7
%17 = load i32, i32* %6
%18 = or i32 %17, %16
store i32 %18, i32* %6
%19 = load i32, i32* %7
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%23 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %22)
%24 = call i32 (...) @md5Test()
store i32 %24, i32* %7
%25 = load i32, i32* %6
%26 = or i32 %25, %24
store i32 %26, i32* %6
%27 = load i32, i32* %7
%28 = icmp ne i32 %27, 0
%29 = zext i1 %28 to i64
%30 = select i1 %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%31 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %30)
%32 = call i32 (...) @DoRSATest()
store i32 %32, i32* %7
%33 = load i32, i32* %6
%34 = or i32 %33, %32
store i32 %34, i32* %6
%35 = load i32, i32* %7
%36 = icmp ne i32 %35, 0
%37 = zext i1 %36 to i64
%38 = select i1 %36, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%39 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %38)
%40 = load i32, i32* %6
%41 = icmp ne i32 %40, 0
%42 = zext i1 %41 to i64
%43 = select i1 %41, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%44 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %43)
%45 = load i32, i32* %6
ret i32 %45
}

LLVM IR (-O2):
@.str = [14 x i8] c"SSL Test %s\0D\0A\00"
@.str.1 = [6 x i8] c"ERROR\00"
@.str.2 = [3 x i8] c"OK\00"
@.str.3 = [17 x i8] c"SHA256 Test %s\0D\0A\00"
@.str.4 = [14 x i8] c"MD5 Test %s\0D\0A\00"
@.str.5 = [14 x i8] c"RSA Test %s\0D\0A\00"
@.str.6 = [20 x i8] c"All tests done %s\0D\0A\00"
@.str.7 = [11 x i8] c"with ERROR\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @DoSSLTest()
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 (...) @sha256Test()
%8 = or i32 %7, %3
%9 = icmp eq i32 %7, 0
%10 = select i1 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %10)
%12 = tail call i32 (...) @md5Test()
%13 = or i32 %8, %12
%14 = icmp eq i32 %12, 0
%15 = select i1 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %15)
%17 = tail call i32 (...) @DoRSATest()
%18 = or i32 %13, %17
%19 = icmp eq i32 %17, 0
%20 = select i1 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %20)
%22 = icmp eq i32 %18, 0
%23 = select i1 %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %23)
ret i32 %18
}