#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*/ dumpBoard(char **);
int /*<<< orphan*/ printf(char *, int);
int solveSudoku(char **, int, int);
int main() {
  char l0[10] = "..9748...";
  char l1[10] = "7........";
  char l2[10] = ".2.1.9...";
  char l3[10] = "..7...24.";
  char l4[10] = ".64.1.59.";
  char l5[10] = ".98...3..";
  char l6[10] = "...8.3.2.";
  char l7[10] = "........6";
  char l8[10] = "...2759..";
  char *board[] = {l0, l1, l2, l3, l4, l5, l6, l7, l8};
  int ret = solveSudoku(board, 9, 9);
  printf("ret:%d\n", ret);
  dumpBoard(board);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xeb4(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea8(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    0xe9f(%rip),%rax
mov    %rax,-0x22(%rbp)
mov    0xe9c(%rip),%ax
mov    %ax,-0x1a(%rbp)
mov    0xe93(%rip),%rax
mov    %rax,-0x2c(%rbp)
mov    0xe90(%rip),%ax
mov    %ax,-0x24(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x36(%rbp)
mov    0xe84(%rip),%ax
mov    %ax,-0x2e(%rbp)
mov    0xe7b(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe78(%rip),%ax
mov    %ax,-0x38(%rbp)
mov    0xe6f(%rip),%rax
mov    %rax,-0x4a(%rbp)
mov    0xe6c(%rip),%ax
mov    %ax,-0x42(%rbp)
mov    0xe63(%rip),%rax
mov    %rax,-0x54(%rbp)
mov    0xe60(%rip),%ax
mov    %ax,-0x4c(%rbp)
mov    0xe57(%rip),%rax
mov    %rax,-0x5e(%rbp)
mov    0xe54(%rip),%ax
mov    %ax,-0x56(%rbp)
lea    -0xe(%rbp),%rax
mov    %rax,-0xb0(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0xa8(%rbp)
lea    -0x22(%rbp),%rax
mov    %rax,-0xa0(%rbp)
lea    -0x2c(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    -0x36(%rbp),%rax
mov    %rax,-0x90(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x88(%rbp)
lea    -0x4a(%rbp),%rax
mov    %rax,-0x80(%rbp)
lea    -0x54(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0x5e(%rbp),%rax
mov    %rax,-0x70(%rbp)
lea    -0xb0(%rbp),%rdi
mov    $0x9,%edx
mov    %edx,%esi
call   1050 <solveSudoku@plt>
mov    %eax,-0xb4(%rbp)
mov    -0xb4(%rbp),%esi
lea    0xdd2(%rip),%rdi
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
call   1040 <dumpBoard@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xe0,%rsp
movabs $0x2e2e383437392e2e,%rax
38 2e 2e
mov    %rax,0x80(%rsp)
movw   $0x2e,0x88(%rsp)
movabs $0x2e2e2e2e2e2e2e37,%rax
2e 2e 2e
mov    %rax,0x70(%rsp)
movw   $0x2e,0x78(%rsp)
movabs $0x2e2e392e312e322e,%rax
39 2e 2e
mov    %rax,0x60(%rsp)
movw   $0x2e,0x68(%rsp)
movabs $0x34322e2e2e372e2e,%rax
2e 32 34
mov    %rax,0x50(%rsp)
movw   $0x2e,0x58(%rsp)
movabs $0x39352e312e34362e,%rax
2e 35 39
mov    %rax,0x40(%rsp)
movw   $0x2e,0x48(%rsp)
movabs $0x2e332e2e2e38392e,%rax
2e 33 2e
mov    %rax,0x30(%rsp)
movw   $0x2e,0x38(%rsp)
movabs $0x322e332e382e2e2e,%rax
33 2e 32
mov    %rax,0x20(%rsp)
movw   $0x2e,0x28(%rsp)
movabs $0x2e2e2e2e2e2e2e2e,%rax
2e 2e 2e
mov    %rax,0x10(%rsp)
movw   $0x36,0x18(%rsp)
movabs $0x2e393537322e2e2e,%rax
35 39 2e
mov    %rax,(%rsp)
movw   $0x2e,0x8(%rsp)
lea    0x80(%rsp),%rax
mov    %rax,0x90(%rsp)
lea    0x70(%rsp),%rax
mov    %rax,0x98(%rsp)
lea    0x60(%rsp),%rax
mov    %rax,0xa0(%rsp)
lea    0x50(%rsp),%rax
mov    %rax,0xa8(%rsp)
lea    0x40(%rsp),%rax
mov    %rax,0xb0(%rsp)
lea    0x30(%rsp),%rax
mov    %rax,0xb8(%rsp)
lea    0x20(%rsp),%rax
mov    %rax,0xc0(%rsp)
lea    0x10(%rsp),%rax
mov    %rax,0xc8(%rsp)
mov    %rsp,%rax
mov    %rax,0xd0(%rsp)
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x9,%edx
call   1050 <solveSudoku@plt>
lea    0xdc0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <dumpBoard@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.l0 = [10 x i8] c"..9748...\00"
@__const.main.l1 = [10 x i8] c"7........\00"
@__const.main.l2 = [10 x i8] c".2.1.9...\00"
@__const.main.l3 = [10 x i8] c"..7...24.\00"
@__const.main.l4 = [10 x i8] c".64.1.59.\00"
@__const.main.l5 = [10 x i8] c".98...3..\00"
@__const.main.l6 = [10 x i8] c"...8.3.2.\00"
@__const.main.l7 = [10 x i8] c"........6\00"
@__const.main.l8 = [10 x i8] c"...2759..\00"
@.str = [8 x i8] c"ret:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
%4 = alloca [10 x i8]
%5 = alloca [10 x i8]
%6 = alloca [10 x i8]
%7 = alloca [10 x i8]
%8 = alloca [10 x i8]
%9 = alloca [10 x i8]
%10 = alloca [10 x i8]
%11 = alloca [9 x i8*]
%12 = alloca i32
store i32 0, i32* %1
%13 = bitcast [10 x i8]* %2 to i8*
%14 = bitcast [10 x i8]* %3 to i8*
%15 = bitcast [10 x i8]* %4 to i8*
%16 = bitcast [10 x i8]* %5 to i8*
%17 = bitcast [10 x i8]* %6 to i8*
%18 = bitcast [10 x i8]* %7 to i8*
%19 = bitcast [10 x i8]* %8 to i8*
%20 = bitcast [10 x i8]* %9 to i8*
%21 = bitcast [10 x i8]* %10 to i8*
%22 = getelementptr inbounds [9 x i8*], [9 x i8*]* %11, i64 0, i64 0
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
store i8* %23, i8** %22
%24 = getelementptr inbounds i8*, i8** %22, i64 1
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
store i8* %25, i8** %24
%26 = getelementptr inbounds i8*, i8** %24, i64 1
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
store i8* %27, i8** %26
%28 = getelementptr inbounds i8*, i8** %26, i64 1
%29 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
store i8* %29, i8** %28
%30 = getelementptr inbounds i8*, i8** %28, i64 1
%31 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
store i8* %31, i8** %30
%32 = getelementptr inbounds i8*, i8** %30, i64 1
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
store i8* %33, i8** %32
%34 = getelementptr inbounds i8*, i8** %32, i64 1
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
store i8* %35, i8** %34
%36 = getelementptr inbounds i8*, i8** %34, i64 1
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
store i8* %37, i8** %36
%38 = getelementptr inbounds i8*, i8** %36, i64 1
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
store i8* %39, i8** %38
%40 = getelementptr inbounds [9 x i8*], [9 x i8*]* %11, i64 0, i64 0
%41 = call i32 @solveSudoku(i8** %40, i32 9, i32 9)
store i32 %41, i32* %12
%42 = load i32, i32* %12
%43 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds [9 x i8*], [9 x i8*]* %11, i64 0, i64 0
%45 = call i32 @dumpBoard(i8** %44)
ret i32 0
}

LLVM IR (-O2):
@__const.main.l0 = [10 x i8] c"..9748...\00"
@__const.main.l1 = [10 x i8] c"7........\00"
@__const.main.l2 = [10 x i8] c".2.1.9...\00"
@__const.main.l3 = [10 x i8] c"..7...24.\00"
@__const.main.l4 = [10 x i8] c".64.1.59.\00"
@__const.main.l5 = [10 x i8] c".98...3..\00"
@__const.main.l6 = [10 x i8] c"...8.3.2.\00"
@__const.main.l7 = [10 x i8] c"........6\00"
@__const.main.l8 = [10 x i8] c"...2759..\00"
@.str = [8 x i8] c"ret:%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
%4 = alloca [10 x i8]
%5 = alloca [10 x i8]
%6 = alloca [10 x i8]
%7 = alloca [10 x i8]
%8 = alloca [10 x i8]
%9 = alloca [10 x i8]
%10 = alloca [9 x i8*]
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%20 = bitcast [9 x i8*]* %10 to i8*
%21 = getelementptr inbounds [9 x i8*], [9 x i8*]* %10, i64 0, i64 0
store i8* %11, i8** %21
%22 = getelementptr inbounds [9 x i8*], [9 x i8*]* %10, i64 0, i64 1
store i8* %12, i8** %22
%23 = getelementptr inbounds [9 x i8*], [9 x i8*]* %10, i64 0, i64 2
store i8* %13, i8** %23
%24 = getelementptr inbounds [9 x i8*], [9 x i8*]* %10, i64 0, i64 3
store i8* %14, i8** %24
%25 = getelementptr inbounds [9 x i8*], [9 x i8*]* %10, i64 0, i64 4
store i8* %15, i8** %25
%26 = getelementptr inbounds [9 x i8*], [9 x i8*]* %10, i64 0, i64 5
store i8* %16, i8** %26
%27 = getelementptr inbounds [9 x i8*], [9 x i8*]* %10, i64 0, i64 6
store i8* %17, i8** %27
%28 = getelementptr inbounds [9 x i8*], [9 x i8*]* %10, i64 0, i64 7
store i8* %18, i8** %28
%29 = getelementptr inbounds [9 x i8*], [9 x i8*]* %10, i64 0, i64 8
store i8* %19, i8** %29
%30 = call i32 @solveSudoku(i8** %21, i32 9, i32 9)
%31 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = call i32 @dumpBoard(i8** %21)
ret i32 0
}