#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*/ apuestaUsuario(int *);
int /*<<< orphan*/ comprobar(int *, int *, int *, int *, int *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ piedraPapelTijera(int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf_s(char *, char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main() {
  int partida = 0, numberplayer = 0, numbercomputer = 0, player = 0,
      computer = 0;
  char a = 'p';
  srand(time(0));
  do {
    fflush(stdin);
    apuestaUsuario(&numberplayer);
    piedraPapelTijera(&numbercomputer);
    comprobar(&numberplayer, &numbercomputer, &player, &computer, &partida);
  } while (partida != 1);
  printf("Quieres volver a jugar? (S/N)\n");
  scanf_s("%c", &a);
  system("cls");
  if (a == 's')
    main();
  else if (a == 'n') {
    system("pause");
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movb   $0x70,-0x19(%rbp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
lea    -0xc(%rbp),%rdi
call   1080 <apuestaUsuario@plt>
lea    -0x10(%rbp),%rdi
call   10c0 <piedraPapelTijera@plt>
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x8(%rbp),%r8
call   1090 <comprobar@plt>
cmpl   $0x1,-0x8(%rbp)
jne    11e4 <main+0x44>
lea    0xdd2(%rip),%rdi
call   1040 <printf@plt>
lea    0xde5(%rip),%rdi
lea    -0x19(%rbp),%rsi
call   10b0 <scanf_s@plt>
lea    0xdd8(%rip),%rdi
call   1030 <system@plt>
movsbl -0x19(%rbp),%eax
cmp    $0x73,%eax
jne    1266 <main+0xc6>
call   10a0 <main@plt>
jmp    1290 <main+0xf0>
movsbl -0x19(%rbp),%eax
cmp    $0x6e,%eax
jne    128b <main+0xeb>
lea    0xdac(%rip),%rdi
call   1030 <system@plt>
movl   $0x0,-0x4(%rbp)
jmp    1290 <main+0xf0>
jmp    1290 <main+0xf0>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x4(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movb   $0x70,0x3(%rsp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    0x2df8(%rip),%rbp
lea    0x14(%rsp),%r14
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r12
lea    0x4(%rsp),%r13
nopl   0x0(%rax)
mov    0x0(%rbp),%edi
call   1070 <fflush@plt>
mov    %r14,%rdi
call   1080 <apuestaUsuario@plt>
mov    %rbx,%rdi
call   10c0 <piedraPapelTijera@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %r13,%r8
call   1090 <comprobar@plt>
cmpl   $0x1,0x4(%rsp)
jne    1210 <main+0x70>
lea    0xdc3(%rip),%rdi
call   1030 <puts@plt>
lea    0xdaa(%rip),%rdi
lea    0x3(%rsp),%rsi
call   10b0 <scanf_s@plt>
lea    0xd9c(%rip),%rdi
call   1040 <system@plt>
mov    0x3(%rsp),%al
cmp    $0x6e,%al
je     127f <main+0xdf>
cmp    $0x73,%al
jne    128b <main+0xeb>
call   10a0 <main@plt>
jmp    128b <main+0xeb>
lea    0xd81(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [31 x i8] c"Quieres volver a jugar? (S/N)\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"cls\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i8 112, i8* %7
%8 = call i32 @time(i32 0)
%9 = call i32 @srand(i32 %8)
br label %10
10: ; preds = %16, %0
%11 = load i32, i32* @stdin
%12 = call i32 @fflush(i32 %11)
%13 = call i32 @apuestaUsuario(i32* %3)
%14 = call i32 @piedraPapelTijera(i32* %4)
%15 = call i32 @comprobar(i32* %3, i32* %4, i32* %5, i32* %6, i32* %2)
br label %16
16: ; preds = %10
%17 = load i32, i32* %2
%18 = icmp ne i32 %17, 1
br i1 %18, label %10, label %19
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%22 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%23 = load i8, i8* %7
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 115
br i1 %25, label %26, label %28
26: ; preds = %19
%27 = call i32 @main()
br label %35
28: ; preds = %19
%29 = load i8, i8* %7
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 110
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %35
34: ; preds = %28
br label %35
35: ; preds = %32, %34, %26
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"cls\00"
@.str.3 = [6 x i8] c"pause\00"
@str = [30 x i8] c"Quieres volver a jugar? (S/N)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%8 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%9 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%10 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%11 = bitcast i32* %5 to i8*
store i32 0, i32* %5
store i8 112, i8* %6
%12 = tail call i32 @time(i32 0)
%13 = tail call i32 @srand(i32 %12)
br label %14
14: ; preds = %14, %0
%15 = load i32, i32* @stdin
%16 = call i32 @fflush(i32 %15)
%17 = call i32 @apuestaUsuario(i32* %2)
%18 = call i32 @piedraPapelTijera(i32* %3)
%19 = call i32 @comprobar(i32* %2, i32* %3, i32* %4, i32* %5, i32* %1)
%20 = load i32, i32* %1
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %14
22: ; preds = %14
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%24 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%25 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%26 = load i8, i8* %6
switch i8 %26, label %31 [
i8 115, label %27
i8 110, label %29
]
27: ; preds = %22
%28 = call i32 @main()
br label %31
29: ; preds = %22
%30 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %31
31: ; preds = %27, %22, %29
ret i32 0
}