#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 */
scalar_t__ find_solution(int /*<<< orphan*/, int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int s[] = {0, 0, 5, 1, 0, 9, 4, 7, 3, 0, 0, 9, 5, 0, 0, 8, 0, 6, 1, 4, 0,
             8, 0, 0, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 6, 7, 0, 2,
             5, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 1, 0, 2, 8,
             5, 0, 2, 0, 0, 8, 6, 0, 0, 3, 9, 8, 2, 0, 7, 1, 0, 0};
  if (find_solution(0, s)) {
    printf("Solution Found!");
    int i;
    for (i = 0; i < 81; i++) {
      if (i % 3 == 0)
        printf(" ");
      if (i % 9 == 0)
        printf("\n");
      if (i % (3 * 9) == 0)
        printf("\n");
      printf("%d ", s[i]);
    }
    printf("\n");
  } else
    printf("No Solution\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x150(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x144,%edx
call   1040 <memcpy@plt>
lea    -0x150(%rbp),%rsi
xor    %edi,%edi
call   1050 <find_solution@plt>
cmp    $0x0,%rax
je     1249 <main+0x119>
lea    0xfcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x154(%rbp)
cmpl   $0x51,-0x154(%rbp)
jge    1236 <main+0x106>
mov    -0x154(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11bc <main+0x8c>
lea    0xfa1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x154(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11e1 <main+0xb1>
lea    0xf89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x154(%rbp),%eax
mov    $0x1b,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1206 <main+0xd6>
lea    0xf64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x154(%rbp),%rax
mov    -0x150(%rbp,%rax,4),%esi
lea    0xf39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x154(%rbp)
jmp    118a <main+0x5a>
lea    0xf26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1257 <main+0x127>
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x150,%rsp
lea    0xe9a(%rip),%rsi
mov    %rsp,%rbx
mov    $0x144,%edx
mov    %rbx,%rdi
call   1060 <memcpy@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <find_solution@plt>
test   %rax,%rax
je     124a <main+0xfa>
lea    0xfb4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xfb6(%rip),%r14
xor    %r15d,%r15d
xor    %ebx,%ebx
jmp    11cb <main+0x7b>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
add    $0xff,%r15b
cmp    $0x51,%rbx
je     123e <main+0xee>
movzbl %bl,%eax
imul   $0xab,%eax,%ecx
shr    $0x9,%ecx
lea    (%rcx,%rcx,2),%ecx
imul   $0x39,%eax,%edx
shr    $0x9,%edx
lea    (%rdx,%rdx,8),%r12d
add    %r15b,%r12b
lea    (%rax,%rax,8),%edx
lea    (%rax,%rdx,2),%eax
movzwl %ax,%ebp
shr    $0x9,%ebp
add    %r15b,%cl
jne    1202 <main+0xb2>
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0x0(%rbp,%rbp,8),%eax
lea    (%rax,%rax,2),%ebp
add    %r15b,%bpl
test   %r12b,%r12b
je     1220 <main+0xd0>
test   %bpl,%bpl
jne    11b0 <main+0x60>
jmp    122f <main+0xdf>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %bpl,%bpl
jne    11b0 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11b0 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1256 <main+0x106>
lea    0xf07(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.s = [81 x i32] [i32 0, i32 0, i32 5, i32 1, i32 0, i32 9, i32 4, i32 7, i32 3, i32 0, i32 0, i32 9, i32 5, i32 0, i32 0, i32 8, i32 0, i32 6, i32 1, i32 4, i32 0, i32 8, i32 0, i32 0, i32 2, i32 0, i32 0, i32 4, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 6, i32 0, i32 0, i32 0, i32 6, i32 7, i32 0, i32 2, i32 5, i32 0, i32 0, i32 0, i32 8, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 4, i32 0, i32 0, i32 1, i32 0, i32 2, i32 8, i32 5, i32 0, i32 2, i32 0, i32 0, i32 8, i32 6, i32 0, i32 0, i32 3, i32 9, i32 8, i32 2, i32 0, i32 7, i32 1, i32 0, i32 0]
@.str = [16 x i8] c"Solution Found!\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [4 x i8] c"%d \00"
@.str.4 = [13 x i8] c"No Solution\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [81 x i32]* %2 to i8*
%5 = getelementptr inbounds [81 x i32], [81 x i32]* %2, i64 0, i64 0
%6 = call i64 @find_solution(i32 0, i32* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %42
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %10
10: ; preds = %37, %8
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 81
br i1 %12, label %13, label %40
13: ; preds = %10
%14 = load i32, i32* %3
%15 = srem i32 %14, 3
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* %3
%21 = srem i32 %20, 9
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %19
%26 = load i32, i32* %3
%27 = srem i32 %26, 27
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %25
%32 = load i32, i32* %3
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [81 x i32], [81 x i32]* %2, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %31
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %10
40: ; preds = %10
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %44
42: ; preds = %0
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
@__const.main.s = [81 x i32] [i32 0, i32 0, i32 5, i32 1, i32 0, i32 9, i32 4, i32 7, i32 3, i32 0, i32 0, i32 9, i32 5, i32 0, i32 0, i32 8, i32 0, i32 6, i32 1, i32 4, i32 0, i32 8, i32 0, i32 0, i32 2, i32 0, i32 0, i32 4, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 6, i32 0, i32 0, i32 0, i32 6, i32 7, i32 0, i32 2, i32 5, i32 0, i32 0, i32 0, i32 8, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 4, i32 0, i32 0, i32 1, i32 0, i32 2, i32 8, i32 5, i32 0, i32 2, i32 0, i32 0, i32 8, i32 6, i32 0, i32 0, i32 3, i32 9, i32 8, i32 2, i32 0, i32 7, i32 1, i32 0, i32 0]
@.str = [16 x i8] c"Solution Found!\00"
@.str.3 = [4 x i8] c"%d \00"
@str = [12 x i8] c"No Solution\00"
define i32 @main() {
%1 = alloca [81 x i32]
%2 = bitcast [81 x i32]* %1 to i8*
%3 = getelementptr inbounds [81 x i32], [81 x i32]* %1, i64 0, i64 0
%4 = call i64 @find_solution(i32 0, i32* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %33, label %6
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %25
%9 = phi i64 [ 0, %6 ], [ %29, %25 ]
%10 = trunc i64 %9 to i8
%11 = urem i8 %10, 3
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @putchar(i32 32)
br label %15
15: ; preds = %13, %8
%16 = urem i8 %10, 9
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @putchar(i32 10)
br label %20
20: ; preds = %18, %15
%21 = urem i8 %10, 27
%22 = icmp eq i8 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @putchar(i32 10)
br label %25
25: ; preds = %23, %20
%26 = getelementptr inbounds [81 x i32], [81 x i32]* %1, i64 0, i64 %9
%27 = load i32, i32* %26
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %27)
%29 = add nuw nsw i64 %9, 1
%30 = icmp eq i64 %29, 81
br i1 %30, label %31, label %8
31: ; preds = %25
%32 = call i32 @putchar(i32 10)
br label %35
33: ; preds = %0
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %35
35: ; preds = %33, %31
ret i32 0
}