#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*/ free(void **);
void free_G(double ***G) {
  int i;
  for (i = 0; i < 6; i++)
    free((void *)(*G)[i]);
  free((void **)(*G));
}


x86 assembly (clang, -O0):
<free_G>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    114f <free_G+0x3f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <free_G+0x13>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_G>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    0x8(%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    0x10(%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    0x18(%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    0x20(%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    0x28(%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_G(double*** nocapture %0) {
%2 = bitcast double*** %0 to i8****
%3 = load i8***, i8**** %2
%4 = load i8**, i8*** %3
%5 = tail call i32 @free(i8** %4)
%6 = load double**, double*** %0
%7 = getelementptr inbounds double*, double** %6, i64 1
%8 = bitcast double** %7 to i8***
%9 = load i8**, i8*** %8
%10 = tail call i32 @free(i8** %9)
%11 = load double**, double*** %0
%12 = getelementptr inbounds double*, double** %11, i64 2
%13 = bitcast double** %12 to i8***
%14 = load i8**, i8*** %13
%15 = tail call i32 @free(i8** %14)
%16 = load double**, double*** %0
%17 = getelementptr inbounds double*, double** %16, i64 3
%18 = bitcast double** %17 to i8***
%19 = load i8**, i8*** %18
%20 = tail call i32 @free(i8** %19)
%21 = load double**, double*** %0
%22 = getelementptr inbounds double*, double** %21, i64 4
%23 = bitcast double** %22 to i8***
%24 = load i8**, i8*** %23
%25 = tail call i32 @free(i8** %24)
%26 = load double**, double*** %0
%27 = getelementptr inbounds double*, double** %26, i64 5
%28 = bitcast double** %27 to i8***
%29 = load i8**, i8*** %28
%30 = tail call i32 @free(i8** %29)
%31 = bitcast double*** %0 to i8***
%32 = load i8**, i8*** %31
%33 = tail call i32 @free(i8** %32)
ret void
}