#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 */
char *run_test(int);
char *run_all_tests() {
  char *msg;
  msg = run_test(1);
  if (msg) {
    return msg;
  }
  msg = run_test(2);
  if (msg) {
    return msg;
  }
  msg = run_test(3);
  if (msg) {
    return msg;
  }
  msg = run_test(4);
  if (msg) {
    return msg;
  }
  msg = run_test(5);
  if (msg) {
    return msg;
  }
  msg = run_test(6);
  if (msg) {
    return msg;
  }
  msg = run_test(7);
  if (msg) {
    return msg;
  }
  msg = run_test(8);
  if (msg) {
    return msg;
  }
  msg = run_test(9);
  if (msg) {
    return msg;
  }
  msg = run_test(10);
  if (msg) {
    return msg;
  }
  return 0;
}


x86 assembly (clang, -O0):
<run_all_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <run_test@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113e <run_all_tests+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    129c <run_all_tests+0x18c>
mov    $0x2,%edi
call   1030 <run_test@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1164 <run_all_tests+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    129c <run_all_tests+0x18c>
mov    $0x3,%edi
call   1030 <run_test@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118a <run_all_tests+0x7a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    129c <run_all_tests+0x18c>
mov    $0x4,%edi
call   1030 <run_test@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11b0 <run_all_tests+0xa0>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    129c <run_all_tests+0x18c>
mov    $0x5,%edi
call   1030 <run_test@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11d6 <run_all_tests+0xc6>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    129c <run_all_tests+0x18c>
mov    $0x6,%edi
call   1030 <run_test@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11fc <run_all_tests+0xec>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    129c <run_all_tests+0x18c>
mov    $0x7,%edi
call   1030 <run_test@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1222 <run_all_tests+0x112>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    129c <run_all_tests+0x18c>
mov    $0x8,%edi
call   1030 <run_test@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1248 <run_all_tests+0x138>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    129c <run_all_tests+0x18c>
mov    $0x9,%edi
call   1030 <run_test@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     126e <run_all_tests+0x15e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    129c <run_all_tests+0x18c>
mov    $0xa,%edi
call   1030 <run_test@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1294 <run_all_tests+0x184>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    129c <run_all_tests+0x18c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_all_tests>:
push   %rax
mov    $0x1,%edi
call   1030 <run_test@plt>
test   %rax,%rax
jne    1198 <run_all_tests+0x88>
mov    $0x2,%edi
call   1030 <run_test@plt>
test   %rax,%rax
jne    1198 <run_all_tests+0x88>
mov    $0x3,%edi
call   1030 <run_test@plt>
test   %rax,%rax
jne    1198 <run_all_tests+0x88>
mov    $0x4,%edi
call   1030 <run_test@plt>
test   %rax,%rax
jne    1198 <run_all_tests+0x88>
mov    $0x5,%edi
call   1030 <run_test@plt>
test   %rax,%rax
jne    1198 <run_all_tests+0x88>
mov    $0x6,%edi
call   1030 <run_test@plt>
test   %rax,%rax
jne    1198 <run_all_tests+0x88>
mov    $0x7,%edi
call   1030 <run_test@plt>
test   %rax,%rax
jne    1198 <run_all_tests+0x88>
mov    $0x8,%edi
call   1030 <run_test@plt>
test   %rax,%rax
jne    1198 <run_all_tests+0x88>
mov    $0x9,%edi
call   1030 <run_test@plt>
test   %rax,%rax
je     119a <run_all_tests+0x8a>
pop    %rcx
ret
mov    $0xa,%edi
pop    %rax
jmp    1030 <run_test@plt>

LLVM IR (-O0):
define i8* @run_all_tests() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @run_test(i32 1)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i8*, i8** %2
store i8* %7, i8** %1
br label %63
8: ; preds = %0
%9 = call i8* @run_test(i32 2)
store i8* %9, i8** %2
%10 = load i8*, i8** %2
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load i8*, i8** %2
store i8* %13, i8** %1
br label %63
14: ; preds = %8
%15 = call i8* @run_test(i32 3)
store i8* %15, i8** %2
%16 = load i8*, i8** %2
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i8*, i8** %2
store i8* %19, i8** %1
br label %63
20: ; preds = %14
%21 = call i8* @run_test(i32 4)
store i8* %21, i8** %2
%22 = load i8*, i8** %2
%23 = icmp ne i8* %22, null
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i8*, i8** %2
store i8* %25, i8** %1
br label %63
26: ; preds = %20
%27 = call i8* @run_test(i32 5)
store i8* %27, i8** %2
%28 = load i8*, i8** %2
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = load i8*, i8** %2
store i8* %31, i8** %1
br label %63
32: ; preds = %26
%33 = call i8* @run_test(i32 6)
store i8* %33, i8** %2
%34 = load i8*, i8** %2
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = load i8*, i8** %2
store i8* %37, i8** %1
br label %63
38: ; preds = %32
%39 = call i8* @run_test(i32 7)
store i8* %39, i8** %2
%40 = load i8*, i8** %2
%41 = icmp ne i8* %40, null
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = load i8*, i8** %2
store i8* %43, i8** %1
br label %63
44: ; preds = %38
%45 = call i8* @run_test(i32 8)
store i8* %45, i8** %2
%46 = load i8*, i8** %2
%47 = icmp ne i8* %46, null
br i1 %47, label %48, label %50
48: ; preds = %44
%49 = load i8*, i8** %2
store i8* %49, i8** %1
br label %63
50: ; preds = %44
%51 = call i8* @run_test(i32 9)
store i8* %51, i8** %2
%52 = load i8*, i8** %2
%53 = icmp ne i8* %52, null
br i1 %53, label %54, label %56
54: ; preds = %50
%55 = load i8*, i8** %2
store i8* %55, i8** %1
br label %63
56: ; preds = %50
%57 = call i8* @run_test(i32 10)
store i8* %57, i8** %2
%58 = load i8*, i8** %2
%59 = icmp ne i8* %58, null
br i1 %59, label %60, label %62
60: ; preds = %56
%61 = load i8*, i8** %2
store i8* %61, i8** %1
br label %63
62: ; preds = %56
store i8* null, i8** %1
br label %63
63: ; preds = %62, %60, %54, %48, %42, %36, %30, %24, %18, %12, %6
%64 = load i8*, i8** %1
ret i8* %64
}

LLVM IR (-O2):
define i8* @run_all_tests() {
%1 = tail call i8* @run_test(i32 1)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %29
3: ; preds = %0
%4 = tail call i8* @run_test(i32 2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %29
6: ; preds = %3
%7 = tail call i8* @run_test(i32 3)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %29
9: ; preds = %6
%10 = tail call i8* @run_test(i32 4)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %29
12: ; preds = %9
%13 = tail call i8* @run_test(i32 5)
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %29
15: ; preds = %12
%16 = tail call i8* @run_test(i32 6)
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %29
18: ; preds = %15
%19 = tail call i8* @run_test(i32 7)
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %29
21: ; preds = %18
%22 = tail call i8* @run_test(i32 8)
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = tail call i8* @run_test(i32 9)
%26 = icmp eq i8* %25, null
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = tail call i8* @run_test(i32 10)
br label %29
29: ; preds = %27, %24, %21, %18, %15, %12, %9, %6, %3, %0
%30 = phi i8* [ %1, %0 ], [ %4, %3 ], [ %7, %6 ], [ %10, %9 ], [ %13, %12 ], [ %16, %15 ], [ %19, %18 ], [ %22, %21 ], [ %25, %24 ], [ %28, %27 ]
ret i8* %30
}