#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
int stub1();
bool run_test_case(bool test_suite_state, bool (*test_case_func)(),
                   char *test_case_name) {
  printf("%s: ", test_case_name);
  fflush(stdout);
  bool test_result = (*test_case_func)();
  printf("%s\n", (test_result ? "PASS" : "FAIL"));
  return test_suite_state && test_result;
}


x86 assembly (clang, -O0):
<run_test_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x0,%al
call   *-0x10(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
lea    0xeab(%rip),%rsi
lea    0xe9f(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x1d(%rbp)
je     1196 <run_test_case+0x76>
cmpl   $0x0,-0x1c(%rbp)
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_test_case>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
call   *%rbx
test   %eax,%eax
setne  %bl
lea    0xeb4(%rip),%rax
lea    0xeb2(%rip),%rsi
cmovne %rax,%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
test   %ebp,%ebp
setne  %al
and    %bl,%al
movzbl %al,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s: \00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c"PASS\00"
@.str.3 = [5 x i8] c"FAIL\00"
define i32 @run_test_case(i32 %0, i32 (...)* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32 (...)*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 (...)* %1, i32 (...)** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
%12 = load i32 (...)*, i32 (...)** %5
%13 = call i32 (...) %12()
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %3
%22 = load i32, i32* %7
%23 = icmp ne i32 %22, 0
br label %24
24: ; preds = %21, %3
%25 = phi i1 [ false, %3 ], [ %23, %21 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s: \00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c"PASS\00"
@.str.3 = [5 x i8] c"FAIL\00"
define i32 @run_test_case(i32 %0, i32 (...)* nocapture %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 (...) %1()
%8 = icmp ne i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = icmp ne i32 %0, 0
%12 = select i1 %11, i1 %8, i1 false
%13 = zext i1 %12 to i32
ret i32 %13
}