#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*/ printf(char *, ...);
void clrcntry(int **g, int c, int m) {
  printf("1 ");
  for (int i = 1; i < c; i++) {
    for (int j = 1; j < c; j++) {
      if (g[i][j] == 0) {
        printf("%d ", j + 1);
        break;
      }
    }
  }
}


x86 assembly (clang, -O0):
<clrcntry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11af <clrcntry+0x9f>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    119c <clrcntry+0x8c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1189 <clrcntry+0x79>
mov    -0x18(%rbp),%esi
add    $0x1,%esi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119c <clrcntry+0x8c>
jmp    118e <clrcntry+0x7e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114a <clrcntry+0x3a>
jmp    11a1 <clrcntry+0x91>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <clrcntry+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrcntry>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r15
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x2,%ebp
jl     1171 <clrcntry+0x61>
mov    %ebp,%ebp
mov    $0x1,%ebx
lea    0xec6(%rip),%r14
jmp    1156 <clrcntry+0x46>
nop
add    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbp,%rbx
je     1171 <clrcntry+0x61>
mov    (%r15,%rbx,8),%rax
mov    $0x1,%esi
nop
cmpl   $0x0,(%rax,%rsi,4)
je     1140 <clrcntry+0x30>
add    $0x1,%rsi
cmp    %rsi,%rbp
jne    1160 <clrcntry+0x50>
jmp    114d <clrcntry+0x3d>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"1 \00"
@.str.1 = [4 x i8] c"%d \00"
define void @clrcntry(i32** nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %1, 1
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %25, %6
%9 = phi i64 [ 1, %6 ], [ %26, %25 ]
%10 = getelementptr inbounds i32*, i32** %0, i64 %9
%11 = load i32*, i32** %10
br label %13
12: ; preds = %25, %3
ret void
13: ; preds = %8, %22
%14 = phi i64 [ 1, %8 ], [ %23, %22 ]
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = trunc i64 %14 to i32
%20 = add nuw nsw i32 %19, 1
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %25
22: ; preds = %13
%23 = add nuw nsw i64 %14, 1
%24 = icmp eq i64 %23, %7
br i1 %24, label %25, label %13
25: ; preds = %22, %18
%26 = add nuw nsw i64 %9, 1
%27 = icmp eq i64 %26, %7
br i1 %27, label %12, label %8
}