#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 */

/* Variables and functions */
int /*<<< orphan*/ hide_menu_by_name(char *, char *);
int /*<<< orphan*/ jhide_menu_by_name(char *, char *);
int /*<<< orphan*/ star_menu_by_name(char *, char *);
void menu_set_flags(char *menu_name, char *entry_name, int flags) {
  if (flags & 1)
    star_menu_by_name(menu_name, entry_name);
  if (flags & 2)
    hide_menu_by_name(menu_name, entry_name);
  if (flags & 4)
    jhide_menu_by_name(menu_name, entry_name);
}


x86 assembly (clang, -O0):
<menu_set_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     115f <menu_set_flags+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <star_menu_by_name@plt>
mov    -0x14(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     117b <menu_set_flags+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <hide_menu_by_name@plt>
mov    -0x14(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1197 <menu_set_flags+0x67>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <jhide_menu_by_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu_set_flags>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
test   $0x1,%bpl
jne    1153 <menu_set_flags+0x23>
test   $0x2,%bpl
jne    1164 <menu_set_flags+0x34>
test   $0x4,%bpl
jne    1175 <menu_set_flags+0x45>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <star_menu_by_name@plt>
test   $0x2,%bpl
je     1148 <menu_set_flags+0x18>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <hide_menu_by_name@plt>
test   $0x4,%bpl
je     114e <menu_set_flags+0x1e>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <jhide_menu_by_name@plt>

LLVM IR (-O0):
define void @menu_set_flags(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call i32 @star_menu_by_name(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %3
%15 = load i32, i32* %6
%16 = and i32 %15, 2
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = call i32 @hide_menu_by_name(i8* %19, i8* %20)
br label %22
22: ; preds = %18, %14
%23 = load i32, i32* %6
%24 = and i32 %23, 4
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i8*, i8** %4
%28 = load i8*, i8** %5
%29 = call i32 @jhide_menu_by_name(i8* %27, i8* %28)
br label %30
30: ; preds = %26, %22
ret void
}

LLVM IR (-O2):
define void @menu_set_flags(i8* %0, i8* %1, i32 %2) {
%4 = and i32 %2, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @star_menu_by_name(i8* %0, i8* %1)
br label %8
8: ; preds = %6, %3
%9 = and i32 %2, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 @hide_menu_by_name(i8* %0, i8* %1)
br label %13
13: ; preds = %11, %8
%14 = and i32 %2, 4
%15 = icmp eq i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = tail call i32 @jhide_menu_by_name(i8* %0, i8* %1)
br label %18
18: ; preds = %16, %13
ret void
}