#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*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *, ...);
int /*<<< orphan*/ stderr;
void _niceassert(long cond, int line, char const *file, char const *condstr,
                 char const *mesg) {
  if (cond)
    return;
  if (mesg) {
    fprintf(stderr, "%s:%d assertion ( %s ) failed: %s\n", file, line, condstr,
            mesg);
  } else {
    fprintf(stderr, "%s:%d assertion ( %s ) failed.\n", file, line, condstr);
  }
}


x86 assembly (clang, -O0):
<_niceassert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <_niceassert+0x2b>
jmp    1193 <_niceassert+0x83>
cmpq   $0x0,-0x28(%rbp)
je     1171 <_niceassert+0x61>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    0xe9b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1193 <_niceassert+0x83>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%r8
lea    0xe97(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_niceassert>:
test   %rdi,%rdi
je     1116 <_niceassert+0x6>
ret
mov    %r8,%r9
mov    %rcx,%r8
mov    %esi,%ecx
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
test   %r9,%r9
je     113a <_niceassert+0x2a>
lea    0xecd(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
lea    0xee2(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"%s:%d assertion ( %s ) failed: %s\0A\00"
@.str.1 = [32 x i8] c"%s:%d assertion ( %s ) failed.\0A\00"
define void @_niceassert(i64 %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i64 %0, i64* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i64, i64* %6
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %5
br label %30
14: ; preds = %5
%15 = load i8*, i8** %10
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %8
%20 = load i32, i32* %7
%21 = load i8*, i8** %9
%22 = load i8*, i8** %10
%23 = call i32 (i32, i8*, i8*, i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %19, i32 %20, i8* %21, i8* %22)
br label %30
24: ; preds = %14
%25 = load i32, i32* @stderr
%26 = load i8*, i8** %8
%27 = load i32, i32* %7
%28 = load i8*, i8** %9
%29 = call i32 (i32, i8*, i8*, i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %26, i32 %27, i8* %28)
br label %30
30: ; preds = %13, %24, %17
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"%s:%d assertion ( %s ) failed: %s\0A\00"
@.str.1 = [32 x i8] c"%s:%d assertion ( %s ) failed.\0A\00"
define void @_niceassert(i64 %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = icmp eq i64 %0, 0
br i1 %6, label %7, label %14
7: ; preds = %5
%8 = icmp eq i8* %4, null
%9 = load i32, i32* @stderr
br i1 %8, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %1, i8* %3, i8* %4)
br label %14
12: ; preds = %7
%13 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %1, i8* %3)
br label %14
14: ; preds = %5, %12, %10
ret void
}