#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*/ initArray(int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ solveSudokuRec(int **, int /*<<< orphan*/ *, int **);
int /*<<< orphan*/ sudokuValide(int **);
void solveSudoku(int sudoku[9][9]) {
  if (!sudokuValide(sudoku)) {
    return;
  }
  int i;
  int prevSolutions[9][9];
  for (i = 0; i < 9; i++) {
    initArray(prevSolutions[i], 9, 0);
  }
  solveSudokuRec(sudoku, NULL, prevSolutions);
}


x86 assembly (clang, -O0):
<solveSudoku>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <sudokuValide@plt>
cmp    $0x0,%eax
jne    1156 <solveSudoku+0x26>
jmp    11a7 <solveSudoku+0x77>
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1193 <solveSudoku+0x63>
movslq -0xc(%rbp),%rax
lea    -0x150(%rbp),%rdi
imul   $0x24,%rax,%rax
add    %rax,%rdi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <initArray@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <solveSudoku+0x2d>
mov    -0x8(%rbp),%rdi
lea    -0x150(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <solveSudokuRec@plt>
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solveSudoku>:
push   %r14
push   %rbx
sub    $0x148,%rsp
mov    %rdi,%rbx
call   1050 <sudokuValide@plt>
test   %eax,%eax
je     1200 <solveSudoku+0xd0>
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <initArray@plt>
lea    0x24(%rsp),%rdi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <initArray@plt>
lea    0x48(%rsp),%rdi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <initArray@plt>
lea    0x6c(%rsp),%rdi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <initArray@plt>
lea    0x90(%rsp),%rdi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <initArray@plt>
lea    0xb4(%rsp),%rdi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <initArray@plt>
lea    0xd8(%rsp),%rdi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <initArray@plt>
lea    0xfc(%rsp),%rdi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <initArray@plt>
lea    0x120(%rsp),%rdi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <initArray@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <solveSudokuRec@plt>
add    $0x148,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @solveSudoku([9 x i32]* %0) {
%2 = alloca [9 x i32]*
%3 = alloca i32
%4 = alloca [9 x [9 x i32]]
store [9 x i32]* %0, [9 x i32]** %2
%5 = load [9 x i32]*, [9 x i32]** %2
%6 = bitcast [9 x i32]* %5 to i32**
%7 = call i32 @sudokuValide(i32** %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %1
br label %29
10: ; preds = %1
store i32 0, i32* %3
br label %11
11: ; preds = %20, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 9
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %4, i64 0, i64 %16
%18 = getelementptr inbounds [9 x i32], [9 x i32]* %17, i64 0, i64 0
%19 = call i32 @initArray(i32* %18, i32 9, i32 0)
br label %20
20: ; preds = %14
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %11
23: ; preds = %11
%24 = load [9 x i32]*, [9 x i32]** %2
%25 = bitcast [9 x i32]* %24 to i32**
%26 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %4, i64 0, i64 0
%27 = bitcast [9 x i32]* %26 to i32**
%28 = call i32 @solveSudokuRec(i32** %25, i32* null, i32** %27)
br label %29
29: ; preds = %23, %9
ret void
}

LLVM IR (-O2):
define void @solveSudoku([9 x i32]* %0) {
%2 = alloca [9 x [9 x i32]]
%3 = bitcast [9 x i32]* %0 to i32**
%4 = tail call i32 @sudokuValide(i32** %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %28, label %6
6: ; preds = %1
%7 = bitcast [9 x [9 x i32]]* %2 to i8*
%8 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0, i64 0
%9 = call i32 @initArray(i32* %8, i32 9, i32 0)
%10 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 1, i64 0
%11 = call i32 @initArray(i32* %10, i32 9, i32 0)
%12 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 2, i64 0
%13 = call i32 @initArray(i32* %12, i32 9, i32 0)
%14 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 3, i64 0
%15 = call i32 @initArray(i32* %14, i32 9, i32 0)
%16 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 4, i64 0
%17 = call i32 @initArray(i32* %16, i32 9, i32 0)
%18 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 5, i64 0
%19 = call i32 @initArray(i32* %18, i32 9, i32 0)
%20 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 6, i64 0
%21 = call i32 @initArray(i32* %20, i32 9, i32 0)
%22 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 7, i64 0
%23 = call i32 @initArray(i32* %22, i32 9, i32 0)
%24 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 8, i64 0
%25 = call i32 @initArray(i32* %24, i32 9, i32 0)
%26 = bitcast [9 x [9 x i32]]* %2 to i32**
%27 = call i32 @solveSudokuRec(i32** %3, i32* null, i32** %26)
br label %28
28: ; preds = %1, %6
ret void
}