#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_segment_code();
char *test_segment_data();
char *test_segment_lifecycle();
char *test_segment_text();
char *all_tests(void) {
  do {
    char *message = test_segment_lifecycle();
    if (message)
      return message;
  } while (0);
  do {
    char *message = test_segment_text();
    if (message)
      return message;
  } while (0);
  do {
    char *message = test_segment_data();
    if (message)
      return message;
  } while (0);
  do {
    char *message = test_segment_code();
    if (message)
      return message;
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<all_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1060 <test_segment_lifecycle@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <all_tests+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11ff <all_tests+0xbf>
jmp    1170 <all_tests+0x30>
jmp    1175 <all_tests+0x35>
mov    $0x0,%al
call   1040 <test_segment_text@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1198 <all_tests+0x58>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11ff <all_tests+0xbf>
jmp    119d <all_tests+0x5d>
jmp    11a2 <all_tests+0x62>
mov    $0x0,%al
call   1050 <test_segment_data@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11c5 <all_tests+0x85>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11ff <all_tests+0xbf>
jmp    11ca <all_tests+0x8a>
jmp    11cf <all_tests+0x8f>
mov    $0x0,%al
call   1030 <test_segment_code@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11f2 <all_tests+0xb2>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11ff <all_tests+0xbf>
jmp    11f7 <all_tests+0xb7>
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   1060 <test_segment_lifecycle@plt>
test   %rax,%rax
jne    1165 <all_tests+0x25>
xor    %eax,%eax
call   1040 <test_segment_text@plt>
test   %rax,%rax
jne    1165 <all_tests+0x25>
xor    %eax,%eax
call   1050 <test_segment_data@plt>
test   %rax,%rax
je     1167 <all_tests+0x27>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_segment_code@plt>

LLVM IR (-O0):
define i8* @all_tests() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
br label %6
6: ; preds = %0
%7 = call i8* (...) @test_segment_lifecycle()
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = load i8*, i8** %2
store i8* %11, i8** %1
br label %38
12: ; preds = %6
br label %13
13: ; preds = %12
br label %14
14: ; preds = %13
%15 = call i8* (...) @test_segment_text()
store i8* %15, i8** %3
%16 = load i8*, i8** %3
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i8*, i8** %3
store i8* %19, i8** %1
br label %38
20: ; preds = %14
br label %21
21: ; preds = %20
br label %22
22: ; preds = %21
%23 = call i8* (...) @test_segment_data()
store i8* %23, i8** %4
%24 = load i8*, i8** %4
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = load i8*, i8** %4
store i8* %27, i8** %1
br label %38
28: ; preds = %22
br label %29
29: ; preds = %28
br label %30
30: ; preds = %29
%31 = call i8* (...) @test_segment_code()
store i8* %31, i8** %5
%32 = load i8*, i8** %5
%33 = icmp ne i8* %32, null
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = load i8*, i8** %5
store i8* %35, i8** %1
br label %38
36: ; preds = %30
br label %37
37: ; preds = %36
store i8* null, i8** %1
br label %38
38: ; preds = %37, %34, %26, %18, %10
%39 = load i8*, i8** %1
ret i8* %39
}

LLVM IR (-O2):
define i8* @all_tests() {
%1 = tail call i8* (...) @test_segment_lifecycle()
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %11
3: ; preds = %0
%4 = tail call i8* (...) @test_segment_text()
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = tail call i8* (...) @test_segment_data()
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i8* (...) @test_segment_code()
br label %11
11: ; preds = %9, %6, %3, %0
%12 = phi i8* [ %1, %0 ], [ %4, %3 ], [ %7, %6 ], [ %10, %9 ]
ret i8* %12
}