#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned int *);
main(void) {
  unsigned int lOperation, operation, val1, val2, result = 0;
  int ii, flag = 0;
  while (1) {
    printf("******Select a logical operation*****\n");
    printf("0.Logical operation\n");
    printf("1.Bitwise operation\n");
    printf("2.Exit\n");
    scanf("%d", &lOperation);
    if (lOperation == 2)
      exit(1);
    printf("Select a operation\n");
    printf("0.AND operation\n");
    printf("1.OR operation\n");
    printf("2.NOT operation\n");
    if (lOperation == 1)
      printf("3.XOR operation\n");
    scanf("%d", &operation);
    printf("Enter an unsigned integer in hex format\n");
    scanf("%x", &val1);
    if (operation != 2) {
      printf("Enter another unsigned integer in hex format\n");
      scanf("%x", &val2);
    }
    if (lOperation == 1) {
      switch (operation) {
      case 0:
        result = val1 & val2;
        break;
      case 1:
        result = val1 | val2;
        break;
      case 2:
        result = ~val1;
        break;
      case 3:
        result = val1 ^ val2;
        break;
      default:
        printf("operation selected is invalid\n");
        break;
      }
      printf("Result = %x\n", result);
    } else if (lOperation == 0) {
      switch (operation) {
      case 0:
        result = val1 && val2;
        break;
      case 1:
        result = val1 || val2;
        break;
      case 2:
        result = !val1;
        break;
      default:
        printf("operation selected is invalid\n");
        break;
      }
      printf("Result = %x\n", result);
    } else
      printf("Logical operation selected is invalid\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2,-0x8(%rbp)
jne    11a9 <main+0x79>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    11f9 <main+0xc9>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe69(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2,-0xc(%rbp)
je     124f <main+0x11f>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    12da <main+0x1aa>
mov    -0xc(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0x3,%rax
ja     12b6 <main+0x186>
mov    -0x28(%rbp),%rax
lea    0xd8b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    12c4 <main+0x194>
mov    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    12c4 <main+0x194>
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    12c4 <main+0x194>
mov    -0x10(%rbp),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    12c4 <main+0x194>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13b8 <main+0x288>
cmpl   $0x0,-0x8(%rbp)
jne    13a5 <main+0x275>
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
test   %eax,%eax
je     1319 <main+0x1e9>
jmp    12f7 <main+0x1c7>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
je     1342 <main+0x212>
jmp    1308 <main+0x1d8>
mov    -0x2c(%rbp),%eax
sub    $0x2,%eax
je     136b <main+0x23b>
jmp    1381 <main+0x251>
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x2d(%rbp)
je     1332 <main+0x202>
cmpl   $0x0,-0x14(%rbp)
setne  %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
jmp    138f <main+0x25f>
mov    $0x1,%al
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x2e(%rbp)
jne    135b <main+0x22b>
cmpl   $0x0,-0x14(%rbp)
setne  %al
mov    %al,-0x2e(%rbp)
mov    -0x2e(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
jmp    138f <main+0x25f>
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
jmp    138f <main+0x25f>
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13b3 <main+0x283>
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13b8 <main+0x288>
jmp    114d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8b(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x2,0x10(%rsp)
jne    11a0 <main+0x60>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0xe69(%rip),%rbp
lea    0xe65(%rip),%r15
lea    0xea8(%rip),%r14
lea    0xeb5(%rip),%r12
lea    0x10(%rsp),%rbx
xor    %r13d,%r13d
jmp    1221 <main+0xe1>
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe3d(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe39(%rip),%rdi
call   1030 <puts@plt>
lea    0xe53(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpl   $0x2,0x10(%rsp)
je     1196 <main+0x56>
lea    0xe50(%rip),%rdi
call   1030 <puts@plt>
lea    0xe57(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5e(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x1,0x10(%rsp)
jne    1264 <main+0x124>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xe42(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x2,0x14(%rsp)
je     12aa <main+0x16a>
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x10(%rsp),%eax
test   %eax,%eax
je     12f0 <main+0x1b0>
cmp    $0x1,%eax
jne    1330 <main+0x1f0>
mov    0x14(%rsp),%eax
cmp    $0x3,%rax
ja     11c6 <main+0x86>
lea    0xd34(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0xc(%rsp),%r13d
and    0x8(%rsp),%r13d
jmp    11d2 <main+0x92>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x14(%rsp),%eax
cmp    $0x2,%eax
je     1341 <main+0x201>
cmp    $0x1,%eax
je     1352 <main+0x212>
test   %eax,%eax
jne    11c6 <main+0x86>
cmpl   $0x0,0x8(%rsp)
setne  %al
cmpl   $0x0,0xc(%rsp)
setne  %cl
and    %al,%cl
movzbl %cl,%r13d
jmp    11d2 <main+0x92>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xdab(%rip),%rdi
call   1030 <puts@plt>
jmp    11e3 <main+0xa3>
xor    %r13d,%r13d
cmpl   $0x0,0x8(%rsp)
sete   %r13b
jmp    11d2 <main+0x92>
mov    0x8(%rsp),%eax
xor    %r13d,%r13d
or     0xc(%rsp),%eax
setne  %r13b
jmp    11d2 <main+0x92>
mov    0xc(%rsp),%r13d
or     0x8(%rsp),%r13d
jmp    11d2 <main+0x92>
mov    0x8(%rsp),%r13d
not    %r13d
jmp    11d2 <main+0x92>
mov    0xc(%rsp),%r13d
xor    0x8(%rsp),%r13d
jmp    11d2 <main+0x92>

LLVM IR (-O0):
@.str = [39 x i8] c"******Select a logical operation*****\0A\00"
@.str.1 = [21 x i8] c"0.Logical operation\0A\00"
@.str.2 = [21 x i8] c"1.Bitwise operation\0A\00"
@.str.3 = [8 x i8] c"2.Exit\0A\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [20 x i8] c"Select a operation\0A\00"
@.str.6 = [17 x i8] c"0.AND operation\0A\00"
@.str.7 = [16 x i8] c"1.OR operation\0A\00"
@.str.8 = [17 x i8] c"2.NOT operation\0A\00"
@.str.9 = [17 x i8] c"3.XOR operation\0A\00"
@.str.10 = [41 x i8] c"Enter an unsigned integer in hex format\0A\00"
@.str.11 = [3 x i8] c"%x\00"
@.str.12 = [46 x i8] c"Enter another unsigned integer in hex format\0A\00"
@.str.13 = [31 x i8] c"operation selected is invalid\0A\00"
@.str.14 = [13 x i8] c"Result = %x\0A\00"
@.str.15 = [39 x i8] c"Logical operation selected is invalid\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
store i32 0, i32* %8
br label %9
9: ; preds = %0, %98
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %19
17: ; preds = %9
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %9
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %28
26: ; preds = %19
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
br label %28
28: ; preds = %26, %19
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0))
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %4)
%32 = load i32, i32* %3
%33 = icmp ne i32 %32, 2
br i1 %33, label %34, label %37
34: ; preds = %28
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.12, i64 0, i64 0))
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %5)
br label %37
37: ; preds = %34, %28
%38 = load i32, i32* %2
%39 = icmp eq i32 %38, 1
br i1 %39, label %40, label %62
40: ; preds = %37
%41 = load i32, i32* %3
switch i32 %41, label %57 [
i32 0, label %42
i32 1, label %46
i32 2, label %50
i32 3, label %53
]
42: ; preds = %40
%43 = load i32, i32* %4
%44 = load i32, i32* %5
%45 = and i32 %43, %44
store i32 %45, i32* %6
br label %59
46: ; preds = %40
%47 = load i32, i32* %4
%48 = load i32, i32* %5
%49 = or i32 %47, %48
store i32 %49, i32* %6
br label %59
50: ; preds = %40
%51 = load i32, i32* %4
%52 = xor i32 %51, -1
store i32 %52, i32* %6
br label %59
53: ; preds = %40
%54 = load i32, i32* %4
%55 = load i32, i32* %5
%56 = xor i32 %54, %55
store i32 %56, i32* %6
br label %59
57: ; preds = %40
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0))
br label %59
59: ; preds = %57, %53, %50, %46, %42
%60 = load i32, i32* %6
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i32 %60)
br label %98
62: ; preds = %37
%63 = load i32, i32* %2
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %95
65: ; preds = %62
%66 = load i32, i32* %3
switch i32 %66, label %90 [
i32 0, label %67
i32 1, label %76
i32 2, label %85
]
67: ; preds = %65
%68 = load i32, i32* %4
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = load i32, i32* %5
%72 = icmp ne i32 %71, 0
br label %73
73: ; preds = %70, %67
%74 = phi i1 [ false, %67 ], [ %72, %70 ]
%75 = zext i1 %74 to i32
store i32 %75, i32* %6
br label %92
76: ; preds = %65
%77 = load i32, i32* %4
%78 = icmp ne i32 %77, 0
br i1 %78, label %82, label %79
79: ; preds = %76
%80 = load i32, i32* %5
%81 = icmp ne i32 %80, 0
br label %82
82: ; preds = %79, %76
%83 = phi i1 [ true, %76 ], [ %81, %79 ]
%84 = zext i1 %83 to i32
store i32 %84, i32* %6
br label %92
85: ; preds = %65
%86 = load i32, i32* %4
%87 = icmp ne i32 %86, 0
%88 = xor i1 %87, true
%89 = zext i1 %88 to i32
store i32 %89, i32* %6
br label %92
90: ; preds = %65
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0))
br label %92
92: ; preds = %90, %85, %82, %73
%93 = load i32, i32* %6
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i32 %93)
br label %97
95: ; preds = %62
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.15, i64 0, i64 0))
br label %97
97: ; preds = %95, %92
br label %98
98: ; preds = %97, %59
br label %9
}

LLVM IR (-O2):
@.str.4 = [3 x i8] c"%d\00"
@.str.11 = [3 x i8] c"%x\00"
@.str.14 = [13 x i8] c"Result = %x\0A\00"
@str = [38 x i8] c"******Select a logical operation*****\00"
@str.16 = [20 x i8] c"0.Logical operation\00"
@str.17 = [20 x i8] c"1.Bitwise operation\00"
@str.18 = [7 x i8] c"2.Exit\00"
@str.19 = [19 x i8] c"Select a operation\00"
@str.20 = [16 x i8] c"0.AND operation\00"
@str.21 = [15 x i8] c"1.OR operation\00"
@str.22 = [16 x i8] c"2.NOT operation\00"
@str.23 = [40 x i8] c"Enter an unsigned integer in hex format\00"
@str.24 = [38 x i8] c"Logical operation selected is invalid\00"
@str.26 = [30 x i8] c"operation selected is invalid\00"
@str.27 = [45 x i8] c"Enter another unsigned integer in hex format\00"
@str.28 = [16 x i8] c"3.XOR operation\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.16, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.17, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.18, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %18
16: ; preds = %88, %0
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %0, %88
%19 = phi i32 [ %89, %88 ], [ 0, %0 ]
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.19, i64 0, i64 0))
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.20, i64 0, i64 0))
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.21, i64 0, i64 0))
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.22, i64 0, i64 0))
%24 = load i32, i32* %1
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %28
26: ; preds = %18
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.28, i64 0, i64 0))
br label %28
28: ; preds = %26, %18
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.23, i64 0, i64 0))
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %3)
%32 = load i32, i32* %2
%33 = icmp eq i32 %32, 2
br i1 %33, label %37, label %34
34: ; preds = %28
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.27, i64 0, i64 0))
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %4)
br label %37
37: ; preds = %34, %28
%38 = load i32, i32* %1
switch i32 %38, label %86 [
i32 1, label %39
i32 0, label %61
]
39: ; preds = %37
%40 = load i32, i32* %2
switch i32 %40, label %56 [
i32 0, label %41
i32 1, label %45
i32 2, label %49
i32 3, label %52
]
41: ; preds = %39
%42 = load i32, i32* %3
%43 = load i32, i32* %4
%44 = and i32 %43, %42
br label %58
45: ; preds = %39
%46 = load i32, i32* %3
%47 = load i32, i32* %4
%48 = or i32 %47, %46
br label %58
49: ; preds = %39
%50 = load i32, i32* %3
%51 = xor i32 %50, -1
br label %58
52: ; preds = %39
%53 = load i32, i32* %3
%54 = load i32, i32* %4
%55 = xor i32 %54, %53
br label %58
56: ; preds = %39
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.26, i64 0, i64 0))
br label %58
58: ; preds = %56, %52, %49, %45, %41
%59 = phi i32 [ %19, %56 ], [ %55, %52 ], [ %51, %49 ], [ %48, %45 ], [ %44, %41 ]
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i32 %59)
br label %88
61: ; preds = %37
%62 = load i32, i32* %2
switch i32 %62, label %81 [
i32 0, label %63
i32 1, label %70
i32 2, label %77
]
63: ; preds = %61
%64 = load i32, i32* %3
%65 = icmp ne i32 %64, 0
%66 = load i32, i32* %4
%67 = icmp ne i32 %66, 0
%68 = select i1 %65, i1 %67, i1 false
%69 = zext i1 %68 to i32
br label %83
70: ; preds = %61
%71 = load i32, i32* %3
%72 = icmp ne i32 %71, 0
%73 = load i32, i32* %4
%74 = icmp ne i32 %73, 0
%75 = select i1 %72, i1 true, i1 %74
%76 = zext i1 %75 to i32
br label %83
77: ; preds = %61
%78 = load i32, i32* %3
%79 = icmp eq i32 %78, 0
%80 = zext i1 %79 to i32
br label %83
81: ; preds = %61
%82 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.26, i64 0, i64 0))
br label %83
83: ; preds = %81, %77, %70, %63
%84 = phi i32 [ %19, %81 ], [ %80, %77 ], [ %76, %70 ], [ %69, %63 ]
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i32 %84)
br label %88
86: ; preds = %37
%87 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.24, i64 0, i64 0))
br label %88
88: ; preds = %83, %86, %58
%89 = phi i32 [ %59, %58 ], [ %84, %83 ], [ %19, %86 ]
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%91 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.16, i64 0, i64 0))
%92 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.17, i64 0, i64 0))
%93 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.18, i64 0, i64 0))
%94 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%95 = load i32, i32* %1
%96 = icmp eq i32 %95, 2
br i1 %96, label %16, label %18
}