#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 menu_item {
  int dummy;
};
struct menu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ make_item_visible(struct menu *, struct menu_item *);
struct menu_item *menu_find(struct menu *, char const *);
void menu_make_visible(struct menu *menu, const char *file) {
  struct menu_item *mi;
  assert(menu != NULL);
  assert(file != NULL);
  if ((mi = menu_find(menu, file)))
    make_item_visible(menu, mi);
}


x86 assembly (clang, -O0):
<menu_make_visible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <menu_find@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     118c <menu_make_visible+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <make_item_visible@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu_make_visible>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <menu_find@plt>
test   %rax,%rax
je     1178 <menu_make_visible+0x48>
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <make_item_visible@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.menu = type { i32 }
%struct.menu_item = type { i32 }
define void @menu_make_visible(%struct.menu* %0, i8* %1) {
%3 = alloca %struct.menu*
%4 = alloca i8*
%5 = alloca %struct.menu_item*
store %struct.menu* %0, %struct.menu** %3
store i8* %1, i8** %4
%6 = load %struct.menu*, %struct.menu** %3
%7 = icmp ne %struct.menu* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load %struct.menu*, %struct.menu** %3
%15 = load i8*, i8** %4
%16 = call %struct.menu_item* @menu_find(%struct.menu* %14, i8* %15)
store %struct.menu_item* %16, %struct.menu_item** %5
%17 = icmp ne %struct.menu_item* %16, null
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load %struct.menu*, %struct.menu** %3
%20 = load %struct.menu_item*, %struct.menu_item** %5
%21 = call i32 @make_item_visible(%struct.menu* %19, %struct.menu_item* %20)
br label %22
22: ; preds = %18, %2
ret void
}

LLVM IR (-O2):
%struct.menu = type { i32 }
%struct.menu_item = type { i32 }
define void @menu_make_visible(%struct.menu* %0, i8* %1) {
%3 = icmp ne %struct.menu* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call %struct.menu_item* @menu_find(%struct.menu* %0, i8* %1)
%10 = icmp eq %struct.menu_item* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = tail call i32 @make_item_visible(%struct.menu* %0, %struct.menu_item* %9)
br label %13
13: ; preds = %11, %2
ret void
}