#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*/ pvp();
int /*<<< orphan*/ scanf(char *, ...);
void start() {
  int choice;
  printf("##########CHESS##########\n");
  printf("<1>PvP\n");
  printf(">");
  scanf("%d", &choice);
  switch (choice) {
  case 1:
    printf("\n");
    pvp();
    break;
  }
  char restart;
  printf("\nDO YOU WANT TO RESTART?(y/n): ");
  scanf("%c", &restart);
  switch (restart) {
  case 'y':
    printf("\n\n");
    start();
    break;
  case 'n':
    return;
    break;
  }
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
jne    11a2 <start+0x62>
jmp    118f <start+0x4f>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <pvp@plt>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
xor    %eax,%eax
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x6e,%eax
je     11fc <start+0xbc>
jmp    11d5 <start+0x95>
mov    -0xc(%rbp),%eax
sub    $0x79,%eax
jne    1201 <start+0xc1>
jmp    11e6 <start+0xa6>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
call   1040 <start@plt>
jmp    1201 <start+0xc1>
jmp    1201 <start+0xc1>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
push   %rax
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <puts@plt>
mov    $0x3e,%edi
call   1030 <putchar@plt>
lea    0xe76(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
cmpl   $0x1,0x4(%rsp)
jne    11ae <start+0x4e>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1080 <pvp@plt>
lea    0xe4e(%rip),%rdi
call   1050 <printf@plt>
lea    0xe62(%rip),%rdi
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
cmpb   $0x79,0x3(%rsp)
jne    11e5 <start+0x85>
lea    0xe6c(%rip),%rdi
call   1040 <puts@plt>
call   1060 <start@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"##########CHESS##########\0A\00"
@.str.1 = [8 x i8] c"<1>PvP\0A\00"
@.str.2 = [2 x i8] c">\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [32 x i8] c"\0ADO YOU WANT TO RESTART?(y/n): \00"
@.str.6 = [3 x i8] c"%c\00"
@.str.7 = [3 x i8] c"\0A\0A\00"
define void @start() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
switch i32 %7, label %11 [
i32 1, label %8
]
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 (...) @pvp()
br label %11
11: ; preds = %0, %8
%12 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %2)
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
switch i32 %15, label %19 [
i32 121, label %16
i32 110, label %18
]
16: ; preds = %11
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %19
18: ; preds = %11
br label %19
19: ; preds = %18, %11, %16
ret void
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"%d\00"
@.str.5 = [32 x i8] c"\0ADO YOU WANT TO RESTART?(y/n): \00"
@.str.6 = [3 x i8] c"%c\00"
@str = [26 x i8] c"##########CHESS##########\00"
@str.8 = [7 x i8] c"<1>PvP\00"
@str.9 = [2 x i8] c"\0A\00"
define void @start() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 @putchar(i32 62)
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = call i32 @putchar(i32 10)
%12 = call i32 (...) @pvp()
br label %13
13: ; preds = %0, %10
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %2)
%16 = load i8, i8* %2
%17 = icmp eq i8 %16, 121
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.9, i64 0, i64 0))
br label %20
20: ; preds = %13, %18
ret void
}