#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 *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ source(int **, int);
int main() {
  int a[20][20], n, i, j;
  printf("enter the num of vertices \n");
  scanf("%d", &n);
  printf("enter the adjacency matrix \n");
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  source(a, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x660,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x654(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x658(%rbp)
mov    -0x658(%rbp),%eax
cmp    -0x654(%rbp),%eax
jg     1201 <main+0xd1>
movl   $0x1,-0x65c(%rbp)
mov    -0x65c(%rbp),%eax
cmp    -0x654(%rbp),%eax
jg     11e8 <main+0xb8>
movslq -0x658(%rbp),%rax
lea    -0x650(%rbp),%rsi
imul   $0x50,%rax,%rax
add    %rax,%rsi
movslq -0x65c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe4d(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x65c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x65c(%rbp)
jmp    1193 <main+0x63>
jmp    11ed <main+0xbd>
mov    -0x658(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x658(%rbp)
jmp    1177 <main+0x47>
lea    -0x650(%rbp),%rdi
mov    -0x654(%rbp),%esi
call   1050 <source@plt>
xor    %eax,%eax
add    $0x660,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x650,%rsp
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
lea    0xead(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    11cf <main+0x9f>
lea    0x64(%rsp),%r15
mov    $0x1,%r12d
lea    0xe7d(%rip),%r14
jmp    11a4 <main+0x74>
cs nopw 0x0(%rax,%rax,1)
nop
movslq %esi,%rax
lea    0x1(%r12),%rcx
add    $0x50,%r15
cmp    %rax,%r12
mov    %rcx,%r12
jge    11cf <main+0x9f>
test   %esi,%esi
jle    1190 <main+0x60>
mov    %r15,%r13
xor    %ebx,%ebx
nopl   (%rax)
mov    %r14,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rsi
add    $0x1,%rbx
add    $0x4,%r13
cmp    %rsi,%rbx
jl     11b0 <main+0x80>
jmp    1190 <main+0x60>
lea    0x10(%rsp),%rdi
call   1050 <source@plt>
xor    %eax,%eax
add    $0x650,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [28 x i8] c"enter the num of vertices \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"enter the adjacency matrix \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x [20 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %4
br label %9
9: ; preds = %30, %0
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %33
13: ; preds = %9
store i32 1, i32* %5
br label %14
14: ; preds = %26, %13
%15 = load i32, i32* %5
%16 = load i32, i32* %3
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %29
18: ; preds = %14
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %2, i64 0, i64 %20
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [20 x i32], [20 x i32]* %21, i64 0, i64 %23
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %24)
br label %26
26: ; preds = %18
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %14
29: ; preds = %14
br label %30
30: ; preds = %29
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %9
33: ; preds = %9
%34 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %2, i64 0, i64 0
%35 = bitcast [20 x i32]* %34 to i32**
%36 = load i32, i32* %3
%37 = call i32 @source(i32** %35, i32 %36)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [27 x i8] c"enter the num of vertices \00"
@str.3 = [28 x i8] c"enter the adjacency matrix \00"
define i32 @main() {
%1 = alloca [20 x [20 x i32]]
%2 = alloca i32
%3 = bitcast [20 x [20 x i32]]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1
br i1 %9, label %27, label %10
10: ; preds = %0, %22
%11 = phi i32 [ %23, %22 ], [ %8, %0 ]
%12 = phi i64 [ %25, %22 ], [ 1, %0 ]
%13 = icmp slt i32 %11, 1
br i1 %13, label %22, label %14
14: ; preds = %10, %14
%15 = phi i64 [ %18, %14 ], [ 1, %10 ]
%16 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %12, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = add nuw nsw i64 %15, 1
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = icmp slt i64 %15, %20
br i1 %21, label %14, label %22
22: ; preds = %14, %10
%23 = phi i32 [ %11, %10 ], [ %19, %14 ]
%24 = sext i32 %23 to i64
%25 = add nuw nsw i64 %12, 1
%26 = icmp slt i64 %12, %24
br i1 %26, label %10, label %27
27: ; preds = %22, %0
%28 = phi i32 [ %8, %0 ], [ %23, %22 ]
%29 = bitcast [20 x [20 x i32]]* %1 to i32**
%30 = call i32 @source(i32** %29, i32 %28)
ret i32 0
}