#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*/ printf(char *, ...);
scalar_t__ safe_calloc(int, int);
int /*<<< orphan*/ safe_free(void **);
scalar_t__ safe_realloc(int *, int);
int main(void) {
  int *p = ((int *)safe_calloc((4), sizeof(int)));
  p = ((int *)safe_realloc((p), (4) * sizeof(int)));
  (safe_free((void **)(&p)));
  int i = 5;
  printf("File: %s Line: %d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/chenxilinsidney/funnycprogram/refs/heads/"
         "master/GetGNU.c",
         17);
  printf("value "
         "i"
         " = "
         "%d"
         "\n",
         (i));
  printf("p = %p\n", p);
  printf("__GNUC__ = %d\n", 9);
  printf("__GNUC_MINOR__ = %d\n", 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%esi
mov    %esi,%edi
call   1040 <safe_calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1050 <safe_realloc@plt>
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1060 <safe_free@plt>
movl   $0x5,-0x14(%rbp)
lea    0xe78(%rip),%rdi
lea    0xe84(%rip),%rsi
mov    $0x11,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x9,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x4,%esi
call   1040 <safe_calloc@plt>
mov    %rax,%rdi
mov    $0x10,%esi
call   1050 <safe_realloc@plt>
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1060 <safe_free@plt>
lea    0xe90(%rip),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x11,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rsi
lea    0xf13(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"File: %s Line: %d\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/chenxilinsidney/funnycprogram/refs/heads/master/GetGNU.c\00"
@.str.2 = [14 x i8] c"value i = %d\0A\00"
@.str.3 = [8 x i8] c"p = %p\0A\00"
@.str.4 = [15 x i8] c"__GNUC__ = %d\0A\00"
@.str.5 = [21 x i8] c"__GNUC_MINOR__ = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 @safe_calloc(i32 4, i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = call i64 @safe_realloc(i32* %6, i32 16)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %2
%9 = bitcast i32** %2 to i8**
%10 = call i32 @safe_free(i8** %9)
store i32 5, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 17)
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = load i32*, i32** %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 9)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"File: %s Line: %d\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/chenxilinsidney/funnycprogram/refs/heads/master/GetGNU.c\00"
@.str.2 = [14 x i8] c"value i = %d\0A\00"
@.str.3 = [8 x i8] c"p = %p\0A\00"
@.str.4 = [15 x i8] c"__GNUC__ = %d\0A\00"
@.str.5 = [21 x i8] c"__GNUC_MINOR__ = %d\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = tail call i64 @safe_calloc(i32 4, i32 4)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i64 @safe_realloc(i32* %4, i32 16)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %1
%7 = bitcast i32** %1 to i8**
%8 = call i32 @safe_free(i8** %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 17)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 5)
%11 = load i32*, i32** %1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32* %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 9)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 4)
ret i32 0
}