type(p) register char *p;
{
  char *firstbl;
  static char lasthdr = 1;
  if ((*p == ' ' || *p == '\t') && lasthdr)
    return 006;
  firstbl = any(p, " \t");
  while (*p == ' ' || *p == '?' || *p == '\t')
    ++p;
  if (*p == '\n' || *p == 0)
    return 004;
  if (((*(p) != *(">From")) ? (*(p) - *(">From")) : strncmp(p, ">From", 5)) ==
          0 ||
      ((*(p) != *("From")) ? (*(p) - *("From")) : strncmp(p, "From", 4)) == 0)
    return 001;
  if (((*(p) != *("Subj")) ? (*(p) - *("Subj")) : strncmp(p, "Subj", 4)) == 0 ||
      ((*(p) != *("Re:")) ? (*(p) - *("Re:")) : strncmp(p, "Re:", 3)) == 0 ||
      ((*(p) != *("re:")) ? (*(p) - *("re:")) : strncmp(p, "re:", 3)) == 0)
    return 002;
  if (((*(p) != *("To")) ? (*(p) - *("To")) : strncmp(p, "To", 2)) == 0)
    return 003;
  if (((*(p) != *("\1\1\1\1")) ? (*(p) - *("\1\1\1\1"))
                               : strncmp(p, "\1\1\1\1", 4)) == 0)
    return 005;
  if (firstbl && firstbl[-1] == ':' && isalpha(*p))
    return 006;
  lasthdr = 0;
  return 007;
}


x86 assembly (clang, -O0):
<type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     115c <type+0x2c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    1178 <type+0x48>
movsbl 0x2ed5(%rip),%eax
cmp    $0x0,%eax
je     1178 <type+0x48>
movl   $0x6,-0x4(%rbp)
jmp    14d0 <type+0x3a0>
mov    -0x10(%rbp),%rdi
lea    0xe7d(%rip),%rsi
mov    $0x0,%al
call   1050 <any@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x19(%rbp)
je     11ca <type+0x9a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x3f,%ecx
mov    %al,-0x19(%rbp)
je     11ca <type+0x9a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    11da <type+0xaa>
jmp    11eb <type+0xbb>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1190 <type+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     120b <type+0xdb>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1217 <type+0xe7>
movl   $0x4,-0x4(%rbp)
jmp    14d0 <type+0x3a0>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xdde(%rip),%ecx
cmp    %ecx,%eax
je     1245 <type+0x115>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xdc8(%rip),%ecx
sub    %ecx,%eax
mov    %eax,-0x20(%rbp)
jmp    125d <type+0x12d>
mov    -0x10(%rbp),%rdi
lea    0xdb3(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    $0x0,%eax
je     12bb <type+0x18b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xd8d(%rip),%ecx
cmp    %ecx,%eax
je     1297 <type+0x167>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xd77(%rip),%ecx
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
jmp    12af <type+0x17f>
mov    -0x10(%rbp),%rdi
lea    0xd62(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    $0x0,%eax
jne    12c7 <type+0x197>
movl   $0x1,-0x4(%rbp)
jmp    14d0 <type+0x3a0>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xd34(%rip),%ecx
cmp    %ecx,%eax
je     12f5 <type+0x1c5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xd1e(%rip),%ecx
sub    %ecx,%eax
mov    %eax,-0x28(%rbp)
jmp    130d <type+0x1dd>
mov    -0x10(%rbp),%rdi
lea    0xd09(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    $0x0,%eax
je     13bd <type+0x28d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xce7(%rip),%ecx
cmp    %ecx,%eax
je     1347 <type+0x217>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xcd1(%rip),%ecx
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
jmp    135f <type+0x22f>
mov    -0x10(%rbp),%rdi
lea    0xcbc(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    $0x0,%eax
je     13bd <type+0x28d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xc99(%rip),%ecx
cmp    %ecx,%eax
je     1399 <type+0x269>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xc83(%rip),%ecx
sub    %ecx,%eax
mov    %eax,-0x30(%rbp)
jmp    13b1 <type+0x281>
mov    -0x10(%rbp),%rdi
lea    0xc6e(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    $0x0,%eax
jne    13c9 <type+0x299>
movl   $0x2,-0x4(%rbp)
jmp    14d0 <type+0x3a0>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xc3f(%rip),%ecx
cmp    %ecx,%eax
je     13f7 <type+0x2c7>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xc29(%rip),%ecx
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
jmp    140f <type+0x2df>
mov    -0x10(%rbp),%rdi
lea    0xc14(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    $0x0,%eax
jne    1427 <type+0x2f7>
movl   $0x3,-0x4(%rbp)
jmp    14d0 <type+0x3a0>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xbe4(%rip),%ecx
cmp    %ecx,%eax
je     1455 <type+0x325>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl 0xbce(%rip),%ecx
sub    %ecx,%eax
mov    %eax,-0x38(%rbp)
jmp    146d <type+0x33d>
mov    -0x10(%rbp),%rdi
lea    0xbb9(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    $0x0,%eax
jne    1485 <type+0x355>
movl   $0x5,-0x4(%rbp)
jmp    14d0 <type+0x3a0>
cmpq   $0x0,-0x18(%rbp)
je     14c2 <type+0x392>
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x3a,%eax
jne    14c2 <type+0x392>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%eax
je     14c2 <type+0x392>
movl   $0x6,-0x4(%rbp)
jmp    14d0 <type+0x3a0>
movb   $0x0,0x2b6f(%rip)
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<type>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
cmp    $0x20,%al
jne    1150 <type+0x20>
mov    $0x6,%eax
cmpb   $0x1,0x2ef0(%rip)
je     1166 <type+0x36>
jmp    12ee <type+0x1be>
cmp    $0x9,%al
jne    1166 <type+0x36>
mov    $0x6,%eax
testb  $0x1,0x2ed9(%rip)
je     12ee <type+0x1be>
lea    0x105f(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <any@plt>
mov    %eax,%ebp
movslq %eax,%r14
lea    0xe7d(%rip),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%ecx
cmp    $0x72,%rcx
ja     11dd <type+0xad>
movslq (%rax,%rcx,4),%rdx
add    %rax,%rdx
jmp    *%rdx
add    $0x1,%rbx
jmp    1190 <type+0x60>
mov    $0x4,%eax
jmp    12ee <type+0x1be>
lea    0x102c(%rip),%rsi
mov    $0x4,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
mov    $0x1,%edi
test   %eax,%eax
jne    12c0 <type+0x190>
mov    $0x5,%eax
jmp    12ee <type+0x1be>
movsbl %cl,%edi
jmp    12b5 <type+0x185>
lea    0xfe3(%rip),%rsi
mov    $0x5,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
mov    $0x3e,%edi
test   %eax,%eax
jne    12b5 <type+0x185>
jmp    1229 <type+0xf9>
lea    0xfc1(%rip),%rsi
mov    $0x4,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
mov    $0x46,%edi
test   %eax,%eax
jne    12b5 <type+0x185>
mov    $0x1,%eax
jmp    12ee <type+0x1be>
lea    0xfa0(%rip),%rsi
mov    $0x3,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
mov    $0x52,%edi
test   %eax,%eax
jne    12b5 <type+0x185>
jmp    12e9 <type+0x1b9>
lea    0xf79(%rip),%rsi
mov    $0x4,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
mov    $0x53,%edi
test   %eax,%eax
jne    12b5 <type+0x185>
jmp    12e9 <type+0x1b9>
lea    0xf67(%rip),%rsi
mov    $0x2,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
mov    $0x54,%edi
test   %eax,%eax
jne    12b5 <type+0x185>
mov    $0x3,%eax
jmp    12ee <type+0x1be>
lea    0xf3f(%rip),%rsi
mov    $0x3,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
mov    $0x72,%edi
test   %eax,%eax
je     12e9 <type+0x1b9>
lea    -0x1(%rdi),%eax
test   %eax,%eax
je     11d3 <type+0xa3>
test   %ebp,%ebp
je     12db <type+0x1ab>
cmpb   $0x3a,-0x1(%r14)
jne    12db <type+0x1ab>
call   1040 <isalpha@plt>
mov    %eax,%ecx
mov    $0x6,%eax
test   %ecx,%ecx
jne    12ee <type+0x1be>
movb   $0x1,0x2d57(%rip)
mov    $0x7,%eax
jmp    12ee <type+0x1be>
mov    $0x2,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@type.lasthdr = internal global i8 1
@.str = [3 x i8] c" \09\00"
@.str.1 = [6 x i8] c">From\00"
@.str.2 = [5 x i8] c"From\00"
@.str.3 = [5 x i8] c"Subj\00"
@.str.4 = [4 x i8] c"Re:\00"
@.str.5 = [4 x i8] c"re:\00"
@.str.6 = [3 x i8] c"To\00"
@.str.7 = [5 x i8] c"\01\01\01\01\00"
define i32 @type(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 32
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 9
br i1 %13, label %14, label %19
14: ; preds = %9, %1
%15 = load i8, i8* @type.lasthdr
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 6, i32* %2
br label %216
19: ; preds = %14, %9
%20 = load i8*, i8** %3
%21 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @any to i32 (i8*, i8*, ...)*)(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i8*
store i8* %23, i8** %4
br label %24
24: ; preds = %41, %19
%25 = load i8*, i8** %3
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 32
br i1 %28, label %39, label %29
29: ; preds = %24
%30 = load i8*, i8** %3
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 63
br i1 %33, label %39, label %34
34: ; preds = %29
%35 = load i8*, i8** %3
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 9
br label %39
39: ; preds = %34, %29, %24
%40 = phi i1 [ true, %29 ], [ true, %24 ], [ %38, %34 ]
br i1 %40, label %41, label %44
41: ; preds = %39
%42 = load i8*, i8** %3
%43 = getelementptr inbounds i8, i8* %42, i32 1
store i8* %43, i8** %3
br label %24
44: ; preds = %39
%45 = load i8*, i8** %3
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 10
br i1 %48, label %54, label %49
49: ; preds = %44
%50 = load i8*, i8** %3
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %55
54: ; preds = %49, %44
store i32 4, i32* %2
br label %216
55: ; preds = %49
%56 = load i8*, i8** %3
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = load i8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%60 = sext i8 %59 to i32
%61 = icmp ne i32 %58, %60
br i1 %61, label %62, label %69
62: ; preds = %55
%63 = load i8*, i8** %3
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = load i8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%67 = sext i8 %66 to i32
%68 = sub nsw i32 %65, %67
br label %72
69: ; preds = %55
%70 = load i8*, i8** %3
%71 = call i32 @strncmp(i8* %70, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 5)
br label %72
72: ; preds = %69, %62
%73 = phi i32 [ %68, %62 ], [ %71, %69 ]
%74 = icmp eq i32 %73, 0
br i1 %74, label %95, label %75
75: ; preds = %72
%76 = load i8*, i8** %3
%77 = load i8, i8* %76
%78 = sext i8 %77 to i32
%79 = load i8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%80 = sext i8 %79 to i32
%81 = icmp ne i32 %78, %80
br i1 %81, label %82, label %89
82: ; preds = %75
%83 = load i8*, i8** %3
%84 = load i8, i8* %83
%85 = sext i8 %84 to i32
%86 = load i8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%87 = sext i8 %86 to i32
%88 = sub nsw i32 %85, %87
br label %92
89: ; preds = %75
%90 = load i8*, i8** %3
%91 = call i32 @strncmp(i8* %90, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 4)
br label %92
92: ; preds = %89, %82
%93 = phi i32 [ %88, %82 ], [ %91, %89 ]
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %96
95: ; preds = %92, %72
store i32 1, i32* %2
br label %216
96: ; preds = %92
%97 = load i8*, i8** %3
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = load i8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%101 = sext i8 %100 to i32
%102 = icmp ne i32 %99, %101
br i1 %102, label %103, label %110
103: ; preds = %96
%104 = load i8*, i8** %3
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = load i8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%108 = sext i8 %107 to i32
%109 = sub nsw i32 %106, %108
br label %113
110: ; preds = %96
%111 = load i8*, i8** %3
%112 = call i32 @strncmp(i8* %111, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 4)
br label %113
113: ; preds = %110, %103
%114 = phi i32 [ %109, %103 ], [ %112, %110 ]
%115 = icmp eq i32 %114, 0
br i1 %115, label %156, label %116
116: ; preds = %113
%117 = load i8*, i8** %3
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0)
%121 = sext i8 %120 to i32
%122 = icmp ne i32 %119, %121
br i1 %122, label %123, label %130
123: ; preds = %116
%124 = load i8*, i8** %3
%125 = load i8, i8* %124
%126 = sext i8 %125 to i32
%127 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0)
%128 = sext i8 %127 to i32
%129 = sub nsw i32 %126, %128
br label %133
130: ; preds = %116
%131 = load i8*, i8** %3
%132 = call i32 @strncmp(i8* %131, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64 3)
br label %133
133: ; preds = %130, %123
%134 = phi i32 [ %129, %123 ], [ %132, %130 ]
%135 = icmp eq i32 %134, 0
br i1 %135, label %156, label %136
136: ; preds = %133
%137 = load i8*, i8** %3
%138 = load i8, i8* %137
%139 = sext i8 %138 to i32
%140 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0)
%141 = sext i8 %140 to i32
%142 = icmp ne i32 %139, %141
br i1 %142, label %143, label %150
143: ; preds = %136
%144 = load i8*, i8** %3
%145 = load i8, i8* %144
%146 = sext i8 %145 to i32
%147 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0)
%148 = sext i8 %147 to i32
%149 = sub nsw i32 %146, %148
br label %153
150: ; preds = %136
%151 = load i8*, i8** %3
%152 = call i32 @strncmp(i8* %151, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64 3)
br label %153
153: ; preds = %150, %143
%154 = phi i32 [ %149, %143 ], [ %152, %150 ]
%155 = icmp eq i32 %154, 0
br i1 %155, label %156, label %157
156: ; preds = %153, %133, %113
store i32 2, i32* %2
br label %216
157: ; preds = %153
%158 = load i8*, i8** %3
%159 = load i8, i8* %158
%160 = sext i8 %159 to i32
%161 = load i8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0)
%162 = sext i8 %161 to i32
%163 = icmp ne i32 %160, %162
br i1 %163, label %164, label %171
164: ; preds = %157
%165 = load i8*, i8** %3
%166 = load i8, i8* %165
%167 = sext i8 %166 to i32
%168 = load i8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0)
%169 = sext i8 %168 to i32
%170 = sub nsw i32 %167, %169
br label %174
171: ; preds = %157
%172 = load i8*, i8** %3
%173 = call i32 @strncmp(i8* %172, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i64 2)
br label %174
174: ; preds = %171, %164
%175 = phi i32 [ %170, %164 ], [ %173, %171 ]
%176 = icmp eq i32 %175, 0
br i1 %176, label %177, label %178
177: ; preds = %174
store i32 3, i32* %2
br label %216
178: ; preds = %174
%179 = load i8*, i8** %3
%180 = load i8, i8* %179
%181 = sext i8 %180 to i32
%182 = load i8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%183 = sext i8 %182 to i32
%184 = icmp ne i32 %181, %183
br i1 %184, label %185, label %192
185: ; preds = %178
%186 = load i8*, i8** %3
%187 = load i8, i8* %186
%188 = sext i8 %187 to i32
%189 = load i8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%190 = sext i8 %189 to i32
%191 = sub nsw i32 %188, %190
br label %195
192: ; preds = %178
%193 = load i8*, i8** %3
%194 = call i32 @strncmp(i8* %193, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i64 4)
br label %195
195: ; preds = %192, %185
%196 = phi i32 [ %191, %185 ], [ %194, %192 ]
%197 = icmp eq i32 %196, 0
br i1 %197, label %198, label %199
198: ; preds = %195
store i32 5, i32* %2
br label %216
199: ; preds = %195
%200 = load i8*, i8** %4
%201 = icmp ne i8* %200, null
br i1 %201, label %202, label %215
202: ; preds = %199
%203 = load i8*, i8** %4
%204 = getelementptr inbounds i8, i8* %203, i64 -1
%205 = load i8, i8* %204
%206 = sext i8 %205 to i32
%207 = icmp eq i32 %206, 58
br i1 %207, label %208, label %215
208: ; preds = %202
%209 = load i8*, i8** %3
%210 = load i8, i8* %209
%211 = sext i8 %210 to i32
%212 = call i32 @isalpha(i32 %211)
%213 = icmp ne i32 %212, 0
br i1 %213, label %214, label %215
214: ; preds = %208
store i32 6, i32* %2
br label %216
215: ; preds = %208, %202, %199
store i8 0, i8* @type.lasthdr
store i32 7, i32* %2
br label %216
216: ; preds = %215, %214, %198, %177, %156, %95, %54, %18
%217 = load i32, i32* %2
ret i32 %217
}

LLVM IR (-O2):
@type.lasthdr = internal unnamed_addr global i1 false
@.str = [3 x i8] c" \09\00"
@.str.1 = [6 x i8] c">From\00"
@.str.2 = [5 x i8] c"From\00"
@.str.3 = [5 x i8] c"Subj\00"
@.str.4 = [4 x i8] c"Re:\00"
@.str.5 = [4 x i8] c"re:\00"
@.str.6 = [3 x i8] c"To\00"
@.str.7 = [5 x i8] c"\01\01\01\01\00"
define i32 @type(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 32
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = icmp eq i8 %2, 9
%6 = load i1, i1* @type.lasthdr
%7 = xor i1 %6, true
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %59, label %11
9: ; preds = %1
%10 = load i1, i1* @type.lasthdr
br i1 %10, label %11, label %59
11: ; preds = %9, %4
%12 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @any to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
br label %15
15: ; preds = %18, %11
%16 = phi i8* [ %0, %11 ], [ %19, %18 ]
%17 = load i8, i8* %16
switch i8 %17, label %38 [
i8 32, label %18
i8 63, label %18
i8 9, label %18
i8 10, label %59
i8 0, label %59
i8 62, label %20
i8 70, label %23
i8 83, label %26
i8 82, label %29
i8 114, label %32
i8 84, label %35
i8 1, label %43
]
18: ; preds = %15, %15, %15
%19 = getelementptr inbounds i8, i8* %16, i64 1
br label %15
20: ; preds = %15
%21 = tail call i32 @strncmp(i8* %16, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 5)
%22 = icmp eq i32 %21, 0
br i1 %22, label %59, label %40
23: ; preds = %15
%24 = tail call i32 @strncmp(i8* %16, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 4)
%25 = icmp eq i32 %24, 0
br i1 %25, label %59, label %40
26: ; preds = %15
%27 = tail call i32 @strncmp(i8* %16, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 4)
%28 = icmp eq i32 %27, 0
br i1 %28, label %59, label %40
29: ; preds = %15
%30 = tail call i32 @strncmp(i8* %16, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64 3)
%31 = icmp eq i32 %30, 0
br i1 %31, label %59, label %40
32: ; preds = %15
%33 = tail call i32 @strncmp(i8* %16, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64 3)
%34 = icmp eq i32 %33, 0
br i1 %34, label %59, label %40
35: ; preds = %15
%36 = tail call i32 @strncmp(i8* %16, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i64 2)
%37 = icmp eq i32 %36, 0
br i1 %37, label %59, label %40
38: ; preds = %15
%39 = sext i8 %17 to i32
br label %40
40: ; preds = %38, %32, %26, %20, %23, %29, %35
%41 = phi i32 [ %39, %38 ], [ 114, %32 ], [ 83, %26 ], [ 62, %20 ], [ 70, %23 ], [ 82, %29 ], [ 84, %35 ]
%42 = add nsw i32 %41, -1
br label %45
43: ; preds = %15
%44 = tail call i32 @strncmp(i8* %16, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i64 4)
br label %45
45: ; preds = %43, %40
%46 = phi i32 [ %41, %40 ], [ 1, %43 ]
%47 = phi i32 [ %42, %40 ], [ %44, %43 ]
%48 = icmp eq i32 %47, 0
br i1 %48, label %59, label %49
49: ; preds = %45
%50 = icmp eq i32 %12, 0
br i1 %50, label %58, label %51
51: ; preds = %49
%52 = getelementptr inbounds i8, i8* %14, i64 -1
%53 = load i8, i8* %52
%54 = icmp eq i8 %53, 58
br i1 %54, label %55, label %58
55: ; preds = %51
%56 = tail call i32 @isalpha(i32 %46)
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %59
58: ; preds = %55, %51, %49
store i1 true, i1* @type.lasthdr
br label %59
59: ; preds = %15, %15, %35, %32, %29, %26, %23, %20, %55, %45, %9, %4, %58
%60 = phi i32 [ 7, %58 ], [ 6, %4 ], [ 6, %9 ], [ 5, %45 ], [ 6, %55 ], [ 1, %20 ], [ 1, %23 ], [ 2, %26 ], [ 2, %29 ], [ 2, %32 ], [ 3, %35 ], [ 4, %15 ], [ 4, %15 ]
ret i32 %60
}