#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 */
char EOF;
char pair(const char c) {
  switch (c) {
  case '(':
    return ')';
  case '[':
    return ']';
  case '{':
    return '}';
  case ')':
    return '(';
  case ']':
    return '[';
  case '}':
    return '{';
  default:
    return EOF;
  }
}


x86 assembly (clang, -O0):
<pair>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x28,%eax
je     1174 <pair+0x74>
jmp    111f <pair+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x29,%eax
je     118f <pair+0x8f>
jmp    1130 <pair+0x30>
mov    -0x8(%rbp),%eax
sub    $0x5b,%eax
je     117d <pair+0x7d>
jmp    1141 <pair+0x41>
mov    -0x8(%rbp),%eax
sub    $0x5d,%eax
je     1198 <pair+0x98>
jmp    1152 <pair+0x52>
mov    -0x8(%rbp),%eax
sub    $0x7b,%eax
je     1186 <pair+0x86>
jmp    1163 <pair+0x63>
mov    -0x8(%rbp),%eax
sub    $0x7d,%eax
je     11a1 <pair+0xa1>
jmp    11aa <pair+0xaa>
movb   $0x29,-0x1(%rbp)
jmp    11b6 <pair+0xb6>
movb   $0x5d,-0x1(%rbp)
jmp    11b6 <pair+0xb6>
movb   $0x7d,-0x1(%rbp)
jmp    11b6 <pair+0xb6>
movb   $0x28,-0x1(%rbp)
jmp    11b6 <pair+0xb6>
movb   $0x5b,-0x1(%rbp)
jmp    11b6 <pair+0xb6>
movb   $0x7b,-0x1(%rbp)
jmp    11b6 <pair+0xb6>
mov    0x2e37(%rip),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair>:
lea    -0x5b(%rdi),%eax
cmp    $0x22,%eax
ja     111b <pair+0x1b>
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x5d,%al
ret
cmp    $0x28,%edi
je     113b <pair+0x3b>
cmp    $0x29,%edi
jne    1128 <pair+0x28>
mov    $0x28,%al
ret
mov    0x2eb9(%rip),%rax
mov    (%rax),%al
ret
mov    $0x5b,%al
ret
mov    $0x7d,%al
ret
mov    $0x7b,%al
ret
mov    $0x29,%al
ret

LLVM IR (-O0):
@EOF = global i8 0
define signext i8 @pair(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 40, label %6
i32 91, label %7
i32 123, label %8
i32 41, label %9
i32 93, label %10
i32 125, label %11
]
6: ; preds = %1
store i8 41, i8* %2
br label %14
7: ; preds = %1
store i8 93, i8* %2
br label %14
8: ; preds = %1
store i8 125, i8* %2
br label %14
9: ; preds = %1
store i8 40, i8* %2
br label %14
10: ; preds = %1
store i8 91, i8* %2
br label %14
11: ; preds = %1
store i8 123, i8* %2
br label %14
12: ; preds = %1
%13 = load i8, i8* @EOF
store i8 %13, i8* %2
br label %14
14: ; preds = %12, %11, %10, %9, %8, %7, %6
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
@EOF = global i8 0
define signext i8 @pair(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %8 [
i32 40, label %10
i32 91, label %3
i32 123, label %4
i32 41, label %5
i32 93, label %6
i32 125, label %7
]
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
%9 = load i8, i8* @EOF
br label %10
10: ; preds = %1, %8, %7, %6, %5, %4, %3
%11 = phi i8 [ %9, %8 ], [ 123, %7 ], [ 91, %6 ], [ 40, %5 ], [ 125, %4 ], [ 93, %3 ], [ 41, %1 ]
ret i8 %11
}