#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 *, ...);
void TEST_execute(short (*funchandle)(), char *testname, short testid) {
  short status;
  printf("%02d  Testing %s...\n", testid, testname);
  status = funchandle();
  if (status != 0) {
    printf("     FAIL... error code %d... quitting\n", status);
    while (1)
      ;
    ;
  } else {
    printf("%s Test PASSED\n", testname);
  }
}


x86 assembly (clang, -O0):
<TEST_execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movswl -0x12(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   *-0x8(%rbp)
mov    %ax,-0x14(%rbp)
movswl -0x14(%rbp),%eax
cmp    $0x0,%eax
je     116a <TEST_execute+0x5a>
movswl -0x14(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1165 <TEST_execute+0x55>
mov    -0x10(%rbp),%rsi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_execute>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rdi
mov    %edx,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   *%rbx
test   %ax,%ax
je     1152 <TEST_execute+0x42>
movswl %ax,%esi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
nopw   0x0(%rax,%rax,1)
jmp    1150 <TEST_execute+0x40>
lea    0xee4(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"%02d Testing %s...\0A\00"
@.str.1 = [40 x i8] c" FAIL... error code %d... quitting\0A\00"
@.str.2 = [16 x i8] c"%s Test PASSED\0A\00"
define void @TEST_execute(i16 (...)* %0, i8* %1, i16 signext %2) {
%4 = alloca i16 (...)*
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
store i16 (...)* %0, i16 (...)** %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%8 = load i16, i16* %6
%9 = sext i16 %8 to i32
%10 = load i8*, i8** %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
%12 = load i16 (...)*, i16 (...)** %4
%13 = call signext i16 (...) %12()
store i16 %13, i16* %7
%14 = load i16, i16* %7
%15 = sext i16 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %3
%18 = load i16, i16* %7
%19 = sext i16 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %17, %21
br label %21
22: ; preds = %3
%23 = load i8*, i8** %5
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %22
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%02d Testing %s...\0A\00"
@.str.1 = [40 x i8] c" FAIL... error code %d... quitting\0A\00"
@.str.2 = [16 x i8] c"%s Test PASSED\0A\00"
define void @TEST_execute(i16 (...)* nocapture %0, i8* %1, i16 signext %2) {
%4 = sext i16 %2 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %1)
%6 = tail call signext i16 (...) %0()
%7 = icmp eq i16 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = sext i16 %6 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %3
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %1)
ret void
}