#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 */
typedef int /*<<< orphan*/ operatorStack;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *getPrecedence(char);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int main() {
  int numCases;
  scanf("%d", &numCases);
  for (int i = 0; i < numCases; ++i) {
    if (i) {
      puts("");
    }
    char operatorStack[256];
    int operatorStackSize = 0;
    char c;
    scanf(" %c", &c);
    while (c != '\n' && c != EOF) {
      if (c >= '0' && c <= '9') {
        printf("%c", c);
      } else {
        switch (c) {
        case '(': {
          if (!(operatorStackSize <
                sizeof(operatorStack) / sizeof(*operatorStack))) {
            *((volatile int *)0) = 0;
          };
          operatorStack[operatorStackSize++] = c;
        } break;
        case ')': {
          while (operatorStackSize) {
            char operator= operatorStack[--operatorStackSize];
            if (operator== '(') {
              break;
            }
            printf("%c", operator);
          }
        } break;
        default: {
          int precedence = getPrecedence(c);
          while (operatorStackSize) {
            char operator= operatorStack[operatorStackSize - 1];
            char operatorPrecedence = getPrecedence(operator);
            if (operator!= '(' && precedence <= operatorPrecedence) {
              printf("%c", operator);
              --operatorStackSize;
            } else {
              break;
            }
          }
          if (!(operatorStackSize <
                sizeof(operatorStack) / sizeof(*operatorStack))) {
            *((volatile int *)0) = 0;
          };
          operatorStack[operatorStackSize++] = c;
        } break;
        }
      }
      fgetc(stdin);
      c = fgetc(stdin);
    }
    while (operatorStackSize--) {
      char operator= operatorStack[operatorStackSize];
      if (operator== '(') {
        fprintf(stderr, "Mismatched parentheses");
      } else {
        printf("%c", operator);
      }
    }
    puts("");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14b1 <main+0x351>
cmpl   $0x0,-0xc(%rbp)
je     11ad <main+0x4d>
lea    0xe5e(%rip),%rdi
call   1040 <puts@plt>
movl   $0x0,-0x114(%rbp)
lea    0xe45(%rip),%rdi
lea    -0x115(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
movsbl -0x115(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x120(%rbp)
je     1200 <main+0xa0>
movsbl -0x115(%rbp),%eax
mov    0x2dee(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x120(%rbp)
mov    -0x120(%rbp),%al
test   $0x1,%al
jne    1213 <main+0xb3>
jmp    1422 <main+0x2c2>
movsbl -0x115(%rbp),%eax
cmp    $0x30,%eax
jl     124b <main+0xeb>
movsbl -0x115(%rbp),%eax
cmp    $0x39,%eax
jg     124b <main+0xeb>
lea    0xdca(%rip),%rdi
movsbl -0x115(%rbp),%esi
call   1050 <printf@plt>
jmp    13fb <main+0x29b>
movsbl -0x115(%rbp),%eax
mov    %eax,-0x124(%rbp)
sub    $0x28,%eax
je     127a <main+0x11a>
jmp    1266 <main+0x106>
mov    -0x124(%rbp),%eax
sub    $0x29,%eax
je     12ba <main+0x15a>
jmp    131c <main+0x1bc>
movslq -0x114(%rbp),%rax
cmp    $0x100,%rax
jb     1295 <main+0x135>
xor    %eax,%eax
movl   $0x0,(%rax)
mov    -0x115(%rbp),%cl
mov    -0x114(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x114(%rbp)
cltq
mov    %cl,-0x110(%rbp,%rax,1)
jmp    13f6 <main+0x296>
jmp    12bf <main+0x15f>
cmpl   $0x0,-0x114(%rbp)
je     1317 <main+0x1b7>
mov    -0x114(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x114(%rbp)
cltq
mov    -0x110(%rbp,%rax,1),%al
mov    %al,-0x116(%rbp)
movsbl -0x116(%rbp),%eax
cmp    $0x28,%eax
jne    12ff <main+0x19f>
jmp    1317 <main+0x1b7>
lea    0xcfe(%rip),%rdi
movsbl -0x116(%rbp),%esi
call   1050 <printf@plt>
jmp    12bf <main+0x15f>
jmp    13f6 <main+0x296>
movsbl -0x115(%rbp),%edi
call   1030 <getPrecedence@plt>
mov    %eax,-0x11c(%rbp)
cmpl   $0x0,-0x114(%rbp)
je     13bb <main+0x25b>
mov    -0x114(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x110(%rbp,%rax,1),%al
mov    %al,-0x11d(%rbp)
movsbl -0x11d(%rbp),%edi
call   1030 <getPrecedence@plt>
mov    %al,-0x11e(%rbp)
movsbl -0x11d(%rbp),%eax
cmp    $0x28,%eax
je     13b1 <main+0x251>
mov    -0x11c(%rbp),%eax
movsbl -0x11e(%rbp),%ecx
cmp    %ecx,%eax
jg     13b1 <main+0x251>
lea    0xc73(%rip),%rdi
movsbl -0x11d(%rbp),%esi
call   1050 <printf@plt>
mov    -0x114(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x114(%rbp)
jmp    13b6 <main+0x256>
jmp    13bb <main+0x25b>
jmp    132e <main+0x1ce>
movslq -0x114(%rbp),%rax
cmp    $0x100,%rax
jb     13d6 <main+0x276>
xor    %eax,%eax
movl   $0x0,(%rax)
mov    -0x115(%rbp),%cl
mov    -0x114(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x114(%rbp)
cltq
mov    %cl,-0x110(%rbp,%rax,1)
jmp    13fb <main+0x29b>
mov    0x2be6(%rip),%rax
mov    (%rax),%edi
call   1060 <fgetc@plt>
mov    0x2bd8(%rip),%rax
mov    (%rax),%edi
call   1060 <fgetc@plt>
mov    %al,-0x115(%rbp)
jmp    11cc <main+0x6c>
jmp    1427 <main+0x2c7>
mov    -0x114(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x114(%rbp)
cmp    $0x0,%eax
je     1497 <main+0x337>
movslq -0x114(%rbp),%rax
mov    -0x110(%rbp,%rax,1),%al
mov    %al,-0x11f(%rbp)
movsbl -0x11f(%rbp),%eax
cmp    $0x28,%eax
jne    147f <main+0x31f>
mov    0x2b64(%rip),%rax
mov    (%rax),%edi
lea    0xb92(%rip),%rsi
call   1070 <fprintf@plt>
jmp    1492 <main+0x332>
lea    0xb7e(%rip),%rdi
movsbl -0x11f(%rbp),%esi
call   1050 <printf@plt>
jmp    1427 <main+0x2c7>
lea    0xb68(%rip),%rdi
call   1040 <puts@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118b <main+0x2b>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
lea    0xe88(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    13f7 <main+0x297>
lea    0xf(%rsp),%r14
mov    0x2e45(%rip),%r12
lea    0xe62(%rip),%r13
xor    %eax,%eax
jmp    11cb <main+0x6b>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
add    $0x1,%eax
cmp    0x8(%rsp),%eax
jge    13f7 <main+0x297>
mov    %eax,0xc(%rsp)
test   %eax,%eax
je     11dd <main+0x7d>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe1f(%rip),%rdi
lea    0x7(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x7(%rsp),%al
cmp    $0xa,%al
je     11b0 <main+0x50>
cmp    (%r12),%al
je     11b0 <main+0x50>
xor    %r15d,%r15d
mov    0x2de0(%rip),%rbp
nopl   0x0(%rax,%rax,1)
lea    -0x30(%rax),%ecx
movsbl %al,%esi
cmp    $0x9,%cl
ja     1230 <main+0xd0>
mov    %r13,%rdi
call   1050 <printf@plt>
jmp    1380 <main+0x220>
nopl   0x0(%rax,%rax,1)
cmp    $0x28,%esi
je     128b <main+0x12b>
cmp    $0x29,%esi
jne    12af <main+0x14f>
test   %r15d,%r15d
je     1344 <main+0x1e4>
movslq %r15d,%rbp
mov    $0x1,%ebx
sub    %r15d,%ebx
add    %r14,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl 0x0(%rbp),%eax
cmp    $0x28,%al
je     1365 <main+0x205>
movsbl %al,%esi
mov    %r13,%rdi
call   1050 <printf@plt>
add    $0x1,%ebx
add    $0xffffffffffffffff,%rbp
cmp    $0x1,%ebx
jne    1260 <main+0x100>
xor    %r15d,%r15d
jmp    136a <main+0x20a>
cmp    $0x100,%r15d
jb     129f <main+0x13f>
movl   $0x0,0x0
movslq %r15d,%rcx
add    $0x1,%r15d
mov    %al,0x10(%rsp,%rcx,1)
jmp    1380 <main+0x220>
mov    %esi,%edi
call   1040 <getPrecedence@plt>
test   %r15d,%r15d
je     1349 <main+0x1e9>
mov    %rax,%rbx
movslq %r15d,%r12
add    %r12,%r14
shl    $0x20,%r12
nopl   0x0(%rax)
movsbl (%r14),%ebp
mov    %ebp,%edi
call   1040 <getPrecedence@plt>
cmp    $0x28,%ebp
je     131e <main+0x1be>
movsbl %al,%eax
cmp    %ebx,%eax
jl     131e <main+0x1be>
movsbl %bpl,%esi
mov    %r13,%rdi
call   1050 <printf@plt>
movabs $0xffffffff00000000,%rax
ff ff ff
add    %rax,%r12
add    $0xffffffffffffffff,%r14
add    $0xffffffff,%r15d
jne    12d0 <main+0x170>
xor    %r15d,%r15d
xor    %r12d,%r12d
lea    0xf(%rsp),%r14
mov    0x2ccc(%rip),%rbp
jmp    134f <main+0x1ef>
sar    $0x20,%r12
cmp    $0x100,%r15d
mov    0x2cb8(%rip),%rbp
jb     133d <main+0x1dd>
movl   $0x0,0x0
lea    0xf(%rsp),%r14
jmp    134f <main+0x1ef>
xor    %r15d,%r15d
jmp    1380 <main+0x220>
xor    %r15d,%r15d
xor    %r12d,%r12d
mov    0x7(%rsp),%al
add    $0x1,%r15d
mov    %al,0x10(%rsp,%r12,1)
mov    0x2c7d(%rip),%r12
jmp    1380 <main+0x220>
neg    %ebx
mov    %ebx,%r15d
mov    0x2c77(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp),%edi
call   1060 <fgetc@plt>
mov    0x0(%rbp),%edi
call   1060 <fgetc@plt>
mov    %al,0x7(%rsp)
cmp    $0xa,%al
je     13a2 <main+0x242>
cmp    (%r12),%al
jne    1210 <main+0xb0>
test   %r15d,%r15d
je     11b0 <main+0x50>
movslq %r15d,%rbx
add    %r14,%rbx
neg    %r15d
xor    %ebp,%ebp
jmp    13d8 <main+0x278>
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r13,%rdi
call   1050 <printf@plt>
add    $0xffffffffffffffff,%rbp
cmp    %ebp,%r15d
je     11b0 <main+0x50>
movzbl (%rbx,%rbp,1),%eax
cmp    $0x28,%al
jne    13c0 <main+0x260>
mov    0x2be9(%rip),%rax
mov    (%rax),%edi
lea    0xc17(%rip),%rsi
call   1070 <fprintf@plt>
jmp    13cb <main+0x26b>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [4 x i8] c" %c\00"
@EOF = global i8 0
@.str.3 = [3 x i8] c"%c\00"
@stdin = global i32 0
@stderr = global i32 0
@.str.4 = [23 x i8] c"Mismatched parentheses\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x i8]
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
store i32 0, i32* %1
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %13
13: ; preds = %149, %0
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %152
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
store i32 0, i32* %5
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %24
24: ; preds = %122, %22
%25 = load i8, i8* %6
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 10
br i1 %27, label %28, label %34
28: ; preds = %24
%29 = load i8, i8* %6
%30 = sext i8 %29 to i32
%31 = load i8, i8* @EOF
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %30, %32
br label %34
34: ; preds = %28, %24
%35 = phi i1 [ false, %24 ], [ %33, %28 ]
br i1 %35, label %36, label %127
36: ; preds = %34
%37 = load i8, i8* %6
%38 = sext i8 %37 to i32
%39 = icmp sge i32 %38, 48
br i1 %39, label %40, label %47
40: ; preds = %36
%41 = load i8, i8* %6
%42 = sext i8 %41 to i32
%43 = icmp sle i32 %42, 57
br i1 %43, label %44, label %47
44: ; preds = %40
%45 = load i8, i8* %6
%46 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8 signext %45)
br label %122
47: ; preds = %40, %36
%48 = load i8, i8* %6
%49 = sext i8 %48 to i32
switch i32 %49, label %79 [
i32 40, label %50
i32 41, label %61
]
50: ; preds = %47
%51 = load i32, i32* %5
%52 = sext i32 %51 to i64
%53 = icmp ult i64 %52, 256
br i1 %53, label %55, label %54
54: ; preds = %50
store volatile i32 0, i32* null
br label %55
55: ; preds = %54, %50
%56 = load i8, i8* %6
%57 = load i32, i32* %5
%58 = add nsw i32 %57, 1
store i32 %58, i32* %5
%59 = sext i32 %57 to i64
%60 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %59
store i8 %56, i8* %60
br label %121
61: ; preds = %47
br label %62
62: ; preds = %75, %61
%63 = load i32, i32* %5
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %78
65: ; preds = %62
%66 = load i32, i32* %5
%67 = add nsw i32 %66, -1
store i32 %67, i32* %5
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %68
%70 = load i8, i8* %69
store i8 %70, i8* %7
%71 = load i8, i8* %7
%72 = sext i8 %71 to i32
%73 = icmp eq i32 %72, 40
br i1 %73, label %74, label %75
74: ; preds = %65
br label %78
75: ; preds = %65
%76 = load i8, i8* %7
%77 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8 signext %76)
br label %62
78: ; preds = %74, %62
br label %121
79: ; preds = %47
%80 = load i8, i8* %6
%81 = call i8* @getPrecedence(i8 signext %80)
%82 = ptrtoint i8* %81 to i32
store i32 %82, i32* %8
br label %83
83: ; preds = %109, %79
%84 = load i32, i32* %5
%85 = icmp ne i32 %84, 0
br i1 %85, label %86, label %110
86: ; preds = %83
%87 = load i32, i32* %5
%88 = sub nsw i32 %87, 1
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %89
%91 = load i8, i8* %90
store i8 %91, i8* %9
%92 = load i8, i8* %9
%93 = call i8* @getPrecedence(i8 signext %92)
%94 = ptrtoint i8* %93 to i8
store i8 %94, i8* %10
%95 = load i8, i8* %9
%96 = sext i8 %95 to i32
%97 = icmp ne i32 %96, 40
br i1 %97, label %98, label %108
98: ; preds = %86
%99 = load i32, i32* %8
%100 = load i8, i8* %10
%101 = sext i8 %100 to i32
%102 = icmp sle i32 %99, %101
br i1 %102, label %103, label %108
103: ; preds = %98
%104 = load i8, i8* %9
%105 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8 signext %104)
%106 = load i32, i32* %5
%107 = add nsw i32 %106, -1
store i32 %107, i32* %5
br label %109
108: ; preds = %98, %86
br label %110
109: ; preds = %103
br label %83
110: ; preds = %108, %83
%111 = load i32, i32* %5
%112 = sext i32 %111 to i64
%113 = icmp ult i64 %112, 256
br i1 %113, label %115, label %114
114: ; preds = %110
store volatile i32 0, i32* null
br label %115
115: ; preds = %114, %110
%116 = load i8, i8* %6
%117 = load i32, i32* %5
%118 = add nsw i32 %117, 1
store i32 %118, i32* %5
%119 = sext i32 %117 to i64
%120 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %119
store i8 %116, i8* %120
br label %121
121: ; preds = %115, %78, %55
br label %122
122: ; preds = %121, %44
%123 = load i32, i32* @stdin
%124 = call signext i8 @fgetc(i32 %123)
%125 = load i32, i32* @stdin
%126 = call signext i8 @fgetc(i32 %125)
store i8 %126, i8* %6
br label %24
127: ; preds = %34
br label %128
128: ; preds = %146, %127
%129 = load i32, i32* %5
%130 = add nsw i32 %129, -1
store i32 %130, i32* %5
%131 = icmp ne i32 %129, 0
br i1 %131, label %132, label %147
132: ; preds = %128
%133 = load i32, i32* %5
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %134
%136 = load i8, i8* %135
store i8 %136, i8* %11
%137 = load i8, i8* %11
%138 = sext i8 %137 to i32
%139 = icmp eq i32 %138, 40
br i1 %139, label %140, label %143
140: ; preds = %132
%141 = load i32, i32* @stderr
%142 = call i32 @fprintf(i32 %141, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
br label %146
143: ; preds = %132
%144 = load i8, i8* %11
%145 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8 signext %144)
br label %146
146: ; preds = %143, %140
br label %128
147: ; preds = %128
%148 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %149
149: ; preds = %147
%150 = load i32, i32* %3
%151 = add nsw i32 %150, 1
store i32 %151, i32* %3
br label %13
152: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c" %c\00"
@EOF = global i8 0
@.str.3 = [3 x i8] c"%c\00"
@stdin = global i32 0
@stderr = global i32 0
@.str.4 = [23 x i8] c"Mismatched parentheses\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
br label %11
10: ; preds = %119, %0
ret i32 0
11: ; preds = %8, %119
%12 = phi i32 [ 0, %8 ], [ %121, %119 ]
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = call i32 @putchar(i32 10)
br label %16
16: ; preds = %14, %11
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%18 = load i8, i8* %3
%19 = icmp ne i8 %18, 10
%20 = load i8, i8* @EOF
%21 = icmp ne i8 %18, %20
%22 = select i1 %19, i1 %21, i1 false
br i1 %22, label %27, label %119
23: ; preds = %95
%24 = icmp eq i32 %96, 0
br i1 %24, label %119, label %25
25: ; preds = %23
%26 = sext i32 %96 to i64
br label %105
27: ; preds = %16, %95
%28 = phi i8 [ %100, %95 ], [ %18, %16 ]
%29 = phi i32 [ %96, %95 ], [ 0, %16 ]
%30 = add i8 %28, -48
%31 = icmp ult i8 %30, 10
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8 signext %28)
br label %95
34: ; preds = %27
%35 = sext i8 %28 to i32
switch i32 %35, label %57 [
i32 40, label %40
i32 41, label %36
]
36: ; preds = %34
%37 = icmp eq i32 %29, 0
br i1 %37, label %95, label %38
38: ; preds = %36
%39 = sext i32 %29 to i64
br label %47
40: ; preds = %34
%41 = sext i32 %29 to i64
%42 = icmp ult i32 %29, 256
br i1 %42, label %44, label %43
43: ; preds = %40
store volatile i32 0, i32* null
br label %44
44: ; preds = %43, %40
%45 = add nsw i32 %29, 1
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %41
store i8 %28, i8* %46
br label %95
47: ; preds = %38, %54
%48 = phi i64 [ %39, %38 ], [ %49, %54 ]
%49 = add nsw i64 %48, -1
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = icmp eq i8 %51, 40
%53 = trunc i64 %49 to i32
br i1 %52, label %93, label %54
54: ; preds = %47
%55 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8 signext %51)
%56 = icmp eq i32 %53, 0
br i1 %56, label %95, label %47
57: ; preds = %34
%58 = call i8* @getPrecedence(i8 signext %28)
%59 = ptrtoint i8* %58 to i64
%60 = trunc i64 %59 to i32
%61 = icmp eq i32 %29, 0
br i1 %61, label %87, label %62
62: ; preds = %57
%63 = sext i32 %29 to i64
br label %64
64: ; preds = %62, %77
%65 = phi i64 [ %63, %62 ], [ %66, %77 ]
%66 = add nsw i64 %65, -1
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = call i8* @getPrecedence(i8 signext %68)
%70 = icmp eq i8 %68, 40
br i1 %70, label %81, label %71
71: ; preds = %64
%72 = ptrtoint i8* %69 to i64
%73 = trunc i64 %72 to i32
%74 = shl i32 %73, 24
%75 = ashr exact i32 %74, 24
%76 = icmp slt i32 %75, %60
br i1 %76, label %81, label %77
77: ; preds = %71
%78 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8 signext %68)
%79 = trunc i64 %66 to i32
%80 = icmp eq i32 %79, 0
br i1 %80, label %87, label %64
81: ; preds = %71, %64
%82 = trunc i64 %65 to i32
%83 = shl i64 %65, 32
%84 = ashr exact i64 %83, 32
%85 = icmp ult i32 %82, 256
br i1 %85, label %87, label %86
86: ; preds = %81
store volatile i32 0, i32* null
br label %87
87: ; preds = %77, %57, %86, %81
%88 = phi i32 [ %82, %86 ], [ %82, %81 ], [ 0, %57 ], [ 0, %77 ]
%89 = phi i64 [ %84, %86 ], [ %84, %81 ], [ 0, %57 ], [ 0, %77 ]
%90 = load i8, i8* %3
%91 = add nsw i32 %88, 1
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %89
store i8 %90, i8* %92
br label %95
93: ; preds = %47
%94 = trunc i64 %49 to i32
br label %95
95: ; preds = %93, %54, %36, %44, %87, %32
%96 = phi i32 [ %29, %32 ], [ %91, %87 ], [ %45, %44 ], [ 0, %36 ], [ %94, %93 ], [ 0, %54 ]
%97 = load i32, i32* @stdin
%98 = call signext i8 @fgetc(i32 %97)
%99 = load i32, i32* @stdin
%100 = call signext i8 @fgetc(i32 %99)
store i8 %100, i8* %3
%101 = icmp ne i8 %100, 10
%102 = load i8, i8* @EOF
%103 = icmp ne i8 %100, %102
%104 = select i1 %101, i1 %103, i1 false
br i1 %104, label %27, label %23
105: ; preds = %25, %116
%106 = phi i64 [ %26, %25 ], [ %107, %116 ]
%107 = add nsw i64 %106, -1
%108 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %107
%109 = load i8, i8* %108
%110 = icmp eq i8 %109, 40
br i1 %110, label %111, label %114
111: ; preds = %105
%112 = load i32, i32* @stderr
%113 = call i32 @fprintf(i32 %112, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
br label %116
114: ; preds = %105
%115 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8 signext %109)
br label %116
116: ; preds = %114, %111
%117 = trunc i64 %107 to i32
%118 = icmp eq i32 %117, 0
br i1 %118, label %119, label %105
119: ; preds = %116, %16, %23
%120 = call i32 @putchar(i32 10)
%121 = add nuw nsw i32 %12, 1
%122 = load i32, i32* %1
%123 = icmp slt i32 %121, %122
br i1 %123, label %11, label %10
}