#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 */
double *del_doubarray(double *);
int /*<<< orphan*/ free(double **);
double **del_doub2(double **doub2, int ndoub2) {
  int i;
  if (doub2) {
    for (i = 0; i < ndoub2; i++)
      doub2[i] = del_doubarray(doub2[i]);
    free(doub2);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<del_doub2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1184 <del_doub2+0x64>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117b <del_doub2+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <del_doubarray@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1141 <del_doub2+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_doub2>:
test   %rdi,%rdi
je     1163 <del_doub2+0x43>
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
test   %esi,%esi
jle    1156 <del_doub2+0x36>
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1040 <del_doubarray@plt>
mov    %rax,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <del_doub2+0x20>
mov    %r15,%rdi
call   1030 <free@plt>
pop    %rbx
pop    %r14
pop    %r15
xor    %eax,%eax
ret

LLVM IR (-O0):
define double** @del_doub2(double** %0, i32 %1) {
%3 = alloca double**
%4 = alloca i32
%5 = alloca i32
store double** %0, double*** %3
store i32 %1, i32* %4
%6 = load double**, double*** %3
%7 = icmp ne double** %6, null
br i1 %7, label %8, label %30
8: ; preds = %2
store i32 0, i32* %5
br label %9
9: ; preds = %24, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load double**, double*** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double*, double** %14, i64 %16
%18 = load double*, double** %17
%19 = call double* @del_doubarray(double* %18)
%20 = load double**, double*** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double*, double** %20, i64 %22
store double* %19, double** %23
br label %24
24: ; preds = %13
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %9
27: ; preds = %9
%28 = load double**, double*** %3
%29 = call i32 @free(double** %28)
br label %30
30: ; preds = %27, %2
ret double** null
}

LLVM IR (-O2):
define noalias double** @del_doub2(double** %0, i32 %1) {
%3 = icmp eq double** %0, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds double*, double** %0, i64 %9
%11 = load double*, double** %10
%12 = tail call double* @del_doubarray(double* %11)
store double* %12, double** %10
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
%16 = tail call i32 @free(double** %0)
br label %17
17: ; preds = %15, %2
ret double** null
}