#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*/ add_2_database();
int /*<<< orphan*/ game_4m_database(int, int **);
int /*<<< orphan*/ print_s(int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int solve(int **, int /*<<< orphan*/);
int main() {
  int S[9][9], i, j, game_no;
  add_2_database();
  printf("\nInput game no.: ");
  scanf(" %d", &game_no);
  game_4m_database(game_no, S);
  printf("\n\n");
  print_s(S);
  printf("\n\n");
  if (solve(S, 0) == 1) {
    printf("\nThe program was unable to solve the Sudoku Completely...!!\n");
  }
  printf("The Solution is given below:\n");
  print_s(S);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <add_2_database@plt>
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
lea    0xe86(%rip),%rdi
lea    -0x15c(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x15c(%rbp),%edi
lea    -0x150(%rbp),%rsi
call   1070 <game_4m_database@plt>
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
lea    -0x150(%rbp),%rdi
call   1050 <print_s@plt>
lea    0xe4d(%rip),%rdi
call   1040 <printf@plt>
lea    -0x150(%rbp),%rdi
xor    %esi,%esi
call   1030 <solve@plt>
cmp    $0x1,%eax
jne    11f1 <main+0x91>
lea    0xe2d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
lea    -0x150(%rbp),%rdi
call   1050 <print_s@plt>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x158,%rsp
xor    %eax,%eax
call   1070 <add_2_database@plt>
lea    0xe78(%rip),%rdi
call   1050 <printf@plt>
lea    0xe7e(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1090 <scanf@plt>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1080 <game_4m_database@plt>
lea    0xe60(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <print_s@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <solve@plt>
cmp    $0x1,%eax
jne    11e9 <main+0x79>
lea    0xe51(%rip),%rdi
call   1040 <puts@plt>
lea    0xe28(%rip),%rdi
call   1040 <puts@plt>
lea    0x10(%rsp),%rdi
call   1060 <print_s@plt>
xor    %eax,%eax
add    $0x158,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0AInput game no.: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
@.str.3 = [61 x i8] c"\0AThe program was unable to solve the Sudoku Completely...!!\0A\00"
@.str.4 = [30 x i8] c"The Solution is given below:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x [9 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (...) @add_2_database()
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%9 = load i32, i32* %5
%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 @game_4m_database(i32 %9, i32** %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, 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 @print_s(i32** %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%18 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%19 = bitcast [9 x i32]* %18 to i32**
%20 = call i32 @solve(i32** %19, i32 0)
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %24
22: ; preds = %0
%23 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
br label %24
24: ; preds = %22, %0
%25 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%26 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%27 = bitcast [9 x i32]* %26 to i32**
%28 = call i32 @print_s(i32** %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0AInput game no.: \00"
@.str.1 = [4 x i8] c" %d\00"
@str.5 = [2 x i8] c"\0A\00"
@str.6 = [29 x i8] c"The Solution is given below:\00"
@str.7 = [60 x i8] c"\0AThe program was unable to solve the Sudoku Completely...!!\00"
define i32 @main() {
%1 = alloca [9 x [9 x i32]]
%2 = alloca i32
%3 = bitcast [9 x [9 x i32]]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (...) @add_2_database()
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = bitcast [9 x [9 x i32]]* %1 to i32**
%10 = call i32 @game_4m_database(i32 %8, i32** %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0))
%12 = call i32 @print_s(i32** %9)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0))
%14 = call i32 @solve(i32** %9, i32 0)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.7, i64 0, i64 0))
br label %18
18: ; preds = %16, %0
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%20 = call i32 @print_s(i32** %9)
ret i32 0
}