#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*/ MST_kruskal(int **, int, int **);
int /*<<< orphan*/ create_graph(int **, int);
int /*<<< orphan*/ print_graph(int **, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int G[20][20], no_of_nodes, mst[20][20];
  printf("Enter no.of nodes:");
  scanf("%d", &no_of_nodes);
  create_graph(G, no_of_nodes);
  printf("---Original graph---\n");
  print_graph(G, no_of_nodes);
  MST_kruskal(G, no_of_nodes, mst);
  printf("----Mst---\n");
  print_graph(mst, no_of_nodes);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc90,%rsp
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
lea    0xea5(%rip),%rdi
lea    -0x644(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x640(%rbp),%rdi
mov    -0x644(%rbp),%esi
call   1070 <create_graph@plt>
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
lea    -0x640(%rbp),%rdi
mov    -0x644(%rbp),%esi
call   1030 <print_graph@plt>
lea    -0x640(%rbp),%rdi
mov    -0x644(%rbp),%esi
lea    -0xc90(%rbp),%rdx
call   1050 <MST_kruskal@plt>
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
lea    -0xc90(%rbp),%rdi
mov    -0x644(%rbp),%esi
call   1030 <print_graph@plt>
xor    %eax,%eax
add    $0xc90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xc98,%rsp
lea    0xe8f(%rip),%rdi
call   1050 <printf@plt>
lea    0xe96(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0x650(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <create_graph@plt>
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <print_graph@plt>
mov    0xc(%rsp),%esi
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rdx
call   1060 <MST_kruskal@plt>
lea    0xe5d(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1040 <print_graph@plt>
xor    %eax,%eax
add    $0xc98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter no.of nodes:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"---Original graph---\0A\00"
@.str.3 = [12 x i8] c"----Mst---\0A\00"
define i32 @main() {
%1 = alloca [20 x [20 x i32]]
%2 = alloca i32
%3 = alloca [20 x [20 x i32]]
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 0
%7 = bitcast [20 x i32]* %6 to i32**
%8 = load i32, i32* %2
%9 = call i32 @create_graph(i32** %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 0
%12 = bitcast [20 x i32]* %11 to i32**
%13 = load i32, i32* %2
%14 = call i32 @print_graph(i32** %12, i32 %13)
%15 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 0
%16 = bitcast [20 x i32]* %15 to i32**
%17 = load i32, i32* %2
%18 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %3, i64 0, i64 0
%19 = bitcast [20 x i32]* %18 to i32**
%20 = call i32 @MST_kruskal(i32** %16, i32 %17, i32** %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%22 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %3, i64 0, i64 0
%23 = bitcast [20 x i32]* %22 to i32**
%24 = load i32, i32* %2
%25 = call i32 @print_graph(i32** %23, i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter no.of nodes:\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [21 x i8] c"---Original graph---\00"
@str.4 = [11 x i8] c"----Mst---\00"
define i32 @main() {
%1 = alloca [20 x [20 x i32]]
%2 = alloca i32
%3 = alloca [20 x [20 x i32]]
%4 = bitcast [20 x [20 x i32]]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [20 x [20 x i32]]* %3 to i8*
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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* %2)
%9 = bitcast [20 x [20 x i32]]* %1 to i32**
%10 = load i32, i32* %2
%11 = call i32 @create_graph(i32** %9, i32 %10)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%13 = load i32, i32* %2
%14 = call i32 @print_graph(i32** %9, i32 %13)
%15 = load i32, i32* %2
%16 = bitcast [20 x [20 x i32]]* %3 to i32**
%17 = call i32 @MST_kruskal(i32** %9, i32 %15, i32** %16)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0))
%19 = load i32, i32* %2
%20 = call i32 @print_graph(i32** %16, i32 %19)
ret i32 0
}