#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 */
typedef int /*<<< orphan*/ ****************************bilist;

/* Variables and functions */
int /*<<< orphan*/ sfree(int **);
void free_kl(struct bilist ****buckets, struct bilist **listspace, int **dvals,
             int **tops) {
  sfree(dvals);
  sfree(tops);
  sfree(listspace[0]);
  sfree(buckets[0][1]);
  sfree(listspace);
  sfree(buckets);
}


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

x86 assembly (clang, -O2):
<free_kl>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <sfree@plt>
mov    %r14,%rdi
call   1030 <sfree@plt>
mov    (%rbx),%rdi
call   1030 <sfree@plt>
mov    (%r15),%rax
mov    0x8(%rax),%rdi
call   1030 <sfree@plt>
mov    %rbx,%rdi
call   1030 <sfree@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <sfree@plt>

LLVM IR (-O0):
%struct.bilist = type opaque
define void @free_kl(%struct.bilist**** %0, %struct.bilist** %1, i32** %2, i32** %3) {
%5 = alloca %struct.bilist****
%6 = alloca %struct.bilist**
%7 = alloca i32**
%8 = alloca i32**
store %struct.bilist**** %0, %struct.bilist***** %5
store %struct.bilist** %1, %struct.bilist*** %6
store i32** %2, i32*** %7
store i32** %3, i32*** %8
%9 = load i32**, i32*** %7
%10 = call i32 @sfree(i32** %9)
%11 = load i32**, i32*** %8
%12 = call i32 @sfree(i32** %11)
%13 = load %struct.bilist**, %struct.bilist*** %6
%14 = getelementptr inbounds %struct.bilist*, %struct.bilist** %13, i64 0
%15 = load %struct.bilist*, %struct.bilist** %14
%16 = bitcast %struct.bilist* %15 to i32**
%17 = call i32 @sfree(i32** %16)
%18 = load %struct.bilist****, %struct.bilist***** %5
%19 = getelementptr inbounds %struct.bilist***, %struct.bilist**** %18, i64 0
%20 = load %struct.bilist***, %struct.bilist**** %19
%21 = getelementptr inbounds %struct.bilist**, %struct.bilist*** %20, i64 1
%22 = load %struct.bilist**, %struct.bilist*** %21
%23 = bitcast %struct.bilist** %22 to i32**
%24 = call i32 @sfree(i32** %23)
%25 = load %struct.bilist**, %struct.bilist*** %6
%26 = bitcast %struct.bilist** %25 to i32**
%27 = call i32 @sfree(i32** %26)
%28 = load %struct.bilist****, %struct.bilist***** %5
%29 = bitcast %struct.bilist**** %28 to i32**
%30 = call i32 @sfree(i32** %29)
ret void
}

LLVM IR (-O2):
%struct.bilist = type opaque
define void @free_kl(%struct.bilist**** %0, %struct.bilist** %1, i32** %2, i32** %3) {
%5 = tail call i32 @sfree(i32** %2)
%6 = tail call i32 @sfree(i32** %3)
%7 = bitcast %struct.bilist** %1 to i32***
%8 = load i32**, i32*** %7
%9 = tail call i32 @sfree(i32** %8)
%10 = load %struct.bilist***, %struct.bilist**** %0
%11 = getelementptr inbounds %struct.bilist**, %struct.bilist*** %10, i64 1
%12 = bitcast %struct.bilist*** %11 to i32***
%13 = load i32**, i32*** %12
%14 = tail call i32 @sfree(i32** %13)
%15 = bitcast %struct.bilist** %1 to i32**
%16 = tail call i32 @sfree(i32** %15)
%17 = bitcast %struct.bilist**** %0 to i32**
%18 = tail call i32 @sfree(i32** %17)
ret void
}