#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 */
struct t_gui_key {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_key_free(struct t_gui_key **, struct t_gui_key **, int *,
                                struct t_gui_key *);
void gui_key_free_all(struct t_gui_key **keys, struct t_gui_key **last_key,
                      int *keys_count) {
  while (*keys) {
    gui_key_free(keys, last_key, keys_count, *keys);
  }
}


x86 assembly (clang, -O0):
<gui_key_free_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <gui_key_free_all+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
call   1030 <gui_key_free@plt>
jmp    1124 <gui_key_free_all+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_key_free_all>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%rcx
test   %rcx,%rcx
je     1146 <gui_key_free_all+0x36>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <gui_key_free@plt>
mov    (%rbx),%rcx
test   %rcx,%rcx
jne    1130 <gui_key_free_all+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.t_gui_key = type { i32 }
define void @gui_key_free_all(%struct.t_gui_key** %0, %struct.t_gui_key** %1, i32* %2) {
%4 = alloca %struct.t_gui_key**
%5 = alloca %struct.t_gui_key**
%6 = alloca i32*
store %struct.t_gui_key** %0, %struct.t_gui_key*** %4
store %struct.t_gui_key** %1, %struct.t_gui_key*** %5
store i32* %2, i32** %6
br label %7
7: ; preds = %11, %3
%8 = load %struct.t_gui_key**, %struct.t_gui_key*** %4
%9 = load %struct.t_gui_key*, %struct.t_gui_key** %8
%10 = icmp ne %struct.t_gui_key* %9, null
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load %struct.t_gui_key**, %struct.t_gui_key*** %4
%13 = load %struct.t_gui_key**, %struct.t_gui_key*** %5
%14 = load i32*, i32** %6
%15 = load %struct.t_gui_key**, %struct.t_gui_key*** %4
%16 = load %struct.t_gui_key*, %struct.t_gui_key** %15
%17 = call i32 @gui_key_free(%struct.t_gui_key** %12, %struct.t_gui_key** %13, i32* %14, %struct.t_gui_key* %16)
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
%struct.t_gui_key = type { i32 }
define void @gui_key_free_all(%struct.t_gui_key** %0, %struct.t_gui_key** %1, i32* %2) {
%4 = load %struct.t_gui_key*, %struct.t_gui_key** %0
%5 = icmp eq %struct.t_gui_key* %4, null
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi %struct.t_gui_key* [ %9, %6 ], [ %4, %3 ]
%8 = tail call i32 @gui_key_free(%struct.t_gui_key** %0, %struct.t_gui_key** %1, i32* %2, %struct.t_gui_key* %7)
%9 = load %struct.t_gui_key*, %struct.t_gui_key** %0
%10 = icmp eq %struct.t_gui_key* %9, null
br i1 %10, label %11, label %6
11: ; preds = %6, %3
ret void
}