#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 showMenu(char *, char *, char **, int);
int /*<<< orphan*/ util_viewFile(char *);
int mainMenu_opt_about() {
  const char *const opts[] = {"View GNU General Public License, Version 3",
                              "View credits", "Back"};
  while (true) {
    int selection = showMenu(
        "Version 0.3-dev by Alex Martin and GitHub contributors.\nCopyright "
        "(C) 2014 Alex Martin.\nThis program is free software: you can "
        "redistribute it and/or modify it under the terms of the GNU General "
        "Public License as published by the Free Software Foundation, either "
        "version 3 of the License, or (at your option) any later "
        "version.\n\nThis program is distributed in the hope that it will be "
        "useful, but WITHOUT ANY WARRANTY; without even the implied warranty "
        "of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU "
        "General Public License for more details.\nUNIX Operator\nVersion "
        "0.4-dev by Alex Martin and GitHub contributors\nCopyright (C) 2014 "
        "Alex Martin.",
        "About UNIX Operator", (char **)opts, 3);
    switch (selection) {
    case 1:
      util_viewFile("LICENSE");
      break;
    case 2:
      util_viewFile("credits.txt");
      break;
    default:
      return 0;
      break;
    }
  }
}


x86 assembly (clang, -O0):
<mainMenu_opt_about>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2cd1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cce(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ccb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeed(%rip),%rdi
lea    0x117e(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x3,%ecx
call   1040 <showMenu@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x1,%eax
je     118d <mainMenu_opt_about+0x6d>
jmp    117c <mainMenu_opt_about+0x5c>
mov    -0x28(%rbp),%eax
sub    $0x2,%eax
je     119e <mainMenu_opt_about+0x7e>
jmp    11af <mainMenu_opt_about+0x8f>
lea    0x1155(%rip),%rdi
call   1030 <util_viewFile@plt>
jmp    11b7 <mainMenu_opt_about+0x97>
lea    0x114c(%rip),%rdi
call   1030 <util_viewFile@plt>
jmp    11b7 <mainMenu_opt_about+0x97>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret
jmp    1149 <mainMenu_opt_about+0x29>

x86 assembly (clang, -O2):
<mainMenu_opt_about>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    0x2cdc(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cc0(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xef2(%rip),%r14
lea    0x1183(%rip),%r15
mov    %rsp,%r12
lea    0x118d(%rip),%rbx
lea    0x118e(%rip),%r13
jmp    1175 <mainMenu_opt_about+0x55>
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <util_viewFile@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    $0x3,%ecx
call   1040 <showMenu@plt>
mov    %rbx,%rdi
cmp    $0x1,%eax
je     1170 <mainMenu_opt_about+0x50>
cmp    $0x2,%eax
jne    119a <mainMenu_opt_about+0x7a>
mov    %r13,%rdi
jmp    1170 <mainMenu_opt_about+0x50>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [43 x i8] c"View GNU General Public License, Version 3\00"
@.str.1 = [13 x i8] c"View credits\00"
@.str.2 = [5 x i8] c"Back\00"
@__const.mainMenu_opt_about.opts = [3 x i8*] [i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 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 = [664 x i8] c"Version 0.3-dev by Alex Martin and GitHub contributors.\0ACopyright (C) 2014 Alex Martin.\0AThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\0A\0AThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\0AUNIX Operator\0AVersion 0.4-dev by Alex Martin and GitHub contributors\0ACopyright (C) 2014 Alex Martin.\00"
@.str.4 = [20 x i8] c"About UNIX Operator\00"
@.str.5 = [8 x i8] c"LICENSE\00"
@.str.6 = [12 x i8] c"credits.txt\00"
define i32 @mainMenu_opt_about() {
%1 = alloca [3 x i8*]
%2 = alloca i32
%3 = bitcast [3 x i8*]* %1 to i8*
br label %4
4: ; preds = %0, %13
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%6 = call i32 @showMenu(i8* getelementptr inbounds ([664 x i8], [664 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8** %5, i32 3)
store i32 %6, i32* %2
%7 = load i32, i32* %2
switch i32 %7, label %12 [
i32 1, label %8
i32 2, label %10
]
8: ; preds = %4
%9 = call i32 @util_viewFile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %13
10: ; preds = %4
%11 = call i32 @util_viewFile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
br label %13
12: ; preds = %4
ret i32 0
13: ; preds = %10, %8
br label %4
}

LLVM IR (-O2):
@.str = [43 x i8] c"View GNU General Public License, Version 3\00"
@.str.1 = [13 x i8] c"View credits\00"
@.str.2 = [5 x i8] c"Back\00"
@__const.mainMenu_opt_about.opts = [3 x i8*] [i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 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 = [664 x i8] c"Version 0.3-dev by Alex Martin and GitHub contributors.\0ACopyright (C) 2014 Alex Martin.\0AThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\0A\0AThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\0AUNIX Operator\0AVersion 0.4-dev by Alex Martin and GitHub contributors\0ACopyright (C) 2014 Alex Martin.\00"
@.str.4 = [20 x i8] c"About UNIX Operator\00"
@.str.5 = [8 x i8] c"LICENSE\00"
@.str.6 = [12 x i8] c"credits.txt\00"
define i32 @mainMenu_opt_about() {
%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
br label %4
4: ; preds = %7, %0
%5 = call i32 @showMenu(i8* getelementptr inbounds ([664 x i8], [664 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8** %3, i32 3)
switch i32 %5, label %10 [
i32 1, label %7
i32 2, label %6
]
6: ; preds = %4
br label %7
7: ; preds = %4, %6
%8 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), %4 ]
%9 = call i32 @util_viewFile(i8* %8)
br label %4
10: ; preds = %4
ret i32 0
}