#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*/ add2set(unsigned int *, int);
int /*<<< orphan*/ clearSet(unsigned int *);
int /*<<< orphan*/ deleteFromSet(unsigned int *, int);
scalar_t__ isMember(unsigned int, int);
int /*<<< orphan*/ printSet(unsigned int);
int /*<<< orphan*/ printf(char *);
unsigned int setIntersection(unsigned int, unsigned int);
unsigned int setUnion(unsigned int, unsigned int);
int main() {
  unsigned int set1 = 0, set2 = 0;
  unsigned int setU = 0, setI = 0;
  add2set(&set1, 17);
  add2set(&set1, 6);
  add2set(&set1, 0);
  add2set(&set1, 2);
  add2set(&set1, 14);
  add2set(&set1, 24);
  printf("Adding { 2, 6, 14, 17, 24, 0 } to set1. \n");
  add2set(&set2, 8);
  add2set(&set2, 6);
  add2set(&set2, 21);
  add2set(&set2, 17);
  add2set(&set1, 18);
  add2set(&set1, 4);
  printf("Adding { 4, 6, 8, 17, 18, 21 } to set2. \n");
  printf("\n");
  setU = setUnion(set1, set2);
  setI = setIntersection(set1, set2);
  printf("Set Union        = ");
  printSet(setU);
  printf("Set Intersection = ");
  printSet(setI);
  deleteFromSet(&set1, 17);
  printf("\nDeleting { 17 } from set1. \n\n");
  setU = setUnion(set1, set2);
  setI = setIntersection(set1, set2);
  printf("Set Union        = ");
  printSet(setU);
  printf("Set Intersection = ");
  printSet(setI);
  printf("\nIs 0 a member of set1? \nLet's see...\n");
  if (isMember(set1, 0))
    printf("Yes! 0 is included in set1. \n\n");
  else
    printf("NOPE! 0 is NOT included in set1. \n\n");
  printf("\nIs 11 a member of set2? \nLet's see...\n");
  if (isMember(set2, 11))
    printf("Yes! 11 is included in set2. \n\n");
  else
    printf("NOPE! 11 is NOT included in set2. \n\n");
  printf("Alright, let's clear set2. \n");
  clearSet(&set2);
  printf("Alright, let's print set2. \n");
  printSet(set2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x11,%esi
call   1090 <add2set@plt>
lea    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1090 <add2set@plt>
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1090 <add2set@plt>
lea    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1090 <add2set@plt>
lea    -0x8(%rbp),%rdi
mov    $0xe,%esi
call   1090 <add2set@plt>
lea    -0x8(%rbp),%rdi
mov    $0x18,%esi
call   1090 <add2set@plt>
lea    0xdfd(%rip),%rdi
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
mov    $0x8,%esi
call   1090 <add2set@plt>
lea    -0xc(%rbp),%rdi
mov    $0x6,%esi
call   1090 <add2set@plt>
lea    -0xc(%rbp),%rdi
mov    $0x15,%esi
call   1090 <add2set@plt>
lea    -0xc(%rbp),%rdi
mov    $0x11,%esi
call   1090 <add2set@plt>
lea    -0x8(%rbp),%rdi
mov    $0x12,%esi
call   1090 <add2set@plt>
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1090 <add2set@plt>
lea    0xdc7(%rip),%rdi
call   1050 <printf@plt>
lea    0xe2a(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <setUnion@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <setIntersection@plt>
mov    %eax,-0x14(%rbp)
lea    0xdbd(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%edi
call   10a0 <printSet@plt>
lea    0xdbd(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   10a0 <printSet@plt>
lea    -0x8(%rbp),%rdi
mov    $0x11,%esi
call   1070 <deleteFromSet@plt>
lea    0xdaf(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <setUnion@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <setIntersection@plt>
mov    %eax,-0x14(%rbp)
lea    0xd5f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%edi
call   10a0 <printSet@plt>
lea    0xd5f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   10a0 <printSet@plt>
lea    0xd7e(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <isMember@plt>
cmp    $0x0,%rax
je     1347 <main+0x1c7>
lea    0xd85(%rip),%rdi
call   1050 <printf@plt>
jmp    1353 <main+0x1d3>
lea    0xd93(%rip),%rdi
call   1050 <printf@plt>
lea    0xdab(%rip),%rdi
call   1050 <printf@plt>
mov    -0xc(%rbp),%edi
mov    $0xb,%esi
call   1030 <isMember@plt>
cmp    $0x0,%rax
je     1387 <main+0x207>
lea    0xdb0(%rip),%rdi
call   1050 <printf@plt>
jmp    1393 <main+0x213>
lea    0xdbf(%rip),%rdi
call   1050 <printf@plt>
lea    0xdd8(%rip),%rdi
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1080 <clearSet@plt>
lea    0xde0(%rip),%rdi
call   1050 <printf@plt>
mov    -0xc(%rbp),%edi
call   10a0 <printSet@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%r13
mov    %r13,%rdi
mov    $0x11,%esi
call   10b0 <add2set@plt>
mov    %r13,%rdi
mov    $0x6,%esi
call   10b0 <add2set@plt>
mov    %r13,%rdi
xor    %esi,%esi
call   10b0 <add2set@plt>
mov    %r13,%rdi
mov    $0x2,%esi
call   10b0 <add2set@plt>
mov    %r13,%rdi
mov    $0xe,%esi
call   10b0 <add2set@plt>
mov    %r13,%rdi
mov    $0x18,%esi
call   10b0 <add2set@plt>
lea    0xe17(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x8,%esi
call   10b0 <add2set@plt>
mov    %r14,%rdi
mov    $0x6,%esi
call   10b0 <add2set@plt>
mov    %r14,%rdi
mov    $0x15,%esi
call   10b0 <add2set@plt>
mov    %r14,%rdi
mov    $0x11,%esi
call   10b0 <add2set@plt>
mov    %r13,%rdi
mov    $0x12,%esi
call   10b0 <add2set@plt>
mov    %r13,%rdi
mov    $0x4,%esi
call   10b0 <add2set@plt>
lea    0xde3(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1060 <setUnion@plt>
mov    %eax,%ebp
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1080 <setIntersection@plt>
mov    %eax,%ebx
lea    0xd60(%rip),%r15
mov    %r15,%rdi
call   1070 <printf@plt>
mov    %ebp,%edi
call   10c0 <printSet@plt>
lea    0xd5e(%rip),%r12
mov    %r12,%rdi
call   1070 <printf@plt>
mov    %ebx,%edi
call   10c0 <printSet@plt>
mov    %r13,%rdi
mov    $0x11,%esi
call   1090 <deleteFromSet@plt>
lea    0xda1(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1060 <setUnion@plt>
mov    %eax,%ebx
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1080 <setIntersection@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1070 <printf@plt>
mov    %ebx,%edi
call   10c0 <printSet@plt>
mov    %r12,%rdi
call   1070 <printf@plt>
mov    %ebp,%edi
call   10c0 <printSet@plt>
lea    0xd79(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%edi
xor    %esi,%esi
call   1050 <isMember@plt>
test   %rax,%rax
lea    0xd85(%rip),%rax
lea    0xe43(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
lea    0xd91(%rip),%rdi
call   1040 <puts@plt>
mov    (%rsp),%edi
mov    $0xb,%esi
call   1050 <isMember@plt>
test   %rax,%rax
lea    0xd9c(%rip),%rax
lea    0xdf1(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
lea    0xda9(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   10a0 <clearSet@plt>
lea    0xdb1(%rip),%rdi
call   1040 <puts@plt>
mov    (%rsp),%edi
call   10c0 <printSet@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Adding { 2, 6, 14, 17, 24, 0 } to set1. \0A\00"
@.str.1 = [42 x i8] c"Adding { 4, 6, 8, 17, 18, 21 } to set2. \0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [20 x i8] c"Set Union = \00"
@.str.4 = [20 x i8] c"Set Intersection = \00"
@.str.5 = [31 x i8] c"\0ADeleting { 17 } from set1. \0A\0A\00"
@.str.6 = [39 x i8] c"\0AIs 0 a member of set1? \0ALet's see...\0A\00"
@.str.7 = [31 x i8] c"Yes! 0 is included in set1. \0A\0A\00"
@.str.8 = [36 x i8] c"NOPE! 0 is NOT included in set1. \0A\0A\00"
@.str.9 = [40 x i8] c"\0AIs 11 a member of set2? \0ALet's see...\0A\00"
@.str.10 = [32 x i8] c"Yes! 11 is included in set2. \0A\0A\00"
@.str.11 = [37 x i8] c"NOPE! 11 is NOT included in set2. \0A\0A\00"
@.str.12 = [29 x i8] c"Alright, let's clear set2. \0A\00"
@.str.13 = [29 x i8] c"Alright, let's print set2. \0A\00"
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 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = call i32 @add2set(i32* %2, i32 17)
%7 = call i32 @add2set(i32* %2, i32 6)
%8 = call i32 @add2set(i32* %2, i32 0)
%9 = call i32 @add2set(i32* %2, i32 2)
%10 = call i32 @add2set(i32* %2, i32 14)
%11 = call i32 @add2set(i32* %2, i32 24)
%12 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @add2set(i32* %3, i32 8)
%14 = call i32 @add2set(i32* %3, i32 6)
%15 = call i32 @add2set(i32* %3, i32 21)
%16 = call i32 @add2set(i32* %3, i32 17)
%17 = call i32 @add2set(i32* %2, i32 18)
%18 = call i32 @add2set(i32* %2, i32 4)
%19 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = call i32 @setUnion(i32 %21, i32 %22)
store i32 %23, i32* %4
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = call i32 @setIntersection(i32 %24, i32 %25)
store i32 %26, i32* %5
%27 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%28 = load i32, i32* %4
%29 = call i32 @printSet(i32 %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%31 = load i32, i32* %5
%32 = call i32 @printSet(i32 %31)
%33 = call i32 @deleteFromSet(i32* %2, i32 17)
%34 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%35 = load i32, i32* %2
%36 = load i32, i32* %3
%37 = call i32 @setUnion(i32 %35, i32 %36)
store i32 %37, i32* %4
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = call i32 @setIntersection(i32 %38, i32 %39)
store i32 %40, i32* %5
%41 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%42 = load i32, i32* %4
%43 = call i32 @printSet(i32 %42)
%44 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%45 = load i32, i32* %5
%46 = call i32 @printSet(i32 %45)
%47 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%48 = load i32, i32* %2
%49 = call i64 @isMember(i32 %48, i32 0)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %0
%52 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
br label %55
53: ; preds = %0
%54 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0))
br label %55
55: ; preds = %53, %51
%56 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0))
%57 = load i32, i32* %3
%58 = call i64 @isMember(i32 %57, i32 11)
%59 = icmp ne i64 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %55
%61 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0))
br label %64
62: ; preds = %55
%63 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0))
br label %64
64: ; preds = %62, %60
%65 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0))
%66 = call i32 @clearSet(i32* %3)
%67 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0))
%68 = load i32, i32* %3
%69 = call i32 @printSet(i32 %68)
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [20 x i8] c"Set Union = \00"
@.str.4 = [20 x i8] c"Set Intersection = \00"
@str = [41 x i8] c"Adding { 2, 6, 14, 17, 24, 0 } to set1. \00"
@str.14 = [41 x i8] c"Adding { 4, 6, 8, 17, 18, 21 } to set2. \00"
@str.15 = [30 x i8] c"\0ADeleting { 17 } from set1. \0A\00"
@str.16 = [38 x i8] c"\0AIs 0 a member of set1? \0ALet's see...\00"
@str.17 = [35 x i8] c"NOPE! 0 is NOT included in set1. \0A\00"
@str.18 = [39 x i8] c"\0AIs 11 a member of set2? \0ALet's see...\00"
@str.19 = [36 x i8] c"NOPE! 11 is NOT included in set2. \0A\00"
@str.20 = [28 x i8] c"Alright, let's clear set2. \00"
@str.21 = [28 x i8] c"Alright, let's print set2. \00"
@str.22 = [31 x i8] c"Yes! 11 is included in set2. \0A\00"
@str.23 = [30 x i8] c"Yes! 0 is included in set1. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @add2set(i32* %1, i32 17)
%6 = call i32 @add2set(i32* %1, i32 6)
%7 = call i32 @add2set(i32* %1, i32 0)
%8 = call i32 @add2set(i32* %1, i32 2)
%9 = call i32 @add2set(i32* %1, i32 14)
%10 = call i32 @add2set(i32* %1, i32 24)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%12 = call i32 @add2set(i32* %2, i32 8)
%13 = call i32 @add2set(i32* %2, i32 6)
%14 = call i32 @add2set(i32* %2, i32 21)
%15 = call i32 @add2set(i32* %2, i32 17)
%16 = call i32 @add2set(i32* %1, i32 18)
%17 = call i32 @add2set(i32* %1, i32 4)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.14, i64 0, i64 0))
%19 = call i32 @putchar(i32 10)
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = call i32 @setUnion(i32 %20, i32 %21)
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = call i32 @setIntersection(i32 %23, i32 %24)
%26 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 @printSet(i32 %22)
%28 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%29 = call i32 @printSet(i32 %25)
%30 = call i32 @deleteFromSet(i32* %1, i32 17)
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.15, i64 0, i64 0))
%32 = load i32, i32* %1
%33 = load i32, i32* %2
%34 = call i32 @setUnion(i32 %32, i32 %33)
%35 = load i32, i32* %1
%36 = load i32, i32* %2
%37 = call i32 @setIntersection(i32 %35, i32 %36)
%38 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%39 = call i32 @printSet(i32 %34)
%40 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%41 = call i32 @printSet(i32 %37)
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.16, i64 0, i64 0))
%43 = load i32, i32* %1
%44 = call i64 @isMember(i32 %43, i32 0)
%45 = icmp eq i64 %44, 0
%46 = select i1 %45, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @str.17, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.23, i64 0, i64 0)
%47 = call i32 @puts(i8* dereferenceable(1) %46)
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.18, i64 0, i64 0))
%49 = load i32, i32* %2
%50 = call i64 @isMember(i32 %49, i32 11)
%51 = icmp eq i64 %50, 0
%52 = select i1 %51, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str.19, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @str.22, i64 0, i64 0)
%53 = call i32 @puts(i8* dereferenceable(1) %52)
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.20, i64 0, i64 0))
%55 = call i32 @clearSet(i32* %2)
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.21, i64 0, i64 0))
%57 = load i32, i32* %2
%58 = call i32 @printSet(i32 %57)
ret i32 0
}