#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 */
scalar_t__ FerMem_Malloc(int, char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void dynmem_make_ptr_array_(int *n, float ***mr_ptrs_ptr, int *status) {
  int size;
  float **mr_ptrs;
  *status = 437;
  size = *n * sizeof(float *);
  mr_ptrs = (float **)FerMem_Malloc(
      size,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/NOAA-PMEL/Ferret/refs/heads/master/fer/ccr/"
      "dynmemUtil.c",
      77);
  if (mr_ptrs == NULL) {
    fprintf(stderr, "**ERROR in dynmem_make_ptr_array");
    return;
  }
  *mr_ptrs_ptr = mr_ptrs;
  *status = 3;
}


x86 assembly (clang, -O0):
<dynmem_make_ptr_array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x1b5,(%rax)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
lea    0xeaa(%rip),%rsi
mov    $0x4d,%edx
call   1030 <FerMem_Malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1189 <dynmem_make_ptr_array_+0x69>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    0xf13(%rip),%rsi
call   1040 <fprintf@plt>
jmp    119e <dynmem_make_ptr_array_+0x7e>
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynmem_make_ptr_array_>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
movl   $0x1b5,(%rdx)
mov    (%rdi),%edi
shl    $0x3,%edi
lea    0xec4(%rip),%rsi
mov    $0x4d,%edx
call   1030 <FerMem_Malloc@plt>
test   %rax,%rax
je     115c <dynmem_make_ptr_array_+0x3c>
mov    %rax,(%r14)
movl   $0x3,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xf26(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NOAA-PMEL/Ferret/refs/heads/master/fer/ccr/dynmemUtil.c\00"
@stderr = global i32 0
@.str.1 = [33 x i8] c"**ERROR in dynmem_make_ptr_array\00"
define void @dynmem_make_ptr_array_(i32* %0, float*** %1, i32* %2) {
%4 = alloca i32*
%5 = alloca float***
%6 = alloca i32*
%7 = alloca i32
%8 = alloca float**
store i32* %0, i32** %4
store float*** %1, float**** %5
store i32* %2, i32** %6
%9 = load i32*, i32** %6
store i32 437, i32* %9
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 8
%14 = trunc i64 %13 to i32
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = call i64 @FerMem_Malloc(i32 %15, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 77)
%17 = inttoptr i64 %16 to float**
store float** %17, float*** %8
%18 = load float**, float*** %8
%19 = icmp eq float** %18, null
br i1 %19, label %20, label %23
20: ; preds = %3
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %27
23: ; preds = %3
%24 = load float**, float*** %8
%25 = load float***, float**** %5
store float** %24, float*** %25
%26 = load i32*, i32** %6
store i32 3, i32* %26
br label %27
27: ; preds = %23, %20
ret void
}

LLVM IR (-O2):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NOAA-PMEL/Ferret/refs/heads/master/fer/ccr/dynmemUtil.c\00"
@stderr = global i32 0
@.str.1 = [33 x i8] c"**ERROR in dynmem_make_ptr_array\00"
define void @dynmem_make_ptr_array_(i32* nocapture %0, float*** nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 437, i32* %2
%4 = load i32, i32* %0
%5 = shl i32 %4, 3
%6 = tail call i64 @FerMem_Malloc(i32 %5, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 77)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %3
%12 = inttoptr i64 %6 to float**
store float** %12, float*** %1
store i32 3, i32* %2
br label %13
13: ; preds = %11, %8
ret void
}