#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 input_sudoku(int **);
int /*<<< orphan*/ print_sudoku(int **);
int /*<<< orphan*/ printf(char *);
scalar_t__ solve_sudoku(int **);
int main() {
  int sudoku[9][9];
  if (input_sudoku(sudoku) == 1) {
    return 1;
  }
  printf("\nSudoku entered:\n");
  print_sudoku(sudoku);
  if (solve_sudoku(sudoku) == 0) {
    printf("\nSolution:\n");
  } else {
    printf("\nInvalid sudoku - unable to solve. Partial result:\n");
  }
  print_sudoku(sudoku);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x150(%rbp),%rdi
call   1060 <input_sudoku@plt>
cmp    $0x1,%eax
jne    1173 <main+0x33>
movl   $0x1,-0x4(%rbp)
jmp    11ca <main+0x8a>
lea    0xe86(%rip),%rdi
call   1050 <printf@plt>
lea    -0x150(%rbp),%rdi
call   1030 <print_sudoku@plt>
lea    -0x150(%rbp),%rdi
call   1040 <solve_sudoku@plt>
cmp    $0x0,%rax
jne    11b2 <main+0x72>
lea    0xe6a(%rip),%rdi
call   1050 <printf@plt>
jmp    11be <main+0x7e>
lea    0xe65(%rip),%rdi
call   1050 <printf@plt>
lea    -0x150(%rbp),%rdi
call   1030 <print_sudoku@plt>
mov    -0x4(%rbp),%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x150,%rsp
mov    %rsp,%rdi
call   1060 <input_sudoku@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     119f <main+0x5f>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <print_sudoku@plt>
mov    %rbx,%rdi
call   1050 <solve_sudoku@plt>
test   %rax,%rax
lea    0xebf(%rip),%rax
lea    0xe85(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <print_sudoku@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0ASudoku entered:\0A\00"
@.str.1 = [12 x i8] c"\0ASolution:\0A\00"
@.str.2 = [52 x i8] c"\0AInvalid sudoku - unable to solve. Partial result:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x [9 x i32]]
store i32 0, i32* %1
%3 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%4 = bitcast [9 x i32]* %3 to i32**
%5 = call i32 @input_sudoku(i32** %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %1
br label %25
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%11 = bitcast [9 x i32]* %10 to i32**
%12 = call i32 @print_sudoku(i32** %11)
%13 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%14 = bitcast [9 x i32]* %13 to i32**
%15 = call i64 @solve_sudoku(i32** %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %8
%18 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %21
19: ; preds = %8
%20 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
%22 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%23 = bitcast [9 x i32]* %22 to i32**
%24 = call i32 @print_sudoku(i32** %23)
br label %25
25: ; preds = %21, %7
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@str = [17 x i8] c"\0ASudoku entered:\00"
@str.3 = [51 x i8] c"\0AInvalid sudoku - unable to solve. Partial result:\00"
@str.4 = [11 x i8] c"\0ASolution:\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 @input_sudoku(i32** %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %14, label %6
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%8 = call i32 @print_sudoku(i32** %3)
%9 = call i64 @solve_sudoku(i32** %3)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @str.3, i64 0, i64 0)
%12 = call i32 @puts(i8* dereferenceable(1) %11)
%13 = call i32 @print_sudoku(i32** %3)
br label %14
14: ; preds = %0, %6
%15 = phi i32 [ 0, %6 ], [ 1, %0 ]
ret i32 %15
}