#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(int /*<<< orphan*/, char *, int, char *, void *,
                        char const *, int);
int /*<<< orphan*/ _np_assert(char *, char *, int, int);
int /*<<< orphan*/ free(void *);
void _np_free(void *ptr, const char *fname, int line) {
  do {
    if (!(ptr != NULL)) {
      _np_assert("ptr != NULL",
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/kenshinx/nproxy/refs/heads/"
                 "master/src/util.c",
                 72, 1);
    }
  } while (0);
  do {
    _log(0,
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/kenshinx/nproxy/refs/heads/master/src/"
         "util.c",
         73, "free(%p) @ %s:%d", ptr, fname, line);
  } while (0);
  free(ptr);
  ptr = NULL;
}


x86 assembly (clang, -O0):
<_np_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    116b <_np_free+0x3b>
lea    0xeab(%rip),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x48,%edx
mov    $0x1,%ecx
call   1050 <_np_assert@plt>
jmp    1170 <_np_free+0x40>
jmp    1175 <_np_free+0x45>
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x14(%rbp),%eax
xor    %edi,%edi
lea    0xe83(%rip),%rsi
mov    $0x49,%edx
lea    0xefe(%rip),%rcx
mov    %eax,(%rsp)
call   1040 <_log@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_np_free>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1162 <_np_free+0x32>
lea    0xeb4(%rip),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x48,%edx
mov    $0x1,%ecx
call   1050 <_np_assert@plt>
mov    %ebp,(%rsp)
lea    0xea0(%rip),%rsi
lea    0xf20(%rip),%rcx
xor    %edi,%edi
mov    $0x49,%edx
mov    %rbx,%r8
mov    %r14,%r9
call   1040 <_log@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"ptr != NULL\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kenshinx/nproxy/refs/heads/master/src/util.c\00"
@.str.2 = [17 x i8] c"free(%p) @ %s:%d\00"
define void @_np_free(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
br label %7
7: ; preds = %3
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = call i32 @_np_assert(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 72, i32 1)
br label %12
12: ; preds = %10, %7
br label %13
13: ; preds = %12
br label %14
14: ; preds = %13
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i32, i32* %6
%18 = call i32 @_log(i32 0, i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 73, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %15, i8* %16, i32 %17)
br label %19
19: ; preds = %14
%20 = load i8*, i8** %4
%21 = call i32 @free(i8* %20)
store i8* null, i8** %4
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"ptr != NULL\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kenshinx/nproxy/refs/heads/master/src/util.c\00"
@.str.2 = [17 x i8] c"free(%p) @ %s:%d\00"
define void @_np_free(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @_np_assert(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 72, i32 1)
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @_log(i32 0, i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 73, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%9 = tail call i32 @free(i8* %0)
ret void
}