#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_window_scroll {
  int dummy;
};
struct t_gui_window {
  int dummy;
};
struct t_gui_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_window_scroll_free(struct t_gui_window *,
                                          struct t_gui_window_scroll *);
struct t_gui_window_scroll *gui_window_scroll_search(struct t_gui_window *,
                                                     struct t_gui_buffer *);
void gui_window_scroll_remove_buffer(struct t_gui_window *window,
                                     struct t_gui_buffer *buffer) {
  struct t_gui_window_scroll *ptr_scroll;
  if (!window || !buffer)
    return;
  ptr_scroll = gui_window_scroll_search(window, buffer);
  if (ptr_scroll)
    gui_window_scroll_free(window, ptr_scroll);
}


x86 assembly (clang, -O0):
<gui_window_scroll_remove_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <gui_window_scroll_remove_buffer+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    114b <gui_window_scroll_remove_buffer+0x2b>
jmp    1174 <gui_window_scroll_remove_buffer+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gui_window_scroll_search@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1174 <gui_window_scroll_remove_buffer+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <gui_window_scroll_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_window_scroll_remove_buffer>:
push   %rbx
test   %rdi,%rdi
je     1144 <gui_window_scroll_remove_buffer+0x24>
test   %rsi,%rsi
je     1144 <gui_window_scroll_remove_buffer+0x24>
mov    %rdi,%rbx
call   1030 <gui_window_scroll_search@plt>
test   %rax,%rax
je     1144 <gui_window_scroll_remove_buffer+0x24>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <gui_window_scroll_free@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.t_gui_window = type { i32 }
%struct.t_gui_buffer = type { i32 }
%struct.t_gui_window_scroll = type { i32 }
define void @gui_window_scroll_remove_buffer(%struct.t_gui_window* %0, %struct.t_gui_buffer* %1) {
%3 = icmp ne %struct.t_gui_window* %0, null
%4 = icmp ne %struct.t_gui_buffer* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = tail call %struct.t_gui_window_scroll* @gui_window_scroll_search(%struct.t_gui_window* %0, %struct.t_gui_buffer* %1)
%8 = icmp eq %struct.t_gui_window_scroll* %7, null
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @gui_window_scroll_free(%struct.t_gui_window* %0, %struct.t_gui_window_scroll* %7)
br label %11
11: ; preds = %6, %9, %2
ret void
}