#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*/ erase();
char getch();
int /*<<< orphan*/ mvprintw(int, int, char *);
int /*<<< orphan*/ refresh();
char choose_race(void) {
  erase();
  mvprintw(0, 0, "a..Human");
  mvprintw(0, 20, "b..Dwarf");
  mvprintw(0, 60, "c..Gnome");
  mvprintw(2, 0, "Choose your race: ");
  refresh();
  return (getch());
}


x86 assembly (clang, -O0):
<choose_race>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <erase@plt>
xor    %esi,%esi
lea    0xeac(%rip),%rdx
mov    %esi,%edi
call   1060 <mvprintw@plt>
xor    %edi,%edi
mov    $0x14,%esi
lea    0xea0(%rip),%rdx
call   1060 <mvprintw@plt>
xor    %edi,%edi
mov    $0x3c,%esi
lea    0xe96(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x2,%edi
xor    %esi,%esi
lea    0xe8c(%rip),%rdx
call   1060 <mvprintw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose_race>:
push   %rax
xor    %eax,%eax
call   1030 <erase@plt>
lea    0xeb1(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1060 <mvprintw@plt>
lea    0xeaa(%rip),%rdx
xor    %edi,%edi
mov    $0x14,%esi
call   1060 <mvprintw@plt>
lea    0xea0(%rip),%rdx
xor    %edi,%edi
mov    $0x3c,%esi
call   1060 <mvprintw@plt>
lea    0xe96(%rip),%rdx
mov    $0x2,%edi
xor    %esi,%esi
call   1060 <mvprintw@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <getch@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"a..Human\00"
@.str.1 = [9 x i8] c"b..Dwarf\00"
@.str.2 = [9 x i8] c"c..Gnome\00"
@.str.3 = [19 x i8] c"Choose your race: \00"
define signext i8 @choose_race() {
%1 = call i32 (...) @erase()
%2 = call i32 @mvprintw(i32 0, i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @mvprintw(i32 0, i32 20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @mvprintw(i32 0, i32 60, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @mvprintw(i32 2, i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (...) @refresh()
%7 = call signext i8 (...) @getch()
ret i8 %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"a..Human\00"
@.str.1 = [9 x i8] c"b..Dwarf\00"
@.str.2 = [9 x i8] c"c..Gnome\00"
@.str.3 = [19 x i8] c"Choose your race: \00"
define signext i8 @choose_race() {
%1 = tail call i32 (...) @erase()
%2 = tail call i32 @mvprintw(i32 0, i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @mvprintw(i32 0, i32 20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @mvprintw(i32 0, i32 60, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @mvprintw(i32 2, i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 (...) @refresh()
%7 = tail call signext i8 (...) @getch()
ret i8 %7
}