int match(char left, char right) {
  int ret = 0;
  switch (left) {
  case '<':
    ret = '>' == right;
    break;
  case '(':
    ret = ')' == right;
    break;
  case '{':
    ret = '}' == right;
    break;
  case '[':
    ret = ']' == right;
    break;
  case '\'':
    ret = '\'' == right;
    break;
  case '\"':
    ret = '\"' == right;
    break;
  default:
    ret = 0;
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x22,%eax
je     1208 <match+0x108>
jmp    112c <match+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x27,%eax
je     11ed <match+0xed>
jmp    113d <match+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x28,%eax
je     119c <match+0x9c>
jmp    114e <match+0x4e>
mov    -0xc(%rbp),%eax
sub    $0x3c,%eax
je     1181 <match+0x81>
jmp    115f <match+0x5f>
mov    -0xc(%rbp),%eax
sub    $0x5b,%eax
je     11d2 <match+0xd2>
jmp    1170 <match+0x70>
mov    -0xc(%rbp),%eax
sub    $0x7b,%eax
je     11b7 <match+0xb7>
jmp    1223 <match+0x123>
movsbl -0x2(%rbp),%ecx
mov    $0x3e,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    122a <match+0x12a>
movsbl -0x2(%rbp),%ecx
mov    $0x29,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    122a <match+0x12a>
movsbl -0x2(%rbp),%ecx
mov    $0x7d,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    122a <match+0x12a>
movsbl -0x2(%rbp),%ecx
mov    $0x5d,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    122a <match+0x12a>
movsbl -0x2(%rbp),%ecx
mov    $0x27,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    122a <match+0x12a>
movsbl -0x2(%rbp),%ecx
mov    $0x22,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    122a <match+0x12a>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
xor    %eax,%eax
lea    -0x22(%rdi),%ecx
cmp    $0x1a,%ecx
ja     1120 <match+0x20>
lea    0xeef(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
cmp    $0x22,%sil
jmp    1146 <match+0x46>
cmp    $0x5b,%edi
je     1142 <match+0x42>
cmp    $0x7b,%edi
jne    1149 <match+0x49>
cmp    $0x7d,%sil
jmp    1146 <match+0x46>
cmp    $0x27,%sil
jmp    1146 <match+0x46>
cmp    $0x29,%sil
jmp    1146 <match+0x46>
cmp    $0x3e,%sil
jmp    1146 <match+0x46>
cmp    $0x5d,%sil
sete   %al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @match(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 0, i32* %5
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
switch i32 %7, label %38 [
i32 60, label %8
i32 40, label %13
i32 123, label %18
i32 91, label %23
i32 39, label %28
i32 34, label %33
]
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp eq i32 62, %10
%12 = zext i1 %11 to i32
store i32 %12, i32* %5
br label %39
13: ; preds = %2
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = icmp eq i32 41, %15
%17 = zext i1 %16 to i32
store i32 %17, i32* %5
br label %39
18: ; preds = %2
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = icmp eq i32 125, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %5
br label %39
23: ; preds = %2
%24 = load i8, i8* %4
%25 = sext i8 %24 to i32
%26 = icmp eq i32 93, %25
%27 = zext i1 %26 to i32
store i32 %27, i32* %5
br label %39
28: ; preds = %2
%29 = load i8, i8* %4
%30 = sext i8 %29 to i32
%31 = icmp eq i32 39, %30
%32 = zext i1 %31 to i32
store i32 %32, i32* %5
br label %39
33: ; preds = %2
%34 = load i8, i8* %4
%35 = sext i8 %34 to i32
%36 = icmp eq i32 34, %35
%37 = zext i1 %36 to i32
store i32 %37, i32* %5
br label %39
38: ; preds = %2
store i32 0, i32* %5
br label %39
39: ; preds = %38, %33, %28, %23, %18, %13, %8
%40 = load i32, i32* %5
ret i32 %40
}

LLVM IR (-O2):
define i32 @match(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
switch i32 %3, label %16 [
i32 60, label %4
i32 40, label %6
i32 123, label %8
i32 91, label %10
i32 39, label %12
i32 34, label %14
]
4: ; preds = %2
%5 = icmp eq i8 %1, 62
br label %16
6: ; preds = %2
%7 = icmp eq i8 %1, 41
br label %16
8: ; preds = %2
%9 = icmp eq i8 %1, 125
br label %16
10: ; preds = %2
%11 = icmp eq i8 %1, 93
br label %16
12: ; preds = %2
%13 = icmp eq i8 %1, 39
br label %16
14: ; preds = %2
%15 = icmp eq i8 %1, 34
br label %16
16: ; preds = %2, %14, %12, %10, %8, %6, %4
%17 = phi i1 [ %15, %14 ], [ %13, %12 ], [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ false, %2 ]
%18 = zext i1 %17 to i32
ret i32 %18
}