#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 EXIT_SUCCESS;
int /*<<< orphan*/ init(int *, int, int);
int *malloc(int);
int /*<<< orphan*/ testFindRoot(int *, int, int);
int /*<<< orphan*/ testSetUnion(int *, int, int);
int main(void) {
  int size = 12;
  int *pdata = malloc(sizeof(int) * size);
  int bySize = 1;
  int pathCompression = 0;
  init(pdata, size, bySize);
  testSetUnion(pdata, size, bySize);
  testFindRoot(pdata, size, pathCompression);
  testFindRoot(pdata, size, !pathCompression);
  bySize = 0;
  pathCompression = 0;
  init(pdata, size, bySize);
  testSetUnion(pdata, size, bySize);
  testFindRoot(pdata, size, pathCompression);
  testFindRoot(pdata, size, !pathCompression);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <init@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1060 <testSetUnion@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <testFindRoot@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
cmpl   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edx
call   1030 <testFindRoot@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <init@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1060 <testSetUnion@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <testFindRoot@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
cmpl   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edx
call   1030 <testFindRoot@plt>
mov    0x2dc6(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x30,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xc,%esi
mov    $0x1,%edx
call   1040 <init@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
mov    $0x1,%edx
call   1060 <testSetUnion@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %edx,%edx
call   1030 <testFindRoot@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
mov    $0x1,%edx
call   1030 <testFindRoot@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %edx,%edx
call   1040 <init@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %edx,%edx
call   1060 <testSetUnion@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %edx,%edx
call   1030 <testFindRoot@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
mov    $0x1,%edx
call   1030 <testFindRoot@plt>
mov    0x2e07(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 12, i32* %2
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
%10 = call i32* @malloc(i32 %9)
store i32* %10, i32** %3
store i32 1, i32* %4
store i32 0, i32* %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = call i32 @init(i32* %11, i32 %12, i32 %13)
%15 = load i32*, i32** %3
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = call i32 @testSetUnion(i32* %15, i32 %16, i32 %17)
%19 = load i32*, i32** %3
%20 = load i32, i32* %2
%21 = load i32, i32* %5
%22 = call i32 @testFindRoot(i32* %19, i32 %20, i32 %21)
%23 = load i32*, i32** %3
%24 = load i32, i32* %2
%25 = load i32, i32* %5
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
%28 = zext i1 %27 to i32
%29 = call i32 @testFindRoot(i32* %23, i32 %24, i32 %28)
store i32 0, i32* %4
store i32 0, i32* %5
%30 = load i32*, i32** %3
%31 = load i32, i32* %2
%32 = load i32, i32* %4
%33 = call i32 @init(i32* %30, i32 %31, i32 %32)
%34 = load i32*, i32** %3
%35 = load i32, i32* %2
%36 = load i32, i32* %4
%37 = call i32 @testSetUnion(i32* %34, i32 %35, i32 %36)
%38 = load i32*, i32** %3
%39 = load i32, i32* %2
%40 = load i32, i32* %5
%41 = call i32 @testFindRoot(i32* %38, i32 %39, i32 %40)
%42 = load i32*, i32** %3
%43 = load i32, i32* %2
%44 = load i32, i32* %5
%45 = icmp ne i32 %44, 0
%46 = xor i1 %45, true
%47 = zext i1 %46 to i32
%48 = call i32 @testFindRoot(i32* %42, i32 %43, i32 %47)
%49 = load i32, i32* @EXIT_SUCCESS
ret i32 %49
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32* @malloc(i32 48)
%2 = tail call i32 @init(i32* %1, i32 12, i32 1)
%3 = tail call i32 @testSetUnion(i32* %1, i32 12, i32 1)
%4 = tail call i32 @testFindRoot(i32* %1, i32 12, i32 0)
%5 = tail call i32 @testFindRoot(i32* %1, i32 12, i32 1)
%6 = tail call i32 @init(i32* %1, i32 12, i32 0)
%7 = tail call i32 @testSetUnion(i32* %1, i32 12, i32 0)
%8 = tail call i32 @testFindRoot(i32* %1, i32 12, i32 0)
%9 = tail call i32 @testFindRoot(i32* %1, i32 12, i32 1)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}