#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 int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int /*<<< orphan*/,
                             char *);
int /*<<< orphan*/ wattroff(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wattron(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wgetnstr(int /*<<< orphan*/ *, char *, int);
void input_name(WINDOW *win, char *name) {
  mvwprintw(win, 1, 0, "Enter name: >");
  wattron(win, COLOR_PAIR(2));
  wgetnstr(win, name, 16);
  wattroff(win, COLOR_PAIR(2));
}


x86 assembly (clang, -O0):
<input_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
lea    0xe8e(%rip),%rcx
call   1040 <mvwprintw@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x2,%edi
call   1030 <COLOR_PAIR@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1070 <wattron@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1050 <wgetnstr@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x2,%edi
call   1030 <COLOR_PAIR@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1060 <wattroff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_name>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xe9f(%rip),%rcx
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <mvwprintw@plt>
mov    $0x2,%edi
call   1030 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1070 <wattron@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1050 <wgetnstr@plt>
mov    $0x2,%edi
call   1030 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <wattroff@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Enter name: >\00"
define void @input_name(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i32 @mvwprintw(i32* %5, i32 1, i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = call i32 @COLOR_PAIR(i32 2)
%9 = call i32 @wattron(i32* %7, i32 %8)
%10 = load i32*, i32** %3
%11 = load i8*, i8** %4
%12 = call i32 @wgetnstr(i32* %10, i8* %11, i32 16)
%13 = load i32*, i32** %3
%14 = call i32 @COLOR_PAIR(i32 2)
%15 = call i32 @wattroff(i32* %13, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Enter name: >\00"
define void @input_name(i32* %0, i8* %1) {
%3 = tail call i32 @mvwprintw(i32* %0, i32 1, i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @COLOR_PAIR(i32 2)
%5 = tail call i32 @wattron(i32* %0, i32 %4)
%6 = tail call i32 @wgetnstr(i32* %0, i8* %1, i32 16)
%7 = tail call i32 @COLOR_PAIR(i32 2)
%8 = tail call i32 @wattroff(i32* %0, i32 %7)
ret void
}