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

/* Variables and functions */
int COLS;
int LINES;
int /*<<< orphan*/ additem(struct MENU *, char *, char *);
int /*<<< orphan*/ initmenu(struct MENU *, int, int, int, int);
void makecapturemenu(struct MENU *menu) {
  initmenu(menu, 8, 40, (LINES) / 2 - 1, (COLS - 40) / 16);
  additem(menu, " Change Output ^F^ilename",
          "Allows you to specify the name of output file");
  additem(menu, " ^O^verwrite Mode", "Toggle overwriting of existing file");
  additem(menu, " Set Capture ^I^nterval",
          "Specify the desired capture generation interval");
  additem(menu, NULL, NULL);
  additem(menu, " ^A^ccept and Begin",
          "Select the specified options and start the capture process!");
  additem(menu, " E^x^it and Abort Capture",
          "Abort the selection and Returns to main menu");
}


x86 assembly (clang, -O0):
<makecapturemenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
sub    $0x1,%ecx
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
sub    $0x28,%eax
mov    $0x10,%esi
cltd
idiv   %esi
mov    %eax,%r8d
mov    $0x8,%esi
mov    $0x28,%edx
call   1040 <initmenu@plt>
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
lea    0xe9c(%rip),%rdx
call   1030 <additem@plt>
mov    -0x8(%rbp),%rdi
lea    0xeba(%rip),%rsi
lea    0xec5(%rip),%rdx
call   1030 <additem@plt>
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xeea(%rip),%rdx
call   1030 <additem@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <additem@plt>
mov    -0x8(%rbp),%rdi
lea    0xefa(%rip),%rsi
lea    0xf07(%rip),%rdx
call   1030 <additem@plt>
mov    -0x8(%rbp),%rdi
lea    0xf33(%rip),%rsi
lea    0xf46(%rip),%rdx
call   1030 <additem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makecapturemenu>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
add    $0xffffffff,%ecx
mov    0x2ea0(%rip),%rax
mov    (%rax),%r8d
lea    -0x28(%r8),%eax
add    $0xffffffe7,%r8d
test   %eax,%eax
cmovns %eax,%r8d
sar    $0x4,%r8d
mov    $0x8,%esi
mov    $0x28,%edx
call   1040 <initmenu@plt>
lea    0xe95(%rip),%rsi
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
call   1030 <additem@plt>
lea    0xec7(%rip),%rsi
lea    0xed2(%rip),%rdx
mov    %rbx,%rdi
call   1030 <additem@plt>
lea    0xee7(%rip),%rsi
lea    0xef8(%rip),%rdx
mov    %rbx,%rdi
call   1030 <additem@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <additem@plt>
lea    0xf0d(%rip),%rsi
lea    0xf1a(%rip),%rdx
mov    %rbx,%rdi
call   1030 <additem@plt>
lea    0xf47(%rip),%rsi
lea    0xf5a(%rip),%rdx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <additem@plt>

LLVM IR (-O0):
%struct.MENU = type { i32 }
@LINES = global i32 0
@COLS = global i32 0
@.str = [26 x i8] c" Change Output ^F^ilename\00"
@.str.1 = [46 x i8] c"Allows you to specify the name of output file\00"
@.str.2 = [18 x i8] c" ^O^verwrite Mode\00"
@.str.3 = [36 x i8] c"Toggle overwriting of existing file\00"
@.str.4 = [24 x i8] c" Set Capture ^I^nterval\00"
@.str.5 = [48 x i8] c"Specify the desired capture generation interval\00"
@.str.6 = [20 x i8] c" ^A^ccept and Begin\00"
@.str.7 = [60 x i8] c"Select the specified options and start the capture process!\00"
@.str.8 = [26 x i8] c" E^x^it and Abort Capture\00"
@.str.9 = [45 x i8] c"Abort the selection and Returns to main menu\00"
define void @makecapturemenu(%struct.MENU* %0) {
%2 = alloca %struct.MENU*
store %struct.MENU* %0, %struct.MENU** %2
%3 = load %struct.MENU*, %struct.MENU** %2
%4 = load i32, i32* @LINES
%5 = sdiv i32 %4, 2
%6 = sub nsw i32 %5, 1
%7 = load i32, i32* @COLS
%8 = sub nsw i32 %7, 40
%9 = sdiv i32 %8, 16
%10 = call i32 @initmenu(%struct.MENU* %3, i32 8, i32 40, i32 %6, i32 %9)
%11 = load %struct.MENU*, %struct.MENU** %2
%12 = call i32 @additem(%struct.MENU* %11, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%13 = load %struct.MENU*, %struct.MENU** %2
%14 = call i32 @additem(%struct.MENU* %13, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%15 = load %struct.MENU*, %struct.MENU** %2
%16 = call i32 @additem(%struct.MENU* %15, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0))
%17 = load %struct.MENU*, %struct.MENU** %2
%18 = call i32 @additem(%struct.MENU* %17, i8* null, i8* null)
%19 = load %struct.MENU*, %struct.MENU** %2
%20 = call i32 @additem(%struct.MENU* %19, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0))
%21 = load %struct.MENU*, %struct.MENU** %2
%22 = call i32 @additem(%struct.MENU* %21, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.MENU = type { i32 }
@LINES = global i32 0
@COLS = global i32 0
@.str = [26 x i8] c" Change Output ^F^ilename\00"
@.str.1 = [46 x i8] c"Allows you to specify the name of output file\00"
@.str.2 = [18 x i8] c" ^O^verwrite Mode\00"
@.str.3 = [36 x i8] c"Toggle overwriting of existing file\00"
@.str.4 = [24 x i8] c" Set Capture ^I^nterval\00"
@.str.5 = [48 x i8] c"Specify the desired capture generation interval\00"
@.str.6 = [20 x i8] c" ^A^ccept and Begin\00"
@.str.7 = [60 x i8] c"Select the specified options and start the capture process!\00"
@.str.8 = [26 x i8] c" E^x^it and Abort Capture\00"
@.str.9 = [45 x i8] c"Abort the selection and Returns to main menu\00"
define void @makecapturemenu(%struct.MENU* %0) {
%2 = load i32, i32* @LINES
%3 = sdiv i32 %2, 2
%4 = add nsw i32 %3, -1
%5 = load i32, i32* @COLS
%6 = add nsw i32 %5, -40
%7 = sdiv i32 %6, 16
%8 = tail call i32 @initmenu(%struct.MENU* %0, i32 8, i32 40, i32 %4, i32 %7)
%9 = tail call i32 @additem(%struct.MENU* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @additem(%struct.MENU* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 @additem(%struct.MENU* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0))
%12 = tail call i32 @additem(%struct.MENU* %0, i8* null, i8* null)
%13 = tail call i32 @additem(%struct.MENU* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0))
%14 = tail call i32 @additem(%struct.MENU* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0))
ret void
}