#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_ERR;
int /*<<< orphan*/ report(int /*<<< orphan*/, char *, char const *,
                          unsigned int, ...);
void log_assert(const char *reason, const char *source, unsigned line) {
  if (reason)
    report(LOG_ERR, "Internal inconsistency at %s:%u (%s)", source, line,
           reason);
  else
    report(LOG_ERR, "Internal inconsistency at %s:%u", source, line);
}


x86 assembly (clang, -O0):
<log_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1155 <log_assert+0x45>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xeb7(%rip),%rsi
mov    $0x0,%al
call   1030 <report@plt>
jmp    1173 <log_assert+0x63>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1030 <report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_assert>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%r8
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
test   %r8,%r8
je     1134 <log_assert+0x24>
lea    0xed3(%rip),%rsi
xor    %eax,%eax
jmp    1030 <report@plt>
lea    0xeea(%rip),%rsi
xor    %eax,%eax
jmp    1030 <report@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [37 x i8] c"Internal inconsistency at %s:%u (%s)\00"
@.str.1 = [32 x i8] c"Internal inconsistency at %s:%u\00"
define void @log_assert(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i32, i32* @LOG_ERR
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = load i8*, i8** %4
%14 = call i32 (i32, i8*, i8*, i32, ...) @report(i32 %10, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i8* %13)
br label %20
15: ; preds = %3
%16 = load i32, i32* @LOG_ERR
%17 = load i8*, i8** %5
%18 = load i32, i32* %6
%19 = call i32 (i32, i8*, i8*, i32, ...) @report(i32 %16, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %17, i32 %18)
br label %20
20: ; preds = %15, %9
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [37 x i8] c"Internal inconsistency at %s:%u (%s)\00"
@.str.1 = [32 x i8] c"Internal inconsistency at %s:%u\00"
define void @log_assert(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
%5 = load i32, i32* @LOG_ERR
br i1 %4, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (i32, i8*, i8*, i32, ...) @report(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
br label %10
8: ; preds = %3
%9 = tail call i32 (i32, i8*, i8*, i32, ...) @report(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %2)
br label %10
10: ; preds = %8, %6
ret void
}