#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*/ apps_opt_cmdline();
int /*<<< orphan*/ apps_opt_uop();
int showMenu(char *, char *, char **, int);
int /*<<< orphan*/ sleep(int);
int mainMenu_opt_apps() {
  const char *const opts[] = {"UNIX Operator applications >",
                              "Command-line applications >", "Back"};
  int selection = showMenu("", "Applications", (char **)opts, 3);
  switch (selection) {
  case 1:
    apps_opt_uop();
    sleep(1);
    break;
  case 2:
    apps_opt_cmdline();
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<mainMenu_opt_apps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2cc1(%rip),%rax
mov    %rax,-0x10(%rbp)
movaps 0x2ca6(%rip),%xmm0
movaps %xmm0,-0x20(%rbp)
lea    0xed3(%rip),%rdi
lea    0xed2(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x3,%ecx
call   1050 <showMenu@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x1,%eax
je     11a2 <mainMenu_opt_apps+0x62>
jmp    1191 <mainMenu_opt_apps+0x51>
mov    -0x28(%rbp),%eax
sub    $0x2,%eax
je     11b8 <mainMenu_opt_apps+0x78>
jmp    11c4 <mainMenu_opt_apps+0x84>
mov    $0x0,%al
call   1030 <apps_opt_uop@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    11c9 <mainMenu_opt_apps+0x89>
mov    $0x0,%al
call   1040 <apps_opt_cmdline@plt>
jmp    11c9 <mainMenu_opt_apps+0x89>
jmp    11c9 <mainMenu_opt_apps+0x89>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainMenu_opt_apps>:
sub    $0x18,%rsp
mov    0x2cc5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2ca9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed6(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    %rsp,%rdx
mov    $0x3,%ecx
call   1050 <showMenu@plt>
cmp    $0x2,%eax
je     1193 <mainMenu_opt_apps+0x53>
cmp    $0x1,%eax
jne    119a <mainMenu_opt_apps+0x5a>
xor    %eax,%eax
call   1030 <apps_opt_uop@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    119a <mainMenu_opt_apps+0x5a>
xor    %eax,%eax
call   1040 <apps_opt_cmdline@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"UNIX Operator applications >\00"
@.str.1 = [28 x i8] c"Command-line applications >\00"
@.str.2 = [5 x i8] c"Back\00"
@__const.mainMenu_opt_apps.opts = [3 x i8*] [i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [13 x i8] c"Applications\00"
define i32 @mainMenu_opt_apps() {
%1 = alloca [3 x i8*]
%2 = alloca i32
%3 = bitcast [3 x i8*]* %1 to i8*
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%5 = call i32 @showMenu(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8** %4, i32 3)
store i32 %5, i32* %2
%6 = load i32, i32* %2
switch i32 %6, label %12 [
i32 1, label %7
i32 2, label %10
]
7: ; preds = %0
%8 = call i32 (...) @apps_opt_uop()
%9 = call i32 @sleep(i32 1)
br label %13
10: ; preds = %0
%11 = call i32 (...) @apps_opt_cmdline()
br label %13
12: ; preds = %0
br label %13
13: ; preds = %12, %10, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"UNIX Operator applications >\00"
@.str.1 = [28 x i8] c"Command-line applications >\00"
@.str.2 = [5 x i8] c"Back\00"
@__const.mainMenu_opt_apps.opts = [3 x i8*] [i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [13 x i8] c"Applications\00"
define i32 @mainMenu_opt_apps() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%4 = call i32 @showMenu(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8** %3, i32 3)
switch i32 %4, label %10 [
i32 1, label %5
i32 2, label %8
]
5: ; preds = %0
%6 = call i32 (...) @apps_opt_uop()
%7 = call i32 @sleep(i32 1)
br label %10
8: ; preds = %0
%9 = call i32 (...) @apps_opt_cmdline()
br label %10
10: ; preds = %0, %8, %5
ret i32 0
}