#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_layout_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_layout_buffer_remove(struct t_gui_layout_buffer **,
                                            struct t_gui_layout_buffer **,
                                            struct t_gui_layout_buffer *);
void gui_layout_buffer_remove_all(
    struct t_gui_layout_buffer **layout_buffers,
    struct t_gui_layout_buffer **last_layout_buffer) {
  while (*layout_buffers) {
    gui_layout_buffer_remove(layout_buffers, last_layout_buffer,
                             *layout_buffers);
  }
}


x86 assembly (clang, -O0):
<gui_layout_buffer_remove_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1147 <gui_layout_buffer_remove_all+0x37>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
call   1030 <gui_layout_buffer_remove@plt>
jmp    1120 <gui_layout_buffer_remove_all+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_layout_buffer_remove_all>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rdx
test   %rdx,%rdx
je     1143 <gui_layout_buffer_remove_all+0x33>
mov    %rsi,%r14
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <gui_layout_buffer_remove@plt>
mov    (%rbx),%rdx
test   %rdx,%rdx
jne    1130 <gui_layout_buffer_remove_all+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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