#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*/ clear();
int fileselmenu();
int /*<<< orphan*/ gettext(char *);
int /*<<< orphan*/ mvaddstr(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ pressanykey(int, int);
int /*<<< orphan*/ writeServerLog(char *);
int choosewordfile(void) {
  int a, k;
  writeServerLog("Choose Dictonary: ");
  k = fileselmenu();
  if (k < 1) {
    clear();
    mvaddstr(1, 5, gettext("No word lists found..."));
    pressanykey(3, 5);
    return -1;
  }
  return k;
}


x86 assembly (clang, -O0):
<choosewordfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe91(%rip),%rdi
call   1060 <writeServerLog@plt>
mov    $0x0,%al
call   1030 <fileselmenu@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    11c7 <choosewordfile+0x67>
mov    $0x0,%al
call   1080 <clear@plt>
lea    0xe7d(%rip),%rdi
call   1040 <gettext@plt>
mov    %eax,%edx
mov    $0x1,%edi
mov    $0x5,%esi
call   1070 <mvaddstr@plt>
mov    $0x3,%edi
mov    $0x5,%esi
call   1050 <pressanykey@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11cd <choosewordfile+0x6d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choosewordfile>:
push   %rax
lea    0xe98(%rip),%rdi
call   1060 <writeServerLog@plt>
xor    %eax,%eax
call   1030 <fileselmenu@plt>
test   %eax,%eax
jle    117a <choosewordfile+0x1a>
pop    %rcx
ret
xor    %eax,%eax
call   1080 <clear@plt>
lea    0xe8b(%rip),%rdi
call   1040 <gettext@plt>
mov    $0x1,%edi
mov    $0x5,%esi
mov    %eax,%edx
call   1070 <mvaddstr@plt>
mov    $0x3,%edi
mov    $0x5,%esi
call   1050 <pressanykey@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Choose Dictonary: \00"
@.str.1 = [23 x i8] c"No word lists found...\00"
define i32 @choosewordfile() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @writeServerLog(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @fileselmenu()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = call i32 (...) @clear()
%10 = call i32 @gettext(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @mvaddstr(i32 1, i32 5, i32 %10)
%12 = call i32 @pressanykey(i32 3, i32 5)
store i32 -1, i32* %1
br label %15
13: ; preds = %0
%14 = load i32, i32* %3
store i32 %14, i32* %1
br label %15
15: ; preds = %13, %8
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [19 x i8] c"Choose Dictonary: \00"
@.str.1 = [23 x i8] c"No word lists found...\00"
define i32 @choosewordfile() {
%1 = tail call i32 @writeServerLog(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @fileselmenu()
%3 = icmp slt i32 %2, 1
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i32 (...) @clear()
%6 = tail call i32 @gettext(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @mvaddstr(i32 1, i32 5, i32 %6)
%8 = tail call i32 @pressanykey(i32 3, i32 5)
br label %9
9: ; preds = %0, %4
%10 = phi i32 [ -1, %4 ], [ %2, %0 ]
ret i32 %10
}