#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__ rellenarSiUnicaPosicion(int **);
scalar_t__ rellenarSiUnicoValor(int **);
int /*<<< orphan*/ verificar81Datos(int **);
int resolverSudoku(int s[9][9]) {
  int cambio;
  int count = 0;
  do {
    cambio = 0;
    while (rellenarSiUnicaPosicion(s)) {
      cambio = 1;
    }
    while (rellenarSiUnicoValor(s)) {
      cambio = 1;
    }
    count++;
    if (count == 50) {
      cambio = 0;
    }
  } while (cambio);
  if (!verificar81Datos(s)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<resolverSudoku>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <rellenarSiUnicaPosicion@plt>
cmp    $0x0,%rax
je     1169 <resolverSudoku+0x39>
movl   $0x1,-0x14(%rbp)
jmp    114a <resolverSudoku+0x1a>
jmp    116e <resolverSudoku+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <rellenarSiUnicoValor@plt>
cmp    $0x0,%rax
je     118d <resolverSudoku+0x5d>
movl   $0x1,-0x14(%rbp)
jmp    116e <resolverSudoku+0x3e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x32,-0x18(%rbp)
jne    11a7 <resolverSudoku+0x77>
movl   $0x0,-0x14(%rbp)
jmp    11ac <resolverSudoku+0x7c>
cmpl   $0x0,-0x14(%rbp)
jne    1143 <resolverSudoku+0x13>
mov    -0x10(%rbp),%rdi
call   1040 <verificar81Datos@plt>
cmp    $0x0,%eax
jne    11d4 <resolverSudoku+0xa4>
movl   $0x0,-0x4(%rbp)
jmp    11db <resolverSudoku+0xab>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resolverSudoku>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <rellenarSiUnicaPosicion@plt>
mov    $0x0,%r14d
test   %rax,%rax
je     1173 <resolverSudoku+0x43>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1050 <rellenarSiUnicaPosicion@plt>
test   %rax,%rax
jne    1160 <resolverSudoku+0x30>
mov    $0x1,%r14d
mov    %rbx,%rdi
call   1030 <rellenarSiUnicoValor@plt>
test   %rax,%rax
je     1193 <resolverSudoku+0x63>
mov    %rbx,%rdi
call   1030 <rellenarSiUnicoValor@plt>
test   %rax,%rax
jne    1180 <resolverSudoku+0x50>
mov    $0x1,%r14d
add    $0x1,%ebp
cmp    $0x32,%ebp
je     11a0 <resolverSudoku+0x70>
test   %r14d,%r14d
jne    1140 <resolverSudoku+0x10>
mov    %rbx,%rdi
call   1040 <verificar81Datos@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @resolverSudoku([9 x i32]* %0) {
%2 = alloca i32
%3 = alloca [9 x i32]*
%4 = alloca i32
%5 = alloca i32
store [9 x i32]* %0, [9 x i32]** %3
store i32 0, i32* %5
br label %6
6: ; preds = %27, %1
store i32 0, i32* %4
br label %7
7: ; preds = %12, %6
%8 = load [9 x i32]*, [9 x i32]** %3
%9 = bitcast [9 x i32]* %8 to i32**
%10 = call i64 @rellenarSiUnicaPosicion(i32** %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7
store i32 1, i32* %4
br label %7
13: ; preds = %7
br label %14
14: ; preds = %19, %13
%15 = load [9 x i32]*, [9 x i32]** %3
%16 = bitcast [9 x i32]* %15 to i32**
%17 = call i64 @rellenarSiUnicoValor(i32** %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 1, i32* %4
br label %14
20: ; preds = %14
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, 50
br i1 %24, label %25, label %26
25: ; preds = %20
store i32 0, i32* %4
br label %26
26: ; preds = %25, %20
br label %27
27: ; preds = %26
%28 = load i32, i32* %4
%29 = icmp ne i32 %28, 0
br i1 %29, label %6, label %30
30: ; preds = %27
%31 = load [9 x i32]*, [9 x i32]** %3
%32 = bitcast [9 x i32]* %31 to i32**
%33 = call i32 @verificar81Datos(i32** %32)
%34 = icmp ne i32 %33, 0
br i1 %34, label %36, label %35
35: ; preds = %30
store i32 0, i32* %2
br label %37
36: ; preds = %30
store i32 1, i32* %2
br label %37
37: ; preds = %36, %35
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @resolverSudoku([9 x i32]* %0) {
%2 = bitcast [9 x i32]* %0 to i32**
br label %3
3: ; preds = %17, %1
%4 = phi i32 [ 0, %1 ], [ %19, %17 ]
%5 = tail call i64 @rellenarSiUnicaPosicion(i32** %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3, %7
%8 = tail call i64 @rellenarSiUnicaPosicion(i32** %2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %7
10: ; preds = %7, %3
%11 = phi i32 [ 0, %3 ], [ 1, %7 ]
%12 = tail call i64 @rellenarSiUnicoValor(i32** %2)
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %10, %14
%15 = tail call i64 @rellenarSiUnicoValor(i32** %2)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %14
17: ; preds = %14, %10
%18 = phi i32 [ %11, %10 ], [ 1, %14 ]
%19 = add nuw nsw i32 %4, 1
%20 = icmp eq i32 %19, 50
%21 = icmp eq i32 %18, 0
%22 = or i1 %20, %21
br i1 %22, label %23, label %3
23: ; preds = %17
%24 = tail call i32 @verificar81Datos(i32** %2)
%25 = icmp ne i32 %24, 0
%26 = zext i1 %25 to i32
ret i32 %26
}