#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*/ getchar();
int /*<<< orphan*/ printBoard(int **);
int /*<<< orphan*/ printf(char *);
scalar_t__ solveSuduko(int **);
int main() {
  int board[9][9] = {{3, 0, 6, 5, 0, 8, 4, 0, 0}, {5, 2, 0, 0, 0, 0, 0, 0, 0},
                     {0, 8, 7, 0, 0, 0, 0, 3, 1}, {0, 0, 3, 0, 1, 0, 0, 8, 0},
                     {9, 0, 0, 8, 6, 3, 0, 0, 5}, {0, 5, 0, 0, 9, 0, 6, 0, 0},
                     {1, 3, 0, 0, 0, 0, 2, 5, 0}, {0, 0, 0, 0, 0, 0, 0, 7, 4},
                     {0, 0, 5, 2, 0, 6, 3, 0, 0}};
  if (solveSuduko(board)) {
    printBoard(board);
  } else {
    printf("The board\n");
    printBoard(board);
    printf("has no solution.\n");
  }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x150(%rbp),%rdi
lea    0xe90(%rip),%rsi
mov    $0x144,%edx
call   1060 <memcpy@plt>
lea    -0x150(%rbp),%rdi
call   1070 <solveSuduko@plt>
cmp    $0x0,%rax
je     11a1 <main+0x51>
lea    -0x150(%rbp),%rdi
call   1030 <printBoard@plt>
jmp    11c5 <main+0x75>
lea    0xf9c(%rip),%rdi
call   1040 <printf@plt>
lea    -0x150(%rbp),%rdi
call   1030 <printBoard@plt>
lea    0xf8f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x150,%rsp
lea    0xea1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x144,%edx
mov    %rbx,%rdi
call   1060 <memcpy@plt>
mov    %rbx,%rdi
call   1070 <solveSuduko@plt>
test   %rax,%rax
je     1186 <main+0x36>
mov    %rsp,%rdi
call   1030 <printBoard@plt>
jmp    11a6 <main+0x56>
lea    0xfb7(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rdi
call   1030 <printBoard@plt>
lea    0xfad(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.board = [9 x [9 x i32]] [[9 x i32] [i32 3, i32 0, i32 6, i32 5, i32 0, i32 8, i32 4, i32 0, i32 0], [9 x i32] [i32 5, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0], [9 x i32] [i32 0, i32 8, i32 7, i32 0, i32 0, i32 0, i32 0, i32 3, i32 1], [9 x i32] [i32 0, i32 0, i32 3, i32 0, i32 1, i32 0, i32 0, i32 8, i32 0], [9 x i32] [i32 9, i32 0, i32 0, i32 8, i32 6, i32 3, i32 0, i32 0, i32 5], [9 x i32] [i32 0, i32 5, i32 0, i32 0, i32 9, i32 0, i32 6, i32 0, i32 0], [9 x i32] [i32 1, i32 3, i32 0, i32 0, i32 0, i32 0, i32 2, i32 5, i32 0], [9 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 7, i32 4], [9 x i32] [i32 0, i32 0, i32 5, i32 2, i32 0, i32 6, i32 3, i32 0, i32 0]]
@.str = [11 x i8] c"The board\0A\00"
@.str.1 = [18 x i8] c"has no solution.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x [9 x i32]]
store i32 0, i32* %1
%3 = bitcast [9 x [9 x i32]]* %2 to i8*
%4 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%5 = bitcast [9 x i32]* %4 to i32**
%6 = call i64 @solveSuduko(i32** %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%10 = bitcast [9 x i32]* %9 to i32**
%11 = call i32 @printBoard(i32** %10)
br label %18
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%14 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%15 = bitcast [9 x i32]* %14 to i32**
%16 = call i32 @printBoard(i32** %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %12, %8
%19 = call i32 (...) @getchar()
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@__const.main.board = [9 x [9 x i32]] [[9 x i32] [i32 3, i32 0, i32 6, i32 5, i32 0, i32 8, i32 4, i32 0, i32 0], [9 x i32] [i32 5, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0], [9 x i32] [i32 0, i32 8, i32 7, i32 0, i32 0, i32 0, i32 0, i32 3, i32 1], [9 x i32] [i32 0, i32 0, i32 3, i32 0, i32 1, i32 0, i32 0, i32 8, i32 0], [9 x i32] [i32 9, i32 0, i32 0, i32 8, i32 6, i32 3, i32 0, i32 0, i32 5], [9 x i32] [i32 0, i32 5, i32 0, i32 0, i32 9, i32 0, i32 6, i32 0, i32 0], [9 x i32] [i32 1, i32 3, i32 0, i32 0, i32 0, i32 0, i32 2, i32 5, i32 0], [9 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 7, i32 4], [9 x i32] [i32 0, i32 0, i32 5, i32 2, i32 0, i32 6, i32 3, i32 0, i32 0]]
@str = [10 x i8] c"The board\00"
@str.2 = [17 x i8] c"has no solution.\00"
define i32 @main() {
%1 = alloca [9 x [9 x i32]]
%2 = bitcast [9 x [9 x i32]]* %1 to i8*
%3 = bitcast [9 x [9 x i32]]* %1 to i32**
%4 = call i64 @solveSuduko(i32** %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @printBoard(i32** %3)
br label %12
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%10 = call i32 @printBoard(i32** %3)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
br label %12
12: ; preds = %8, %6
%13 = call i32 (...) @getchar()
ret i32 0
}