#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*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ stderr;
void mem_free(void *ptr, const char *filename, unsigned long line) {
  ((void)((ptr != NULL) ||
          (fprintf(stderr, "%s:%d Assertion failed: %s\n",
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/ajholanda/edu-C/refs/"
                   "heads/master/mem/mem.c",
                   40, "ptr != NULL"),
           abort(), 0)));
  free(ptr);
}


x86 assembly (clang, -O0):
<mem_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117e <mem_free+0x4e>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
lea    0xeb6(%rip),%rdx
mov    $0x28,%ecx
lea    0xf30(%rip),%r8
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_free>:
test   %rdi,%rdi
je     113a <mem_free+0xa>
jmp    1030 <free@plt>
push   %rax
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
lea    0xeca(%rip),%rdx
lea    0xf49(%rip),%r8
mov    $0x28,%ecx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"%s:%d Assertion failed: %s\0A\00"
@.str.1 = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ajholanda/edu-C/refs/heads/master/mem/mem.c\00"
@.str.2 = [12 x i8] c"ptr != NULL\00"
define void @mem_free(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %14, label %9
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.1, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (...) @abort()
unreachable
13: ; No predecessors!
br label %14
14: ; preds = %13, %3
%15 = phi i1 [ true, %3 ], [ false, %13 ]
%16 = zext i1 %15 to i32
%17 = load i8*, i8** %4
%18 = call i32 @free(i8* %17)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"%s:%d Assertion failed: %s\0A\00"
@.str.1 = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ajholanda/edu-C/refs/heads/master/mem/mem.c\00"
@.str.2 = [12 x i8] c"ptr != NULL\00"
define void @mem_free(i8* %0, i8* nocapture readnone %1, i64 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.1, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %3
%10 = tail call i32 @free(i8* %0)
ret void
}