#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*/ D2B(int, char *);
int GetOperands(int **);
int /*<<< orphan*/ MyFlush();
int /*<<< orphan*/ free(int *);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char oper;
  int *operands;
  int numOperands, i, result;
  char binNumber[32 + 1];
  binNumber[32] = '\0';
  printf("Enter your operation in |, &, ^ or q: ");
  while ((oper = getchar()) != 'q') {
    MyFlush();
    switch (oper) {
    case '&':
    case '|':
    case '^':
      printf("Your typed operation was: %c\n", oper);
      break;
    default:
      printf("Please enter a acceptable operation: &, |, ^ or q.\nEnter "
             "operation: ");
      continue;
    }
    numOperands = GetOperands(&operands);
    if (numOperands <= 0 || numOperands > 8) {
      printf("The number should be greater than zero and less than %d.\n", 8);
    } else {
      result = *operands;
      printf("Hexadecimal operation\n \t%08X\n", *operands);
      for (i = 1; i < numOperands; ++i) {
        printf("%c\t%08X\n", oper, operands[i]);
        if (oper == '&')
          result &= operands[i];
        else if (oper == '|')
          result |= operands[i];
        else
          result ^= operands[i];
      }
      printf("=\t%08X\n\n", result);
      D2B(*operands, binNumber);
      printf("Binary operation\n \t%s\n", binNumber);
      for (i = 1; i < numOperands; ++i) {
        D2B(operands[i], binNumber);
        printf("%c\t%s\n", oper, binNumber);
      }
      D2B(result, binNumber);
      printf("=\t%s\n\n", binNumber);
      printf("The operation result is %d(signed),%u(unsigned),"
             "%#010X(16),and %s(2).\n\n",
             result, result, result, binNumber);
      free(operands);
    }
    printf("Enter operation: ");
  }
  printf("GoodBye!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x20(%rbp)
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x71,%eax
je     13c5 <main+0x265>
xor    %eax,%eax
call   1080 <MyFlush@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x44(%rbp)
sub    $0x26,%eax
je     11d5 <main+0x75>
jmp    11b3 <main+0x53>
mov    -0x44(%rbp),%eax
sub    $0x5e,%eax
je     11d5 <main+0x75>
jmp    11c4 <main+0x64>
mov    -0x44(%rbp),%eax
sub    $0x7c,%eax
jne    11ec <main+0x8c>
jmp    11d5 <main+0x75>
movsbl -0x5(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11ff <main+0x9f>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1181 <main+0x21>
lea    -0x10(%rbp),%rdi
call   1070 <GetOperands@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    121f <main+0xbf>
cmpl   $0x8,-0x14(%rbp)
jle    1237 <main+0xd7>
lea    0xe64(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13b2 <main+0x252>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12f3 <main+0x193>
movsbl -0x5(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x26,%eax
jne    12a7 <main+0x147>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    12e0 <main+0x180>
movsbl -0x5(%rbp),%eax
cmp    $0x7c,%eax
jne    12ca <main+0x16a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    12db <main+0x17b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    12e0 <main+0x180>
jmp    12e5 <main+0x185>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    125b <main+0xfb>
mov    -0x1c(%rbp),%esi
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rsi
call   1060 <D2B@plt>
lea    -0x40(%rbp),%rsi
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1370 <main+0x210>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
lea    -0x40(%rbp),%rsi
call   1060 <D2B@plt>
movsbl -0x5(%rbp),%esi
lea    -0x40(%rbp),%rdx
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    132c <main+0x1cc>
mov    -0x1c(%rbp),%edi
lea    -0x40(%rbp),%rsi
call   1060 <D2B@plt>
lea    -0x40(%rbp),%rsi
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    -0x40(%rbp),%r8
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1181 <main+0x21>
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
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    $0x38,%rsp
movb   $0x0,0x30(%rsp)
lea    0xe76(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0x71,%al
jne    11b9 <main+0x49>
lea    0xfbe(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%r13d
lea    0xe64(%rip),%rbx
mov    %rsp,%rbp
lea    0xeab(%rip),%r14
lea    0x10(%rsp),%r15
jmp    124c <main+0xdc>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14d,%edi
mov    %r15,%rsi
call   1070 <D2B@plt>
lea    0xf20(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf16(%rip),%rdi
mov    %r14d,%esi
mov    %r14d,%edx
mov    %r14d,%ecx
mov    %r15,%r8
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
lea    0xe52(%rip),%r14
mov    %r14,%rdi
lea    0xdf7(%rip),%rbx
mov    %rsp,%rbp
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%r13d
cmp    $0x71,%al
je     119c <main+0x2c>
movsbl %r13b,%r12d
xor    %eax,%eax
call   1090 <MyFlush@plt>
cmp    $0x26,%r12d
je     1270 <main+0x100>
cmp    $0x7c,%r12d
je     1270 <main+0x100>
lea    0xddb(%rip),%rdi
cmp    $0x5e,%r12d
jne    1233 <main+0xc3>
mov    %rbx,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
call   1080 <GetOperands@plt>
mov    %eax,%ecx
lea    -0x9(%rcx),%eax
cmp    $0xfffffff8,%eax
jae    12b0 <main+0x140>
lea    0xdf4(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
jmp    1233 <main+0xc3>
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%rax
mov    (%rax),%r14d
lea    0xe06(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
mov    %rcx,0x8(%rsp)
call   1050 <printf@plt>
mov    0x8(%rsp),%rax
mov    %eax,%ebp
cmp    $0x2,%eax
jb     1340 <main+0x1d0>
mov    $0x1,%ebx
mov    (%rsp),%rax
jmp    1301 <main+0x191>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rsp),%rax
or     (%rax,%rbx,4),%r14d
add    $0x1,%rbx
cmp    %rbx,%rbp
je     1340 <main+0x1d0>
mov    (%rax,%rbx,4),%edx
lea    0xdd7(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x7c,%r13b
je     12f0 <main+0x180>
cmp    $0x26,%r13b
jne    1330 <main+0x1c0>
mov    (%rsp),%rax
and    (%rax,%rbx,4),%r14d
jmp    12f8 <main+0x188>
nopl   0x0(%rax,%rax,1)
mov    (%rsp),%rax
xor    (%rax,%rbx,4),%r14d
jmp    12f8 <main+0x188>
nopw   0x0(%rax,%rax,1)
lea    0xda4(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%rax
mov    (%rax),%edi
mov    %r15,%rsi
call   1070 <D2B@plt>
lea    0xd8e(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x2,0x8(%rsp)
lea    0xd8f(%rip),%r13
jb     11e0 <main+0x70>
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%rax
mov    (%rax,%rbx,4),%edi
mov    %r15,%rsi
call   1070 <D2B@plt>
mov    %r13,%rdi
mov    %r12d,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1390 <main+0x220>
jmp    11e0 <main+0x70>

LLVM IR (-O0):
@.str = [39 x i8] c"Enter your operation in |, &, ^ or q: \00"
@.str.1 = [30 x i8] c"Your typed operation was: %c\0A\00"
@.str.2 = [69 x i8] c"Please enter a acceptable operation: &, |, ^ or q.\0AEnter operation: \00"
@.str.3 = [58 x i8] c"The number should be greater than zero and less than %d.\0A\00"
@.str.4 = [30 x i8] c"Hexadecimal operation\0A \09%08X\0A\00"
@.str.5 = [9 x i8] c"%c\09%08X\0A\00"
@.str.6 = [9 x i8] c"=\09%08X\0A\0A\00"
@.str.7 = [23 x i8] c"Binary operation\0A \09%s\0A\00"
@.str.8 = [7 x i8] c"%c\09%s\0A\00"
@.str.9 = [7 x i8] c"=\09%s\0A\0A\00"
@.str.10 = [72 x i8] c"The operation result is %d(signed),%u(unsigned),%X(16),and %s(2).\0A\0A\00"
@.str.11 = [18 x i8] c"Enter operation: \00"
@.str.12 = [10 x i8] c"GoodBye!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [33 x i8]
store i32 0, i32* %1
%8 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 32
store i8 0, i8* %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %129, %22, %0
%11 = call signext i8 (...) @getchar()
store i8 %11, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 113
br i1 %13, label %14, label %131
14: ; preds = %10
%15 = call i32 (...) @MyFlush()
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
switch i32 %17, label %22 [
i32 38, label %18
i32 124, label %18
i32 94, label %18
]
18: ; preds = %14, %14, %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %24
22: ; preds = %14
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
br label %10
24: ; preds = %18
%25 = call i32 @GetOperands(i32** %3)
store i32 %25, i32* %4
%26 = load i32, i32* %4
%27 = icmp sle i32 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %24
%29 = load i32, i32* %4
%30 = icmp sgt i32 %29, 8
br i1 %30, label %31, label %33
31: ; preds = %28, %24
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0), i32 8)
br label %129
33: ; preds = %28
%34 = load i32*, i32** %3
%35 = load i32, i32* %34
store i32 %35, i32* %6
%36 = load i32*, i32** %3
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %37)
store i32 1, i32* %5
br label %39
39: ; preds = %85, %33
%40 = load i32, i32* %5
%41 = load i32, i32* %4
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %88
43: ; preds = %39
%44 = load i8, i8* %2
%45 = sext i8 %44 to i32
%46 = load i32*, i32** %3
%47 = load i32, i32* %5
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %46, i64 %48
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %45, i32 %50)
%52 = load i8, i8* %2
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 38
br i1 %54, label %55, label %63
55: ; preds = %43
%56 = load i32*, i32** %3
%57 = load i32, i32* %5
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i32, i32* %56, i64 %58
%60 = load i32, i32* %59
%61 = load i32, i32* %6
%62 = and i32 %61, %60
store i32 %62, i32* %6
br label %84
63: ; preds = %43
%64 = load i8, i8* %2
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 124
br i1 %66, label %67, label %75
67: ; preds = %63
%68 = load i32*, i32** %3
%69 = load i32, i32* %5
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i32, i32* %68, i64 %70
%72 = load i32, i32* %71
%73 = load i32, i32* %6
%74 = or i32 %73, %72
store i32 %74, i32* %6
br label %83
75: ; preds = %63
%76 = load i32*, i32** %3
%77 = load i32, i32* %5
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i32, i32* %76, i64 %78
%80 = load i32, i32* %79
%81 = load i32, i32* %6
%82 = xor i32 %81, %80
store i32 %82, i32* %6
br label %83
83: ; preds = %75, %67
br label %84
84: ; preds = %83, %55
br label %85
85: ; preds = %84
%86 = load i32, i32* %5
%87 = add nsw i32 %86, 1
store i32 %87, i32* %5
br label %39
88: ; preds = %39
%89 = load i32, i32* %6
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %89)
%91 = load i32*, i32** %3
%92 = load i32, i32* %91
%93 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%94 = call i32 @D2B(i32 %92, i8* %93)
%95 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* %95)
store i32 1, i32* %5
br label %97
97: ; preds = %113, %88
%98 = load i32, i32* %5
%99 = load i32, i32* %4
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %116
101: ; preds = %97
%102 = load i32*, i32** %3
%103 = load i32, i32* %5
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i32, i32* %102, i64 %104
%106 = load i32, i32* %105
%107 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%108 = call i32 @D2B(i32 %106, i8* %107)
%109 = load i8, i8* %2
%110 = sext i8 %109 to i32
%111 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %110, i8* %111)
br label %113
113: ; preds = %101
%114 = load i32, i32* %5
%115 = add nsw i32 %114, 1
store i32 %115, i32* %5
br label %97
116: ; preds = %97
%117 = load i32, i32* %6
%118 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%119 = call i32 @D2B(i32 %117, i8* %118)
%120 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %120)
%122 = load i32, i32* %6
%123 = load i32, i32* %6
%124 = load i32, i32* %6
%125 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.10, i64 0, i64 0), i32 %122, i32 %123, i32 %124, i8* %125)
%127 = load i32*, i32** %3
%128 = call i32 @free(i32* %127)
br label %129
129: ; preds = %116, %31
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
br label %10
131: ; preds = %10
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Enter your operation in |, &, ^ or q: \00"
@.str.1 = [30 x i8] c"Your typed operation was: %c\0A\00"
@.str.2 = [69 x i8] c"Please enter a acceptable operation: &, |, ^ or q.\0AEnter operation: \00"
@.str.3 = [58 x i8] c"The number should be greater than zero and less than %d.\0A\00"
@.str.4 = [30 x i8] c"Hexadecimal operation\0A \09%08X\0A\00"
@.str.5 = [9 x i8] c"%c\09%08X\0A\00"
@.str.6 = [9 x i8] c"=\09%08X\0A\0A\00"
@.str.7 = [23 x i8] c"Binary operation\0A \09%s\0A\00"
@.str.8 = [7 x i8] c"%c\09%s\0A\00"
@.str.9 = [7 x i8] c"=\09%s\0A\0A\00"
@.str.10 = [72 x i8] c"The operation result is %d(signed),%u(unsigned),%X(16),and %s(2).\0A\0A\00"
@.str.11 = [18 x i8] c"Enter operation: \00"
@str = [9 x i8] c"GoodBye!\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca [33 x i8]
%3 = bitcast i32** %1 to i8*
%4 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 32
store i8 0, i8* %5
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%7 = call signext i8 (...) @getchar()
%8 = icmp eq i8 %7, 113
br i1 %8, label %84, label %9
9: ; preds = %0, %18
%10 = phi i8 [ %21, %18 ], [ %7, %0 ]
%11 = sext i8 %10 to i32
%12 = call i32 (...) @MyFlush()
switch i32 %11, label %18 [
i32 38, label %13
i32 124, label %13
i32 94, label %13
]
13: ; preds = %9, %9, %9
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%15 = call i32 @GetOperands(i32** %1)
%16 = add i32 %15, -9
%17 = icmp ult i32 %16, -8
br i1 %17, label %23, label %25
18: ; preds = %9, %23, %78
%19 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), %78 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), %23 ], [ getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0), %9 ]
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %19)
%21 = call signext i8 (...) @getchar()
%22 = icmp eq i8 %21, 113
br i1 %22, label %84, label %9
23: ; preds = %13
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0), i32 8)
br label %18
25: ; preds = %13
%26 = load i32*, i32** %1
%27 = load i32, i32* %26
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %27)
%29 = icmp ugt i32 %15, 1
br i1 %29, label %30, label %60
30: ; preds = %25
%31 = zext i32 %15 to i64
%32 = load i32*, i32** %1
br label %33
33: ; preds = %30, %55
%34 = phi i32* [ %32, %30 ], [ %56, %55 ]
%35 = phi i64 [ 1, %30 ], [ %58, %55 ]
%36 = phi i32 [ %27, %30 ], [ %57, %55 ]
%37 = getelementptr inbounds i32, i32* %34, i64 %35
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %11, i32 %38)
switch i8 %10, label %50 [
i8 38, label %40
i8 124, label %45
]
40: ; preds = %33
%41 = load i32*, i32** %1
%42 = getelementptr inbounds i32, i32* %41, i64 %35
%43 = load i32, i32* %42
%44 = and i32 %43, %36
br label %55
45: ; preds = %33
%46 = load i32*, i32** %1
%47 = getelementptr inbounds i32, i32* %46, i64 %35
%48 = load i32, i32* %47
%49 = or i32 %48, %36
br label %55
50: ; preds = %33
%51 = load i32*, i32** %1
%52 = getelementptr inbounds i32, i32* %51, i64 %35
%53 = load i32, i32* %52
%54 = xor i32 %53, %36
br label %55
55: ; preds = %40, %50, %45
%56 = phi i32* [ %41, %40 ], [ %46, %45 ], [ %51, %50 ]
%57 = phi i32 [ %44, %40 ], [ %49, %45 ], [ %54, %50 ]
%58 = add nuw nsw i64 %35, 1
%59 = icmp eq i64 %58, %31
br i1 %59, label %60, label %33
60: ; preds = %55, %25
%61 = phi i32 [ %27, %25 ], [ %57, %55 ]
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %61)
%63 = load i32*, i32** %1
%64 = load i32, i32* %63
%65 = call i32 @D2B(i32 %64, i8* %4)
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* %4)
br i1 %29, label %67, label %78
67: ; preds = %60
%68 = zext i32 %15 to i64
br label %69
69: ; preds = %67, %69
%70 = phi i64 [ 1, %67 ], [ %76, %69 ]
%71 = load i32*, i32** %1
%72 = getelementptr inbounds i32, i32* %71, i64 %70
%73 = load i32, i32* %72
%74 = call i32 @D2B(i32 %73, i8* %4)
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %11, i8* %4)
%76 = add nuw nsw i64 %70, 1
%77 = icmp eq i64 %76, %68
br i1 %77, label %78, label %69
78: ; preds = %69, %60
%79 = call i32 @D2B(i32 %61, i8* %4)
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %4)
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str.10, i64 0, i64 0), i32 %61, i32 %61, i32 %61, i8* %4)
%82 = load i32*, i32** %1
%83 = call i32 @free(i32* %82)
br label %18
84: ; preds = %18, %0
%85 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}