void freeEnvelopes(float **envs) {
  if (envs) {
    for (unsigned int i = 0; i < 13; i++) {
      free(envs[i]);
    }
    free(envs);
  }
}


x86 assembly (clang, -O0):
<freeEnvelopes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115f <freeEnvelopes+0x4f>
movl   $0x0,-0xc(%rbp)
cmpl   $0xd,-0xc(%rbp)
jae    1156 <freeEnvelopes+0x46>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <freeEnvelopes+0x1e>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeEnvelopes>:
test   %rdi,%rdi
je     119a <freeEnvelopes+0x8a>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    0x8(%rbx),%rdi
call   1030 <free@plt>
mov    0x10(%rbx),%rdi
call   1030 <free@plt>
mov    0x18(%rbx),%rdi
call   1030 <free@plt>
mov    0x20(%rbx),%rdi
call   1030 <free@plt>
mov    0x28(%rbx),%rdi
call   1030 <free@plt>
mov    0x30(%rbx),%rdi
call   1030 <free@plt>
mov    0x38(%rbx),%rdi
call   1030 <free@plt>
mov    0x40(%rbx),%rdi
call   1030 <free@plt>
mov    0x48(%rbx),%rdi
call   1030 <free@plt>
mov    0x50(%rbx),%rdi
call   1030 <free@plt>
mov    0x58(%rbx),%rdi
call   1030 <free@plt>
mov    0x60(%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @freeEnvelopes(float** %0) {
%2 = icmp eq float** %0, null
br i1 %2, label %43, label %3
3: ; preds = %1
%4 = bitcast float** %0 to i8**
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = getelementptr inbounds float*, float** %0, i64 1
%7 = bitcast float** %6 to i8**
%8 = load i8*, i8** %7
tail call void @free(i8* %8)
%9 = getelementptr inbounds float*, float** %0, i64 2
%10 = bitcast float** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = getelementptr inbounds float*, float** %0, i64 3
%13 = bitcast float** %12 to i8**
%14 = load i8*, i8** %13
tail call void @free(i8* %14)
%15 = getelementptr inbounds float*, float** %0, i64 4
%16 = bitcast float** %15 to i8**
%17 = load i8*, i8** %16
tail call void @free(i8* %17)
%18 = getelementptr inbounds float*, float** %0, i64 5
%19 = bitcast float** %18 to i8**
%20 = load i8*, i8** %19
tail call void @free(i8* %20)
%21 = getelementptr inbounds float*, float** %0, i64 6
%22 = bitcast float** %21 to i8**
%23 = load i8*, i8** %22
tail call void @free(i8* %23)
%24 = getelementptr inbounds float*, float** %0, i64 7
%25 = bitcast float** %24 to i8**
%26 = load i8*, i8** %25
tail call void @free(i8* %26)
%27 = getelementptr inbounds float*, float** %0, i64 8
%28 = bitcast float** %27 to i8**
%29 = load i8*, i8** %28
tail call void @free(i8* %29)
%30 = getelementptr inbounds float*, float** %0, i64 9
%31 = bitcast float** %30 to i8**
%32 = load i8*, i8** %31
tail call void @free(i8* %32)
%33 = getelementptr inbounds float*, float** %0, i64 10
%34 = bitcast float** %33 to i8**
%35 = load i8*, i8** %34
tail call void @free(i8* %35)
%36 = getelementptr inbounds float*, float** %0, i64 11
%37 = bitcast float** %36 to i8**
%38 = load i8*, i8** %37
tail call void @free(i8* %38)
%39 = getelementptr inbounds float*, float** %0, i64 12
%40 = bitcast float** %39 to i8**
%41 = load i8*, i8** %40
tail call void @free(i8* %41)
%42 = bitcast float** %0 to i8*
tail call void @free(i8* %42)
br label %43
43: ; preds = %3, %1
ret void
}