void free2d(double *vals[4][8], int *indices[4][8]) {
  sfree(vals[0][1]);
  sfree(vals[0][2]);
  sfree(vals[0][3]);
  sfree(vals[1][2]);
  sfree(indices[0][1]);
  sfree(indices[0][2]);
  sfree(indices[0][3]);
  sfree(indices[1][2]);
}


x86 assembly (clang, -O0):
<free2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1030 <sfree@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x0,%al
call   1030 <sfree@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rdi
mov    $0x0,%al
call   1030 <sfree@plt>
mov    -0x8(%rbp),%rax
mov    0x50(%rax),%rdi
mov    $0x0,%al
call   1030 <sfree@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1030 <sfree@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x0,%al
call   1030 <sfree@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    $0x0,%al
call   1030 <sfree@plt>
mov    -0x10(%rbp),%rax
mov    0x50(%rax),%rdi
mov    $0x0,%al
call   1030 <sfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free2d>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x8(%rdi),%rdi
xor    %eax,%eax
call   1030 <sfree@plt>
mov    0x10(%rbx),%rdi
xor    %eax,%eax
call   1030 <sfree@plt>
mov    0x18(%rbx),%rdi
xor    %eax,%eax
call   1030 <sfree@plt>
mov    0x50(%rbx),%rdi
xor    %eax,%eax
call   1030 <sfree@plt>
mov    0x8(%r14),%rdi
xor    %eax,%eax
call   1030 <sfree@plt>
mov    0x10(%r14),%rdi
xor    %eax,%eax
call   1030 <sfree@plt>
mov    0x18(%r14),%rdi
xor    %eax,%eax
call   1030 <sfree@plt>
mov    0x50(%r14),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <sfree@plt>

LLVM IR (-O0):
define void @free2d([8 x double*]* %0, [8 x i32*]* %1) {
%3 = alloca [8 x double*]*
%4 = alloca [8 x i32*]*
store [8 x double*]* %0, [8 x double*]** %3
store [8 x i32*]* %1, [8 x i32*]** %4
%5 = load [8 x double*]*, [8 x double*]** %3
%6 = getelementptr inbounds [8 x double*], [8 x double*]* %5, i64 0
%7 = getelementptr inbounds [8 x double*], [8 x double*]* %6, i64 0, i64 1
%8 = load double*, double** %7
%9 = call i32 (double*, ...) bitcast (i32 (...)* @sfree to i32 (double*, ...)*)(double* %8)
%10 = load [8 x double*]*, [8 x double*]** %3
%11 = getelementptr inbounds [8 x double*], [8 x double*]* %10, i64 0
%12 = getelementptr inbounds [8 x double*], [8 x double*]* %11, i64 0, i64 2
%13 = load double*, double** %12
%14 = call i32 (double*, ...) bitcast (i32 (...)* @sfree to i32 (double*, ...)*)(double* %13)
%15 = load [8 x double*]*, [8 x double*]** %3
%16 = getelementptr inbounds [8 x double*], [8 x double*]* %15, i64 0
%17 = getelementptr inbounds [8 x double*], [8 x double*]* %16, i64 0, i64 3
%18 = load double*, double** %17
%19 = call i32 (double*, ...) bitcast (i32 (...)* @sfree to i32 (double*, ...)*)(double* %18)
%20 = load [8 x double*]*, [8 x double*]** %3
%21 = getelementptr inbounds [8 x double*], [8 x double*]* %20, i64 1
%22 = getelementptr inbounds [8 x double*], [8 x double*]* %21, i64 0, i64 2
%23 = load double*, double** %22
%24 = call i32 (double*, ...) bitcast (i32 (...)* @sfree to i32 (double*, ...)*)(double* %23)
%25 = load [8 x i32*]*, [8 x i32*]** %4
%26 = getelementptr inbounds [8 x i32*], [8 x i32*]* %25, i64 0
%27 = getelementptr inbounds [8 x i32*], [8 x i32*]* %26, i64 0, i64 1
%28 = load i32*, i32** %27
%29 = call i32 (i32*, ...) bitcast (i32 (...)* @sfree to i32 (i32*, ...)*)(i32* %28)
%30 = load [8 x i32*]*, [8 x i32*]** %4
%31 = getelementptr inbounds [8 x i32*], [8 x i32*]* %30, i64 0
%32 = getelementptr inbounds [8 x i32*], [8 x i32*]* %31, i64 0, i64 2
%33 = load i32*, i32** %32
%34 = call i32 (i32*, ...) bitcast (i32 (...)* @sfree to i32 (i32*, ...)*)(i32* %33)
%35 = load [8 x i32*]*, [8 x i32*]** %4
%36 = getelementptr inbounds [8 x i32*], [8 x i32*]* %35, i64 0
%37 = getelementptr inbounds [8 x i32*], [8 x i32*]* %36, i64 0, i64 3
%38 = load i32*, i32** %37
%39 = call i32 (i32*, ...) bitcast (i32 (...)* @sfree to i32 (i32*, ...)*)(i32* %38)
%40 = load [8 x i32*]*, [8 x i32*]** %4
%41 = getelementptr inbounds [8 x i32*], [8 x i32*]* %40, i64 1
%42 = getelementptr inbounds [8 x i32*], [8 x i32*]* %41, i64 0, i64 2
%43 = load i32*, i32** %42
%44 = call i32 (i32*, ...) bitcast (i32 (...)* @sfree to i32 (i32*, ...)*)(i32* %43)
ret void
}

LLVM IR (-O2):
define void @free2d([8 x double*]* nocapture %0, [8 x i32*]* nocapture %1) {
%3 = getelementptr inbounds [8 x double*], [8 x double*]* %0, i64 0, i64 1
%4 = load double*, double** %3
%5 = tail call i32 (double*, ...) bitcast (i32 (...)* @sfree to i32 (double*, ...)*)(double* %4)
%6 = getelementptr inbounds [8 x double*], [8 x double*]* %0, i64 0, i64 2
%7 = load double*, double** %6
%8 = tail call i32 (double*, ...) bitcast (i32 (...)* @sfree to i32 (double*, ...)*)(double* %7)
%9 = getelementptr inbounds [8 x double*], [8 x double*]* %0, i64 0, i64 3
%10 = load double*, double** %9
%11 = tail call i32 (double*, ...) bitcast (i32 (...)* @sfree to i32 (double*, ...)*)(double* %10)
%12 = getelementptr inbounds [8 x double*], [8 x double*]* %0, i64 1, i64 2
%13 = load double*, double** %12
%14 = tail call i32 (double*, ...) bitcast (i32 (...)* @sfree to i32 (double*, ...)*)(double* %13)
%15 = getelementptr inbounds [8 x i32*], [8 x i32*]* %1, i64 0, i64 1
%16 = load i32*, i32** %15
%17 = tail call i32 (i32*, ...) bitcast (i32 (...)* @sfree to i32 (i32*, ...)*)(i32* %16)
%18 = getelementptr inbounds [8 x i32*], [8 x i32*]* %1, i64 0, i64 2
%19 = load i32*, i32** %18
%20 = tail call i32 (i32*, ...) bitcast (i32 (...)* @sfree to i32 (i32*, ...)*)(i32* %19)
%21 = getelementptr inbounds [8 x i32*], [8 x i32*]* %1, i64 0, i64 3
%22 = load i32*, i32** %21
%23 = tail call i32 (i32*, ...) bitcast (i32 (...)* @sfree to i32 (i32*, ...)*)(i32* %22)
%24 = getelementptr inbounds [8 x i32*], [8 x i32*]* %1, i64 1, i64 2
%25 = load i32*, i32** %24
%26 = tail call i32 (i32*, ...) bitcast (i32 (...)* @sfree to i32 (i32*, ...)*)(i32* %25)
ret void
}