#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*/ TESTError_Fail(char *, char const *, int, char const *);
int /*<<< orphan*/ TESTError_Get();
int /*<<< orphan*/ TESTError_Recover();
int AssertFailure(int line, const char *file, const char *function) {
  if (!TESTError_Get()) {
    TESTError_Fail("%s:%d> %s() FAILED: Should have failed, bud didn't\n", file,
                   line, function);
    return 0;
  }
  TESTError_Recover();
  return 1;
}


x86 assembly (clang, -O0):
<AssertFailure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <TESTError_Get@plt>
cmp    $0x0,%eax
jne    1176 <AssertFailure+0x46>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xe9b(%rip),%rdi
call   1050 <TESTError_Fail@plt>
movl   $0x0,-0x4(%rbp)
jmp    1184 <AssertFailure+0x54>
mov    $0x0,%al
call   1040 <TESTError_Recover@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AssertFailure>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <TESTError_Get@plt>
test   %eax,%eax
je     115a <AssertFailure+0x2a>
xor    %eax,%eax
call   1040 <TESTError_Recover@plt>
mov    $0x1,%ebx
jmp    116e <AssertFailure+0x3e>
lea    0xe9f(%rip),%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
call   1050 <TESTError_Fail@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [52 x i8] c"%s:%d> %s() FAILED: Should have failed, bud didn't\0A\00"
define i32 @AssertFailure(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = call i32 (...) @TESTError_Get()
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = load i32, i32* %5
%13 = load i8*, i8** %7
%14 = call i32 @TESTError_Fail(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i8* %13)
store i32 0, i32* %4
br label %17
15: ; preds = %3
%16 = call i32 (...) @TESTError_Recover()
store i32 1, i32* %4
br label %17
17: ; preds = %15, %10
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@.str = [52 x i8] c"%s:%d> %s() FAILED: Should have failed, bud didn't\0A\00"
define i32 @AssertFailure(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 (...) @TESTError_Get()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @TESTError_Fail(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %0, i8* %2)
br label %10
8: ; preds = %3
%9 = tail call i32 (...) @TESTError_Recover()
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ 1, %8 ], [ 0, %6 ]
ret i32 %11
}