char CharTag(in)
char in;
{
  if (in & 0x80)
    return 'H';
  else if (in == '\n')
    return '#';
  else if (isdigit(in))
    return 'N';
  else if (isalpha(in))
    return 'E';
  else if (isspace(in))
    return 'S';
  else if (strchr(",:/", in))
    return ',';
  else if (strchr("!?", in))
    return '?';
  else if (in == '.')
    return '.';
  else if (strchr("`({[", in))
    return 'O';
  else if (strchr("'\")}]", in))
    return 'C';
  else if (strchr("-~", in))
    return '-';
  else if (in == '%')
    return '@';
  else if (in == '$')
    return '!';
  else
    return '*';
}


x86 assembly (clang, -O0):
<CharTag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1169 <CharTag+0x29>
movb   $0x48,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jne    117f <CharTag+0x3f>
movb   $0x23,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movsbl -0x2(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     119a <CharTag+0x5a>
movb   $0x4e,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movsbl -0x2(%rbp),%edi
call   1060 <isalpha@plt>
cmp    $0x0,%eax
je     11b5 <CharTag+0x75>
movb   $0x45,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movsbl -0x2(%rbp),%edi
call   1050 <isspace@plt>
cmp    $0x0,%eax
je     11d0 <CharTag+0x90>
movb   $0x53,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movsbl -0x2(%rbp),%esi
lea    0xe25(%rip),%rdi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     11f3 <CharTag+0xb3>
movb   $0x2c,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movsbl -0x2(%rbp),%esi
lea    0xe06(%rip),%rdi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     1216 <CharTag+0xd6>
movb   $0x3f,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movsbl -0x2(%rbp),%eax
cmp    $0x2e,%eax
jne    122c <CharTag+0xec>
movb   $0x2e,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movsbl -0x2(%rbp),%esi
lea    0xdd0(%rip),%rdi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     124f <CharTag+0x10f>
movb   $0x4f,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movsbl -0x2(%rbp),%esi
lea    0xdb2(%rip),%rdi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     1272 <CharTag+0x132>
movb   $0x43,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movsbl -0x2(%rbp),%esi
lea    0xd95(%rip),%rdi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     1295 <CharTag+0x155>
movb   $0x2d,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movsbl -0x2(%rbp),%eax
cmp    $0x25,%eax
jne    12ab <CharTag+0x16b>
movb   $0x40,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movsbl -0x2(%rbp),%eax
cmp    $0x24,%eax
jne    12c1 <CharTag+0x181>
movb   $0x21,-0x1(%rbp)
jmp    12c5 <CharTag+0x185>
movb   $0x2a,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharTag>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
mov    $0x48,%al
test   $0x80,%bpl
jne    1253 <CharTag+0x123>
mov    %ebp,%ebx
shl    $0x18,%ebx
mov    $0x23,%al
cmp    $0xa000000,%ebx
je     1253 <CharTag+0x123>
movsbl %bpl,%r14d
lea    -0x30(%r14),%ecx
mov    $0x4e,%al
cmp    $0xa,%ecx
jb     1253 <CharTag+0x123>
mov    %r14d,%edi
call   1050 <isalpha@plt>
mov    %eax,%ecx
mov    $0x45,%al
test   %ecx,%ecx
jne    1253 <CharTag+0x123>
mov    %r14d,%edi
call   1030 <isspace@plt>
mov    %eax,%ecx
mov    $0x53,%al
test   %ecx,%ecx
jne    1253 <CharTag+0x123>
movzbl %bpl,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
cmp    $0x3f,%ecx
ja     11b6 <CharTag+0x86>
movabs $0x400900000000001,%rsi
mov    $0x2c,%al
and    %rdx,%rsi
jne    1253 <CharTag+0x123>
cmp    $0x3f,%ecx
ja     11d0 <CharTag+0xa0>
movabs $0x8000000200000001,%rcx
mov    $0x3f,%al
and    %rcx,%rdx
jne    1253 <CharTag+0x123>
mov    $0x2e,%al
cmp    $0x2e000000,%ebx
je     1253 <CharTag+0x123>
lea    0xe1f(%rip),%rdi
mov    $0x5,%edx
mov    %r14d,%esi
call   1040 <memchr@plt>
mov    %rax,%rcx
mov    $0x4f,%al
test   %rcx,%rcx
jne    1253 <CharTag+0x123>
lea    0xe06(%rip),%rdi
mov    $0x6,%edx
mov    %r14d,%esi
call   1040 <memchr@plt>
mov    %rax,%rcx
mov    $0x43,%al
test   %rcx,%rcx
jne    1253 <CharTag+0x123>
lea    0xdee(%rip),%rdi
mov    $0x3,%edx
mov    %r14d,%esi
call   1040 <memchr@plt>
mov    %rax,%rcx
mov    $0x2d,%al
test   %rcx,%rcx
jne    1253 <CharTag+0x123>
xor    %eax,%eax
cmp    $0x24000000,%ebx
setne  %al
lea    (%rax,%rax,8),%ecx
add    $0x21,%ecx
cmp    $0x25000000,%ebx
mov    $0x40,%eax
cmovne %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c",:/\00"
@.str.1 = [3 x i8] c"!?\00"
@.str.2 = [5 x i8] c"`({[\00"
@.str.3 = [6 x i8] c"'\22)}]\00"
@.str.4 = [3 x i8] c"-~\00"
define signext i8 @CharTag(i32 %0) {
%2 = alloca i8
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = and i32 %6, 128
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i8 72, i8* %2
br label %79
10: ; preds = %1
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %15
14: ; preds = %10
store i8 35, i8* %2
br label %79
15: ; preds = %10
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = call i32 @isdigit(i32 %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %15
store i8 78, i8* %2
br label %79
21: ; preds = %15
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = call i32 @isalpha(i32 %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %21
store i8 69, i8* %2
br label %79
27: ; preds = %21
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = call i32 @isspace(i32 %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %27
store i8 83, i8* %2
br label %79
33: ; preds = %27
%34 = load i8, i8* %3
%35 = sext i8 %34 to i32
%36 = call i8* @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = icmp ne i8* %36, null
br i1 %37, label %38, label %39
38: ; preds = %33
store i8 44, i8* %2
br label %79
39: ; preds = %33
%40 = load i8, i8* %3
%41 = sext i8 %40 to i32
%42 = call i8* @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = icmp ne i8* %42, null
br i1 %43, label %44, label %45
44: ; preds = %39
store i8 63, i8* %2
br label %79
45: ; preds = %39
%46 = load i8, i8* %3
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 46
br i1 %48, label %49, label %50
49: ; preds = %45
store i8 46, i8* %2
br label %79
50: ; preds = %45
%51 = load i8, i8* %3
%52 = sext i8 %51 to i32
%53 = call i8* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %52)
%54 = icmp ne i8* %53, null
br i1 %54, label %55, label %56
55: ; preds = %50
store i8 79, i8* %2
br label %79
56: ; preds = %50
%57 = load i8, i8* %3
%58 = sext i8 %57 to i32
%59 = call i8* @strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %58)
%60 = icmp ne i8* %59, null
br i1 %60, label %61, label %62
61: ; preds = %56
store i8 67, i8* %2
br label %79
62: ; preds = %56
%63 = load i8, i8* %3
%64 = sext i8 %63 to i32
%65 = call i8* @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %64)
%66 = icmp ne i8* %65, null
br i1 %66, label %67, label %68
67: ; preds = %62
store i8 45, i8* %2
br label %79
68: ; preds = %62
%69 = load i8, i8* %3
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 37
br i1 %71, label %72, label %73
72: ; preds = %68
store i8 64, i8* %2
br label %79
73: ; preds = %68
%74 = load i8, i8* %3
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 36
br i1 %76, label %77, label %78
77: ; preds = %73
store i8 33, i8* %2
br label %79
78: ; preds = %73
store i8 42, i8* %2
br label %79
79: ; preds = %78, %77, %72, %67, %61, %55, %49, %44, %38, %32, %26, %20, %14, %9
%80 = load i8, i8* %2
ret i8 %80
}

LLVM IR (-O2):
@.str.2 = [5 x i8] c"`({[\00"
@.str.3 = [6 x i8] c"'\22)}]\00"
@.str.4 = [3 x i8] c"-~\00"
define signext i8 @CharTag(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = and i32 %0, 128
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %45
6: ; preds = %1
%7 = icmp eq i32 %2, 167772160
br i1 %7, label %45, label %8
8: ; preds = %6
%9 = add nsw i32 %3, -48
%10 = icmp ult i32 %9, 10
br i1 %10, label %45, label %11
11: ; preds = %8
%12 = tail call i32 @isalpha(i32 %3)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %45
14: ; preds = %11
%15 = tail call i32 @isspace(i32 %3)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %45
17: ; preds = %14
%18 = and i32 %0, 255
%19 = zext i32 %18 to i64
%20 = icmp ugt i32 %18, 63
%21 = shl nuw i64 1, %19
%22 = and i64 %21, 288388705826111489
%23 = icmp eq i64 %22, 0
%24 = select i1 %20, i1 true, i1 %23
br i1 %24, label %25, label %45
25: ; preds = %17
%26 = and i64 %21, -9223372028264841215
%27 = icmp eq i64 %26, 0
%28 = select i1 %20, i1 true, i1 %27
br i1 %28, label %29, label %45
29: ; preds = %25
%30 = icmp eq i32 %2, 771751936
br i1 %30, label %45, label %31
31: ; preds = %29
%32 = tail call i8* @memchr(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %3, i64 5)
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %45
34: ; preds = %31
%35 = tail call i8* @memchr(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %3, i64 6)
%36 = icmp eq i8* %35, null
br i1 %36, label %37, label %45
37: ; preds = %34
%38 = tail call i8* @memchr(i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %3, i64 3)
%39 = icmp eq i8* %38, null
br i1 %39, label %40, label %45
40: ; preds = %37
%41 = icmp eq i32 %2, 603979776
%42 = select i1 %41, i8 33, i8 42
%43 = icmp eq i32 %2, 620756992
%44 = select i1 %43, i8 64, i8 %42
br label %45
45: ; preds = %40, %37, %34, %31, %29, %25, %17, %14, %11, %8, %6, %1
%46 = phi i8 [ 72, %1 ], [ 35, %6 ], [ 78, %8 ], [ 69, %11 ], [ 83, %14 ], [ 44, %17 ], [ 63, %25 ], [ 46, %29 ], [ 79, %31 ], [ 67, %34 ], [ 45, %37 ], [ %44, %40 ]
ret i8 %46
}