#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(double *);
void cleanup_all(double **f, double *feval, double *fBphat, double *fBhat,
                 double *fB, double *fBp, double *res1, double *res2) {
  int j;
  for (j = 0; j < 17; j++) {
    free(f[j]);
  }
  free(feval);
  free(fBphat);
  free(fBhat);
  free(fB);
  free(fBp);
  free(res1);
  free(res2);
}


x86 assembly (clang, -O0):
<cleanup_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x11,-0x34(%rbp)
jge    1168 <cleanup_all+0x58>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113f <cleanup_all+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    0x10(%rbp),%rdi
call   1030 <free@plt>
mov    0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_all>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,0x8(%rsp)
mov    %r8,%r13
mov    %rcx,%rbx
mov    %rdx,%rbp
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x58(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    0x50(%rsp),%r12
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    0x8(%r15),%rdi
call   1030 <free@plt>
mov    0x10(%r15),%rdi
call   1030 <free@plt>
mov    0x18(%r15),%rdi
call   1030 <free@plt>
mov    0x20(%r15),%rdi
call   1030 <free@plt>
mov    0x28(%r15),%rdi
call   1030 <free@plt>
mov    0x30(%r15),%rdi
call   1030 <free@plt>
mov    0x38(%r15),%rdi
call   1030 <free@plt>
mov    0x40(%r15),%rdi
call   1030 <free@plt>
mov    0x48(%r15),%rdi
call   1030 <free@plt>
mov    0x50(%r15),%rdi
call   1030 <free@plt>
mov    0x58(%r15),%rdi
call   1030 <free@plt>
mov    0x60(%r15),%rdi
call   1030 <free@plt>
mov    0x68(%r15),%rdi
call   1030 <free@plt>
mov    0x70(%r15),%rdi
call   1030 <free@plt>
mov    0x78(%r15),%rdi
call   1030 <free@plt>
mov    0x80(%r15),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @cleanup_all(double** %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7) {
%9 = alloca double**
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca i32
store double** %0, double*** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store double* %6, double** %15
store double* %7, double** %16
store i32 0, i32* %17
br label %18
18: ; preds = %28, %8
%19 = load i32, i32* %17
%20 = icmp slt i32 %19, 17
br i1 %20, label %21, label %31
21: ; preds = %18
%22 = load double**, double*** %9
%23 = load i32, i32* %17
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double*, double** %22, i64 %24
%26 = load double*, double** %25
%27 = call i32 @free(double* %26)
br label %28
28: ; preds = %21
%29 = load i32, i32* %17
%30 = add nsw i32 %29, 1
store i32 %30, i32* %17
br label %18
31: ; preds = %18
%32 = load double*, double** %10
%33 = call i32 @free(double* %32)
%34 = load double*, double** %11
%35 = call i32 @free(double* %34)
%36 = load double*, double** %12
%37 = call i32 @free(double* %36)
%38 = load double*, double** %13
%39 = call i32 @free(double* %38)
%40 = load double*, double** %14
%41 = call i32 @free(double* %40)
%42 = load double*, double** %15
%43 = call i32 @free(double* %42)
%44 = load double*, double** %16
%45 = call i32 @free(double* %44)
ret void
}

LLVM IR (-O2):
define void @cleanup_all(double** nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, double* nocapture %7) {
%9 = load double*, double** %0
%10 = tail call i32 @free(double* %9)
%11 = getelementptr inbounds double*, double** %0, i64 1
%12 = load double*, double** %11
%13 = tail call i32 @free(double* %12)
%14 = getelementptr inbounds double*, double** %0, i64 2
%15 = load double*, double** %14
%16 = tail call i32 @free(double* %15)
%17 = getelementptr inbounds double*, double** %0, i64 3
%18 = load double*, double** %17
%19 = tail call i32 @free(double* %18)
%20 = getelementptr inbounds double*, double** %0, i64 4
%21 = load double*, double** %20
%22 = tail call i32 @free(double* %21)
%23 = getelementptr inbounds double*, double** %0, i64 5
%24 = load double*, double** %23
%25 = tail call i32 @free(double* %24)
%26 = getelementptr inbounds double*, double** %0, i64 6
%27 = load double*, double** %26
%28 = tail call i32 @free(double* %27)
%29 = getelementptr inbounds double*, double** %0, i64 7
%30 = load double*, double** %29
%31 = tail call i32 @free(double* %30)
%32 = getelementptr inbounds double*, double** %0, i64 8
%33 = load double*, double** %32
%34 = tail call i32 @free(double* %33)
%35 = getelementptr inbounds double*, double** %0, i64 9
%36 = load double*, double** %35
%37 = tail call i32 @free(double* %36)
%38 = getelementptr inbounds double*, double** %0, i64 10
%39 = load double*, double** %38
%40 = tail call i32 @free(double* %39)
%41 = getelementptr inbounds double*, double** %0, i64 11
%42 = load double*, double** %41
%43 = tail call i32 @free(double* %42)
%44 = getelementptr inbounds double*, double** %0, i64 12
%45 = load double*, double** %44
%46 = tail call i32 @free(double* %45)
%47 = getelementptr inbounds double*, double** %0, i64 13
%48 = load double*, double** %47
%49 = tail call i32 @free(double* %48)
%50 = getelementptr inbounds double*, double** %0, i64 14
%51 = load double*, double** %50
%52 = tail call i32 @free(double* %51)
%53 = getelementptr inbounds double*, double** %0, i64 15
%54 = load double*, double** %53
%55 = tail call i32 @free(double* %54)
%56 = getelementptr inbounds double*, double** %0, i64 16
%57 = load double*, double** %56
%58 = tail call i32 @free(double* %57)
%59 = tail call i32 @free(double* %1)
%60 = tail call i32 @free(double* %2)
%61 = tail call i32 @free(double* %3)
%62 = tail call i32 @free(double* %4)
%63 = tail call i32 @free(double* %5)
%64 = tail call i32 @free(double* %6)
%65 = tail call i32 @free(double* %7)
ret void
}