#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 artist {
  int dummy;
};
struct album {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ remove_sel_album(struct album *);
int /*<<< orphan*/ remove_sel_artist(struct artist *);
int /*<<< orphan*/ tree_win_get_selected(struct artist **, struct album **);
void tree_win_remove_sel(void) {
  struct artist *artist;
  struct album *album;
  tree_win_get_selected(&artist, &album);
  if (album) {
    remove_sel_album(album);
  } else if (artist) {
    remove_sel_artist(artist);
  }
}


x86 assembly (clang, -O0):
<tree_win_remove_sel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <tree_win_get_selected@plt>
cmpq   $0x0,-0x10(%rbp)
je     115e <tree_win_remove_sel+0x2e>
mov    -0x10(%rbp),%rdi
call   1050 <remove_sel_album@plt>
jmp    1177 <tree_win_remove_sel+0x47>
cmpq   $0x0,-0x8(%rbp)
je     1172 <tree_win_remove_sel+0x42>
mov    -0x8(%rbp),%rdi
call   1040 <remove_sel_artist@plt>
jmp    1177 <tree_win_remove_sel+0x47>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_win_remove_sel>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <tree_win_get_selected@plt>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     1157 <tree_win_remove_sel+0x27>
call   1050 <remove_sel_album@plt>
add    $0x18,%rsp
ret
mov    0x10(%rsp),%rdi
test   %rdi,%rdi
je     1166 <tree_win_remove_sel+0x36>
call   1040 <remove_sel_artist@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.artist = type { i32 }
%struct.album = type { i32 }
define void @tree_win_remove_sel() {
%1 = alloca %struct.artist*
%2 = alloca %struct.album*
%3 = bitcast %struct.artist** %1 to i8*
%4 = bitcast %struct.album** %2 to i8*
%5 = call i32 @tree_win_get_selected(%struct.artist** %1, %struct.album** %2)
%6 = load %struct.album*, %struct.album** %2
%7 = icmp eq %struct.album* %6, null
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 @remove_sel_album(%struct.album* %6)
br label %15
10: ; preds = %0
%11 = load %struct.artist*, %struct.artist** %1
%12 = icmp eq %struct.artist* %11, null
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = call i32 @remove_sel_artist(%struct.artist* %11)
br label %15
15: ; preds = %10, %13, %8
ret void
}