#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 /*<<< orphan*/ solveSudoku(char **, int, int);
int /*<<< orphan*/ system(char *);
int main() {
  char board[][9] = {{"53..7...."}, {"6..195..."}, {".98....6."},
                     {"8...6...3"}, {"4..8.3..1"}, {"7...2...6"},
                     {".6....28."}, {"...419..5"}, {"....8..79"}};
  solveSudoku(board, 9, 9);
  for (int i = 0; i < 9; i++) {
    for (int j = 0; j < 9; j++) {
      printf("%c", board[i][j]);
    }
    printf("\n");
  }
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x51,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rdi
mov    $0x9,%edx
mov    %edx,%esi
call   1060 <solveSudoku@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0x9,-0x64(%rbp)
jge    11e5 <main+0xa5>
movl   $0x0,-0x68(%rbp)
cmpl   $0x9,-0x68(%rbp)
jge    11c9 <main+0x89>
movslq -0x64(%rbp),%rcx
lea    -0x60(%rbp),%rax
imul   $0x9,%rcx,%rcx
add    %rcx,%rax
movslq -0x68(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    118c <main+0x4c>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    117b <main+0x3b>
lea    0xe6a(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
mov    0xf15(%rip),%al
mov    %al,0x50(%rsp)
movaps 0xefa(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe8a(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
mov    $0x9,%edx
call   1050 <solveSudoku@plt>
mov    $0x8,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl -0x8(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl -0x7(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl -0x6(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl -0x5(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl -0x4(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl -0x3(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl -0x2(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl -0x1(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
movsbl (%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x9,%rbx
cmp    $0x59,%rbx
jne    11a0 <main+0x70>
lea    0xe3d(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.board = [9 x [9 x i8]] [[9 x i8] c"53..7....", [9 x i8] c"6..195...", [9 x i8] c".98....6.", [9 x i8] c"8...6...3", [9 x i8] c"4..8.3..1", [9 x i8] c"7...2...6", [9 x i8] c".6....28.", [9 x i8] c"...419..5", [9 x i8] c"....8..79"]
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x [9 x i8]]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [9 x [9 x i8]]* %2 to i8*
%6 = getelementptr inbounds [9 x [9 x i8]], [9 x [9 x i8]]* %2, i64 0, i64 0
%7 = bitcast [9 x i8]* %6 to i8**
%8 = call i32 @solveSudoku(i8** %7, i32 9, i32 9)
store i32 0, i32* %3
br label %9
9: ; preds = %31, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 9
br i1 %11, label %12, label %34
12: ; preds = %9
store i32 0, i32* %4
br label %13
13: ; preds = %26, %12
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 9
br i1 %15, label %16, label %29
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [9 x [9 x i8]], [9 x [9 x i8]]* %2, i64 0, i64 %18
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [9 x i8], [9 x i8]* %19, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %16
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %13
29: ; preds = %13
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %29
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %9
34: ; preds = %9
%35 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.board = [9 x [9 x i8]] [[9 x i8] c"53..7....", [9 x i8] c"6..195...", [9 x i8] c".98....6.", [9 x i8] c"8...6...3", [9 x i8] c"4..8.3..1", [9 x i8] c"7...2...6", [9 x i8] c".6....28.", [9 x i8] c"...419..5", [9 x i8] c"....8..79"]
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [9 x [9 x i8]]
%2 = getelementptr inbounds [9 x [9 x i8]], [9 x [9 x i8]]* %1, i64 0, i64 0, i64 0
%3 = bitcast [9 x [9 x i8]]* %1 to i8**
%4 = call i32 @solveSudoku(i8** %3, i32 9, i32 9)
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 0, %0 ], [ %44, %5 ]
%7 = getelementptr inbounds [9 x [9 x i8]], [9 x [9 x i8]]* %1, i64 0, i64 %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = call i32 @putchar(i32 %9)
%11 = getelementptr inbounds [9 x [9 x i8]], [9 x [9 x i8]]* %1, i64 0, i64 %6, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = call i32 @putchar(i32 %13)
%15 = getelementptr inbounds [9 x [9 x i8]], [9 x [9 x i8]]* %1, i64 0, i64 %6, i64 2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = call i32 @putchar(i32 %17)
%19 = getelementptr inbounds [9 x [9 x i8]], [9 x [9 x i8]]* %1, i64 0, i64 %6, i64 3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = call i32 @putchar(i32 %21)
%23 = getelementptr inbounds [9 x [9 x i8]], [9 x [9 x i8]]* %1, i64 0, i64 %6, i64 4
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = call i32 @putchar(i32 %25)
%27 = getelementptr inbounds [9 x [9 x i8]], [9 x [9 x i8]]* %1, i64 0, i64 %6, i64 5
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = call i32 @putchar(i32 %29)
%31 = getelementptr inbounds [9 x [9 x i8]], [9 x [9 x i8]]* %1, i64 0, i64 %6, i64 6
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = call i32 @putchar(i32 %33)
%35 = getelementptr inbounds [9 x [9 x i8]], [9 x [9 x i8]]* %1, i64 0, i64 %6, i64 7
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = call i32 @putchar(i32 %37)
%39 = getelementptr inbounds [9 x [9 x i8]], [9 x [9 x i8]]* %1, i64 0, i64 %6, i64 8
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = call i32 @putchar(i32 %41)
%43 = call i32 @putchar(i32 10)
%44 = add nuw nsw i64 %6, 1
%45 = icmp eq i64 %44, 9
br i1 %45, label %46, label %5
46: ; preds = %5
%47 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}