#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 */
struct set_s {
  int dummy;
};

/* Variables and functions */
struct set_s *Difference(struct set_s *, int, struct set_s *, int,
                         struct set_s *, int, struct set_s *);
struct set_s *Free_list(struct set_s *);
char Get_command();
struct set_s *Intersection(struct set_s *, int, struct set_s *, int,
                           struct set_s *, int, struct set_s *);
int /*<<< orphan*/ Print(struct set_s *, int);
struct set_s *Read_set(struct set_s *, int *, int);
struct set_s *Union(struct set_s *, int, struct set_s *, int, struct set_s *,
                    int, struct set_s *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  struct set_s *a_p = NULL;
  struct set_s *b_p = NULL;
  struct set_s *c_p = NULL;
  struct set_s *C = NULL;
  int asize, bsize, csize;
  asize = bsize = csize = 0;
  char command;
  command = Get_command();
  if (command != 'q' && command != 'Q') {
    a_p = Read_set(a_p, &asize, 1);
    b_p = Read_set(b_p, &bsize, 2);
    csize = asize + bsize;
  }
  while (command != 'q' && command != 'Q') {
    switch (command) {
    case 'u':
    case 'U':
      printf("\n\nFinding the union of the two sets. \n");
      c_p = Union(a_p, asize, b_p, bsize, c_p, csize, C);
      Print(a_p, 1);
      Print(b_p, 2);
      printf("Union: ");
      Print(c_p, 3);
      printf("\n");
      break;
    case 'i':
    case 'I':
      printf("\n\nFinding the intersection of the two sets. \n");
      c_p = Intersection(a_p, asize, b_p, bsize, c_p, csize, C);
      Print(a_p, 1);
      Print(b_p, 2);
      printf("Intersection: ");
      Print(c_p, 3);
      printf("\n");
      break;
    case 'd':
    case 'D':
      printf("\n\nFinding the difference of the two sets. \n");
      c_p = Difference(a_p, asize, b_p, bsize, c_p, csize, C);
      Print(a_p, 1);
      Print(b_p, 2);
      printf("Difference: ");
      Print(c_p, 3);
      printf("\n");
      break;
    case '\n':
      printf("\n$ ");
      break;
    default:
      printf("There is no %c command\n", command);
      printf("Please try aga_pn\n");
    }
    a_p = Free_list(a_p);
    b_p = Free_list(b_p);
    c_p = Free_list(c_p);
    C = Free_list(C);
    asize = bsize = csize = 0;
    command = Get_command();
    if (command != 'q' && command != 'Q') {
      a_p = Read_set(a_p, &asize, 1);
      b_p = Read_set(b_p, &bsize, 2);
      csize = asize + bsize;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    $0x0,%al
call   1050 <Get_command@plt>
mov    %al,-0x35(%rbp)
movsbl -0x35(%rbp),%eax
cmp    $0x71,%eax
je     121d <main+0x9d>
movsbl -0x35(%rbp),%eax
cmp    $0x51,%eax
je     121d <main+0x9d>
mov    -0x10(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
mov    $0x1,%edx
call   1030 <Read_set@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x2,%edx
call   1030 <Read_set@plt>
mov    %rax,-0x18(%rbp)
mov    -0x2c(%rbp),%eax
add    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1222 <main+0xa2>
movsbl -0x35(%rbp),%ecx
xor    %eax,%eax
cmp    $0x71,%ecx
mov    %al,-0x36(%rbp)
je     1241 <main+0xc1>
movsbl -0x35(%rbp),%eax
cmp    $0x51,%eax
setne  %al
mov    %al,-0x36(%rbp)
mov    -0x36(%rbp),%al
test   $0x1,%al
jne    1251 <main+0xd1>
jmp    1526 <main+0x3a6>
movsbl -0x35(%rbp),%eax
mov    %eax,-0x3c(%rbp)
sub    $0xa,%eax
je     144c <main+0x2cc>
jmp    1266 <main+0xe6>
mov    -0x3c(%rbp),%eax
sub    $0x44,%eax
je     13cc <main+0x24c>
jmp    1277 <main+0xf7>
mov    -0x3c(%rbp),%eax
sub    $0x49,%eax
je     134c <main+0x1cc>
jmp    1288 <main+0x108>
mov    -0x3c(%rbp),%eax
sub    $0x55,%eax
je     12cc <main+0x14c>
jmp    1299 <main+0x119>
mov    -0x3c(%rbp),%eax
sub    $0x64,%eax
je     13cc <main+0x24c>
jmp    12aa <main+0x12a>
mov    -0x3c(%rbp),%eax
sub    $0x69,%eax
je     134c <main+0x1cc>
jmp    12bb <main+0x13b>
mov    -0x3c(%rbp),%eax
sub    $0x75,%eax
jne    145f <main+0x2df>
jmp    12cc <main+0x14c>
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x34(%rbp),%r9d
mov    -0x28(%rbp),%rax
mov    %rax,(%rsp)
call   1090 <Union@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1080 <Print@plt>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1080 <Print@plt>
lea    0xd03(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x3,%esi
call   1080 <Print@plt>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    147f <main+0x2ff>
lea    0xcdc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x34(%rbp),%r9d
mov    -0x28(%rbp),%rax
mov    %rax,(%rsp)
call   1070 <Intersection@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1080 <Print@plt>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1080 <Print@plt>
lea    0xcb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x3,%esi
call   1080 <Print@plt>
lea    0xcd6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    147f <main+0x2ff>
lea    0xc99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x34(%rbp),%r9d
mov    -0x28(%rbp),%rax
mov    %rax,(%rsp)
call   10a0 <Difference@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1080 <Print@plt>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1080 <Print@plt>
lea    0xc74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x3,%esi
call   1080 <Print@plt>
lea    0xc56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    147f <main+0x2ff>
lea    0xc52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    147f <main+0x2ff>
movsbl -0x35(%rbp),%esi
lea    0xc3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <Free_list@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <Free_list@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <Free_list@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
call   1060 <Free_list@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    $0x0,%al
call   1050 <Get_command@plt>
mov    %al,-0x35(%rbp)
movsbl -0x35(%rbp),%eax
cmp    $0x71,%eax
je     1521 <main+0x3a1>
movsbl -0x35(%rbp),%eax
cmp    $0x51,%eax
je     1521 <main+0x3a1>
mov    -0x10(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
mov    $0x1,%edx
call   1030 <Read_set@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x2,%edx
call   1030 <Read_set@plt>
mov    %rax,-0x18(%rbp)
mov    -0x2c(%rbp),%eax
add    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1222 <main+0xa2>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
xor    %eax,%eax
call   1070 <Get_command@plt>
mov    %eax,%r13d
and    $0xdf,%al
cmp    $0x51,%al
jne    11df <main+0x3f>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x14(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1050 <Read_set@plt>
mov    %rax,%rbx
lea    0x10(%rsp),%rsi
xor    %edi,%edi
mov    $0x2,%edx
call   1050 <Read_set@plt>
mov    %rax,%rbp
mov    0x10(%rsp),%r14d
add    0x14(%rsp),%r14d
xor    %r15d,%r15d
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
movsbl %r13b,%esi
lea    -0x44(%rsi),%eax
cmp    $0x31,%eax
ja     1310 <main+0x170>
movabs $0x100000001,%rcx
bt     %rax,%rcx
jb     1330 <main+0x190>
movabs $0x2000000020,%rcx
bt     %rax,%rcx
jb     12c0 <main+0x120>
movabs $0x2000000020000,%rcx
bt     %rax,%rcx
jae    1310 <main+0x170>
lea    0xe29(%rip),%rdi
call   1040 <puts@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%ecx
mov    %r15,(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r12,%r8
mov    %r14d,%r9d
call   10b0 <Union@plt>
mov    %rax,%r12
mov    %rbx,%rdi
mov    $0x1,%esi
call   10a0 <Print@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
call   10a0 <Print@plt>
lea    0xd4b(%rip),%rdi
jmp    137d <main+0x1dd>
nopw   0x0(%rax,%rax,1)
lea    0xda4(%rip),%rdi
call   1040 <puts@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%ecx
mov    %r15,(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r12,%r8
mov    %r14d,%r9d
call   1090 <Intersection@plt>
mov    %rax,%r12
mov    %rbx,%rdi
mov    $0x1,%esi
call   10a0 <Print@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
call   10a0 <Print@plt>
lea    0xcfb(%rip),%rdi
jmp    137d <main+0x1dd>
nop
cmp    $0xa,%esi
jne    1424 <main+0x284>
lea    0xd04(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    139b <main+0x1fb>
nopl   0x0(%rax)
lea    0xd09(%rip),%rdi
call   1040 <puts@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%ecx
mov    %r15,(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r12,%r8
mov    %r14d,%r9d
call   10c0 <Difference@plt>
mov    %rax,%r12
mov    %rbx,%rdi
mov    $0x1,%esi
call   10a0 <Print@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
call   10a0 <Print@plt>
lea    0xc9a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12,%rdi
mov    $0x3,%esi
call   10a0 <Print@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1080 <Free_list@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1080 <Free_list@plt>
mov    %rax,%rbp
mov    %r12,%rdi
call   1080 <Free_list@plt>
mov    %rax,%r12
mov    %r15,%rdi
call   1080 <Free_list@plt>
mov    %rax,%r15
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
xor    %eax,%eax
call   1070 <Get_command@plt>
mov    %eax,%r13d
and    $0xdf,%al
cmp    $0x51,%al
je     11ce <main+0x2e>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
mov    $0x1,%edx
call   1050 <Read_set@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
lea    0x10(%rsp),%rsi
mov    $0x2,%edx
call   1050 <Read_set@plt>
mov    %rax,%rbp
mov    0x10(%rsp),%r14d
add    0x14(%rsp),%r14d
jmp    1220 <main+0x80>
lea    0xbfd(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc85(%rip),%rdi
call   1040 <puts@plt>
jmp    139b <main+0x1fb>

LLVM IR (-O0):
%struct.set_s = type { i32 }
@.str = [39 x i8] c"\0A\0AFinding the union of the two sets. \0A\00"
@.str.1 = [8 x i8] c"Union: \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [46 x i8] c"\0A\0AFinding the intersection of the two sets. \0A\00"
@.str.4 = [15 x i8] c"Intersection: \00"
@.str.5 = [44 x i8] c"\0A\0AFinding the difference of the two sets. \0A\00"
@.str.6 = [13 x i8] c"Difference: \00"
@.str.7 = [4 x i8] c"\0A$ \00"
@.str.8 = [24 x i8] c"There is no %c command\0A\00"
@.str.9 = [19 x i8] c"Please try aga_pn\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.set_s*
%3 = alloca %struct.set_s*
%4 = alloca %struct.set_s*
%5 = alloca %struct.set_s*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
store i32 0, i32* %1
store %struct.set_s* null, %struct.set_s** %2
store %struct.set_s* null, %struct.set_s** %3
store %struct.set_s* null, %struct.set_s** %4
store %struct.set_s* null, %struct.set_s** %5
store i32 0, i32* %8
store i32 0, i32* %7
store i32 0, i32* %6
%10 = call signext i8 (...) @Get_command()
store i8 %10, i8* %9
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 113
br i1 %13, label %14, label %26
14: ; preds = %0
%15 = load i8, i8* %9
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 81
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = load %struct.set_s*, %struct.set_s** %2
%20 = call %struct.set_s* @Read_set(%struct.set_s* %19, i32* %6, i32 1)
store %struct.set_s* %20, %struct.set_s** %2
%21 = load %struct.set_s*, %struct.set_s** %3
%22 = call %struct.set_s* @Read_set(%struct.set_s* %21, i32* %7, i32 2)
store %struct.set_s* %22, %struct.set_s** %3
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = add nsw i32 %23, %24
store i32 %25, i32* %8
br label %26
26: ; preds = %18, %14, %0
br label %27
27: ; preds = %126, %26
%28 = load i8, i8* %9
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 113
br i1 %30, label %31, label %35
31: ; preds = %27
%32 = load i8, i8* %9
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %33, 81
br label %35
35: ; preds = %31, %27
%36 = phi i1 [ false, %27 ], [ %34, %31 ]
br i1 %36, label %37, label %127
37: ; preds = %35
%38 = load i8, i8* %9
%39 = sext i8 %38 to i32
switch i32 %39, label %96 [
i32 117, label %40
i32 85, label %40
i32 105, label %58
i32 73, label %58
i32 100, label %76
i32 68, label %76
i32 10, label %94
]
40: ; preds = %37, %37
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%42 = load %struct.set_s*, %struct.set_s** %2
%43 = load i32, i32* %6
%44 = load %struct.set_s*, %struct.set_s** %3
%45 = load i32, i32* %7
%46 = load %struct.set_s*, %struct.set_s** %4
%47 = load i32, i32* %8
%48 = load %struct.set_s*, %struct.set_s** %5
%49 = call %struct.set_s* @Union(%struct.set_s* %42, i32 %43, %struct.set_s* %44, i32 %45, %struct.set_s* %46, i32 %47, %struct.set_s* %48)
store %struct.set_s* %49, %struct.set_s** %4
%50 = load %struct.set_s*, %struct.set_s** %2
%51 = call i32 @Print(%struct.set_s* %50, i32 1)
%52 = load %struct.set_s*, %struct.set_s** %3
%53 = call i32 @Print(%struct.set_s* %52, i32 2)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%55 = load %struct.set_s*, %struct.set_s** %4
%56 = call i32 @Print(%struct.set_s* %55, i32 3)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %101
58: ; preds = %37, %37
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%60 = load %struct.set_s*, %struct.set_s** %2
%61 = load i32, i32* %6
%62 = load %struct.set_s*, %struct.set_s** %3
%63 = load i32, i32* %7
%64 = load %struct.set_s*, %struct.set_s** %4
%65 = load i32, i32* %8
%66 = load %struct.set_s*, %struct.set_s** %5
%67 = call %struct.set_s* @Intersection(%struct.set_s* %60, i32 %61, %struct.set_s* %62, i32 %63, %struct.set_s* %64, i32 %65, %struct.set_s* %66)
store %struct.set_s* %67, %struct.set_s** %4
%68 = load %struct.set_s*, %struct.set_s** %2
%69 = call i32 @Print(%struct.set_s* %68, i32 1)
%70 = load %struct.set_s*, %struct.set_s** %3
%71 = call i32 @Print(%struct.set_s* %70, i32 2)
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%73 = load %struct.set_s*, %struct.set_s** %4
%74 = call i32 @Print(%struct.set_s* %73, i32 3)
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %101
76: ; preds = %37, %37
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
%78 = load %struct.set_s*, %struct.set_s** %2
%79 = load i32, i32* %6
%80 = load %struct.set_s*, %struct.set_s** %3
%81 = load i32, i32* %7
%82 = load %struct.set_s*, %struct.set_s** %4
%83 = load i32, i32* %8
%84 = load %struct.set_s*, %struct.set_s** %5
%85 = call %struct.set_s* @Difference(%struct.set_s* %78, i32 %79, %struct.set_s* %80, i32 %81, %struct.set_s* %82, i32 %83, %struct.set_s* %84)
store %struct.set_s* %85, %struct.set_s** %4
%86 = load %struct.set_s*, %struct.set_s** %2
%87 = call i32 @Print(%struct.set_s* %86, i32 1)
%88 = load %struct.set_s*, %struct.set_s** %3
%89 = call i32 @Print(%struct.set_s* %88, i32 2)
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%91 = load %struct.set_s*, %struct.set_s** %4
%92 = call i32 @Print(%struct.set_s* %91, i32 3)
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %101
94: ; preds = %37
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %101
96: ; preds = %37
%97 = load i8, i8* %9
%98 = sext i8 %97 to i32
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %98)
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
br label %101
101: ; preds = %96, %94, %76, %58, %40
%102 = load %struct.set_s*, %struct.set_s** %2
%103 = call %struct.set_s* @Free_list(%struct.set_s* %102)
store %struct.set_s* %103, %struct.set_s** %2
%104 = load %struct.set_s*, %struct.set_s** %3
%105 = call %struct.set_s* @Free_list(%struct.set_s* %104)
store %struct.set_s* %105, %struct.set_s** %3
%106 = load %struct.set_s*, %struct.set_s** %4
%107 = call %struct.set_s* @Free_list(%struct.set_s* %106)
store %struct.set_s* %107, %struct.set_s** %4
%108 = load %struct.set_s*, %struct.set_s** %5
%109 = call %struct.set_s* @Free_list(%struct.set_s* %108)
store %struct.set_s* %109, %struct.set_s** %5
store i32 0, i32* %8
store i32 0, i32* %7
store i32 0, i32* %6
%110 = call signext i8 (...) @Get_command()
store i8 %110, i8* %9
%111 = load i8, i8* %9
%112 = sext i8 %111 to i32
%113 = icmp ne i32 %112, 113
br i1 %113, label %114, label %126
114: ; preds = %101
%115 = load i8, i8* %9
%116 = sext i8 %115 to i32
%117 = icmp ne i32 %116, 81
br i1 %117, label %118, label %126
118: ; preds = %114
%119 = load %struct.set_s*, %struct.set_s** %2
%120 = call %struct.set_s* @Read_set(%struct.set_s* %119, i32* %6, i32 1)
store %struct.set_s* %120, %struct.set_s** %2
%121 = load %struct.set_s*, %struct.set_s** %3
%122 = call %struct.set_s* @Read_set(%struct.set_s* %121, i32* %7, i32 2)
store %struct.set_s* %122, %struct.set_s** %3
%123 = load i32, i32* %6
%124 = load i32, i32* %7
%125 = add nsw i32 %123, %124
store i32 %125, i32* %8
br label %126
126: ; preds = %118, %114, %101
br label %27
127: ; preds = %35
ret i32 0
}

LLVM IR (-O2):
%struct.set_s = type { i32 }
@.str.1 = [8 x i8] c"Union: \00"
@.str.4 = [15 x i8] c"Intersection: \00"
@.str.6 = [13 x i8] c"Difference: \00"
@.str.7 = [4 x i8] c"\0A$ \00"
@.str.8 = [24 x i8] c"There is no %c command\0A\00"
@str = [43 x i8] c"\0A\0AFinding the difference of the two sets. \00"
@str.10 = [45 x i8] c"\0A\0AFinding the intersection of the two sets. \00"
@str.11 = [38 x i8] c"\0A\0AFinding the union of the two sets. \00"
@str.12 = [18 x i8] c"Please try aga_pn\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
store i32 0, i32* %1
%5 = tail call signext i8 (...) @Get_command()
%6 = and i8 %5, -33
%7 = icmp eq i8 %6, 81
br i1 %7, label %72, label %8
8: ; preds = %0
%9 = call %struct.set_s* @Read_set(%struct.set_s* null, i32* %1, i32 1)
%10 = call %struct.set_s* @Read_set(%struct.set_s* null, i32* %2, i32 2)
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = add nsw i32 %12, %11
br label %14
14: ; preds = %66, %8
%15 = phi i8 [ %63, %66 ], [ %5, %8 ]
%16 = phi i32 [ %71, %66 ], [ %13, %8 ]
%17 = phi %struct.set_s* [ %62, %66 ], [ null, %8 ]
%18 = phi %struct.set_s* [ %61, %66 ], [ null, %8 ]
%19 = phi %struct.set_s* [ %68, %66 ], [ %10, %8 ]
%20 = phi %struct.set_s* [ %67, %66 ], [ %9, %8 ]
%21 = sext i8 %15 to i32
switch i32 %21, label %54 [
i32 117, label %22
i32 85, label %22
i32 105, label %32
i32 73, label %32
i32 100, label %42
i32 68, label %42
i32 10, label %52
]
22: ; preds = %14, %14
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.11, i64 0, i64 0))
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = call %struct.set_s* @Union(%struct.set_s* %20, i32 %24, %struct.set_s* %19, i32 %25, %struct.set_s* %18, i32 %16, %struct.set_s* %17)
%27 = call i32 @Print(%struct.set_s* %20, i32 1)
%28 = call i32 @Print(%struct.set_s* %19, i32 2)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%30 = call i32 @Print(%struct.set_s* %26, i32 3)
%31 = call i32 @putchar(i32 10)
br label %57
32: ; preds = %14, %14
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.10, i64 0, i64 0))
%34 = load i32, i32* %1
%35 = load i32, i32* %2
%36 = call %struct.set_s* @Intersection(%struct.set_s* %20, i32 %34, %struct.set_s* %19, i32 %35, %struct.set_s* %18, i32 %16, %struct.set_s* %17)
%37 = call i32 @Print(%struct.set_s* %20, i32 1)
%38 = call i32 @Print(%struct.set_s* %19, i32 2)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%40 = call i32 @Print(%struct.set_s* %36, i32 3)
%41 = call i32 @putchar(i32 10)
br label %57
42: ; preds = %14, %14
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%44 = load i32, i32* %1
%45 = load i32, i32* %2
%46 = call %struct.set_s* @Difference(%struct.set_s* %20, i32 %44, %struct.set_s* %19, i32 %45, %struct.set_s* %18, i32 %16, %struct.set_s* %17)
%47 = call i32 @Print(%struct.set_s* %20, i32 1)
%48 = call i32 @Print(%struct.set_s* %19, i32 2)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%50 = call i32 @Print(%struct.set_s* %46, i32 3)
%51 = call i32 @putchar(i32 10)
br label %57
52: ; preds = %14
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %57
54: ; preds = %14
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %21)
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.12, i64 0, i64 0))
br label %57
57: ; preds = %54, %52, %42, %32, %22
%58 = phi %struct.set_s* [ %18, %54 ], [ %18, %52 ], [ %46, %42 ], [ %36, %32 ], [ %26, %22 ]
%59 = call %struct.set_s* @Free_list(%struct.set_s* %20)
%60 = call %struct.set_s* @Free_list(%struct.set_s* %19)
%61 = call %struct.set_s* @Free_list(%struct.set_s* %58)
%62 = call %struct.set_s* @Free_list(%struct.set_s* %17)
store i32 0, i32* %2
store i32 0, i32* %1
%63 = call signext i8 (...) @Get_command()
%64 = and i8 %63, -33
%65 = icmp eq i8 %64, 81
br i1 %65, label %72, label %66
66: ; preds = %57
%67 = call %struct.set_s* @Read_set(%struct.set_s* %59, i32* %1, i32 1)
%68 = call %struct.set_s* @Read_set(%struct.set_s* %60, i32* %2, i32 2)
%69 = load i32, i32* %1
%70 = load i32, i32* %2
%71 = add nsw i32 %70, %69
br label %14
72: ; preds = %57, %0
ret i32 0
}