#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*/ addInt(int *, int, int);
int /*<<< orphan*/ containsInt(int *, int, int);
int getFilaConflictoEnColumna(int **, int, int);
int /*<<< orphan*/ hayConflictoEnColumna(int **, int);
scalar_t__ hayConflictoSoloEnColumna(int **, int, int, int);
int forzarColumnaUnica(int sudoku[9][9], int iPosicionAtratar,
                       int jPosicionAtratar, int *j, int *blackList) {
  if (!hayConflictoEnColumna(sudoku, jPosicionAtratar)) {
    return 0;
  }
  int nuevoCandidato;
  for (nuevoCandidato = 1; nuevoCandidato <= 9; nuevoCandidato++) {
    if (hayConflictoSoloEnColumna(sudoku, iPosicionAtratar, jPosicionAtratar,
                                  nuevoCandidato) &&
        !containsInt(blackList, 9, nuevoCandidato)) {
      addInt(blackList, 9, nuevoCandidato);
      int iPosicionConflicto =
          getFilaConflictoEnColumna(sudoku, jPosicionAtratar, nuevoCandidato);
      int jPosicionConflicto = jPosicionAtratar;
      sudoku[iPosicionConflicto][jPosicionConflicto] = 0;
      sudoku[iPosicionAtratar][jPosicionAtratar] = nuevoCandidato;
      *j -= 1;
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<forzarColumnaUnica>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1050 <hayConflictoEnColumna@plt>
cmp    $0x0,%eax
jne    118b <forzarColumnaUnica+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    125f <forzarColumnaUnica+0x10f>
movl   $0x1,-0x2c(%rbp)
cmpl   $0x9,-0x2c(%rbp)
jg     1258 <forzarColumnaUnica+0x108>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x2c(%rbp),%ecx
call   1070 <hayConflictoSoloEnColumna@plt>
cmp    $0x0,%rax
je     1245 <forzarColumnaUnica+0xf5>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%edx
mov    $0x9,%esi
call   1040 <containsInt@plt>
cmp    $0x0,%eax
jne    1245 <forzarColumnaUnica+0xf5>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%edx
mov    $0x9,%esi
call   1030 <addInt@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x2c(%rbp),%edx
call   1060 <getFilaConflictoEnColumna@plt>
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x2c(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    125f <forzarColumnaUnica+0x10f>
jmp    124a <forzarColumnaUnica+0xfa>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1192 <forzarColumnaUnica+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forzarColumnaUnica>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r12
mov    %rcx,%rbp
mov    %edx,%r13d
mov    %esi,%r15d
mov    %rdi,%rbx
mov    %edx,%esi
call   1050 <hayConflictoEnColumna@plt>
test   %eax,%eax
je     13bc <forzarColumnaUnica+0x26c>
movl   $0x0,0x4(%rsp)
mov    $0x1,%r14d
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    $0x1,%ecx
call   1070 <hayConflictoSoloEnColumna@plt>
test   %rax,%rax
je     11b9 <forzarColumnaUnica+0x69>
mov    %r12,%rdi
mov    $0x9,%esi
mov    $0x1,%edx
call   1040 <containsInt@plt>
test   %eax,%eax
je     136d <forzarColumnaUnica+0x21d>
mov    $0x2,%r14d
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    $0x2,%ecx
call   1070 <hayConflictoSoloEnColumna@plt>
test   %rax,%rax
je     11f1 <forzarColumnaUnica+0xa1>
mov    %r12,%rdi
mov    $0x9,%esi
mov    $0x2,%edx
call   1040 <containsInt@plt>
test   %eax,%eax
je     136d <forzarColumnaUnica+0x21d>
mov    $0x3,%r14d
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    $0x3,%ecx
call   1070 <hayConflictoSoloEnColumna@plt>
test   %rax,%rax
je     1229 <forzarColumnaUnica+0xd9>
mov    %r12,%rdi
mov    $0x9,%esi
mov    $0x3,%edx
call   1040 <containsInt@plt>
test   %eax,%eax
je     136d <forzarColumnaUnica+0x21d>
mov    $0x4,%r14d
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    $0x4,%ecx
call   1070 <hayConflictoSoloEnColumna@plt>
test   %rax,%rax
je     1261 <forzarColumnaUnica+0x111>
mov    %r12,%rdi
mov    $0x9,%esi
mov    $0x4,%edx
call   1040 <containsInt@plt>
test   %eax,%eax
je     136d <forzarColumnaUnica+0x21d>
mov    $0x5,%r14d
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    $0x5,%ecx
call   1070 <hayConflictoSoloEnColumna@plt>
test   %rax,%rax
je     1299 <forzarColumnaUnica+0x149>
mov    %r12,%rdi
mov    $0x9,%esi
mov    $0x5,%edx
call   1040 <containsInt@plt>
test   %eax,%eax
je     136d <forzarColumnaUnica+0x21d>
mov    $0x6,%r14d
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    $0x6,%ecx
call   1070 <hayConflictoSoloEnColumna@plt>
test   %rax,%rax
je     12d1 <forzarColumnaUnica+0x181>
mov    %r12,%rdi
mov    $0x9,%esi
mov    $0x6,%edx
call   1040 <containsInt@plt>
test   %eax,%eax
je     136d <forzarColumnaUnica+0x21d>
mov    $0x7,%r14d
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    $0x7,%ecx
call   1070 <hayConflictoSoloEnColumna@plt>
test   %rax,%rax
je     1305 <forzarColumnaUnica+0x1b5>
mov    %r12,%rdi
mov    $0x9,%esi
mov    $0x7,%edx
call   1040 <containsInt@plt>
test   %eax,%eax
je     136d <forzarColumnaUnica+0x21d>
mov    $0x8,%r14d
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    $0x8,%ecx
call   1070 <hayConflictoSoloEnColumna@plt>
test   %rax,%rax
je     1339 <forzarColumnaUnica+0x1e9>
mov    %r12,%rdi
mov    $0x9,%esi
mov    $0x8,%edx
call   1040 <containsInt@plt>
test   %eax,%eax
je     136d <forzarColumnaUnica+0x21d>
mov    $0x9,%r14d
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    $0x9,%ecx
call   1070 <hayConflictoSoloEnColumna@plt>
test   %rax,%rax
je     13c4 <forzarColumnaUnica+0x274>
mov    %r12,%rdi
mov    $0x9,%esi
mov    $0x9,%edx
call   1040 <containsInt@plt>
test   %eax,%eax
jne    13c4 <forzarColumnaUnica+0x274>
mov    %r12,%rdi
mov    $0x9,%esi
mov    %r14d,%edx
call   1030 <addInt@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %r14d,%edx
call   1060 <getFilaConflictoEnColumna@plt>
cltq
movslq %r13d,%rcx
lea    (%rax,%rax,8),%rax
lea    (%rbx,%rax,4),%rax
movl   $0x0,(%rax,%rcx,4)
movslq %r15d,%rax
lea    (%rax,%rax,8),%rax
lea    (%rbx,%rax,4),%rax
mov    %r14d,(%rax,%rcx,4)
addl   $0xffffffff,0x0(%rbp)
movl   $0x1,0x4(%rsp)
jmp    13c4 <forzarColumnaUnica+0x274>
movl   $0x0,0x4(%rsp)
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @forzarColumnaUnica([9 x i32]* %0, i32 %1, i32 %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca [9 x i32]*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store [9 x i32]* %0, [9 x i32]** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i32* %4, i32** %11
%15 = load [9 x i32]*, [9 x i32]** %7
%16 = bitcast [9 x i32]* %15 to i32**
%17 = load i32, i32* %9
%18 = call i32 @hayConflictoEnColumna(i32** %16, i32 %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %5
store i32 0, i32* %6
br label %71
21: ; preds = %5
store i32 1, i32* %12
br label %22
22: ; preds = %67, %21
%23 = load i32, i32* %12
%24 = icmp sle i32 %23, 9
br i1 %24, label %25, label %70
25: ; preds = %22
%26 = load [9 x i32]*, [9 x i32]** %7
%27 = bitcast [9 x i32]* %26 to i32**
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = load i32, i32* %12
%31 = call i64 @hayConflictoSoloEnColumna(i32** %27, i32 %28, i32 %29, i32 %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %66
33: ; preds = %25
%34 = load i32*, i32** %11
%35 = load i32, i32* %12
%36 = call i32 @containsInt(i32* %34, i32 9, i32 %35)
%37 = icmp ne i32 %36, 0
br i1 %37, label %66, label %38
38: ; preds = %33
%39 = load i32*, i32** %11
%40 = load i32, i32* %12
%41 = call i32 @addInt(i32* %39, i32 9, i32 %40)
%42 = load [9 x i32]*, [9 x i32]** %7
%43 = bitcast [9 x i32]* %42 to i32**
%44 = load i32, i32* %9
%45 = load i32, i32* %12
%46 = call i32 @getFilaConflictoEnColumna(i32** %43, i32 %44, i32 %45)
store i32 %46, i32* %13
%47 = load i32, i32* %9
store i32 %47, i32* %14
%48 = load [9 x i32]*, [9 x i32]** %7
%49 = load i32, i32* %13
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [9 x i32], [9 x i32]* %48, i64 %50
%52 = load i32, i32* %14
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [9 x i32], [9 x i32]* %51, i64 0, i64 %53
store i32 0, i32* %54
%55 = load i32, i32* %12
%56 = load [9 x i32]*, [9 x i32]** %7
%57 = load i32, i32* %8
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [9 x i32], [9 x i32]* %56, i64 %58
%60 = load i32, i32* %9
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [9 x i32], [9 x i32]* %59, i64 0, i64 %61
store i32 %55, i32* %62
%63 = load i32*, i32** %10
%64 = load i32, i32* %63
%65 = sub nsw i32 %64, 1
store i32 %65, i32* %63
store i32 1, i32* %6
br label %71
66: ; preds = %33, %25
br label %67
67: ; preds = %66
%68 = load i32, i32* %12
%69 = add nsw i32 %68, 1
store i32 %69, i32* %12
br label %22
70: ; preds = %22
store i32 0, i32* %6
br label %71
71: ; preds = %70, %38, %20
%72 = load i32, i32* %6
ret i32 %72
}

LLVM IR (-O2):
define i32 @forzarColumnaUnica([9 x i32]* %0, i32 %1, i32 %2, i32* nocapture %3, i32* %4) {
%6 = bitcast [9 x i32]* %0 to i32**
%7 = tail call i32 @hayConflictoEnColumna(i32** %6, i32 %2)
%8 = icmp eq i32 %7, 0
br i1 %8, label %74, label %9
9: ; preds = %5
%10 = tail call i64 @hayConflictoSoloEnColumna(i32** %6, i32 %1, i32 %2, i32 1)
%11 = icmp eq i64 %10, 0
br i1 %11, label %26, label %12
12: ; preds = %9
%13 = tail call i32 @containsInt(i32* %4, i32 9, i32 1)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %71, %65, %59, %53, %47, %41, %35, %29, %12
%16 = phi i32 [ 1, %12 ], [ 2, %29 ], [ 3, %35 ], [ 4, %41 ], [ 5, %47 ], [ 6, %53 ], [ 7, %59 ], [ 8, %65 ], [ 9, %71 ]
%17 = tail call i32 @addInt(i32* %4, i32 9, i32 %16)
%18 = tail call i32 @getFilaConflictoEnColumna(i32** %6, i32 %2, i32 %16)
%19 = sext i32 %18 to i64
%20 = sext i32 %2 to i64
%21 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %19, i64 %20
store i32 0, i32* %21
%22 = sext i32 %1 to i64
%23 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %22, i64 %20
store i32 %16, i32* %23
%24 = load i32, i32* %3
%25 = add nsw i32 %24, -1
store i32 %25, i32* %3
br label %74
26: ; preds = %9, %12
%27 = tail call i64 @hayConflictoSoloEnColumna(i32** %6, i32 %1, i32 %2, i32 2)
%28 = icmp eq i64 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = tail call i32 @containsInt(i32* %4, i32 9, i32 2)
%31 = icmp eq i32 %30, 0
br i1 %31, label %15, label %32
32: ; preds = %29, %26
%33 = tail call i64 @hayConflictoSoloEnColumna(i32** %6, i32 %1, i32 %2, i32 3)
%34 = icmp eq i64 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %32
%36 = tail call i32 @containsInt(i32* %4, i32 9, i32 3)
%37 = icmp eq i32 %36, 0
br i1 %37, label %15, label %38
38: ; preds = %35, %32
%39 = tail call i64 @hayConflictoSoloEnColumna(i32** %6, i32 %1, i32 %2, i32 4)
%40 = icmp eq i64 %39, 0
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = tail call i32 @containsInt(i32* %4, i32 9, i32 4)
%43 = icmp eq i32 %42, 0
br i1 %43, label %15, label %44
44: ; preds = %41, %38
%45 = tail call i64 @hayConflictoSoloEnColumna(i32** %6, i32 %1, i32 %2, i32 5)
%46 = icmp eq i64 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %44
%48 = tail call i32 @containsInt(i32* %4, i32 9, i32 5)
%49 = icmp eq i32 %48, 0
br i1 %49, label %15, label %50
50: ; preds = %47, %44
%51 = tail call i64 @hayConflictoSoloEnColumna(i32** %6, i32 %1, i32 %2, i32 6)
%52 = icmp eq i64 %51, 0
br i1 %52, label %56, label %53
53: ; preds = %50
%54 = tail call i32 @containsInt(i32* %4, i32 9, i32 6)
%55 = icmp eq i32 %54, 0
br i1 %55, label %15, label %56
56: ; preds = %53, %50
%57 = tail call i64 @hayConflictoSoloEnColumna(i32** %6, i32 %1, i32 %2, i32 7)
%58 = icmp eq i64 %57, 0
br i1 %58, label %62, label %59
59: ; preds = %56
%60 = tail call i32 @containsInt(i32* %4, i32 9, i32 7)
%61 = icmp eq i32 %60, 0
br i1 %61, label %15, label %62
62: ; preds = %59, %56
%63 = tail call i64 @hayConflictoSoloEnColumna(i32** %6, i32 %1, i32 %2, i32 8)
%64 = icmp eq i64 %63, 0
br i1 %64, label %68, label %65
65: ; preds = %62
%66 = tail call i32 @containsInt(i32* %4, i32 9, i32 8)
%67 = icmp eq i32 %66, 0
br i1 %67, label %15, label %68
68: ; preds = %65, %62
%69 = tail call i64 @hayConflictoSoloEnColumna(i32** %6, i32 %1, i32 %2, i32 9)
%70 = icmp eq i64 %69, 0
br i1 %70, label %74, label %71
71: ; preds = %68
%72 = tail call i32 @containsInt(i32* %4, i32 9, i32 9)
%73 = icmp eq i32 %72, 0
br i1 %73, label %15, label %74
74: ; preds = %68, %71, %15, %5
%75 = phi i32 [ 0, %5 ], [ 1, %15 ], [ 0, %71 ], [ 0, %68 ]
ret i32 %75
}