#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *, char *);
int /*<<< orphan*/ stderr;
void test_fail_null(const char *xstr, const char *message, const char *file,
                    int line, int not_null) {
  fprintf(stderr, "%s:%d: FAILED %s\n  got: %sNULL\n", file, line, message,
          not_null ? "" : "non-");
  exit(1);
}


x86 assembly (clang, -O0):
<test_fail_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    -0x20(%rbp),%esi
lea    0xec7(%rip),%r9
lea    0xebf(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r9
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<test_fail_null>:
push   %rax
mov    %rsi,%rax
mov    0x2eb5(%rip),%rsi
mov    (%rsi),%edi
test   %r8d,%r8d
lea    0xee9(%rip),%rsi
lea    0xee1(%rip),%r9
cmove  %rsi,%r9
lea    0xeb7(%rip),%rsi
mov    %rax,%r8
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"%s:%d: FAILED %s\0A got: %sNULL\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"non-\00"
define void @test_fail_null(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %8
%13 = load i32, i32* %9
%14 = load i8*, i8** %7
%15 = load i32, i32* %10
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%19 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13, i8* %14, i8* %18)
%20 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"%s:%d: FAILED %s\0A got: %sNULL\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"non-\00"
define void @test_fail_null(i8* nocapture readnone %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = load i32, i32* @stderr
%7 = icmp eq i32 %4, 0
%8 = select i1 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %1, i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
}