#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__ fun(int **, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int a[9][9];
  int i;
  int j;
  for (i = 0; i < 9; ++i)
    for (j = 0; j < 9; ++j) {
      scanf("%d", &a[i][j]);
    }
  printf("begin:\n");
  if (fun(a, 1)) {
    printf("answer:\n");
    for (i = 0; i < 9; ++i) {
      for (j = 0; j < 9; ++j) {
        printf("%2d", a[i][j]);
      }
      printf("\n");
    }
  } else
    printf("no answer\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x164(%rbp)
cmpl   $0x9,-0x164(%rbp)
jge    11d3 <main+0xa3>
movl   $0x0,-0x168(%rbp)
cmpl   $0x9,-0x168(%rbp)
jge    11ba <main+0x8a>
movslq -0x164(%rbp),%rax
lea    -0x160(%rbp),%rsi
imul   $0x24,%rax,%rax
add    %rax,%rsi
movslq -0x168(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5f(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x168(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x168(%rbp)
jmp    116a <main+0x3a>
jmp    11bf <main+0x8f>
mov    -0x164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x164(%rbp)
jmp    1153 <main+0x23>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x160(%rbp),%rdi
mov    $0x1,%esi
call   1030 <fun@plt>
cmp    $0x0,%rax
je     12a0 <main+0x170>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x164(%rbp)
cmpl   $0x9,-0x164(%rbp)
jge    129b <main+0x16b>
movl   $0x0,-0x168(%rbp)
cmpl   $0x9,-0x168(%rbp)
jge    1279 <main+0x149>
movslq -0x164(%rbp),%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x168(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x168(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x168(%rbp)
jmp    122b <main+0xfb>
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x164(%rbp)
jmp    1214 <main+0xe4>
jmp    12ae <main+0x17e>
lea    0xd71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x148,%rsp
xor    %ebx,%ebx
lea    0xe9d(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rsp,%rbx,1),%rsi
mov    %r14,%rdi
call   1070 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x4,%rsi
mov    %r14,%rdi
call   1070 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x8,%rsi
mov    %r14,%rdi
call   1070 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0xc,%rsi
mov    %r14,%rdi
call   1070 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x10,%rsi
mov    %r14,%rdi
call   1070 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x14,%rsi
mov    %r14,%rdi
call   1070 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x18,%rsi
mov    %r14,%rdi
call   1070 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x1c,%rsi
mov    %r14,%rdi
call   1070 <scanf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x20,%rsi
mov    %r14,%rdi
call   1070 <scanf@plt>
add    $0x24,%rbx
cmp    $0x144,%rbx
jne    1170 <main+0x20>
lea    0xdf3(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rdi
mov    $0x1,%esi
call   1050 <fun@plt>
test   %rax,%rax
je     12ea <main+0x19a>
lea    0xde2(%rip),%rdi
call   1040 <puts@plt>
mov    $0x20,%ebx
lea    0xdbc(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    -0x20(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x1c(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x18(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x14(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x10(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0xc(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x8(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x4(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x24,%rbx
cmp    $0x164,%rbx
jne    1250 <main+0x100>
jmp    12f6 <main+0x1a6>
lea    0xd1d(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x148,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"begin:\0A\00"
@.str.2 = [9 x i8] c"answer:\0A\00"
@.str.3 = [4 x i8] c"%2d\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [11 x i8] c"no answer\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [9 x [9 x i32]]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
br label %9
9: ; preds = %28, %2
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 9
br i1 %11, label %12, label %31
12: ; preds = %9
store i32 0, i32* %8
br label %13
13: ; preds = %24, %12
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 9
br i1 %15, label %16, label %27
16: ; preds = %13
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %6, i64 0, i64 %18
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [9 x i32], [9 x i32]* %19, i64 0, i64 %21
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %22)
br label %24
24: ; preds = %16
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %13
27: ; preds = %13
br label %28
28: ; preds = %27
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %9
31: ; preds = %9
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%33 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %6, i64 0, i64 0
%34 = bitcast [9 x i32]* %33 to i32**
%35 = call i64 @fun(i32** %34, i32 1)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %64
37: ; preds = %31
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %39
39: ; preds = %60, %37
%40 = load i32, i32* %7
%41 = icmp slt i32 %40, 9
br i1 %41, label %42, label %63
42: ; preds = %39
store i32 0, i32* %8
br label %43
43: ; preds = %55, %42
%44 = load i32, i32* %8
%45 = icmp slt i32 %44, 9
br i1 %45, label %46, label %58
46: ; preds = %43
%47 = load i32, i32* %7
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %6, i64 0, i64 %48
%50 = load i32, i32* %8
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [9 x i32], [9 x i32]* %49, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %46
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 1
store i32 %57, i32* %8
br label %43
58: ; preds = %43
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %60
60: ; preds = %58
%61 = load i32, i32* %7
%62 = add nsw i32 %61, 1
store i32 %62, i32* %7
br label %39
63: ; preds = %39
br label %66
64: ; preds = %31
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %66
66: ; preds = %64, %63
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"%2d\00"
@str = [7 x i8] c"begin:\00"
@str.6 = [10 x i8] c"no answer\00"
@str.7 = [8 x i8] c"answer:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x [9 x i32]]
%4 = bitcast [9 x [9 x i32]]* %3 to i8*
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %25, %5 ]
%7 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %6, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %6, i64 1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %6, i64 2
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %6, i64 3
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %6, i64 4
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %6, i64 5
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%19 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %6, i64 6
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
%21 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %6, i64 7
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
%23 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %6, i64 8
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %23)
%25 = add nuw nsw i64 %6, 1
%26 = icmp eq i64 %25, 9
br i1 %26, label %27, label %5
27: ; preds = %5
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%29 = bitcast [9 x [9 x i32]]* %3 to i32**
%30 = call i64 @fun(i32** %29, i32 1)
%31 = icmp eq i64 %30, 0
br i1 %31, label %66, label %32
32: ; preds = %27
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.7, i64 0, i64 0))
br label %34
34: ; preds = %32, %34
%35 = phi i64 [ 0, %32 ], [ %64, %34 ]
%36 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %35, i64 0
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %35, i64 1
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %40)
%42 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %35, i64 2
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %43)
%45 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %35, i64 3
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %46)
%48 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %35, i64 4
%49 = load i32, i32* %48
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %49)
%51 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %35, i64 5
%52 = load i32, i32* %51
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %52)
%54 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %35, i64 6
%55 = load i32, i32* %54
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %55)
%57 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %35, i64 7
%58 = load i32, i32* %57
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %58)
%60 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %3, i64 0, i64 %35, i64 8
%61 = load i32, i32* %60
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %61)
%63 = call i32 @putchar(i32 10)
%64 = add nuw nsw i64 %35, 1
%65 = icmp eq i64 %64, 9
br i1 %65, label %68, label %34
66: ; preds = %27
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.6, i64 0, i64 0))
br label %68
68: ; preds = %34, %66
ret i32 0
}