#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*/ customFree(int *, char *, int);
scalar_t__ customMalloc(int, char *, int);
void redundantly_free() {
  int *y = (int *)customMalloc(
      100,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/refs/"
      "heads/master/EnhancedMalloc/src/main.c",
      18);
  ;
  customFree(y,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/"
             "refs/heads/master/EnhancedMalloc/src/main.c",
             19);
  ;
  customFree(y,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/"
             "refs/heads/master/EnhancedMalloc/src/main.c",
             20);
  ;
}


x86 assembly (clang, -O0):
<redundantly_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
lea    0xecc(%rip),%rsi
mov    $0x12,%edx
call   1030 <customMalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x13,%edx
call   1040 <customFree@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9e(%rip),%rsi
mov    $0x14,%edx
call   1040 <customFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redundantly_free>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
mov    $0x64,%edi
mov    %r14,%rsi
mov    $0x12,%edx
call   1030 <customMalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x13,%edx
call   1040 <customFree@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x14,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <customFree@plt>

LLVM IR (-O0):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/refs/heads/master/EnhancedMalloc/src/main.c\00"
define void @redundantly_free() {
%1 = alloca i32*
%2 = call i64 @customMalloc(i32 100, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 18)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @customFree(i32* %4, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 19)
%6 = load i32*, i32** %1
%7 = call i32 @customFree(i32* %6, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 20)
ret void
}

LLVM IR (-O2):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/refs/heads/master/EnhancedMalloc/src/main.c\00"
define void @redundantly_free() {
%1 = tail call i64 @customMalloc(i32 100, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 18)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @customFree(i32* %2, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 19)
%4 = tail call i32 @customFree(i32* %2, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 20)
ret void
}