#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 load_puzzle(int **);
int /*<<< orphan*/ print_puzzle(int **);
int /*<<< orphan*/ printf(char *);
scalar_t__ solve_sdk(int **);
int main(void) {
  int pzl[9][9];
  int e;
  if ((e = load_puzzle(pzl)) != 1) {
    return (e);
  }
  printf("This is the original puzzle:\n");
  print_puzzle(pzl);
  if (solve_sdk(pzl)) {
    printf("The puzzle has been solved.\n");
    print_puzzle(pzl);
  } else {
    printf("The puzzle was NOT solved.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x150(%rbp),%rdi
call   1040 <load_puzzle@plt>
mov    %eax,-0x154(%rbp)
cmp    $0x1,%eax
je     117b <main+0x3b>
mov    -0x154(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11d9 <main+0x99>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
lea    -0x150(%rbp),%rdi
call   1050 <print_puzzle@plt>
lea    -0x150(%rbp),%rdi
call   1060 <solve_sdk@plt>
cmp    $0x0,%rax
je     11c6 <main+0x86>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
lea    -0x150(%rbp),%rdi
call   1050 <print_puzzle@plt>
jmp    11d2 <main+0x92>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x150,%rsp
mov    %rsp,%rdi
call   1040 <load_puzzle@plt>
cmp    $0x1,%eax
jne    119d <main+0x5d>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <print_puzzle@plt>
mov    %rbx,%rdi
call   1060 <solve_sdk@plt>
test   %rax,%rax
je     118f <main+0x4f>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1050 <print_puzzle@plt>
jmp    119b <main+0x5b>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"This is the original puzzle:\0A\00"
@.str.1 = [29 x i8] c"The puzzle has been solved.\0A\00"
@.str.2 = [28 x i8] c"The puzzle was NOT solved.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x [9 x i32]]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%5 = bitcast [9 x i32]* %4 to i32**
%6 = call i32 @load_puzzle(i32** %5)
store i32 %6, i32* %3
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load i32, i32* %3
store i32 %9, i32* %1
br label %27
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%13 = bitcast [9 x i32]* %12 to i32**
%14 = call i32 @print_puzzle(i32** %13)
%15 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%16 = bitcast [9 x i32]* %15 to i32**
%17 = call i64 @solve_sdk(i32** %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %10
%20 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%21 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%22 = bitcast [9 x i32]* %21 to i32**
%23 = call i32 @print_puzzle(i32** %22)
br label %26
24: ; preds = %10
%25 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24, %19
store i32 0, i32* %1
br label %27
27: ; preds = %26, %8
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@str = [29 x i8] c"This is the original puzzle:\00"
@str.3 = [27 x i8] c"The puzzle was NOT solved.\00"
@str.4 = [28 x i8] c"The puzzle has been solved.\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 @load_puzzle(i32** %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %16
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%8 = call i32 @print_puzzle(i32** %3)
%9 = call i64 @solve_sdk(i32** %3)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
%13 = call i32 @print_puzzle(i32** %3)
br label %16
14: ; preds = %6
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0))
br label %16
16: ; preds = %11, %14, %0
%17 = phi i32 [ %4, %0 ], [ 0, %14 ], [ 0, %11 ]
ret i32 %17
}