void __attribute__((__noreturn__))
wa_assert_fail(const char *file, int line, const char *function,
               const char *expr) {
  _wa_log_msg("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jamesodhunt/wrapalloc/refs/heads/"
              "master/src/wa_util.c",
              111, __func__,
              "ERROR: "
              "Assertion failure: %s:%d:%s:%s\n",
              file, line, function, expr);
  abort();
}


x86 assembly (clang, -O0):
<wa_assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%r8
mov    -0xc(%rbp),%r9d
mov    -0x18(%rbp),%r10
mov    -0x20(%rbp),%rax
lea    0xeb2(%rip),%rdi
mov    $0x6f,%esi
lea    0xf36(%rip),%rdx
lea    0xf3e(%rip),%rcx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1040 <_wa_log_msg@plt>
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<wa_assert_fail>:
push   %rax
mov    %rcx,%r10
mov    %rdx,%r11
mov    %esi,%r9d
mov    %rdi,%r8
lea    0xecc(%rip),%rdi
lea    0xf55(%rip),%rdx
lea    0xf5d(%rip),%rcx
mov    $0x6f,%esi
xor    %eax,%eax
push   %r10
push   %r11
call   1040 <_wa_log_msg@plt>
add    $0x10,%rsp
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jamesodhunt/wrapalloc/refs/heads/master/src/wa_util.c\00"
@__func__.wa_assert_fail = [15 x i8] c"wa_assert_fail\00"
@.str.1 = [39 x i8] c"ERROR: Assertion failure: %s:%d:%s:%s\0A\00"
define void @wa_assert_fail(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** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 (i8*, i32, i8*, i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_wa_log_msg to i32 (i8*, i32, i8*, i8*, i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 111, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.wa_assert_fail, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %9, i32 %10, i8* %11, i8* %12)
unreachable
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jamesodhunt/wrapalloc/refs/heads/master/src/wa_util.c\00"
@__func__.wa_assert_fail = [15 x i8] c"wa_assert_fail\00"
@.str.1 = [39 x i8] c"ERROR: Assertion failure: %s:%d:%s:%s\0A\00"
define void @wa_assert_fail(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 (i8*, i32, i8*, i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_wa_log_msg to i32 (i8*, i32, i8*, i8*, i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 111, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.wa_assert_fail, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i8* %3)
tail call void @abort()
unreachable
}