#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 */
struct yatzy_game {
  int dummy;
};
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ *newwin(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ wborder(int /*<<< orphan*/ *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ wgetstr(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ wmove(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ wprintw(int /*<<< orphan*/ *, char *, int, char *);
int /*<<< orphan*/ yatzy_game_add_player(struct yatzy_game *,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ yatzy_player_create(char *);
void yatzy_ui_ask_for_players(struct yatzy_game *game) {
  int i;
  WINDOW *win;
  char names[6][20] = {};
  win = newwin(8, 30, 0, 0);
  wborder(win, 0, 0, 0, 0, 0, 0, 0, 0);
  for (i = 0; i < 6; i++) {
    wmove(win, i + 1, 2);
    wprintw(win, "Player %d: %s", i + 1, names[i]);
  }
  for (i = 0; i < 6; i++) {
    wmove(win, i + 1, 12);
    wgetstr(win, names[i]);
    if (names[i][0] == '\0') {
      break;
    }
  }
  for (i = 0; i < 6; i++) {
    if (names[i][0] == '\0') {
      break;
    }
    yatzy_game_add_player(game, yatzy_player_create(names[i]));
  }
  delwin(win);
}


x86 assembly (clang, -O0):
<yatzy_ui_ask_for_players>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x78,%edx
call   1070 <memset@plt>
mov    $0x8,%edi
mov    $0x1e,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1060 <newwin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1040 <wborder@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    1253 <yatzy_ui_ask_for_players+0xc3>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    $0x2,%edx
call   10b0 <wmove@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
movslq -0xc(%rbp),%rax
lea    -0x90(%rbp),%rcx
imul   $0x14,%rax,%rax
add    %rax,%rcx
lea    0xdc0(%rip),%rsi
call   1090 <wprintw@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ff <yatzy_ui_ask_for_players+0x6f>
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    12c9 <yatzy_ui_ask_for_players+0x139>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    $0xc,%edx
call   10b0 <wmove@plt>
mov    -0x18(%rbp),%rdi
movslq -0xc(%rbp),%rax
lea    -0x90(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
call   1030 <wgetstr@plt>
movslq -0xc(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    12b6 <yatzy_ui_ask_for_players+0x126>
jmp    12c9 <yatzy_ui_ask_for_players+0x139>
jmp    12bb <yatzy_ui_ask_for_players+0x12b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    125a <yatzy_ui_ask_for_players+0xca>
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    133b <yatzy_ui_ask_for_players+0x1ab>
movslq -0xc(%rbp),%rcx
lea    -0x90(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    12fd <yatzy_ui_ask_for_players+0x16d>
jmp    133b <yatzy_ui_ask_for_players+0x1ab>
mov    -0x8(%rbp),%rax
mov    %rax,-0x98(%rbp)
movslq -0xc(%rbp),%rax
lea    -0x90(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
call   1050 <yatzy_player_create@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%esi
call   10a0 <yatzy_game_add_player@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12d0 <yatzy_ui_ask_for_players+0x140>
mov    -0x18(%rbp),%rdi
call   1080 <delwin@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yatzy_ui_ask_for_players>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x70(%rsp)
lea    0x50(%rsp),%r13
mov    $0x8,%edi
mov    $0x1e,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <newwin@plt>
mov    %rax,%rbx
sub    $0x8,%rsp
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
push   $0x0
call   1040 <wborder@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   10a0 <wmove@plt>
lea    0xdeb(%rip),%rbp
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x1,%edx
mov    %r15,%rcx
call   1080 <wprintw@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   10a0 <wmove@plt>
lea    0x14(%rsp),%r12
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x2,%edx
mov    %r12,%rcx
call   1080 <wprintw@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   10a0 <wmove@plt>
lea    0x28(%rsp),%rcx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x3,%edx
call   1080 <wprintw@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
call   10a0 <wmove@plt>
lea    0x3c(%rsp),%rcx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x4,%edx
call   1080 <wprintw@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x2,%edx
call   10a0 <wmove@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x5,%edx
mov    %r13,%rcx
call   1080 <wprintw@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x2,%edx
call   10a0 <wmove@plt>
lea    0x64(%rsp),%r13
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
mov    %r13,%rcx
call   1080 <wprintw@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0xc,%edx
call   10a0 <wmove@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <wgetstr@plt>
cmpb   $0x0,(%rsp)
je     146f <yatzy_ui_ask_for_players+0x2ef>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xc,%edx
call   10a0 <wmove@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <wgetstr@plt>
cmpb   $0x0,0x14(%rsp)
je     13d0 <yatzy_ui_ask_for_players+0x250>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0xc,%edx
call   10a0 <wmove@plt>
mov    %rbx,%rdi
lea    0x28(%rsp),%rsi
call   1030 <wgetstr@plt>
cmpb   $0x0,0x28(%rsp)
je     13d0 <yatzy_ui_ask_for_players+0x250>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0xc,%edx
call   10a0 <wmove@plt>
mov    %rbx,%rdi
lea    0x3c(%rsp),%rsi
call   1030 <wgetstr@plt>
cmpb   $0x0,0x3c(%rsp)
je     13d0 <yatzy_ui_ask_for_players+0x250>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0xc,%edx
call   10a0 <wmove@plt>
mov    %rbx,%rdi
lea    0x50(%rsp),%rsi
call   1030 <wgetstr@plt>
cmpb   $0x0,0x50(%rsp)
je     13d0 <yatzy_ui_ask_for_players+0x250>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0xc,%edx
call   10a0 <wmove@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <wgetstr@plt>
cmpb   $0x0,(%rsp)
je     146f <yatzy_ui_ask_for_players+0x2ef>
mov    %rsp,%rdi
call   1050 <yatzy_player_create@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1090 <yatzy_game_add_player@plt>
cmpb   $0x0,0x14(%rsp)
je     146f <yatzy_ui_ask_for_players+0x2ef>
mov    %r12,%rdi
call   1050 <yatzy_player_create@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1090 <yatzy_game_add_player@plt>
cmpb   $0x0,0x28(%rsp)
je     146f <yatzy_ui_ask_for_players+0x2ef>
lea    0x28(%rsp),%rdi
call   1050 <yatzy_player_create@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1090 <yatzy_game_add_player@plt>
cmpb   $0x0,0x3c(%rsp)
je     146f <yatzy_ui_ask_for_players+0x2ef>
lea    0x3c(%rsp),%rdi
call   1050 <yatzy_player_create@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1090 <yatzy_game_add_player@plt>
cmpb   $0x0,0x50(%rsp)
je     146f <yatzy_ui_ask_for_players+0x2ef>
lea    0x50(%rsp),%rdi
call   1050 <yatzy_player_create@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1090 <yatzy_game_add_player@plt>
cmpb   $0x0,0x64(%rsp)
je     146f <yatzy_ui_ask_for_players+0x2ef>
mov    %r13,%rdi
call   1050 <yatzy_player_create@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1090 <yatzy_game_add_player@plt>
mov    %rbx,%rdi
call   1070 <delwin@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.yatzy_game = type { i32 }
@.str = [14 x i8] c"Player %d: %s\00"
define void @yatzy_ui_ask_for_players(%struct.yatzy_game* %0) {
%2 = alloca %struct.yatzy_game*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [6 x [20 x i8]]
store %struct.yatzy_game* %0, %struct.yatzy_game** %2
%6 = bitcast [6 x [20 x i8]]* %5 to i8*
%7 = call i32* @newwin(i32 8, i32 30, i32 0, i32 0)
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = call i32 @wborder(i32* %8, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 0, i32* %3
br label %10
10: ; preds = %26, %1
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 6
br i1 %12, label %13, label %29
13: ; preds = %10
%14 = load i32*, i32** %4
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
%17 = call i32 @wmove(i32* %14, i32 %16, i32 2)
%18 = load i32*, i32** %4
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %5, i64 0, i64 %22
%24 = getelementptr inbounds [20 x i8], [20 x i8]* %23, i64 0, i64 0
%25 = call i32 @wprintw(i32* %18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %20, i8* %24)
br label %26
26: ; preds = %13
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %10
29: ; preds = %10
store i32 0, i32* %3
br label %30
30: ; preds = %53, %29
%31 = load i32, i32* %3
%32 = icmp slt i32 %31, 6
br i1 %32, label %33, label %56
33: ; preds = %30
%34 = load i32*, i32** %4
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
%37 = call i32 @wmove(i32* %34, i32 %36, i32 12)
%38 = load i32*, i32** %4
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %5, i64 0, i64 %40
%42 = getelementptr inbounds [20 x i8], [20 x i8]* %41, i64 0, i64 0
%43 = call i32 @wgetstr(i32* %38, i8* %42)
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %5, i64 0, i64 %45
%47 = getelementptr inbounds [20 x i8], [20 x i8]* %46, i64 0, i64 0
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %33
br label %56
52: ; preds = %33
br label %53
53: ; preds = %52
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %30
56: ; preds = %51, %30
store i32 0, i32* %3
br label %57
57: ; preds = %77, %56
%58 = load i32, i32* %3
%59 = icmp slt i32 %58, 6
br i1 %59, label %60, label %80
60: ; preds = %57
%61 = load i32, i32* %3
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %5, i64 0, i64 %62
%64 = getelementptr inbounds [20 x i8], [20 x i8]* %63, i64 0, i64 0
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %69
68: ; preds = %60
br label %80
69: ; preds = %60
%70 = load %struct.yatzy_game*, %struct.yatzy_game** %2
%71 = load i32, i32* %3
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %5, i64 0, i64 %72
%74 = getelementptr inbounds [20 x i8], [20 x i8]* %73, i64 0, i64 0
%75 = call i32 @yatzy_player_create(i8* %74)
%76 = call i32 @yatzy_game_add_player(%struct.yatzy_game* %70, i32 %75)
br label %77
77: ; preds = %69
%78 = load i32, i32* %3
%79 = add nsw i32 %78, 1
store i32 %79, i32* %3
br label %57
80: ; preds = %68, %57
%81 = load i32*, i32** %4
%82 = call i32 @delwin(i32* %81)
ret void
}

LLVM IR (-O2):
%struct.yatzy_game = type { i32 }
@.str = [14 x i8] c"Player %d: %s\00"
define void @yatzy_ui_ask_for_players(%struct.yatzy_game* %0) {
%2 = alloca [6 x [20 x i8]]
%3 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %2, i64 0, i64 0, i64 0
%4 = tail call i32* @newwin(i32 8, i32 30, i32 0, i32 0)
%5 = tail call i32 @wborder(i32* %4, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%6 = call i32 @wmove(i32* %4, i32 1, i32 2)
%7 = call i32 @wprintw(i32* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i8* %3)
%8 = call i32 @wmove(i32* %4, i32 2, i32 2)
%9 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %2, i64 0, i64 1, i64 0
%10 = call i32 @wprintw(i32* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2, i8* %9)
%11 = call i32 @wmove(i32* %4, i32 3, i32 2)
%12 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %2, i64 0, i64 2, i64 0
%13 = call i32 @wprintw(i32* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, i8* %12)
%14 = call i32 @wmove(i32* %4, i32 4, i32 2)
%15 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %2, i64 0, i64 3, i64 0
%16 = call i32 @wprintw(i32* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4, i8* %15)
%17 = call i32 @wmove(i32* %4, i32 5, i32 2)
%18 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %2, i64 0, i64 4, i64 0
%19 = call i32 @wprintw(i32* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i8* %18)
%20 = call i32 @wmove(i32* %4, i32 6, i32 2)
%21 = getelementptr inbounds [6 x [20 x i8]], [6 x [20 x i8]]* %2, i64 0, i64 5, i64 0
%22 = call i32 @wprintw(i32* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 6, i8* %21)
%23 = call i32 @wmove(i32* %4, i32 1, i32 12)
%24 = call i32 @wgetstr(i32* %4, i8* %3)
%25 = load i8, i8* %3
%26 = icmp eq i8 %25, 0
br i1 %26, label %81, label %27
27: ; preds = %1
%28 = call i32 @wmove(i32* %4, i32 2, i32 12)
%29 = call i32 @wgetstr(i32* %4, i8* %9)
%30 = load i8, i8* %9
%31 = icmp eq i8 %30, 0
br i1 %31, label %50, label %32
32: ; preds = %27
%33 = call i32 @wmove(i32* %4, i32 3, i32 12)
%34 = call i32 @wgetstr(i32* %4, i8* %12)
%35 = load i8, i8* %12
%36 = icmp eq i8 %35, 0
br i1 %36, label %50, label %37
37: ; preds = %32
%38 = call i32 @wmove(i32* %4, i32 4, i32 12)
%39 = call i32 @wgetstr(i32* %4, i8* %15)
%40 = load i8, i8* %15
%41 = icmp eq i8 %40, 0
br i1 %41, label %50, label %42
42: ; preds = %37
%43 = call i32 @wmove(i32* %4, i32 5, i32 12)
%44 = call i32 @wgetstr(i32* %4, i8* %18)
%45 = load i8, i8* %18
%46 = icmp eq i8 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %42
%48 = call i32 @wmove(i32* %4, i32 6, i32 12)
%49 = call i32 @wgetstr(i32* %4, i8* %21)
br label %50
50: ; preds = %47, %42, %37, %32, %27
%51 = load i8, i8* %3
%52 = icmp eq i8 %51, 0
br i1 %52, label %81, label %53
53: ; preds = %50
%54 = call i32 @yatzy_player_create(i8* %3)
%55 = call i32 @yatzy_game_add_player(%struct.yatzy_game* %0, i32 %54)
%56 = load i8, i8* %9
%57 = icmp eq i8 %56, 0
br i1 %57, label %81, label %58
58: ; preds = %53
%59 = call i32 @yatzy_player_create(i8* %9)
%60 = call i32 @yatzy_game_add_player(%struct.yatzy_game* %0, i32 %59)
%61 = load i8, i8* %12
%62 = icmp eq i8 %61, 0
br i1 %62, label %81, label %63
63: ; preds = %58
%64 = call i32 @yatzy_player_create(i8* %12)
%65 = call i32 @yatzy_game_add_player(%struct.yatzy_game* %0, i32 %64)
%66 = load i8, i8* %15
%67 = icmp eq i8 %66, 0
br i1 %67, label %81, label %68
68: ; preds = %63
%69 = call i32 @yatzy_player_create(i8* %15)
%70 = call i32 @yatzy_game_add_player(%struct.yatzy_game* %0, i32 %69)
%71 = load i8, i8* %18
%72 = icmp eq i8 %71, 0
br i1 %72, label %81, label %73
73: ; preds = %68
%74 = call i32 @yatzy_player_create(i8* %18)
%75 = call i32 @yatzy_game_add_player(%struct.yatzy_game* %0, i32 %74)
%76 = load i8, i8* %21
%77 = icmp eq i8 %76, 0
br i1 %77, label %81, label %78
78: ; preds = %73
%79 = call i32 @yatzy_player_create(i8* %21)
%80 = call i32 @yatzy_game_add_player(%struct.yatzy_game* %0, i32 %79)
br label %81
81: ; preds = %1, %78, %73, %68, %63, %58, %53, %50
%82 = call i32 @delwin(i32* %4)
ret void
}