#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*/ abort();
int /*<<< orphan*/ trace_printf(char *, char const *, char const *, int, char *,
                                char const *);
void __attribute__((noreturn))
__assert_func(const char *file, int line, const char *func,
              const char *failedexpr) {
  trace_printf("assertion \"%s\" failed: file \"%s\", line %d%s%s\n",
               failedexpr, file, line, func ? ", function: " : "",
               func ? func : "");
  abort();
}


x86 assembly (clang, -O0):
<__assert_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdx
lea    0xed6(%rip),%rax
lea    0xed0(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1183 <__assert_func+0x63>
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    1193 <__assert_func+0x73>
lea    0xea4(%rip),%rax
mov    %rax,-0x48(%rbp)
jmp    1193 <__assert_func+0x73>
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%ecx
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%r9
lea    0xe53(%rip),%rdi
call   1040 <trace_printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__assert_func>:
push   %rax
mov    %esi,%r10d
mov    %rdi,%rax
test   %rdx,%rdx
lea    0xefd(%rip),%r9
lea    0xef7(%rip),%r8
cmove  %r9,%r8
cmovne %rdx,%r9
lea    0xeb9(%rip),%rdi
mov    %rcx,%rsi
mov    %rax,%rdx
mov    %r10d,%ecx
call   1040 <trace_printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"assertion \22%s\22 failed: file \22%s\22, line %d%s%s\0A\00"
@.str.1 = [13 x i8] c", function: \00"
@.str.2 = [1 x i8] zeroinitializer
define void @__assert_func(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%16 = load i8*, i8** %7
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %4
%19 = load i8*, i8** %7
br label %21
20: ; preds = %4
br label %21
21: ; preds = %20, %18
%22 = phi i8* [ %19, %18 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %20 ]
%23 = call i32 @trace_printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i32 %11, i8* %15, i8* %22)
%24 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [47 x i8] c"assertion \22%s\22 failed: file \22%s\22, line %d%s%s\0A\00"
@.str.1 = [13 x i8] c", function: \00"
@.str.2 = [1 x i8] zeroinitializer
define void @__assert_func(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = icmp eq i8* %2, null
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0)
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %2
%8 = tail call i32 @trace_printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %0, i32 %1, i8* %6, i8* %7)
%9 = tail call i32 (...) @abort()
unreachable
}