#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*/ printf(char *, int);
int sudoku(int **);
int main(void) {
  int testGrid[9][9] = {
      {5, 3, 4, 6, 7, 8, 9, 1, 2}, {6, 7, 2, 1, 9, 5, 3, 4, 8},
      {1, 9, 8, 3, 4, 2, 5, 6, 7}, {8, 5, 9, 7, 6, 1, 4, 2, 3},
      {4, 2, 6, 8, 5, 3, 7, 9, 1}, {7, 1, 3, 9, 2, 4, 8, 5, 6},
      {9, 6, 1, 5, 3, 7, 2, 8, 4}, {2, 8, 7, 4, 1, 9, 6, 3, 5},
      {3, 4, 5, 2, 8, 6, 1, 7, 9}};
  printf("%d\n", sudoku(testGrid));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
lea    -0x150(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x144,%edx
call   1050 <memcpy@plt>
lea    -0x150(%rbp),%rdi
call   1030 <sudoku@plt>
mov    %eax,%esi
lea    0xfdc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x150,%rsp
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x144,%edx
mov    %rbx,%rdi
call   1050 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <sudoku@plt>
lea    0xfe6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.testGrid = [9 x [9 x i32]] [[9 x i32] [i32 5, i32 3, i32 4, i32 6, i32 7, i32 8, i32 9, i32 1, i32 2], [9 x i32] [i32 6, i32 7, i32 2, i32 1, i32 9, i32 5, i32 3, i32 4, i32 8], [9 x i32] [i32 1, i32 9, i32 8, i32 3, i32 4, i32 2, i32 5, i32 6, i32 7], [9 x i32] [i32 8, i32 5, i32 9, i32 7, i32 6, i32 1, i32 4, i32 2, i32 3], [9 x i32] [i32 4, i32 2, i32 6, i32 8, i32 5, i32 3, i32 7, i32 9, i32 1], [9 x i32] [i32 7, i32 1, i32 3, i32 9, i32 2, i32 4, i32 8, i32 5, i32 6], [9 x i32] [i32 9, i32 6, i32 1, i32 5, i32 3, i32 7, i32 2, i32 8, i32 4], [9 x i32] [i32 2, i32 8, i32 7, i32 4, i32 1, i32 9, i32 6, i32 3, i32 5], [9 x i32] [i32 3, i32 4, i32 5, i32 2, i32 8, i32 6, i32 1, i32 7, i32 9]]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [9 x [9 x i32]]
%2 = bitcast [9 x [9 x i32]]* %1 to i8*
%3 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %1, i64 0, i64 0
%4 = bitcast [9 x i32]* %3 to i32**
%5 = call i32 @sudoku(i32** %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.testGrid = [9 x [9 x i32]] [[9 x i32] [i32 5, i32 3, i32 4, i32 6, i32 7, i32 8, i32 9, i32 1, i32 2], [9 x i32] [i32 6, i32 7, i32 2, i32 1, i32 9, i32 5, i32 3, i32 4, i32 8], [9 x i32] [i32 1, i32 9, i32 8, i32 3, i32 4, i32 2, i32 5, i32 6, i32 7], [9 x i32] [i32 8, i32 5, i32 9, i32 7, i32 6, i32 1, i32 4, i32 2, i32 3], [9 x i32] [i32 4, i32 2, i32 6, i32 8, i32 5, i32 3, i32 7, i32 9, i32 1], [9 x i32] [i32 7, i32 1, i32 3, i32 9, i32 2, i32 4, i32 8, i32 5, i32 6], [9 x i32] [i32 9, i32 6, i32 1, i32 5, i32 3, i32 7, i32 2, i32 8, i32 4], [9 x i32] [i32 2, i32 8, i32 7, i32 4, i32 1, i32 9, i32 6, i32 3, i32 5], [9 x i32] [i32 3, i32 4, i32 5, i32 2, i32 8, i32 6, i32 1, i32 7, i32 9]]
@.str = [4 x i8] c"%d\0A\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 i32 @sudoku(i32** %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}