#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_profession(void) {
  erase();
  mvprintw(0, 0, "a..Monk");
  mvprintw(0, 20, "b..Ranger");
  mvprintw(0, 60, "c..Mage");
  mvprintw(2, 0, "Choose your profession: ");
  refresh();
  return (getch());
}


x86 assembly (clang, -O0):
<choose_profession>:
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    0xe9f(%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    0xe8b(%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_profession>:
push   %rax
xor    %eax,%eax
call   1030 <erase@plt>
lea    0xeb1(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1060 <mvprintw@plt>
lea    0xea9(%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    0xe95(%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 = [8 x i8] c"a..Monk\00"
@.str.1 = [10 x i8] c"b..Ranger\00"
@.str.2 = [8 x i8] c"c..Mage\00"
@.str.3 = [25 x i8] c"Choose your profession: \00"
define signext i8 @choose_profession() {
%1 = call i32 (...) @erase()
%2 = call i32 @mvprintw(i32 0, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @mvprintw(i32 0, i32 20, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @mvprintw(i32 0, i32 60, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @mvprintw(i32 2, i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (...) @refresh()
%7 = call signext i8 (...) @getch()
ret i8 %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"a..Monk\00"
@.str.1 = [10 x i8] c"b..Ranger\00"
@.str.2 = [8 x i8] c"c..Mage\00"
@.str.3 = [25 x i8] c"Choose your profession: \00"
define signext i8 @choose_profession() {
%1 = tail call i32 (...) @erase()
%2 = tail call i32 @mvprintw(i32 0, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @mvprintw(i32 0, i32 20, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @mvprintw(i32 0, i32 60, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @mvprintw(i32 2, i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 (...) @refresh()
%7 = tail call signext i8 (...) @getch()
ret i8 %7
}