int outer(char a) {
  int y = a == '('   ? 80
          : a == '^' ? 70
          : a == '/' ? 60
          : a == '*' ? 50
          : a == '-' ? 40
          : a == '+' ? 30
                     : 0;
  return y;
}


x86 assembly (clang, -O0):
<outer>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x28,%eax
jne    1124 <outer+0x24>
mov    $0x50,%eax
mov    %eax,-0xc(%rbp)
jmp    11b8 <outer+0xb8>
movsbl -0x1(%rbp),%eax
cmp    $0x5e,%eax
jne    113e <outer+0x3e>
mov    $0x46,%eax
mov    %eax,-0x10(%rbp)
jmp    11b2 <outer+0xb2>
movsbl -0x1(%rbp),%eax
cmp    $0x2f,%eax
jne    1158 <outer+0x58>
mov    $0x3c,%eax
mov    %eax,-0x14(%rbp)
jmp    11ac <outer+0xac>
movsbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
jne    1172 <outer+0x72>
mov    $0x32,%eax
mov    %eax,-0x18(%rbp)
jmp    11a6 <outer+0xa6>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
jne    118c <outer+0x8c>
mov    $0x28,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a0 <outer+0xa0>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1e,%ecx
cmp    $0x2b,%edx
cmove  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<outer>:
lea    -0x28(%rdi),%ecx
cmp    $0x7,%cl
ja     1126 <outer+0x26>
mov    $0x50,%eax
movzbl %cl,%ecx
lea    0xee9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x32,%eax
ret
cmp    $0x5e,%dil
jne    1132 <outer+0x32>
mov    $0x46,%eax
ret
xor    %ecx,%ecx
cmp    $0x2b,%dil
mov    $0x1e,%eax
cmovne %ecx,%eax
ret
mov    $0x28,%eax
ret
mov    $0x3c,%eax
ret

LLVM IR (-O0):
define i32 @outer(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 40
br i1 %6, label %7, label %8
7: ; preds = %1
br label %42
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 94
br i1 %11, label %12, label %13
12: ; preds = %8
br label %40
13: ; preds = %8
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 47
br i1 %16, label %17, label %18
17: ; preds = %13
br label %38
18: ; preds = %13
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 42
br i1 %21, label %22, label %23
22: ; preds = %18
br label %36
23: ; preds = %18
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 45
br i1 %26, label %27, label %28
27: ; preds = %23
br label %34
28: ; preds = %23
%29 = load i8, i8* %2
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 43
%32 = zext i1 %31 to i64
%33 = select i1 %31, i32 30, i32 0
br label %34
34: ; preds = %28, %27
%35 = phi i32 [ 40, %27 ], [ %33, %28 ]
br label %36
36: ; preds = %34, %22
%37 = phi i32 [ 50, %22 ], [ %35, %34 ]
br label %38
38: ; preds = %36, %17
%39 = phi i32 [ 60, %17 ], [ %37, %36 ]
br label %40
40: ; preds = %38, %12
%41 = phi i32 [ 70, %12 ], [ %39, %38 ]
br label %42
42: ; preds = %40, %7
%43 = phi i32 [ 80, %7 ], [ %41, %40 ]
store i32 %43, i32* %3
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
define i32 @outer(i8 signext %0) {
switch i8 %0, label %2 [
i8 40, label %9
i8 94, label %5
i8 47, label %6
i8 42, label %7
i8 45, label %8
]
2: ; preds = %1
%3 = icmp eq i8 %0, 43
%4 = select i1 %3, i32 30, i32 0
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %7, %6, %5, %2
%10 = phi i32 [ 80, %1 ], [ %4, %2 ], [ 70, %5 ], [ 60, %6 ], [ 50, %7 ], [ 40, %8 ]
ret i32 %10
}