int char2sym(int pchar) {
  int gchar;
  if (((32 <= pchar) && (pchar <= 126))) {
    gchar = pchar;
  } else if (pchar == -1) {
    gchar = (6 | 128);
  } else if ((pchar > 127)) {
    gchar = (1 | 128);
  } else if (pchar == '\n') {
    gchar = (2 | 128);
  } else if (pchar == '\r') {
    gchar = (3 | 128);
  } else if (pchar == '\f') {
    gchar = (4 | 128);
  } else if (pchar == '\t') {
    gchar = (0 | 128);
  } else {
    gchar = (5 | 128);
  }
  return (gchar);
}


x86 assembly (clang, -O0):
<char2sym>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x20,%eax
cmp    -0x4(%rbp),%eax
jg     112a <char2sym+0x2a>
cmpl   $0x7e,-0x4(%rbp)
jg     112a <char2sym+0x2a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    11d3 <char2sym+0xd3>
cmpl   $0xffffffff,-0x4(%rbp)
jne    1140 <char2sym+0x40>
movl   $0x86,-0x8(%rbp)
jmp    11ce <char2sym+0xce>
cmpl   $0x7f,-0x4(%rbp)
jle    1156 <char2sym+0x56>
movl   $0x81,-0x8(%rbp)
jmp    11c9 <char2sym+0xc9>
cmpl   $0xa,-0x4(%rbp)
jne    116c <char2sym+0x6c>
movl   $0x82,-0x8(%rbp)
jmp    11c4 <char2sym+0xc4>
cmpl   $0xd,-0x4(%rbp)
jne    1182 <char2sym+0x82>
movl   $0x83,-0x8(%rbp)
jmp    11bf <char2sym+0xbf>
cmpl   $0xc,-0x4(%rbp)
jne    1198 <char2sym+0x98>
movl   $0x84,-0x8(%rbp)
jmp    11ba <char2sym+0xba>
cmpl   $0x9,-0x4(%rbp)
jne    11ae <char2sym+0xae>
movl   $0x80,-0x8(%rbp)
jmp    11b5 <char2sym+0xb5>
movl   $0x85,-0x8(%rbp)
jmp    11ba <char2sym+0xba>
jmp    11bf <char2sym+0xbf>
jmp    11c4 <char2sym+0xc4>
jmp    11c9 <char2sym+0xc9>
jmp    11ce <char2sym+0xce>
jmp    11d3 <char2sym+0xd3>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2sym>:
lea    -0x20(%rdi),%eax
cmp    $0x5f,%eax
jae    110b <char2sym+0xb>
mov    %edi,%eax
ret
cmp    $0xffffffff,%edi
je     1135 <char2sym+0x35>
mov    $0x81,%eax
cmp    $0x7f,%edi
jg     1134 <char2sym+0x34>
add    $0xfffffff7,%edi
mov    $0x85,%eax
cmp    $0x4,%edi
ja     1134 <char2sym+0x34>
movslq %edi,%rax
lea    0xecf(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret
mov    $0x86,%eax
ret

LLVM IR (-O0):
define i32 @char2sym(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 32, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 126
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = load i32, i32* %2
store i32 %10, i32* %3
br label %42
11: ; preds = %6, %1
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 134, i32* %3
br label %41
15: ; preds = %11
%16 = load i32, i32* %2
%17 = icmp sgt i32 %16, 127
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 129, i32* %3
br label %40
19: ; preds = %15
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 10
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 130, i32* %3
br label %39
23: ; preds = %19
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 13
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 131, i32* %3
br label %38
27: ; preds = %23
%28 = load i32, i32* %2
%29 = icmp eq i32 %28, 12
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 132, i32* %3
br label %37
31: ; preds = %27
%32 = load i32, i32* %2
%33 = icmp eq i32 %32, 9
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 128, i32* %3
br label %36
35: ; preds = %31
store i32 133, i32* %3
br label %36
36: ; preds = %35, %34
br label %37
37: ; preds = %36, %30
br label %38
38: ; preds = %37, %26
br label %39
39: ; preds = %38, %22
br label %40
40: ; preds = %39, %18
br label %41
41: ; preds = %40, %14
br label %42
42: ; preds = %41, %9
%43 = load i32, i32* %3
ret i32 %43
}

LLVM IR (-O2):
@switch.table.char2sym = [5 x i32] [i32 128, i32 130, i32 133, i32 132, i32 131]
define i32 @char2sym(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = icmp eq i32 %0, -1
br i1 %5, label %15, label %6
6: ; preds = %4
%7 = icmp sgt i32 %0, 127
br i1 %7, label %15, label %8
8: ; preds = %6
%9 = add i32 %0, -9
%10 = icmp ult i32 %9, 5
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = sext i32 %9 to i64
%13 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.char2sym, i64 0, i64 %12
%14 = load i32, i32* %13
br label %15
15: ; preds = %8, %11, %6, %4, %1
%16 = phi i32 [ %0, %1 ], [ 134, %4 ], [ 129, %6 ], [ %14, %11 ], [ 133, %8 ]
ret i32 %16
}