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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1040 <memset@plt>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1204 <main+0xc4>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11f1 <main+0xb1>
movslq -0x18(%rbp),%rax
lea    -0x1b0(%rbp),%rsi
imul   $0x28,%rax,%rax
add    %rax,%rsi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe3c(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ae <main+0x6e>
jmp    11f6 <main+0xb6>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    119b <main+0x5b>
lea    -0x1b0(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <prims@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a0,%rsp
lea    0x10(%rsp),%rdi
mov    $0x190,%edx
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    11ef <main+0xaf>
lea    0x3c(%rsp),%r15
mov    $0x1,%r12d
lea    0xe5c(%rip),%r14
jmp    11c4 <main+0x84>
cs nopw 0x0(%rax,%rax,1)
movslq %esi,%rax
lea    0x1(%r12),%rcx
add    $0x28,%r15
cmp    %rax,%r12
mov    %rcx,%r12
jge    11ef <main+0xaf>
test   %esi,%esi
jle    11b0 <main+0x70>
mov    %r15,%r13
xor    %ebx,%ebx
nopl   (%rax)
mov    %r14,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rsi
add    $0x1,%rbx
add    $0x4,%r13
cmp    %rsi,%rbx
jl     11d0 <main+0x90>
jmp    11b0 <main+0x70>
lea    0x10(%rsp),%rdi
call   1060 <prims@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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