#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*/ panic1(char *, int, char *, char *);
void *realloc(void *, long);
void *Marraygrow(void *p, long size) {
  if (!(p = realloc(p, size)))
    panic1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/tomgr/graphviz-cmake/refs/heads/master/"
           "cmd/lefty/mem.c",
           179, "Marrayreallocate", "cannot re-allocate array");
  return p;
}


x86 assembly (clang, -O0):
<Marraygrow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    116a <Marraygrow+0x4a>
lea    0xeae(%rip),%rdi
mov    $0xb3,%esi
lea    0xf33(%rip),%rdx
lea    0xf3d(%rip),%rcx
call   1030 <panic1@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Marraygrow>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114d <Marraygrow+0x2d>
lea    0xecb(%rip),%rdi
lea    0xf55(%rip),%rdx
lea    0xf5f(%rip),%rcx
mov    $0xb3,%esi
call   1030 <panic1@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tomgr/graphviz-cmake/refs/heads/master/cmd/lefty/mem.c\00"
@.str.1 = [17 x i8] c"Marrayreallocate\00"
@.str.2 = [25 x i8] c"cannot re-allocate array\00"
define i8* @Marraygrow(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @panic1(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 179, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tomgr/graphviz-cmake/refs/heads/master/cmd/lefty/mem.c\00"
@.str.1 = [17 x i8] c"Marrayreallocate\00"
@.str.2 = [25 x i8] c"cannot re-allocate array\00"
define noalias i8* @Marraygrow(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @panic1(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 179, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}