#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 *test_add_chars();
char *test_char_to_int();
char *test_int_to_char();
char *test_remove_leading_zero();
char *test_sum();
char *all_tests() {
  do {
    char *run_test_msg = test_char_to_int();
    if (run_test_msg)
      return run_test_msg;
  } while (0);
  do {
    char *run_test_msg = test_int_to_char();
    if (run_test_msg)
      return run_test_msg;
  } while (0);
  do {
    char *run_test_msg = test_add_chars();
    if (run_test_msg)
      return run_test_msg;
  } while (0);
  do {
    char *run_test_msg = test_remove_leading_zero();
    if (run_test_msg)
      return run_test_msg;
  } while (0);
  do {
    char *run_test_msg = test_sum();
    if (run_test_msg)
      return run_test_msg;
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<all_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1050 <test_char_to_int@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117b <all_tests+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    123c <all_tests+0xec>
jmp    1180 <all_tests+0x30>
jmp    1185 <all_tests+0x35>
mov    $0x0,%al
call   1030 <test_int_to_char@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11a8 <all_tests+0x58>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    123c <all_tests+0xec>
jmp    11ad <all_tests+0x5d>
jmp    11b2 <all_tests+0x62>
mov    $0x0,%al
call   1040 <test_add_chars@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11d5 <all_tests+0x85>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    123c <all_tests+0xec>
jmp    11da <all_tests+0x8a>
jmp    11df <all_tests+0x8f>
mov    $0x0,%al
call   1070 <test_remove_leading_zero@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1202 <all_tests+0xb2>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    123c <all_tests+0xec>
jmp    1207 <all_tests+0xb7>
jmp    120c <all_tests+0xbc>
mov    $0x0,%al
call   1060 <test_sum@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     122f <all_tests+0xdf>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    123c <all_tests+0xec>
jmp    1234 <all_tests+0xe4>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_tests>:
push   %rax
xor    %eax,%eax
call   1050 <test_char_to_int@plt>
test   %rax,%rax
jne    1181 <all_tests+0x31>
xor    %eax,%eax
call   1030 <test_int_to_char@plt>
test   %rax,%rax
jne    1181 <all_tests+0x31>
xor    %eax,%eax
call   1040 <test_add_chars@plt>
test   %rax,%rax
jne    1181 <all_tests+0x31>
xor    %eax,%eax
call   1070 <test_remove_leading_zero@plt>
test   %rax,%rax
je     1183 <all_tests+0x33>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1060 <test_sum@plt>

LLVM IR (-O0):
define i8* @all_tests() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
br label %7
7: ; preds = %0
%8 = call i8* (...) @test_char_to_int()
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8*, i8** %2
store i8* %12, i8** %1
br label %47
13: ; preds = %7
br label %14
14: ; preds = %13
br label %15
15: ; preds = %14
%16 = call i8* (...) @test_int_to_char()
store i8* %16, i8** %3
%17 = load i8*, i8** %3
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i8*, i8** %3
store i8* %20, i8** %1
br label %47
21: ; preds = %15
br label %22
22: ; preds = %21
br label %23
23: ; preds = %22
%24 = call i8* (...) @test_add_chars()
store i8* %24, i8** %4
%25 = load i8*, i8** %4
%26 = icmp ne i8* %25, null
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = load i8*, i8** %4
store i8* %28, i8** %1
br label %47
29: ; preds = %23
br label %30
30: ; preds = %29
br label %31
31: ; preds = %30
%32 = call i8* (...) @test_remove_leading_zero()
store i8* %32, i8** %5
%33 = load i8*, i8** %5
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = load i8*, i8** %5
store i8* %36, i8** %1
br label %47
37: ; preds = %31
br label %38
38: ; preds = %37
br label %39
39: ; preds = %38
%40 = call i8* (...) @test_sum()
store i8* %40, i8** %6
%41 = load i8*, i8** %6
%42 = icmp ne i8* %41, null
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = load i8*, i8** %6
store i8* %44, i8** %1
br label %47
45: ; preds = %39
br label %46
46: ; preds = %45
store i8* null, i8** %1
br label %47
47: ; preds = %46, %43, %35, %27, %19, %11
%48 = load i8*, i8** %1
ret i8* %48
}

LLVM IR (-O2):
define i8* @all_tests() {
%1 = tail call i8* (...) @test_char_to_int()
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %14
3: ; preds = %0
%4 = tail call i8* (...) @test_int_to_char()
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = tail call i8* (...) @test_add_chars()
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = tail call i8* (...) @test_remove_leading_zero()
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i8* (...) @test_sum()
br label %14
14: ; preds = %12, %9, %6, %3, %0
%15 = phi i8* [ %1, %0 ], [ %4, %3 ], [ %7, %6 ], [ %10, %9 ], [ %13, %12 ]
ret i8* %15
}