#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 comprobar_fin();
scalar_t__ hacer_jugada(int);
int /*<<< orphan*/ inicializar_tablero();
int /*<<< orphan*/ mostrar_tablero();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char **argv) {
  int jugador;
  int total_jugadas;
  total_jugadas = 0;
  inicializar_tablero();
  do {
    if (total_jugadas % 2 == 0)
      jugador = 0;
    else
      jugador = 1;
    total_jugadas++;
    mostrar_tablero();
    if (hacer_jugada(jugador) == 0) {
      printf("\n\nJugada incorrecta.\n\n");
      system("pause");
    }
  } while (comprobar_fin() == -1);
  mostrar_tablero();
  if (comprobar_fin() == 1)
    printf("\n\nEnhorabuena!! Has ganado!!\n\n");
  else
    printf("\n\nEl ordenador ha ganado la partida!!\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1070 <inicializar_tablero@plt>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a4 <main+0x44>
movl   $0x0,-0x14(%rbp)
jmp    11ab <main+0x4b>
movl   $0x1,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1080 <mostrar_tablero@plt>
mov    -0x14(%rbp),%edi
call   1030 <hacer_jugada@plt>
cmp    $0x0,%rax
jne    11e5 <main+0x85>
lea    0xe2c(%rip),%rdi
call   1050 <printf@plt>
lea    0xe37(%rip),%rdi
call   1040 <system@plt>
jmp    11ea <main+0x8a>
mov    $0x0,%al
call   1060 <comprobar_fin@plt>
cmp    $0xffffffff,%eax
je     1184 <main+0x24>
mov    $0x0,%al
call   1080 <mostrar_tablero@plt>
mov    $0x0,%al
call   1060 <comprobar_fin@plt>
cmp    $0x1,%eax
jne    1222 <main+0xc2>
lea    0xe05(%rip),%rdi
call   1050 <printf@plt>
jmp    122e <main+0xce>
lea    0xe13(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <inicializar_tablero@plt>
lea    0xed6(%rip),%r14
lea    0xe84(%rip),%r15
xor    %ebx,%ebx
jmp    118f <main+0x2f>
xor    %eax,%eax
call   1060 <comprobar_fin@plt>
add    $0x1,%ebx
cmp    $0xffffffff,%eax
jne    11b9 <main+0x59>
mov    %ebx,%ebp
and    $0x1,%ebp
xor    %eax,%eax
call   1080 <mostrar_tablero@plt>
mov    %ebp,%edi
call   1040 <hacer_jugada@plt>
test   %rax,%rax
jne    1180 <main+0x20>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1050 <system@plt>
jmp    1180 <main+0x20>
xor    %eax,%eax
call   1080 <mostrar_tablero@plt>
xor    %eax,%eax
call   1060 <comprobar_fin@plt>
cmp    $0x1,%eax
lea    0xe5c(%rip),%rax
lea    0xe2e(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0A\0AJugada incorrecta.\0A\0A\00"
@.str.1 = [6 x i8] c"pause\00"
@.str.2 = [31 x i8] c"\0A\0AEnhorabuena!! Has ganado!!\0A\0A\00"
@.str.3 = [40 x i8] c"\0A\0AEl ordenador ha ganado la partida!!\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%8 = call i32 (...) @inicializar_tablero()
br label %9
9: ; preds = %26, %2
%10 = load i32, i32* %7
%11 = srem i32 %10, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 0, i32* %6
br label %15
14: ; preds = %9
store i32 1, i32* %6
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
store i32 %17, i32* %7
%18 = call i32 (...) @mostrar_tablero()
%19 = load i32, i32* %6
%20 = call i64 @hacer_jugada(i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %15
%23 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %22, %15
br label %26
26: ; preds = %25
%27 = call i32 (...) @comprobar_fin()
%28 = icmp eq i32 %27, -1
br i1 %28, label %9, label %29
29: ; preds = %26
%30 = call i32 (...) @mostrar_tablero()
%31 = call i32 (...) @comprobar_fin()
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %37
35: ; preds = %29
%36 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
br label %37
37: ; preds = %35, %33
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"pause\00"
@str = [39 x i8] c"\0A\0AEl ordenador ha ganado la partida!!\0A\00"
@str.4 = [30 x i8] c"\0A\0AEnhorabuena!! Has ganado!!\0A\00"
@str.5 = [22 x i8] c"\0A\0AJugada incorrecta.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @inicializar_tablero()
br label %4
4: ; preds = %14, %2
%5 = phi i32 [ 0, %2 ], [ %7, %14 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %5, 1
%8 = tail call i32 (...) @mostrar_tablero()
%9 = tail call i64 @hacer_jugada(i32 %6)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0))
%13 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %4, %11
%15 = tail call i32 (...) @comprobar_fin()
%16 = icmp eq i32 %15, -1
br i1 %16, label %4, label %17
17: ; preds = %14
%18 = tail call i32 (...) @mostrar_tablero()
%19 = tail call i32 (...) @comprobar_fin()
%20 = icmp eq i32 %19, 1
%21 = select i1 %20, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0)
%22 = tail call i32 @puts(i8* dereferenceable(1) %21)
ret i32 0
}