#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 Exist_Row(int **, int, int);
int /*<<< orphan*/ printf(char *, int, int, ...);
void Unique_Row(int a[9][9], int i) {
  int k, j;
  int count = 0, flag = 9 + 1;
  for (j = 0; j < 9; j++) {
    if (a[i][j] == 0) {
      count += 1;
      flag = j;
    }
  }
  if (count == 1) {
    printf("Row unique is a[%d][%d]\n", i, flag);
    for (k = 1; k < 9 + 1; k++) {
      if (Exist_Row(a, i, k) != 1) {
        a[i][flag] = k;
        printf("a[%d][%d]=%d\n", i, flag, k);
      }
    }
  }
}


x86 assembly (clang, -O0):
<Unique_Row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0xa,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jge    118d <Unique_Row+0x6d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    117a <Unique_Row+0x5a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    117f <Unique_Row+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <Unique_Row+0x24>
cmpl   $0x1,-0x18(%rbp)
jne    121c <Unique_Row+0xfc>
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1217 <Unique_Row+0xf7>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <Exist_Row@plt>
cmp    $0x1,%eax
je     1204 <Unique_Row+0xe4>
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1209 <Unique_Row+0xe9>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b2 <Unique_Row+0x92>
jmp    121c <Unique_Row+0xfc>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Unique_Row>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
movslq %esi,%rax
lea    (%rax,%rax,8),%rbp
movdqu (%rdi,%rbp,4),%xmm0
movdqu 0x10(%rdi,%rbp,4),%xmm1
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm1
pcmpeqd %xmm2,%xmm0
packssdw %xmm1,%xmm0
packsswb %xmm0,%xmm0
pmovmskb %xmm0,%eax
xor    %ecx,%ecx
test   $0x1,%al
mov    $0xa,%edx
cmovne %ecx,%edx
test   $0x2,%al
mov    $0x1,%ecx
cmove  %edx,%ecx
test   $0x4,%al
mov    $0x2,%edx
cmove  %ecx,%edx
test   $0x8,%al
mov    $0x3,%ecx
cmove  %edx,%ecx
test   $0x10,%al
mov    $0x4,%edx
cmove  %ecx,%edx
test   $0x20,%al
mov    $0x5,%ecx
cmove  %edx,%ecx
test   $0x40,%al
mov    $0x6,%edx
cmove  %ecx,%edx
test   $0x80,%al
mov    $0x7,%ecx
cmove  %edx,%ecx
mov    %eax,%edx
shr    %dl
and    $0x55,%dl
sub    %dl,%al
mov    %eax,%edx
and    $0x33,%dl
shr    $0x2,%al
and    $0x33,%al
add    %dl,%al
mov    %eax,%edx
shr    $0x4,%dl
add    %al,%dl
and    $0xf,%dl
xor    %eax,%eax
cmpl   $0x0,0x20(%rdi,%rbp,4)
sete   %al
movzbl %dl,%edx
mov    $0x8,%r14d
cmovne %ecx,%r14d
add    %eax,%edx
cmp    $0x1,%edx
jne    13c4 <Unique_Row+0x2a4>
mov    %esi,%r12d
mov    %rdi,%rbx
lea    0xe0e(%rip),%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14d,%eax
lea    (%rbx,%rbp,4),%rcx
lea    (%rcx,%rax,4),%r15
mov    %rbx,%rdi
mov    %r12d,%esi
mov    $0x1,%edx
call   1040 <Exist_Row@plt>
cmp    $0x1,%eax
je     123c <Unique_Row+0x11c>
movl   $0x1,(%r15)
lea    0xdef(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    $0x2,%edx
call   1040 <Exist_Row@plt>
cmp    $0x1,%eax
je     1271 <Unique_Row+0x151>
movl   $0x2,(%r15)
lea    0xdba(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    $0x3,%edx
call   1040 <Exist_Row@plt>
cmp    $0x1,%eax
je     12a6 <Unique_Row+0x186>
movl   $0x3,(%r15)
lea    0xd85(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    $0x4,%edx
call   1040 <Exist_Row@plt>
cmp    $0x1,%eax
je     12db <Unique_Row+0x1bb>
movl   $0x4,(%r15)
lea    0xd50(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    $0x4,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    $0x5,%edx
call   1040 <Exist_Row@plt>
cmp    $0x1,%eax
je     1310 <Unique_Row+0x1f0>
movl   $0x5,(%r15)
lea    0xd1b(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    $0x6,%edx
call   1040 <Exist_Row@plt>
cmp    $0x1,%eax
je     1345 <Unique_Row+0x225>
movl   $0x6,(%r15)
lea    0xce6(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    $0x6,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    $0x7,%edx
call   1040 <Exist_Row@plt>
cmp    $0x1,%eax
je     137a <Unique_Row+0x25a>
movl   $0x7,(%r15)
lea    0xcb1(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    $0x7,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    $0x8,%edx
call   1040 <Exist_Row@plt>
cmp    $0x1,%eax
je     13af <Unique_Row+0x28f>
movl   $0x8,(%r15)
lea    0xc7c(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    $0x8,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    $0x9,%edx
call   1040 <Exist_Row@plt>
cmp    $0x1,%eax
jne    13cd <Unique_Row+0x2ad>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
movl   $0x9,(%r15)
lea    0xc3e(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    $0x9,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [25 x i8] c"Row unique is a[%d][%d]\0A\00"
@.str.1 = [14 x i8] c"a[%d][%d]=%d\0A\00"
define void @Unique_Row([9 x i32]* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 0
%5 = bitcast i32* %4 to <8 x i32>*
%6 = load <8 x i32>, <8 x i32>* %5
%7 = icmp eq <8 x i32> %6, zeroinitializer
%8 = extractelement <8 x i1> %7, i64 0
%9 = select i1 %8, i32 0, i32 10
%10 = extractelement <8 x i1> %7, i64 1
%11 = select i1 %10, i32 1, i32 %9
%12 = extractelement <8 x i1> %7, i64 2
%13 = select i1 %12, i32 2, i32 %11
%14 = extractelement <8 x i1> %7, i64 3
%15 = select i1 %14, i32 3, i32 %13
%16 = extractelement <8 x i1> %7, i64 4
%17 = select i1 %16, i32 4, i32 %15
%18 = extractelement <8 x i1> %7, i64 5
%19 = select i1 %18, i32 5, i32 %17
%20 = extractelement <8 x i1> %7, i64 6
%21 = select i1 %20, i32 6, i32 %19
%22 = extractelement <8 x i1> %7, i64 7
%23 = select i1 %22, i32 7, i32 %21
%24 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 8
%25 = load i32, i32* %24
%26 = icmp eq i32 %25, 0
%27 = zext i1 %26 to i32
%28 = bitcast <8 x i1> %7 to i8
%29 = call i8 @llvm.ctpop.i8(i8 %28)
%30 = zext i8 %29 to i32
%31 = add nuw nsw i32 %30, %27
%32 = select i1 %26, i32 8, i32 %23
%33 = icmp eq i32 %31, 1
br i1 %33, label %34, label %83
34: ; preds = %2
%35 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %32)
%36 = bitcast [9 x i32]* %0 to i32**
%37 = zext i32 %32 to i64
%38 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 %37
%39 = tail call i32 @Exist_Row(i32** %36, i32 %1, i32 1)
%40 = icmp eq i32 %39, 1
br i1 %40, label %43, label %41
41: ; preds = %34
store i32 1, i32* %38
%42 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %32, i32 1)
br label %43
43: ; preds = %34, %41
%44 = tail call i32 @Exist_Row(i32** %36, i32 %1, i32 2)
%45 = icmp eq i32 %44, 1
br i1 %45, label %48, label %46
46: ; preds = %43
store i32 2, i32* %38
%47 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %32, i32 2)
br label %48
48: ; preds = %46, %43
%49 = tail call i32 @Exist_Row(i32** %36, i32 %1, i32 3)
%50 = icmp eq i32 %49, 1
br i1 %50, label %53, label %51
51: ; preds = %48
store i32 3, i32* %38
%52 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %32, i32 3)
br label %53
53: ; preds = %51, %48
%54 = tail call i32 @Exist_Row(i32** %36, i32 %1, i32 4)
%55 = icmp eq i32 %54, 1
br i1 %55, label %58, label %56
56: ; preds = %53
store i32 4, i32* %38
%57 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %32, i32 4)
br label %58
58: ; preds = %56, %53
%59 = tail call i32 @Exist_Row(i32** %36, i32 %1, i32 5)
%60 = icmp eq i32 %59, 1
br i1 %60, label %63, label %61
61: ; preds = %58
store i32 5, i32* %38
%62 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %32, i32 5)
br label %63
63: ; preds = %61, %58
%64 = tail call i32 @Exist_Row(i32** %36, i32 %1, i32 6)
%65 = icmp eq i32 %64, 1
br i1 %65, label %68, label %66
66: ; preds = %63
store i32 6, i32* %38
%67 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %32, i32 6)
br label %68
68: ; preds = %66, %63
%69 = tail call i32 @Exist_Row(i32** %36, i32 %1, i32 7)
%70 = icmp eq i32 %69, 1
br i1 %70, label %73, label %71
71: ; preds = %68
store i32 7, i32* %38
%72 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %32, i32 7)
br label %73
73: ; preds = %71, %68
%74 = tail call i32 @Exist_Row(i32** %36, i32 %1, i32 8)
%75 = icmp eq i32 %74, 1
br i1 %75, label %78, label %76
76: ; preds = %73
store i32 8, i32* %38
%77 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %32, i32 8)
br label %78
78: ; preds = %76, %73
%79 = tail call i32 @Exist_Row(i32** %36, i32 %1, i32 9)
%80 = icmp eq i32 %79, 1
br i1 %80, label %83, label %81
81: ; preds = %78
store i32 9, i32* %38
%82 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %32, i32 9)
br label %83
83: ; preds = %78, %81, %2
ret void
}