int main(int argc, char *argv[]) {
  char *p;
  p = debug_malloc(
      1024,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/millken/c-example/refs/heads/master/malloc.c",
      28, __func__);
  do {
    printf("%s:%d:%s:free(0x%lx)\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/millken/c-example/refs/heads/master/"
           "malloc.c",
           29, __func__, (unsigned long)p);
    free(p);
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400,%edi
lea    0xeae(%rip),%rsi
mov    $0x1c,%edx
lea    0xf29(%rip),%rcx
mov    $0x0,%al
call   1050 <debug_malloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%r8
lea    0xf16(%rip),%rdi
lea    0xe83(%rip),%rsi
mov    $0x1d,%edx
lea    0xefe(%rip),%rcx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xec4(%rip),%r15
lea    0xf44(%rip),%r14
mov    $0x400,%edi
mov    %r15,%rsi
mov    $0x1c,%edx
mov    %r14,%rcx
xor    %eax,%eax
call   1050 <debug_malloc@plt>
movslq %eax,%rbx
lea    0xf28(%rip),%rdi
mov    %r15,%rsi
mov    $0x1d,%edx
mov    %r14,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/millken/c-example/refs/heads/master/malloc.c\00"
@__func__.main = [5 x i8] c"main\00"
@.str.1 = [22 x i8] c"%s:%d:%s:free(0x%lx)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @debug_malloc to i32 (i32, i8*, i32, i8*, ...)*)(i32 1024, i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0), i32 28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %6
br label %10
10: ; preds = %2
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i64
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0), i32 29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i64 %12)
%14 = load i8*, i8** %6
br label %15
15: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/millken/c-example/refs/heads/master/malloc.c\00"
@__func__.main = [5 x i8] c"main\00"
@.str.1 = [22 x i8] c"%s:%d:%s:free(0x%lx)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @debug_malloc to i32 (i32, i8*, i32, i8*, ...)*)(i32 1024, i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0), i32 28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0), i32 29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i64 %4)
tail call void @free(i8* %5)
ret i32 0
}