#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 */
void *malloc(int);
int /*<<< orphan*/ printInt(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printLnAndFile(char *, int, int);
int /*<<< orphan*/ printVoidSt(char *, int *, int /*<<< orphan*/);
double **newPDoubleDArea(int size, int *ret) {
  void *pTmp = NULL;
  if ((ret != NULL) && (size >= 0)) {
    pTmp = malloc(sizeof(double *) * size);
    if ((size != 0) && (pTmp == NULL)) {
      *ret = 0;
    } else {
    }
  } else if (ret != NULL) {
    *ret = 0;
    printInt("Error Cannot allocate space ,size:", size, 0);
    printLnAndFile(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/Chalearm/MachineLearning-/refs/heads/master/"
        "mProject/library_jui/dataStruct/src/basicVarArea.c",
        327, 1);
  } else {
    printVoidSt("Error ret is", ret, 0);
    printLnAndFile(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/Chalearm/MachineLearning-/refs/heads/master/"
        "mProject/library_jui/dataStruct/src/basicVarArea.c",
        332, 1);
  }
  return (double **)pTmp;
}


x86 assembly (clang, -O0):
<newPDoubleDArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11ad <newPDoubleDArea+0x6d>
cmpl   $0x0,-0x4(%rbp)
jl     11ad <newPDoubleDArea+0x6d>
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11a3 <newPDoubleDArea+0x63>
cmpq   $0x0,-0x18(%rbp)
jne    11a3 <newPDoubleDArea+0x63>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    11a8 <newPDoubleDArea+0x68>
jmp    11a8 <newPDoubleDArea+0x68>
jmp    121b <newPDoubleDArea+0xdb>
cmpq   $0x0,-0x10(%rbp)
je     11ee <newPDoubleDArea+0xae>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x4(%rbp),%esi
lea    0xe34(%rip),%rdi
xor    %edx,%edx
call   1030 <printInt@plt>
lea    0xe49(%rip),%rdi
mov    $0x147,%esi
mov    $0x1,%edx
call   1060 <printLnAndFile@plt>
jmp    1216 <newPDoubleDArea+0xd6>
mov    -0x10(%rbp),%rsi
lea    0xee3(%rip),%rdi
xor    %edx,%edx
call   1040 <printVoidSt@plt>
lea    0xe1c(%rip),%rdi
mov    $0x14c,%esi
mov    $0x1,%edx
call   1060 <printLnAndFile@plt>
jmp    121b <newPDoubleDArea+0xdb>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newPDoubleDArea>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %edi,%ebx
test   %edi,%edi
js     1177 <newPDoubleDArea+0x37>
test   %r15,%r15
je     1177 <newPDoubleDArea+0x37>
lea    0x0(,%rbx,8),%edi
call   1050 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
je     11cd <newPDoubleDArea+0x8d>
test   %r14,%r14
jne    11cd <newPDoubleDArea+0x8d>
movl   $0x0,(%r15)
xor    %r14d,%r14d
jmp    11cd <newPDoubleDArea+0x8d>
test   %r15,%r15
je     11a4 <newPDoubleDArea+0x64>
movl   $0x0,(%r15)
lea    0xe76(%rip),%rdi
xor    %r14d,%r14d
mov    %ebx,%esi
xor    %edx,%edx
call   1030 <printInt@plt>
lea    0xe86(%rip),%rdi
mov    $0x147,%esi
jmp    11c3 <newPDoubleDArea+0x83>
lea    0xf31(%rip),%rdi
xor    %r14d,%r14d
xor    %esi,%esi
xor    %edx,%edx
call   1040 <printVoidSt@plt>
lea    0xe65(%rip),%rdi
mov    $0x14c,%esi
mov    $0x1,%edx
call   1060 <printLnAndFile@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Error Cannot allocate space ,size:\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chalearm/MachineLearning-/refs/heads/master/mProject/library_jui/dataStruct/src/basicVarArea.c\00"
@.str.2 = [13 x i8] c"Error ret is\00"
define double** @newPDoubleDArea(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
store i32 %0, i32* %3
store i32* %1, i32** %4
store i8* null, i8** %5
%6 = load i32*, i32** %4
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %26
8: ; preds = %2
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = mul i64 8, %13
%15 = trunc i64 %14 to i32
%16 = call i8* @malloc(i32 %15)
store i8* %16, i8** %5
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %11
%20 = load i8*, i8** %5
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = load i32*, i32** %4
store i32 0, i32* %23
br label %25
24: ; preds = %19, %11
br label %25
25: ; preds = %24, %22
br label %39
26: ; preds = %8, %2
%27 = load i32*, i32** %4
%28 = icmp ne i32* %27, null
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = load i32*, i32** %4
store i32 0, i32* %30
%31 = load i32, i32* %3
%32 = call i32 @printInt(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %31, i32 0)
%33 = call i32 @printLnAndFile(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 327, i32 1)
br label %38
34: ; preds = %26
%35 = load i32*, i32** %4
%36 = call i32 @printVoidSt(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %35, i32 0)
%37 = call i32 @printLnAndFile(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 332, i32 1)
br label %38
38: ; preds = %34, %29
br label %39
39: ; preds = %38, %25
%40 = load i8*, i8** %5
%41 = bitcast i8* %40 to double**
ret double** %41
}

LLVM IR (-O2):
@.str = [35 x i8] c"Error Cannot allocate space ,size:\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chalearm/MachineLearning-/refs/heads/master/mProject/library_jui/dataStruct/src/basicVarArea.c\00"
@.str.2 = [13 x i8] c"Error ret is\00"
define noalias double** @newPDoubleDArea(i32 %0, i32* writeonly %1) {
%3 = icmp ne i32* %1, null
%4 = icmp sgt i32 %0, -1
%5 = and i1 %4, %3
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = shl i32 %0, 3
%8 = tail call i8* @malloc(i32 %7)
%9 = icmp ne i32 %0, 0
%10 = icmp eq i8* %8, null
%11 = and i1 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %6
store i32 0, i32* %1
br label %20
13: ; preds = %2
br i1 %3, label %14, label %17
14: ; preds = %13
store i32 0, i32* %1
%15 = tail call i32 @printInt(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0)
%16 = tail call i32 @printLnAndFile(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 327, i32 1)
br label %20
17: ; preds = %13
%18 = tail call i32 @printVoidSt(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* null, i32 0)
%19 = tail call i32 @printLnAndFile(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 332, i32 1)
br label %20
20: ; preds = %14, %17, %12, %6
%21 = phi i8* [ null, %12 ], [ %8, %6 ], [ null, %14 ], [ null, %17 ]
%22 = bitcast i8* %21 to double**
ret double** %22
}