char Precede(char left, char right) {
  char relation[7][7] = {'>', '>', '<', '<', '<', '>', '>', '>', '>', '<',
                         '<', '<', '>', '>', '>', '>', '>', '>', '<', '>',
                         '>', '>', '>', '>', '>', '<', '>', '>', '<', '<',
                         '<', '<', '<', '=', '0', '>', '>', '>', '>', '0',
                         '>', '>', '<', '<', '<', '<', '<', '0', '='};
  switch (left) {
  case '+':
    left = 0;
    break;
  case '-':
    left = 1;
    break;
  case '*':
    left = 2;
    break;
  case '/':
    left = 3;
    break;
  case '(':
    left = 4;
    break;
  case ')':
    left = 5;
    break;
  case '#':
    left = 6;
    break;
  }
  switch (right) {
  case '+':
    right = 0;
    break;
  case '-':
    right = 1;
    break;
  case '*':
    right = 2;
    break;
  case '/':
    right = 3;
    break;
  case '(':
    right = 4;
    break;
  case ')':
    right = 5;
    break;
  case '#':
    right = 6;
    break;
  }
  return relation[left][right];
}


x86 assembly (clang, -O0):
<Precede>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    0xf8a(%rip),%al
mov    %al,-0x10(%rbp)
movaps 0xf70(%rip),%xmm0
movaps %xmm0,-0x20(%rbp)
movaps 0xf55(%rip),%xmm0
movaps %xmm0,-0x30(%rbp)
movaps 0xf3a(%rip),%xmm0
movaps %xmm0,-0x40(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffdd,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0xc,%eax
ja     119e <Precede+0x9e>
mov    -0x48(%rbp),%rax
lea    0xea5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x0,-0x1(%rbp)
jmp    119e <Precede+0x9e>
movb   $0x1,-0x1(%rbp)
jmp    119e <Precede+0x9e>
movb   $0x2,-0x1(%rbp)
jmp    119e <Precede+0x9e>
movb   $0x3,-0x1(%rbp)
jmp    119e <Precede+0x9e>
movb   $0x4,-0x1(%rbp)
jmp    119e <Precede+0x9e>
movb   $0x5,-0x1(%rbp)
jmp    119e <Precede+0x9e>
movb   $0x6,-0x1(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffdd,%eax
mov    %eax,%ecx
mov    %rcx,-0x50(%rbp)
sub    $0xc,%eax
ja     1202 <Precede+0x102>
mov    -0x50(%rbp),%rax
lea    0xe75(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x0,-0x2(%rbp)
jmp    1202 <Precede+0x102>
movb   $0x1,-0x2(%rbp)
jmp    1202 <Precede+0x102>
movb   $0x2,-0x2(%rbp)
jmp    1202 <Precede+0x102>
movb   $0x3,-0x2(%rbp)
jmp    1202 <Precede+0x102>
movb   $0x4,-0x2(%rbp)
jmp    1202 <Precede+0x102>
movb   $0x5,-0x2(%rbp)
jmp    1202 <Precede+0x102>
movb   $0x6,-0x2(%rbp)
movsbq -0x1(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0x7,%rcx,%rcx
add    %rcx,%rax
movsbq -0x2(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Precede>:
movslq %edi,%rax
add    $0xffffffffffffffdd,%rax
cmp    $0xc,%eax
ja     1121 <Precede+0x21>
mov    $0x15e1,%ecx
bt     %eax,%ecx
jae    1121 <Precede+0x21>
lea    0xf14(%rip),%rcx
mov    (%rax,%rcx,1),%dil
movsbq %sil,%rax
add    $0xffffffffffffffdd,%rax
cmp    $0xc,%eax
ja     1143 <Precede+0x43>
mov    $0x15e1,%ecx
bt     %eax,%ecx
jae    1143 <Precede+0x43>
lea    0xef2(%rip),%rcx
mov    (%rax,%rcx,1),%sil
movsbq %dil,%rax
movsbq %sil,%rcx
lea    0x0(,%rax,8),%rdx
sub    %rax,%rdx
lea    0xea3(%rip),%rax
add    %rdx,%rax
mov    (%rcx,%rax,1),%al
ret

LLVM IR (-O0):
@__const.Precede.relation = [7 x [7 x i8]] [[7 x i8] c">><<<>>", [7 x i8] c">><<<>>", [7 x i8] c">>>><>>", [7 x i8] c">>>><>>", [7 x i8] c"<<<<<=0", [7 x i8] c">>>>0>>", [7 x i8] c"<<<<<0="]
define signext i8 @Precede(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca [7 x [7 x i8]]
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = bitcast [7 x [7 x i8]]* %5 to i8*
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
switch i32 %8, label %16 [
i32 43, label %9
i32 45, label %10
i32 42, label %11
i32 47, label %12
i32 40, label %13
i32 41, label %14
i32 35, label %15
]
9: ; preds = %2
store i8 0, i8* %3
br label %16
10: ; preds = %2
store i8 1, i8* %3
br label %16
11: ; preds = %2
store i8 2, i8* %3
br label %16
12: ; preds = %2
store i8 3, i8* %3
br label %16
13: ; preds = %2
store i8 4, i8* %3
br label %16
14: ; preds = %2
store i8 5, i8* %3
br label %16
15: ; preds = %2
store i8 6, i8* %3
br label %16
16: ; preds = %2, %15, %14, %13, %12, %11, %10, %9
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
switch i32 %18, label %26 [
i32 43, label %19
i32 45, label %20
i32 42, label %21
i32 47, label %22
i32 40, label %23
i32 41, label %24
i32 35, label %25
]
19: ; preds = %16
store i8 0, i8* %4
br label %26
20: ; preds = %16
store i8 1, i8* %4
br label %26
21: ; preds = %16
store i8 2, i8* %4
br label %26
22: ; preds = %16
store i8 3, i8* %4
br label %26
23: ; preds = %16
store i8 4, i8* %4
br label %26
24: ; preds = %16
store i8 5, i8* %4
br label %26
25: ; preds = %16
store i8 6, i8* %4
br label %26
26: ; preds = %16, %25, %24, %23, %22, %21, %20, %19
%27 = load i8, i8* %3
%28 = sext i8 %27 to i64
%29 = getelementptr inbounds [7 x [7 x i8]], [7 x [7 x i8]]* %5, i64 0, i64 %28
%30 = load i8, i8* %4
%31 = sext i8 %30 to i64
%32 = getelementptr inbounds [7 x i8], [7 x i8]* %29, i64 0, i64 %31
%33 = load i8, i8* %32
ret i8 %33
}

LLVM IR (-O2):
@__const.Precede.relation = [7 x [7 x i8]] [[7 x i8] c">><<<>>", [7 x i8] c">><<<>>", [7 x i8] c">>>><>>", [7 x i8] c">>>><>>", [7 x i8] c"<<<<<=0", [7 x i8] c">>>>0>>", [7 x i8] c"<<<<<0="]
@switch.table.Precede.1 = [13 x i8] c"\06\00\00\00\00\04\05\02\00\00\01\00\03"
define signext i8 @Precede(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = add nsw i32 %3, -35
%5 = icmp ult i32 %4, 13
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = trunc i32 %4 to i16
%8 = lshr i16 5601, %7
%9 = and i16 %8, 1
%10 = icmp eq i16 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = sext i32 %4 to i64
%13 = getelementptr inbounds [13 x i8], [13 x i8]* @switch.table.Precede.1, i64 0, i64 %12
%14 = load i8, i8* %13
br label %15
15: ; preds = %11, %6, %2
%16 = phi i8 [ %0, %2 ], [ %0, %6 ], [ %14, %11 ]
%17 = sext i8 %1 to i32
%18 = add nsw i32 %17, -35
%19 = icmp ult i32 %18, 13
br i1 %19, label %20, label %29
20: ; preds = %15
%21 = trunc i32 %18 to i16
%22 = lshr i16 5601, %21
%23 = and i16 %22, 1
%24 = icmp eq i16 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %20
%26 = sext i32 %18 to i64
%27 = getelementptr inbounds [13 x i8], [13 x i8]* @switch.table.Precede.1, i64 0, i64 %26
%28 = load i8, i8* %27
br label %29
29: ; preds = %25, %20, %15
%30 = phi i8 [ %1, %15 ], [ %1, %20 ], [ %28, %25 ]
%31 = sext i8 %16 to i64
%32 = sext i8 %30 to i64
%33 = getelementptr inbounds [7 x [7 x i8]], [7 x [7 x i8]]* @__const.Precede.relation, i64 0, i64 %31, i64 %32
%34 = load i8, i8* %33
ret i8 %34
}