void unload_data(double **trainX, double *trainY, double **testX, double *testY,
                 double **bounds, double *mean, double *sd) {
  if (trainX)
    free(trainX[0]);
  free(trainX);
  free(trainY);
  if (testX)
    free(testX[0]);
  free(testX);
  free(testY);
  if (bounds)
    free(bounds[0]);
  free(bounds);
  free(mean);
  free(sd);
}


x86 assembly (clang, -O0):
<unload_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
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)
cmpq   $0x0,-0x8(%rbp)
je     114b <unload_data+0x3b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x18(%rbp)
je     1174 <unload_data+0x64>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x28(%rbp)
je     119d <unload_data+0x8d>
mov    -0x28(%rbp),%rax
mov    (%rax),%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>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unload_data>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
mov    %r8,%r13
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %rsi,%rbp
mov    %rdi,%r14
mov    0x40(%rsp),%r15
test   %rdi,%rdi
je     1140 <unload_data+0x30>
mov    (%r14),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
test   %rbx,%rbx
je     115d <unload_data+0x4d>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
test   %r13,%r13
je     117b <unload_data+0x6b>
mov    0x0(%r13),%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @unload_data(double** %0, double* %1, double** %2, double* %3, double** %4, double* %5, double* %6) {
%8 = alloca double**
%9 = alloca double*
%10 = alloca double**
%11 = alloca double*
%12 = alloca double**
%13 = alloca double*
%14 = alloca double*
store double** %0, double*** %8
store double* %1, double** %9
store double** %2, double*** %10
store double* %3, double** %11
store double** %4, double*** %12
store double* %5, double** %13
store double* %6, double** %14
%15 = load double**, double*** %8
%16 = icmp ne double** %15, null
br i1 %16, label %17, label %22
17: ; preds = %7
%18 = load double**, double*** %8
%19 = getelementptr inbounds double*, double** %18, i64 0
%20 = load double*, double** %19
%21 = bitcast double* %20 to i8*
br label %22
22: ; preds = %17, %7
%23 = load double**, double*** %8
%24 = bitcast double** %23 to i8*
%25 = load double*, double** %9
%26 = bitcast double* %25 to i8*
%27 = load double**, double*** %10
%28 = icmp ne double** %27, null
br i1 %28, label %29, label %34
29: ; preds = %22
%30 = load double**, double*** %10
%31 = getelementptr inbounds double*, double** %30, i64 0
%32 = load double*, double** %31
%33 = bitcast double* %32 to i8*
br label %34
34: ; preds = %29, %22
%35 = load double**, double*** %10
%36 = bitcast double** %35 to i8*
%37 = load double*, double** %11
%38 = bitcast double* %37 to i8*
%39 = load double**, double*** %12
%40 = icmp ne double** %39, null
br i1 %40, label %41, label %46
41: ; preds = %34
%42 = load double**, double*** %12
%43 = getelementptr inbounds double*, double** %42, i64 0
%44 = load double*, double** %43
%45 = bitcast double* %44 to i8*
br label %46
46: ; preds = %41, %34
%47 = load double**, double*** %12
%48 = bitcast double** %47 to i8*
%49 = load double*, double** %13
%50 = bitcast double* %49 to i8*
%51 = load double*, double** %14
%52 = bitcast double* %51 to i8*
ret void
}

LLVM IR (-O2):
define void @unload_data(double** %0, double* nocapture %1, double** %2, double* nocapture %3, double** %4, double* nocapture %5, double* nocapture %6) {
%8 = icmp eq double** %0, null
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = bitcast double** %0 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
br label %12
12: ; preds = %9, %7
%13 = bitcast double** %0 to i8*
tail call void @free(i8* %13)
%14 = bitcast double* %1 to i8*
tail call void @free(i8* %14)
%15 = icmp eq double** %2, null
br i1 %15, label %19, label %16
16: ; preds = %12
%17 = bitcast double** %2 to i8**
%18 = load i8*, i8** %17
tail call void @free(i8* %18)
br label %19
19: ; preds = %16, %12
%20 = bitcast double** %2 to i8*
tail call void @free(i8* %20)
%21 = bitcast double* %3 to i8*
tail call void @free(i8* %21)
%22 = icmp eq double** %4, null
br i1 %22, label %26, label %23
23: ; preds = %19
%24 = bitcast double** %4 to i8**
%25 = load i8*, i8** %24
tail call void @free(i8* %25)
br label %26
26: ; preds = %23, %19
%27 = bitcast double** %4 to i8*
tail call void @free(i8* %27)
%28 = bitcast double* %5 to i8*
tail call void @free(i8* %28)
%29 = bitcast double* %6 to i8*
tail call void @free(i8* %29)
ret void
}