#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 */
scalar_t__ candidatoCabeEnCaja(int **, int, int, int);
scalar_t__ candidatoCabeEnColumna(int **, int, int);
scalar_t__ candidatoCabeEnFila(int **, int, int);
int candidatoUnicoEnPosicion(int s[9][9], int f, int c, int candidato) {
  int otroCandidato;
  for (otroCandidato = 1; otroCandidato <= 9; otroCandidato++) {
    if (otroCandidato != candidato &&
        candidatoCabeEnFila(s, f, otroCandidato) &&
        candidatoCabeEnColumna(s, c, otroCandidato) &&
        candidatoCabeEnCaja(s, f, c, otroCandidato)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<candidatoUnicoEnPosicion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
cmpl   $0x9,-0x20(%rbp)
jg     11cf <candidatoUnicoEnPosicion+0x9f>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     11bc <candidatoUnicoEnPosicion+0x8c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1030 <candidatoCabeEnFila@plt>
cmp    $0x0,%rax
je     11bc <candidatoUnicoEnPosicion+0x8c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1050 <candidatoCabeEnColumna@plt>
cmp    $0x0,%rax
je     11bc <candidatoUnicoEnPosicion+0x8c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1040 <candidatoCabeEnCaja@plt>
cmp    $0x0,%rax
je     11bc <candidatoUnicoEnPosicion+0x8c>
movl   $0x0,-0x4(%rbp)
jmp    11d6 <candidatoUnicoEnPosicion+0xa6>
jmp    11c1 <candidatoUnicoEnPosicion+0x91>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    114c <candidatoUnicoEnPosicion+0x1c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<candidatoUnicoEnPosicion>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r12d
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbp
mov    $0x1,%ebx
jmp    1158 <candidatoUnicoEnPosicion+0x28>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0xa,%ebx
je     119a <candidatoUnicoEnPosicion+0x6a>
cmp    %ebx,%r12d
je     1150 <candidatoUnicoEnPosicion+0x20>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
call   1030 <candidatoCabeEnFila@plt>
test   %rax,%rax
je     1150 <candidatoUnicoEnPosicion+0x20>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1050 <candidatoCabeEnColumna@plt>
test   %rax,%rax
je     1150 <candidatoUnicoEnPosicion+0x20>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <candidatoCabeEnCaja@plt>
test   %rax,%rax
je     1150 <candidatoUnicoEnPosicion+0x20>
xor    %eax,%eax
jmp    119f <candidatoUnicoEnPosicion+0x6f>
mov    $0x1,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @candidatoUnicoEnPosicion([9 x i32]* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca [9 x i32]*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store [9 x i32]* %0, [9 x i32]** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 1, i32* %10
br label %11
11: ; preds = %42, %4
%12 = load i32, i32* %10
%13 = icmp sle i32 %12, 9
br i1 %13, label %14, label %45
14: ; preds = %11
%15 = load i32, i32* %10
%16 = load i32, i32* %9
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %41
18: ; preds = %14
%19 = load [9 x i32]*, [9 x i32]** %6
%20 = bitcast [9 x i32]* %19 to i32**
%21 = load i32, i32* %7
%22 = load i32, i32* %10
%23 = call i64 @candidatoCabeEnFila(i32** %20, i32 %21, i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %41
25: ; preds = %18
%26 = load [9 x i32]*, [9 x i32]** %6
%27 = bitcast [9 x i32]* %26 to i32**
%28 = load i32, i32* %8
%29 = load i32, i32* %10
%30 = call i64 @candidatoCabeEnColumna(i32** %27, i32 %28, i32 %29)
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %41
32: ; preds = %25
%33 = load [9 x i32]*, [9 x i32]** %6
%34 = bitcast [9 x i32]* %33 to i32**
%35 = load i32, i32* %7
%36 = load i32, i32* %8
%37 = load i32, i32* %10
%38 = call i64 @candidatoCabeEnCaja(i32** %34, i32 %35, i32 %36, i32 %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %32
store i32 0, i32* %5
br label %46
41: ; preds = %32, %25, %18, %14
br label %42
42: ; preds = %41
%43 = load i32, i32* %10
%44 = add nsw i32 %43, 1
store i32 %44, i32* %10
br label %11
45: ; preds = %11
store i32 1, i32* %5
br label %46
46: ; preds = %45, %40
%47 = load i32, i32* %5
ret i32 %47
}

LLVM IR (-O2):
define i32 @candidatoUnicoEnPosicion([9 x i32]* %0, i32 %1, i32 %2, i32 %3) {
%5 = bitcast [9 x i32]* %0 to i32**
br label %6
6: ; preds = %4, %18
%7 = phi i32 [ 1, %4 ], [ %19, %18 ]
%8 = icmp eq i32 %7, %3
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = tail call i64 @candidatoCabeEnFila(i32** %5, i32 %1, i32 %7)
%11 = icmp eq i64 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %9
%13 = tail call i64 @candidatoCabeEnColumna(i32** %5, i32 %2, i32 %7)
%14 = icmp eq i64 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = tail call i64 @candidatoCabeEnCaja(i32** %5, i32 %1, i32 %2, i32 %7)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %6, %9, %12, %15
%19 = add nuw nsw i32 %7, 1
%20 = icmp eq i32 %19, 10
br i1 %20, label %21, label %6
21: ; preds = %18, %15
%22 = phi i32 [ 0, %15 ], [ 1, %18 ]
ret i32 %22
}