#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*/ my_free(int, char *, int);
int /*<<< orphan*/ printf(char *);
void freeing_pointers_not_allocated() {
  printf("\n--------------------------------");
  printf("\nBegin **freeing pointer not allocated** test. \n\n");
  printf("You should expect to see a denied free \n\n");
  int x;
  my_free(
      x,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/PLJNS/Rutgers-Systems-Programming-Fall-2013/"
      "refs/heads/master/Malloc/testcases.c",
      13);
  printf("\nEnd **freeing porinter not allocated** test.");
  printf("\n------------------------------\n\n");
}


x86 assembly (clang, -O0):
<freeing_pointers_not_allocated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
lea    0xf28(%rip),%rsi
mov    $0xd,%edx
call   1040 <my_free@plt>
lea    0xfc2(%rip),%rdi
call   1030 <printf@plt>
lea    0xfe4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeing_pointers_not_allocated>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xfb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xfdc(%rip),%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rsi
mov    $0xd,%edx
call   1050 <my_free@plt>
lea    0xf60(%rip),%rdi
call   1040 <printf@plt>
lea    0xfdc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0A--------------------------------\00"
@.str.1 = [50 x i8] c"\0ABegin **freeing pointer not allocated** test. \0A\0A\00"
@.str.2 = [42 x i8] c"You should expect to see a denied free \0A\0A\00"
@.str.3 = [171 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PLJNS/Rutgers-Systems-Programming-Fall-2013/refs/heads/master/Malloc/testcases.c\00"
@.str.4 = [46 x i8] c"\0AEnd **freeing porinter not allocated** test.\00"
@.str.5 = [34 x i8] c"\0A------------------------------\0A\0A\00"
define void @freeing_pointers_not_allocated() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = call i32 @my_free(i32 %5, i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.3, i64 0, i64 0), i32 13)
%7 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0A--------------------------------\00"
@.str.3 = [171 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PLJNS/Rutgers-Systems-Programming-Fall-2013/refs/heads/master/Malloc/testcases.c\00"
@.str.4 = [46 x i8] c"\0AEnd **freeing porinter not allocated** test.\00"
@str = [49 x i8] c"\0ABegin **freeing pointer not allocated** test. \0A\00"
@str.6 = [41 x i8] c"You should expect to see a denied free \0A\00"
@str.7 = [33 x i8] c"\0A------------------------------\0A\00"
define void @freeing_pointers_not_allocated() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @my_free(i32 undef, i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.3, i64 0, i64 0), i32 13)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.7, i64 0, i64 0))
ret void
}