#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*/ menu_delete(struct menu *, struct menu_item *);
struct menu_item *menu_find(struct menu *, char const *);
void menu_del_item(struct menu *menu, const char *fname) {
  struct menu_item *mi;
  assert(menu != NULL);
  assert(fname != NULL);
  mi = menu_find(menu, fname);
  assert(mi != NULL);
  menu_delete(menu, mi);
}


x86 assembly (clang, -O0):
<menu_del_item>:
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   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <menu_find@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <menu_delete@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu_del_item>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <menu_find@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <menu_delete@plt>

LLVM IR (-O0):
%struct.menu = type { i32 }
%struct.menu_item = type { i32 }
define void @menu_del_item(%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 = load %struct.menu_item*, %struct.menu_item** %5
%18 = icmp ne %struct.menu_item* %17, null
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load %struct.menu*, %struct.menu** %3
%22 = load %struct.menu_item*, %struct.menu_item** %5
%23 = call i32 @menu_delete(%struct.menu* %21, %struct.menu_item* %22)
ret void
}

LLVM IR (-O2):
%struct.menu = type { i32 }
%struct.menu_item = type { i32 }
define void @menu_del_item(%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 ne %struct.menu_item* %9, null
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @menu_delete(%struct.menu* %0, %struct.menu_item* %9)
ret void
}