#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*/ encontrar_jugada_posible(char *, char, int *, int *,
                                            int /*<<< orphan*/);
int es_empate(char *ptablero, char jugador) {
  int a1 = 0, a2 = 0;
  if (jugador == 'B' && !encontrar_jugada_posible(ptablero, 'B', &a1, &a2, 0))
    return 1;
  if (jugador == 'N' && !encontrar_jugada_posible(ptablero, 'N', &a1, &a2, 0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<es_empate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x42,%eax
jne    116b <es_empate+0x5b>
mov    -0x10(%rbp),%rdi
mov    $0x42,%esi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <encontrar_jugada_posible@plt>
cmp    $0x0,%eax
jne    116b <es_empate+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    11ad <es_empate+0x9d>
movsbl -0x11(%rbp),%eax
cmp    $0x4e,%eax
jne    11a6 <es_empate+0x96>
mov    -0x10(%rbp),%rdi
mov    $0x4e,%esi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <encontrar_jugada_posible@plt>
cmp    $0x0,%eax
jne    11a6 <es_empate+0x96>
movl   $0x1,-0x4(%rbp)
jmp    11ad <es_empate+0x9d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_empate>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
cmp    $0x4e,%sil
je     113b <es_empate+0x2b>
cmp    $0x42,%sil
jne    1154 <es_empate+0x44>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x42,%esi
jmp    1148 <es_empate+0x38>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x4e,%esi
xor    %r8d,%r8d
call   1030 <encontrar_jugada_posible@plt>
test   %eax,%eax
je     1158 <es_empate+0x48>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @es_empate(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 66
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 @encontrar_jugada_posible(i8* %12, i8 signext 66, i32* %6, i32* %7, i32 0)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %11
store i32 1, i32* %3
br label %26
16: ; preds = %11, %2
%17 = load i8, i8* %5
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 78
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = load i8*, i8** %4
%22 = call i32 @encontrar_jugada_posible(i8* %21, i8 signext 78, i32* %6, i32* %7, i32 0)
%23 = icmp ne i32 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %20
store i32 1, i32* %3
br label %26
25: ; preds = %20, %16
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %15
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @es_empate(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
switch i8 %1, label %13 [
i8 66, label %7
i8 78, label %10
]
7: ; preds = %2
%8 = call i32 @encontrar_jugada_posible(i8* %0, i8 signext 66, i32* %3, i32* %4, i32 0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %13
10: ; preds = %2
%11 = call i32 @encontrar_jugada_posible(i8* %0, i8 signext 78, i32* %3, i32* %4, i32 0)
%12 = icmp eq i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %7, %2, %10
br label %14
14: ; preds = %10, %7, %13
%15 = phi i32 [ 0, %13 ], [ 1, %7 ], [ 1, %10 ]
ret i32 %15
}