#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 *, ...);
int /*<<< orphan*/ stdout;
void verify(int expression, char *message) {
  static int x = 0;
  printf("Test %d: %s...", x, message);
  if (expression)
    printf("passed.\n");
  else
    printf("FAILED.\n");
  fflush(stdout);
  x++;
}


x86 assembly (clang, -O0):
<verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eff(%rip),%esi
mov    -0x10(%rbp),%rdx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
je     1164 <verify+0x44>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1172 <verify+0x52>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2eae(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ea5(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify>:
push   %rbx
mov    %rsi,%rdx
mov    %edi,%ebx
mov    0x2f00(%rip),%esi
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
lea    0xebc(%rip),%rax
lea    0xebd(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
addl   $0x1,0x2ec4(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@verify.x = internal global i32 0
@.str = [15 x i8] c"Test %d: %s...\00"
@.str.1 = [9 x i8] c"passed.\0A\00"
@.str.2 = [9 x i8] c"FAILED.\0A\00"
@stdout = global i32 0
define void @verify(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @verify.x
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* @stdout
%16 = call i32 @fflush(i32 %15)
%17 = load i32, i32* @verify.x
%18 = add nsw i32 %17, 1
store i32 %18, i32* @verify.x
ret void
}

LLVM IR (-O2):
@verify.x = internal unnamed_addr global i32 0
@.str = [15 x i8] c"Test %d: %s...\00"
@stdout = global i32 0
@str = [8 x i8] c"FAILED.\00"
@str.3 = [8 x i8] c"passed.\00"
define void @verify(i32 %0, i8* %1) {
%3 = load i32, i32* @verify.x
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %1)
%5 = icmp eq i32 %0, 0
%6 = select i1 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
%8 = load i32, i32* @stdout
%9 = tail call i32 @fflush(i32 %8)
%10 = load i32, i32* @verify.x
%11 = add nsw i32 %10, 1
store i32 %11, i32* @verify.x
ret void
}