#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*/ x_msg(int, char *, char const *, int, ...);
void assert_failed(const char *filename, int line, const char *condition) {
  if (condition) {
    x_msg((1 << 4), "Assertion failed at %s:%d (%s)", filename, line,
          condition);
  } else {
    x_msg((1 << 4), "Assertion failed at %s:%d", filename, line);
  }
  _exit(1);
}


x86 assembly (clang, -O0):
<assert_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <assert_failed+0x41>
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    $0x10,%edi
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1040 <x_msg@plt>
jmp    117b <assert_failed+0x5b>
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x10,%edi
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1040 <x_msg@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<assert_failed>:
push   %rax
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
test   %r8,%r8
jne    114b <assert_failed+0x2b>
lea    0xeea(%rip),%rsi
mov    $0x10,%edi
xor    %eax,%eax
call   1040 <x_msg@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>
lea    0xeae(%rip),%rsi
mov    $0x10,%edi
xor    %eax,%eax
call   1040 <x_msg@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Assertion failed at %s:%d (%s)\00"
@.str.1 = [26 x i8] c"Assertion failed at %s:%d\00"
define void @assert_failed(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i8*, i8** %6
%13 = call i32 (i32, i8*, i8*, i32, ...) @x_msg(i32 16, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12)
br label %18
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = call i32 (i32, i8*, i8*, i32, ...) @x_msg(i32 16, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %15, i32 %16)
br label %18
18: ; preds = %14, %9
%19 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"Assertion failed at %s:%d (%s)\00"
@.str.1 = [26 x i8] c"Assertion failed at %s:%d\00"
define void @assert_failed(i8* %0, i32 %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i32, i8*, i8*, i32, ...) @x_msg(i32 16, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
br label %9
7: ; preds = %3
%8 = tail call i32 (i32, i8*, i8*, i32, ...) @x_msg(i32 16, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1)
br label %9
9: ; preds = %7, %5
%10 = tail call i32 @_exit(i32 1)
unreachable
}