#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void menu() {
  int numPlayers = -1;
  int i = 0;
  for (i = 0; i < 80; i++)
    printf("*");
  ;
  printf("                           Welcome to ASCII Vols!\n");
  for (i = 0; i < 80; i++)
    printf("*");
  ;
  while (numPlayers < 0) {
    printf("\n\nPlease input the number of players: ");
    scanf("%d", &numPlayers);
    if (numPlayers > 5)
      printf("You should split the game");
  }
  return;
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x50,-0x8(%rbp)
jge    1161 <menu+0x41>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <menu+0x1d>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x50,-0x8(%rbp)
jge    1198 <menu+0x78>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <menu+0x54>
jmp    119d <menu+0x7d>
cmpl   $0x0,-0x4(%rbp)
jge    11de <menu+0xbe>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x5,-0x4(%rbp)
jle    11d9 <menu+0xb9>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
jmp    119d <menu+0x7d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
mov    $0x50,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1160 <menu+0x20>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
mov    $0x50,%ebx
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1180 <menu+0x40>
lea    0xe6a(%rip),%r14
lea    0xe8a(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xe81(%rip),%r12
jmp    11b4 <menu+0x74>
nopl   0x0(%rax,%rax,1)
test   %eax,%eax
jns    11de <menu+0x9e>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x6,%eax
jl     11b0 <menu+0x70>
mov    %r12,%rdi
call   1050 <printf@plt>
mov    0x4(%rsp),%eax
jmp    11b0 <menu+0x70>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
@.str.1 = [51 x i8] c" Welcome to ASCII Vols!\0A\00"
@.str.2 = [39 x i8] c"\0A\0APlease input the number of players: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [26 x i8] c"You should split the game\00"
define void @menu() {
%1 = alloca i32
%2 = alloca i32
store i32 -1, i32* %1
store i32 0, i32* %2
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 80
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %13
13: ; preds = %18, %11
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 80
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %13
21: ; preds = %13
br label %22
22: ; preds = %32, %21
%23 = load i32, i32* %1
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %22
%26 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%28 = load i32, i32* %1
%29 = icmp sgt i32 %28, 5
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
br label %32
32: ; preds = %30, %25
br label %22
33: ; preds = %22
ret void
}

LLVM IR (-O2):
@.str.2 = [39 x i8] c"\0A\0APlease input the number of players: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [26 x i8] c"You should split the game\00"
@str = [50 x i8] c" Welcome to ASCII Vols!\00"
define void @menu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @putchar(i32 42)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 80
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %10
%11 = phi i32 [ 0, %8 ], [ %13, %10 ]
%12 = tail call i32 @putchar(i32 42)
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, 80
br i1 %14, label %15, label %10
15: ; preds = %10, %23
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%18 = load i32, i32* %1
%19 = icmp sgt i32 %18, 5
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%22 = load i32, i32* %1
br label %23
23: ; preds = %20, %15
%24 = phi i32 [ %22, %20 ], [ %18, %15 ]
%25 = icmp slt i32 %24, 0
br i1 %25, label %15, label %26
26: ; preds = %23
ret void
}