#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*/ LOG_CRIT;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ do_log(int /*<<< orphan*/, char *, char const *,
                          unsigned int, char const *, char *, char const *);
void __assert_fail(const char *assertion, const char *file, unsigned int line,
                   const char *function) {
  do_log(LOG_CRIT, "%s:%u: %s%sAssertion `%s' failed", file, line,
         function ? function : "", function ? ": " : "", assertion);
  abort();
}


x86 assembly (clang, -O0):
<__assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1169 <__assert_fail+0x49>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    1179 <__assert_fail+0x59>
lea    0xeb3(%rip),%rax
mov    %rax,-0x40(%rbp)
jmp    1179 <__assert_fail+0x59>
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%rdx
mov    -0x34(%rbp),%edi
mov    -0x40(%rbp),%r8
mov    -0x20(%rbp),%rsi
lea    0xe91(%rip),%r9
lea    0xe88(%rip),%rax
cmp    $0x0,%rsi
cmovne %rax,%r9
mov    -0x8(%rbp),%rax
lea    0xe54(%rip),%rsi
mov    %rax,(%rsp)
call   1040 <do_log@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__assert_fail>:
push   %rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    0x2eb8(%rip),%rax
test   %r8,%r8
lea    0xee9(%rip),%rsi
cmove  %rsi,%r8
mov    (%rax),%eax
lea    0xeda(%rip),%r9
cmove  %rsi,%r9
mov    %rdi,(%rsp)
lea    0xeaa(%rip),%rsi
mov    %eax,%edi
call   1040 <do_log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@LOG_CRIT = global i32 0
@.str = [33 x i8] c"%s:%u: %s%sAssertion `%s' failed\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [3 x i8] c": \00"
define void @__assert_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @LOG_CRIT
%6 = icmp eq i8* %3, null
%7 = select i1 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %3
%8 = select i1 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%9 = tail call i32 @do_log(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %7, i8* %8, i8* %0)
%10 = tail call i32 (...) @abort()
unreachable
}