#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 */
typedef size_t u_int;

/* Variables and functions */
int /*<<< orphan*/ A_BOLD;
int /*<<< orphan*/ A_NORMAL;
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ attrset(int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ wmove(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ wprintw(int /*<<< orphan*/, char *, char *);
void choose(const u_int numer, char **logfile) {
  (void)attron(A_BOLD);
  (void)wmove(stdscr, (int)numer + 1, 0);
  (void)wprintw(stdscr, ">%s<", logfile[numer]);
  attrset(A_NORMAL);
  (void)refresh();
}


x86 assembly (clang, -O0):
<choose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1030 <attron@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%esi
add    $0x1,%esi
xor    %edx,%edx
call   1070 <wmove@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe5d(%rip),%rsi
call   1040 <wprintw@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
call   1060 <attrset@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1030 <attron@plt>
mov    0x2e70(%rip),%r15
mov    (%r15),%edi
lea    0x1(%rbx),%esi
xor    %edx,%edx
call   1070 <wmove@plt>
mov    (%r15),%edi
mov    (%r14,%rbx,8),%rdx
lea    0xe75(%rip),%rsi
call   1040 <wprintw@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
call   1060 <attrset@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <refresh@plt>

LLVM IR (-O0):
@A_BOLD = global i32 0
@stdscr = global i32 0
@.str = [5 x i8] c">%s<\00"
@A_NORMAL = global i32 0
define void @choose(i64 %0, i8** %1) {
%3 = alloca i64
%4 = alloca i8**
store i64 %0, i64* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @A_BOLD
%6 = call i32 @attron(i32 %5)
%7 = load i32, i32* @stdscr
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
%10 = add nsw i32 %9, 1
%11 = call i32 @wmove(i32 %7, i32 %10, i32 0)
%12 = load i32, i32* @stdscr
%13 = load i8**, i8*** %4
%14 = load i64, i64* %3
%15 = getelementptr inbounds i8*, i8** %13, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @wprintw(i32 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = load i32, i32* @A_NORMAL
%19 = call i32 @attrset(i32 %18)
%20 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@A_BOLD = global i32 0
@stdscr = global i32 0
@.str = [5 x i8] c">%s<\00"
@A_NORMAL = global i32 0
define void @choose(i64 %0, i8** nocapture %1) {
%3 = load i32, i32* @A_BOLD
%4 = tail call i32 @attron(i32 %3)
%5 = load i32, i32* @stdscr
%6 = trunc i64 %0 to i32
%7 = add nsw i32 %6, 1
%8 = tail call i32 @wmove(i32 %5, i32 %7, i32 0)
%9 = load i32, i32* @stdscr
%10 = getelementptr inbounds i8*, i8** %1, i64 %0
%11 = load i8*, i8** %10
%12 = tail call i32 @wprintw(i32 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @A_NORMAL
%14 = tail call i32 @attrset(i32 %13)
%15 = tail call i32 (...) @refresh()
ret void
}