#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*/ printf(char *);
scalar_t__ test_each();
scalar_t__ test_filter();
scalar_t__ test_fold_right();
scalar_t__ test_map();
scalar_t__ test_minmax();
int main(void) {
  do {
    printf("Running "
           "test_fold_right()"
           "...");
    if (test_fold_right()) {
      printf(" passed!\n");
    } else {
      printf(" failed!\n");
    }
  } while (0);
  do {
    printf("Running "
           "test_each()"
           "...");
    if (test_each()) {
      printf(" passed!\n");
    } else {
      printf(" failed!\n");
    }
  } while (0);
  do {
    printf("Running "
           "test_minmax()"
           "...");
    if (test_minmax()) {
      printf(" passed!\n");
    } else {
      printf(" failed!\n");
    }
  } while (0);
  do {
    printf("Running "
           "test_filter()"
           "...");
    if (test_filter()) {
      printf(" passed!\n");
    } else {
      printf(" failed!\n");
    }
  } while (0);
  do {
    printf("Running "
           "test_map()"
           "...");
    if (test_map()) {
      printf(" passed!\n");
    } else {
      printf(" failed!\n");
    }
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <test_fold_right@plt>
cmp    $0x0,%rax
je     119d <main+0x3d>
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
jmp    11a9 <main+0x49>
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
jmp    11ae <main+0x4e>
jmp    11b3 <main+0x53>
lea    0xe77(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <test_each@plt>
cmp    $0x0,%rax
je     11e1 <main+0x81>
lea    0xe46(%rip),%rdi
call   1050 <printf@plt>
jmp    11ed <main+0x8d>
lea    0xe3f(%rip),%rdi
call   1050 <printf@plt>
jmp    11f2 <main+0x92>
jmp    11f7 <main+0x97>
lea    0xe4a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <test_minmax@plt>
cmp    $0x0,%rax
je     1225 <main+0xc5>
lea    0xe02(%rip),%rdi
call   1050 <printf@plt>
jmp    1231 <main+0xd1>
lea    0xdfb(%rip),%rdi
call   1050 <printf@plt>
jmp    1236 <main+0xd6>
jmp    123b <main+0xdb>
lea    0xe1f(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <test_filter@plt>
cmp    $0x0,%rax
je     1269 <main+0x109>
lea    0xdbe(%rip),%rdi
call   1050 <printf@plt>
jmp    1275 <main+0x115>
lea    0xdb7(%rip),%rdi
call   1050 <printf@plt>
jmp    127a <main+0x11a>
jmp    127f <main+0x11f>
lea    0xdf4(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1080 <test_map@plt>
cmp    $0x0,%rax
je     12ad <main+0x14d>
lea    0xd7a(%rip),%rdi
call   1050 <printf@plt>
jmp    12b9 <main+0x159>
lea    0xd73(%rip),%rdi
call   1050 <printf@plt>
jmp    12be <main+0x15e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xe85(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <test_fold_right@plt>
test   %rax,%rax
lea    0xeeb(%rip),%r14
lea    0xeed(%rip),%rbx
mov    %rbx,%rdi
cmove  %r14,%rdi
call   1030 <puts@plt>
lea    0xe72(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1050 <test_each@plt>
test   %rax,%rax
mov    %rbx,%rdi
cmove  %r14,%rdi
call   1030 <puts@plt>
lea    0xe67(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1040 <test_minmax@plt>
test   %rax,%rax
mov    %rbx,%rdi
cmove  %r14,%rdi
call   1030 <puts@plt>
lea    0xe5e(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1080 <test_filter@plt>
test   %rax,%rax
mov    %rbx,%rdi
cmove  %r14,%rdi
call   1030 <puts@plt>
lea    0xe55(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1090 <test_map@plt>
test   %rax,%rax
cmove  %r14,%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Running test_fold_right()...\00"
@.str.1 = [10 x i8] c" passed!\0A\00"
@.str.2 = [10 x i8] c" failed!\0A\00"
@.str.3 = [23 x i8] c"Running test_each()...\00"
@.str.4 = [25 x i8] c"Running test_minmax()...\00"
@.str.5 = [25 x i8] c"Running test_filter()...\00"
@.str.6 = [22 x i8] c"Running test_map()...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i64 (...) @test_fold_right()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%14 = call i64 (...) @test_each()
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %20
18: ; preds = %12
%19 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
br label %21
21: ; preds = %20
br label %22
22: ; preds = %21
%23 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%24 = call i64 (...) @test_minmax()
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %30
28: ; preds = %22
%29 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %28, %26
br label %31
31: ; preds = %30
br label %32
32: ; preds = %31
%33 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%34 = call i64 (...) @test_filter()
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %40
38: ; preds = %32
%39 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
br label %41
41: ; preds = %40
br label %42
42: ; preds = %41
%43 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%44 = call i64 (...) @test_map()
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %42
%47 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %50
48: ; preds = %42
%49 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %50
50: ; preds = %48, %46
br label %51
51: ; preds = %50
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Running test_fold_right()...\00"
@.str.3 = [23 x i8] c"Running test_each()...\00"
@.str.4 = [25 x i8] c"Running test_minmax()...\00"
@.str.5 = [25 x i8] c"Running test_filter()...\00"
@.str.6 = [22 x i8] c"Running test_map()...\00"
@str.10 = [9 x i8] c" failed!\00"
@str.15 = [9 x i8] c" passed!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 (...) @test_fold_right()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.15, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i64 (...) @test_each()
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.15, i64 0, i64 0)
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%12 = tail call i64 (...) @test_minmax()
%13 = icmp eq i64 %12, 0
%14 = select i1 %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.15, i64 0, i64 0)
%15 = tail call i32 @puts(i8* dereferenceable(1) %14)
%16 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%17 = tail call i64 (...) @test_filter()
%18 = icmp eq i64 %17, 0
%19 = select i1 %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.15, i64 0, i64 0)
%20 = tail call i32 @puts(i8* dereferenceable(1) %19)
%21 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%22 = tail call i64 (...) @test_map()
%23 = icmp eq i64 %22, 0
%24 = select i1 %23, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.15, i64 0, i64 0)
%25 = tail call i32 @puts(i8* dereferenceable(1) %24)
ret i32 0
}