void free6(void ******p) {
  free(p[0][0][0][0][0]);
  free(p[0][0][0][0]);
  free(p[0][0][0]);
  free(p[0][0]);
  free(p[0]);
  free(p);
}


x86 assembly (clang, -O0):
<free6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free6>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free6(i8****** nocapture %0) {
%2 = load i8*****, i8****** %0
%3 = load i8****, i8***** %2
%4 = load i8***, i8**** %3
%5 = load i8**, i8*** %4
%6 = load i8*, i8** %5
tail call void @free(i8* %6)
%7 = bitcast i8****** %0 to i8*****
%8 = load i8****, i8***** %7
%9 = load i8***, i8**** %8
%10 = load i8**, i8*** %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = bitcast i8****** %0 to i8****
%13 = load i8***, i8**** %12
%14 = load i8**, i8*** %13
%15 = load i8*, i8** %14
tail call void @free(i8* %15)
%16 = bitcast i8****** %0 to i8***
%17 = load i8**, i8*** %16
%18 = load i8*, i8** %17
tail call void @free(i8* %18)
%19 = bitcast i8****** %0 to i8**
%20 = load i8*, i8** %19
tail call void @free(i8* %20)
%21 = bitcast i8****** %0 to i8*
tail call void @free(i8* %21)
ret void
}