#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*/ copyMatriz(int **, int **);
int /*<<< orphan*/ forzarColumna(int **, int, int, int, int *, int *, int *);
scalar_t__ forzarColumnaUnica(int **, int, int, int *, int *);
int /*<<< orphan*/ forzarFilasCuadros(int **, int, int, int);
int getCandidatoMenorCantidadConflictos(int **, int, int, int *, int *);
int /*<<< orphan*/ reiniciarVector(int *, int);
int /*<<< orphan*/ verificarReglas(int **, int, int, int, int /*<<< orphan*/);
int forzar(int sudoku[9][9], int iPosicionAtratar, int jPosicionAtratar, int *j,
           int *jAnterior, int *blackList, int *blackListForzarColumna,
           int *blackListCandidatosMenorCantidadConflictos) {
  int loop = -1;
  do {
    if (*jAnterior != jPosicionAtratar || loop != -1) {
      reiniciarVector(blackList, 9);
      reiniciarVector(blackListForzarColumna, 9);
      reiniciarVector(blackListCandidatosMenorCantidadConflictos, 9);
      *jAnterior = jPosicionAtratar;
    }
    if (forzarColumnaUnica(sudoku, iPosicionAtratar, jPosicionAtratar, j,
                           blackList)) {
      return 1;
    }
    loop = loop == -1 ? 20 : loop;
    loop--;
  } while (loop);
  *jAnterior = *j;
  int sudokuSimulacion[9][9];
  copyMatriz(sudoku, sudokuSimulacion);
  int candidatoConMenorCantidadDeConflictos =
      getCandidatoMenorCantidadConflictos(
          sudoku, iPosicionAtratar, jPosicionAtratar, blackList,
          blackListCandidatosMenorCantidadConflictos);
  forzarColumna(sudoku, candidatoConMenorCantidadDeConflictos, iPosicionAtratar,
                jPosicionAtratar, j, jAnterior, blackListForzarColumna);
  do {
    if (!forzarFilasCuadros(sudoku, candidatoConMenorCantidadDeConflictos,
                            iPosicionAtratar, jPosicionAtratar)) {
      candidatoConMenorCantidadDeConflictos =
          getCandidatoMenorCantidadConflictos(
              sudoku, iPosicionAtratar, jPosicionAtratar, blackList,
              blackListCandidatosMenorCantidadConflictos);
      if (!candidatoConMenorCantidadDeConflictos) {
        return 0;
      }
      forzarColumna(sudoku, candidatoConMenorCantidadDeConflictos,
                    iPosicionAtratar, jPosicionAtratar, j, jAnterior,
                    blackListForzarColumna);
    }
  } while (!verificarReglas(sudoku, iPosicionAtratar, jPosicionAtratar,
                            candidatoConMenorCantidadDeConflictos, 0));
  return 1;
}


x86 assembly (clang, -O0):
<forzar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0xffffffff,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
cmp    -0x18(%rbp),%eax
jne    11b9 <forzar+0x49>
cmpl   $0xffffffff,-0x34(%rbp)
je     11ec <forzar+0x7c>
mov    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1040 <reiniciarVector@plt>
mov    0x10(%rbp),%rdi
mov    $0x9,%esi
call   1040 <reiniciarVector@plt>
mov    0x18(%rbp),%rdi
mov    $0x9,%esi
call   1040 <reiniciarVector@plt>
mov    -0x18(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1090 <forzarColumnaUnica@plt>
cmp    $0x0,%rax
je     1219 <forzar+0xa9>
movl   $0x1,-0x4(%rbp)
jmp    1363 <forzar+0x1f3>
cmpl   $0xffffffff,-0x34(%rbp)
jne    1233 <forzar+0xc3>
mov    $0x14,%eax
mov    %eax,-0x188(%rbp)
jmp    123c <forzar+0xcc>
mov    -0x34(%rbp),%eax
mov    %eax,-0x188(%rbp)
mov    -0x188(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jne    11a0 <forzar+0x30>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x180(%rbp),%rsi
call   1080 <copyMatriz@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    0x18(%rbp),%r8
call   1070 <getCandidatoMenorCantidadConflictos@plt>
mov    %eax,-0x184(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x184(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <forzarColumna@plt>
mov    -0x10(%rbp),%rdi
mov    -0x184(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1050 <forzarFilasCuadros@plt>
cmp    $0x0,%eax
jne    132f <forzar+0x1bf>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    0x18(%rbp),%r8
call   1070 <getCandidatoMenorCantidadConflictos@plt>
mov    %eax,-0x184(%rbp)
cmpl   $0x0,-0x184(%rbp)
jne    130a <forzar+0x19a>
movl   $0x0,-0x4(%rbp)
jmp    1363 <forzar+0x1f3>
mov    -0x10(%rbp),%rdi
mov    -0x184(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <forzarColumna@plt>
jmp    1334 <forzar+0x1c4>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x184(%rbp),%ecx
xor    %r8d,%r8d
call   1060 <verificarReglas@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    12b6 <forzar+0x146>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forzar>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x158,%rsp
mov    %r9,%r14
mov    %r8,%r12
mov    %rcx,0x8(%rsp)
mov    %edx,%ebp
mov    %esi,%r13d
mov    %rdi,%rbx
mov    $0xffffffff,%r15d
nopw   0x0(%rax,%rax,1)
cmp    %ebp,(%r12)
jne    11ac <forzar+0x3c>
cmp    $0xffffffff,%r15d
je     11e1 <forzar+0x71>
mov    %r14,%rdi
mov    $0x9,%esi
call   1040 <reiniciarVector@plt>
mov    0x190(%rsp),%rdi
mov    $0x9,%esi
call   1040 <reiniciarVector@plt>
mov    0x198(%rsp),%rdi
mov    $0x9,%esi
call   1040 <reiniciarVector@plt>
mov    %ebp,(%r12)
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %ebp,%edx
mov    0x8(%rsp),%rcx
mov    %r14,%r8
call   1090 <forzarColumnaUnica@plt>
test   %rax,%rax
jne    12e0 <forzar+0x170>
cmp    $0xffffffff,%r15d
lea    -0x1(%r15),%eax
mov    $0x13,%ecx
cmove  %ecx,%eax
mov    %eax,%r15d
test   %eax,%eax
jne    11a0 <forzar+0x30>
mov    0x8(%rsp),%rax
mov    (%rax),%eax
mov    %eax,(%r12)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <copyMatriz@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %ebp,%edx
mov    %r14,%rcx
mov    0x198(%rsp),%r8
call   1070 <getCandidatoMenorCantidadConflictos@plt>
mov    %eax,%r15d
mov    0x190(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    %ebp,%ecx
mov    0x8(%rsp),%r8
mov    %r12,%r9
call   1030 <forzarColumna@plt>
jmp    1287 <forzar+0x117>
nop
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %ebp,%edx
mov    %r15d,%ecx
xor    %r8d,%r8d
call   1060 <verificarReglas@plt>
test   %eax,%eax
jne    12e0 <forzar+0x170>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    %ebp,%ecx
call   1050 <forzarFilasCuadros@plt>
test   %eax,%eax
jne    1270 <forzar+0x100>
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %ebp,%edx
mov    %r14,%rcx
mov    0x198(%rsp),%r8
call   1070 <getCandidatoMenorCantidadConflictos@plt>
test   %eax,%eax
je     12f7 <forzar+0x187>
mov    %eax,%r15d
mov    0x190(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    %ebp,%ecx
mov    0x8(%rsp),%r8
mov    %r12,%r9
call   1030 <forzarColumna@plt>
jmp    1270 <forzar+0x100>
mov    $0x1,%eax
add    $0x158,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
jmp    12e5 <forzar+0x175>

LLVM IR (-O0):
define i32 @forzar([9 x i32]* %0, i32 %1, i32 %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7) {
%9 = alloca i32
%10 = alloca [9 x i32]*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32
%19 = alloca [9 x [9 x i32]]
%20 = alloca i32
store [9 x i32]* %0, [9 x i32]** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32* %3, i32** %13
store i32* %4, i32** %14
store i32* %5, i32** %15
store i32* %6, i32** %16
store i32* %7, i32** %17
store i32 -1, i32* %18
br label %21
21: ; preds = %58, %8
%22 = load i32*, i32** %14
%23 = load i32, i32* %22
%24 = load i32, i32* %12
%25 = icmp ne i32 %23, %24
br i1 %25, label %29, label %26
26: ; preds = %21
%27 = load i32, i32* %18
%28 = icmp ne i32 %27, -1
br i1 %28, label %29, label %38
29: ; preds = %26, %21
%30 = load i32*, i32** %15
%31 = call i32 @reiniciarVector(i32* %30, i32 9)
%32 = load i32*, i32** %16
%33 = call i32 @reiniciarVector(i32* %32, i32 9)
%34 = load i32*, i32** %17
%35 = call i32 @reiniciarVector(i32* %34, i32 9)
%36 = load i32, i32* %12
%37 = load i32*, i32** %14
store i32 %36, i32* %37
br label %38
38: ; preds = %29, %26
%39 = load [9 x i32]*, [9 x i32]** %10
%40 = bitcast [9 x i32]* %39 to i32**
%41 = load i32, i32* %11
%42 = load i32, i32* %12
%43 = load i32*, i32** %13
%44 = load i32*, i32** %15
%45 = call i64 @forzarColumnaUnica(i32** %40, i32 %41, i32 %42, i32* %43, i32* %44)
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %38
store i32 1, i32* %9
br label %126
48: ; preds = %38
%49 = load i32, i32* %18
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %52
51: ; preds = %48
br label %54
52: ; preds = %48
%53 = load i32, i32* %18
br label %54
54: ; preds = %52, %51
%55 = phi i32 [ 20, %51 ], [ %53, %52 ]
store i32 %55, i32* %18
%56 = load i32, i32* %18
%57 = add nsw i32 %56, -1
store i32 %57, i32* %18
br label %58
58: ; preds = %54
%59 = load i32, i32* %18
%60 = icmp ne i32 %59, 0
br i1 %60, label %21, label %61
61: ; preds = %58
%62 = load i32*, i32** %13
%63 = load i32, i32* %62
%64 = load i32*, i32** %14
store i32 %63, i32* %64
%65 = load [9 x i32]*, [9 x i32]** %10
%66 = bitcast [9 x i32]* %65 to i32**
%67 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %19, i64 0, i64 0
%68 = bitcast [9 x i32]* %67 to i32**
%69 = call i32 @copyMatriz(i32** %66, i32** %68)
%70 = load [9 x i32]*, [9 x i32]** %10
%71 = bitcast [9 x i32]* %70 to i32**
%72 = load i32, i32* %11
%73 = load i32, i32* %12
%74 = load i32*, i32** %15
%75 = load i32*, i32** %17
%76 = call i32 @getCandidatoMenorCantidadConflictos(i32** %71, i32 %72, i32 %73, i32* %74, i32* %75)
store i32 %76, i32* %20
%77 = load [9 x i32]*, [9 x i32]** %10
%78 = bitcast [9 x i32]* %77 to i32**
%79 = load i32, i32* %20
%80 = load i32, i32* %11
%81 = load i32, i32* %12
%82 = load i32*, i32** %13
%83 = load i32*, i32** %14
%84 = load i32*, i32** %16
%85 = call i32 @forzarColumna(i32** %78, i32 %79, i32 %80, i32 %81, i32* %82, i32* %83, i32* %84)
br label %86
86: ; preds = %116, %61
%87 = load [9 x i32]*, [9 x i32]** %10
%88 = bitcast [9 x i32]* %87 to i32**
%89 = load i32, i32* %20
%90 = load i32, i32* %11
%91 = load i32, i32* %12
%92 = call i32 @forzarFilasCuadros(i32** %88, i32 %89, i32 %90, i32 %91)
%93 = icmp ne i32 %92, 0
br i1 %93, label %115, label %94
94: ; preds = %86
%95 = load [9 x i32]*, [9 x i32]** %10
%96 = bitcast [9 x i32]* %95 to i32**
%97 = load i32, i32* %11
%98 = load i32, i32* %12
%99 = load i32*, i32** %15
%100 = load i32*, i32** %17
%101 = call i32 @getCandidatoMenorCantidadConflictos(i32** %96, i32 %97, i32 %98, i32* %99, i32* %100)
store i32 %101, i32* %20
%102 = load i32, i32* %20
%103 = icmp ne i32 %102, 0
br i1 %103, label %105, label %104
104: ; preds = %94
store i32 0, i32* %9
br label %126
105: ; preds = %94
%106 = load [9 x i32]*, [9 x i32]** %10
%107 = bitcast [9 x i32]* %106 to i32**
%108 = load i32, i32* %20
%109 = load i32, i32* %11
%110 = load i32, i32* %12
%111 = load i32*, i32** %13
%112 = load i32*, i32** %14
%113 = load i32*, i32** %16
%114 = call i32 @forzarColumna(i32** %107, i32 %108, i32 %109, i32 %110, i32* %111, i32* %112, i32* %113)
br label %115
115: ; preds = %105, %86
br label %116
116: ; preds = %115
%117 = load [9 x i32]*, [9 x i32]** %10
%118 = bitcast [9 x i32]* %117 to i32**
%119 = load i32, i32* %11
%120 = load i32, i32* %12
%121 = load i32, i32* %20
%122 = call i32 @verificarReglas(i32** %118, i32 %119, i32 %120, i32 %121, i32 0)
%123 = icmp ne i32 %122, 0
%124 = xor i1 %123, true
br i1 %124, label %86, label %125
125: ; preds = %116
store i32 1, i32* %9
br label %126
126: ; preds = %125, %104, %47
%127 = load i32, i32* %9
ret i32 %127
}

LLVM IR (-O2):
define i32 @forzar([9 x i32]* %0, i32 %1, i32 %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7) {
%9 = alloca [9 x [9 x i32]]
%10 = bitcast [9 x i32]* %0 to i32**
br label %11
11: ; preds = %24, %8
%12 = phi i32 [ -1, %8 ], [ %27, %24 ]
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, %2
%15 = icmp ne i32 %12, -1
%16 = select i1 %14, i1 true, i1 %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = tail call i32 @reiniciarVector(i32* %5, i32 9)
%19 = tail call i32 @reiniciarVector(i32* %6, i32 9)
%20 = tail call i32 @reiniciarVector(i32* %7, i32 9)
store i32 %2, i32* %4
br label %21
21: ; preds = %11, %17
%22 = tail call i64 @forzarColumnaUnica(i32** %10, i32 %1, i32 %2, i32* %3, i32* %5)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %51
24: ; preds = %21
%25 = icmp eq i32 %12, -1
%26 = add nsw i32 %12, -1
%27 = select i1 %25, i32 19, i32 %26
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %11
29: ; preds = %24
%30 = load i32, i32* %3
store i32 %30, i32* %4
%31 = bitcast [9 x [9 x i32]]* %9 to i8*
%32 = bitcast [9 x [9 x i32]]* %9 to i32**
%33 = call i32 @copyMatriz(i32** %10, i32** %32)
%34 = call i32 @getCandidatoMenorCantidadConflictos(i32** %10, i32 %1, i32 %2, i32* %5, i32* %7)
%35 = call i32 @forzarColumna(i32** %10, i32 %34, i32 %1, i32 %2, i32* %3, i32* %4, i32* %6)
br label %36
36: ; preds = %45, %29
%37 = phi i32 [ %34, %29 ], [ %46, %45 ]
%38 = call i32 @forzarFilasCuadros(i32** %10, i32 %37, i32 %1, i32 %2)
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %45
40: ; preds = %36
%41 = call i32 @getCandidatoMenorCantidadConflictos(i32** %10, i32 %1, i32 %2, i32* %5, i32* %7)
%42 = icmp eq i32 %41, 0
br i1 %42, label %49, label %43
43: ; preds = %40
%44 = call i32 @forzarColumna(i32** %10, i32 %41, i32 %1, i32 %2, i32* %3, i32* %4, i32* %6)
br label %45
45: ; preds = %36, %43
%46 = phi i32 [ %37, %36 ], [ %41, %43 ]
%47 = call i32 @verificarReglas(i32** %10, i32 %1, i32 %2, i32 %46, i32 0)
%48 = icmp eq i32 %47, 0
br i1 %48, label %36, label %49
49: ; preds = %45, %40
%50 = phi i32 [ 0, %40 ], [ 1, %45 ]
br label %51
51: ; preds = %21, %49
%52 = phi i32 [ %50, %49 ], [ 1, %21 ]
ret i32 %52
}