#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*/ Unique_Blk(int **, int, int);
int /*<<< orphan*/ Unique_Col(int **, int);
int /*<<< orphan*/ Unique_Row(int **, int);
int /*<<< orphan*/ printf(char *, ...);
void Unique(int a[9][9]) {
  int i, j;
  int temp[9][9];
  for (i = 0; i < 9; i++) {
    for (j = 0; j < 9; j++)
      temp[i][j] = a[i][j];
  }
  for (i = 0; i < 9; i++) {
    for (j = 0; j < 9; j++) {
      Unique_Row(temp, i);
      Unique_Col(temp, j);
      Unique_Blk(temp, i, j);
    }
  }
  for (i = 0; i < 9; i++) {
    for (j = 0; j < 9; j++) {
      printf("%d ", temp[i][j]);
      if ((j + 1) % 3 == 0)
        printf(" ");
      if ((j + 1) % 9 == 0)
        printf("\n");
    }
    if ((i + 1) % 3 == 0)
      printf("\n");
  }
}


x86 assembly (clang, -O0):
<Unique>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    11c1 <Unique+0x81>
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jge    11ae <Unique+0x6e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
movslq -0xc(%rbp),%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1167 <Unique+0x27>
jmp    11b3 <Unique+0x73>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <Unique+0x16>
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1234 <Unique+0xf4>
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jge    1221 <Unique+0xe1>
lea    -0x160(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <Unique_Row@plt>
lea    -0x160(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1060 <Unique_Col@plt>
lea    -0x160(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <Unique_Blk@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11d9 <Unique+0x99>
jmp    1226 <Unique+0xe6>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c8 <Unique+0x88>
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1312 <Unique+0x1d2>
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jge    12da <Unique+0x19a>
movslq -0xc(%rbp),%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12a2 <Unique+0x162>
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12c7 <Unique+0x187>
lea    0xd44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12cc <Unique+0x18c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    124c <Unique+0x10c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12ff <Unique+0x1bf>
lea    0xd0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1304 <Unique+0x1c4>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    123b <Unique+0xfb>
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Unique>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x158,%rsp
mov    %rdi,%rsi
lea    0x10(%rsp),%r12
mov    $0x144,%edx
mov    %r12,%rdi
call   1070 <memcpy@plt>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %ebx,%esi
call   1060 <Unique_Row@plt>
mov    %r12,%rdi
xor    %esi,%esi
call   1080 <Unique_Col@plt>
mov    %r12,%rdi
mov    %ebx,%esi
xor    %edx,%edx
call   1040 <Unique_Blk@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   1060 <Unique_Row@plt>
mov    %r12,%rdi
mov    $0x1,%esi
call   1080 <Unique_Col@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1040 <Unique_Blk@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   1060 <Unique_Row@plt>
mov    %r12,%rdi
mov    $0x2,%esi
call   1080 <Unique_Col@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
call   1040 <Unique_Blk@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   1060 <Unique_Row@plt>
mov    %r12,%rdi
mov    $0x3,%esi
call   1080 <Unique_Col@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
call   1040 <Unique_Blk@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   1060 <Unique_Row@plt>
mov    %r12,%rdi
mov    $0x4,%esi
call   1080 <Unique_Col@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
call   1040 <Unique_Blk@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   1060 <Unique_Row@plt>
mov    %r12,%rdi
mov    $0x5,%esi
call   1080 <Unique_Col@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
call   1040 <Unique_Blk@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   1060 <Unique_Row@plt>
mov    %r12,%rdi
mov    $0x6,%esi
call   1080 <Unique_Col@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    $0x6,%edx
call   1040 <Unique_Blk@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   1060 <Unique_Row@plt>
mov    %r12,%rdi
mov    $0x7,%esi
call   1080 <Unique_Col@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    $0x7,%edx
call   1040 <Unique_Blk@plt>
mov    %r12,%rdi
mov    %ebx,%esi
call   1060 <Unique_Row@plt>
mov    %r12,%rdi
mov    $0x8,%esi
call   1080 <Unique_Col@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    $0x8,%edx
call   1040 <Unique_Blk@plt>
add    $0x1,%ebx
cmp    $0x9,%ebx
jne    1190 <Unique+0x30>
lea    0xd0d(%rip),%r15
xor    %ebx,%ebx
jmp    1328 <Unique+0x1c8>
nopw   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rbx
add    $0x1,%rbx
imul   $0xaaaaaaab,%ebx,%eax
cmp    $0x55555555,%eax
jbe    13b0 <Unique+0x250>
add    $0x24,%r12
cmp    $0x9,%rbx
je     13bf <Unique+0x25f>
mov    %rbx,0x8(%rsp)
mov    $0x1,%bl
xor    %ebp,%ebp
jmp    134c <Unique+0x1ec>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%bl
mov    %r13,%rbp
cmp    $0x9,%r13
je     1300 <Unique+0x1a0>
movzbl %bl,%eax
imul   $0x39,%eax,%ecx
shr    $0x9,%ecx
lea    (%rcx,%rcx,8),%r13d
add    $0xff,%r13b
imul   $0xab,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%r14d
add    $0xff,%r14b
mov    (%r12,%rbp,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %bpl,%r14b
jne    138b <Unique+0x22b>
mov    $0x20,%edi
call   1030 <putchar@plt>
movzbl %r13b,%eax
lea    0x1(%rbp),%r13
cmp    %bpl,%al
jne    1340 <Unique+0x1e0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1340 <Unique+0x1e0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    131a <Unique+0x1ba>
add    $0x158,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @Unique([9 x i32]* %0) {
%2 = alloca [9 x i32]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [9 x [9 x i32]]
store [9 x i32]* %0, [9 x i32]** %2
store i32 0, i32* %3
br label %6
6: ; preds = %32, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 9
br i1 %8, label %9, label %35
9: ; preds = %6
store i32 0, i32* %4
br label %10
10: ; preds = %28, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 9
br i1 %12, label %13, label %31
13: ; preds = %10
%14 = load [9 x i32]*, [9 x i32]** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [9 x i32], [9 x i32]* %14, i64 %16
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [9 x i32], [9 x i32]* %17, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %5, i64 0, i64 %23
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [9 x i32], [9 x i32]* %24, i64 0, i64 %26
store i32 %21, i32* %27
br label %28
28: ; preds = %13
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %10
31: ; preds = %10
br label %32
32: ; preds = %31
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %6
35: ; preds = %6
store i32 0, i32* %3
br label %36
36: ; preds = %61, %35
%37 = load i32, i32* %3
%38 = icmp slt i32 %37, 9
br i1 %38, label %39, label %64
39: ; preds = %36
store i32 0, i32* %4
br label %40
40: ; preds = %57, %39
%41 = load i32, i32* %4
%42 = icmp slt i32 %41, 9
br i1 %42, label %43, label %60
43: ; preds = %40
%44 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %5, i64 0, i64 0
%45 = bitcast [9 x i32]* %44 to i32**
%46 = load i32, i32* %3
%47 = call i32 @Unique_Row(i32** %45, i32 %46)
%48 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %5, i64 0, i64 0
%49 = bitcast [9 x i32]* %48 to i32**
%50 = load i32, i32* %4
%51 = call i32 @Unique_Col(i32** %49, i32 %50)
%52 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %5, i64 0, i64 0
%53 = bitcast [9 x i32]* %52 to i32**
%54 = load i32, i32* %3
%55 = load i32, i32* %4
%56 = call i32 @Unique_Blk(i32** %53, i32 %54, i32 %55)
br label %57
57: ; preds = %43
%58 = load i32, i32* %4
%59 = add nsw i32 %58, 1
store i32 %59, i32* %4
br label %40
60: ; preds = %40
br label %61
61: ; preds = %60
%62 = load i32, i32* %3
%63 = add nsw i32 %62, 1
store i32 %63, i32* %3
br label %36
64: ; preds = %36
store i32 0, i32* %3
br label %65
65: ; preds = %106, %64
%66 = load i32, i32* %3
%67 = icmp slt i32 %66, 9
br i1 %67, label %68, label %109
68: ; preds = %65
store i32 0, i32* %4
br label %69
69: ; preds = %95, %68
%70 = load i32, i32* %4
%71 = icmp slt i32 %70, 9
br i1 %71, label %72, label %98
72: ; preds = %69
%73 = load i32, i32* %3
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %5, i64 0, i64 %74
%76 = load i32, i32* %4
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [9 x i32], [9 x i32]* %75, i64 0, i64 %77
%79 = load i32, i32* %78
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %79)
%81 = load i32, i32* %4
%82 = add nsw i32 %81, 1
%83 = srem i32 %82, 3
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %72
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %87
87: ; preds = %85, %72
%88 = load i32, i32* %4
%89 = add nsw i32 %88, 1
%90 = srem i32 %89, 9
%91 = icmp eq i32 %90, 0
br i1 %91, label %92, label %94
92: ; preds = %87
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %94
94: ; preds = %92, %87
br label %95
95: ; preds = %94
%96 = load i32, i32* %4
%97 = add nsw i32 %96, 1
store i32 %97, i32* %4
br label %69
98: ; preds = %69
%99 = load i32, i32* %3
%100 = add nsw i32 %99, 1
%101 = srem i32 %100, 3
%102 = icmp eq i32 %101, 0
br i1 %102, label %103, label %105
103: ; preds = %98
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %105
105: ; preds = %103, %98
br label %106
106: ; preds = %105
%107 = load i32, i32* %3
%108 = add nsw i32 %107, 1
store i32 %108, i32* %3
br label %65
109: ; preds = %65
ret void
}

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