#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 fmap_test();
int /*<<< orphan*/ puts(char *);
int main(void) {
  int result = fmap_test();
  puts("");
  puts("===");
  puts("");
  if (!result)
    puts("RESULT: All unit tests PASSED.");
  else
    puts("RESULT: One or more tests FAILED!");
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fmap_test@plt>
mov    %eax,-0x8(%rbp)
lea    0xf04(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1178 <main+0x58>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
jmp    1184 <main+0x64>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <fmap_test@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
lea    0xea1(%rip),%rax
lea    0xeb9(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"===\00"
@.str.2 = [31 x i8] c"RESULT: All unit tests PASSED.\00"
@.str.3 = [34 x i8] c"RESULT: One or more tests FAILED!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @fmap_test()
store i32 %3, i32* %2
%4 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"===\00"
@.str.2 = [31 x i8] c"RESULT: All unit tests PASSED.\00"
@.str.3 = [34 x i8] c"RESULT: One or more tests FAILED!\00"
define i32 @main() {
%1 = tail call i32 (...) @fmap_test()
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
ret i32 %1
}