#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*/ Union(int *, int, int, int);
int /*<<< orphan*/ display(int *, int);
int find(int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ makeSet(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int S[8];
  makeSet(S, 8);
  Union(S, 5, 6, 8);
  Union(S, 1, 2, 8);
  Union(S, 0, 2, 8);
  Union(S, 2, 3, 8);
  display(S, 8);
  int p = find(S, 8, 0);
  printf("%d is the parent of 0\n", p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1060 <makeSet@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x8,%ecx
call   1070 <Union@plt>
lea    -0x20(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x8,%ecx
call   1070 <Union@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
mov    $0x8,%ecx
call   1070 <Union@plt>
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x8,%ecx
call   1070 <Union@plt>
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1030 <display@plt>
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
xor    %edx,%edx
call   1050 <find@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe12(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1060 <makeSet@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x8,%ecx
call   1070 <Union@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x8,%ecx
call   1070 <Union@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
mov    $0x8,%ecx
call   1070 <Union@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x8,%ecx
call   1070 <Union@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <display@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %edx,%edx
call   1050 <find@plt>
lea    0xe1f(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"%d is the parent of 0\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = alloca i32
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @makeSet(i32* %3, i32 8)
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%6 = call i32 @Union(i32* %5, i32 5, i32 6, i32 8)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%8 = call i32 @Union(i32* %7, i32 1, i32 2, i32 8)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%10 = call i32 @Union(i32* %9, i32 0, i32 2, i32 8)
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%12 = call i32 @Union(i32* %11, i32 2, i32 3, i32 8)
%13 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%14 = call i32 @display(i32* %13, i32 8)
%15 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%16 = call i32 @find(i32* %15, i32 8, i32 0)
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"%d is the parent of 0\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @makeSet(i32* %3, i32 8)
%5 = call i32 @Union(i32* %3, i32 5, i32 6, i32 8)
%6 = call i32 @Union(i32* %3, i32 1, i32 2, i32 8)
%7 = call i32 @Union(i32* %3, i32 0, i32 2, i32 8)
%8 = call i32 @Union(i32* %3, i32 2, i32 3, i32 8)
%9 = call i32 @display(i32* %3, i32 8)
%10 = call i32 @find(i32* %3, i32 8, i32 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}