const char *firetalk_nhtmlentities(const char *str, int len) {
  static char buf[1024];
  int i, b = 0;
  for (i = 0;
       (str[i] != 0) && (b < sizeof(buf) - 6 - 1) && ((len < 0) || (i < len));
       i++)
    switch (str[i]) {
    case '<':
      buf[b++] = '&';
      buf[b++] = 'l';
      buf[b++] = 't';
      buf[b++] = ';';
      break;
    case '>':
      buf[b++] = '&';
      buf[b++] = 'g';
      buf[b++] = 't';
      buf[b++] = ';';
      break;
    case '&':
      buf[b++] = '&';
      buf[b++] = 'a';
      buf[b++] = 'm';
      buf[b++] = 'p';
      buf[b++] = ';';
      break;
    case '"':
      buf[b++] = '&';
      buf[b++] = 'q';
      buf[b++] = 'u';
      buf[b++] = 'o';
      buf[b++] = 't';
      buf[b++] = ';';
      break;
    case '\n':
      buf[b++] = '<';
      buf[b++] = 'b';
      buf[b++] = 'r';
      buf[b++] = '>';
      break;
    default:
      buf[b++] = str[i];
      break;
    }
  buf[b] = 0;
  return (buf);
}


x86 assembly (clang, -O0):
<firetalk_nhtmlentities>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     116a <firetalk_nhtmlentities+0x6a>
movslq -0x14(%rbp),%rcx
xor    %eax,%eax
cmp    $0x3f9,%rcx
mov    %al,-0x15(%rbp)
jae    116a <firetalk_nhtmlentities+0x6a>
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x16(%rbp)
jl     1164 <firetalk_nhtmlentities+0x64>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    117a <firetalk_nhtmlentities+0x7a>
jmp    1469 <firetalk_nhtmlentities+0x369>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x1c(%rbp)
sub    $0xa,%eax
je     13ca <firetalk_nhtmlentities+0x2ca>
jmp    1197 <firetalk_nhtmlentities+0x97>
mov    -0x1c(%rbp),%eax
sub    $0x22,%eax
je     132f <firetalk_nhtmlentities+0x22f>
jmp    11a8 <firetalk_nhtmlentities+0xa8>
mov    -0x1c(%rbp),%eax
sub    $0x26,%eax
je     12ad <firetalk_nhtmlentities+0x1ad>
jmp    11b9 <firetalk_nhtmlentities+0xb9>
mov    -0x1c(%rbp),%eax
sub    $0x3c,%eax
je     11db <firetalk_nhtmlentities+0xdb>
jmp    11ca <firetalk_nhtmlentities+0xca>
mov    -0x1c(%rbp),%eax
sub    $0x3e,%eax
je     1244 <firetalk_nhtmlentities+0x144>
jmp    1433 <firetalk_nhtmlentities+0x333>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2e40(%rip),%rax
movb   $0x26,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2e27(%rip),%rax
movb   $0x6c,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2e0e(%rip),%rax
movb   $0x74,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2df5(%rip),%rax
movb   $0x3b,(%rax,%rcx,1)
jmp    1456 <firetalk_nhtmlentities+0x356>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2dd7(%rip),%rax
movb   $0x26,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2dbe(%rip),%rax
movb   $0x67,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2da5(%rip),%rax
movb   $0x74,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2d8c(%rip),%rax
movb   $0x3b,(%rax,%rcx,1)
jmp    1456 <firetalk_nhtmlentities+0x356>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2d6e(%rip),%rax
movb   $0x26,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2d55(%rip),%rax
movb   $0x61,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2d3c(%rip),%rax
movb   $0x6d,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2d23(%rip),%rax
movb   $0x70,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2d0a(%rip),%rax
movb   $0x3b,(%rax,%rcx,1)
jmp    1456 <firetalk_nhtmlentities+0x356>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2cec(%rip),%rax
movb   $0x26,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2cd3(%rip),%rax
movb   $0x71,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2cba(%rip),%rax
movb   $0x75,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2ca1(%rip),%rax
movb   $0x6f,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2c88(%rip),%rax
movb   $0x74,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2c6f(%rip),%rax
movb   $0x3b,(%rax,%rcx,1)
jmp    1456 <firetalk_nhtmlentities+0x356>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2c51(%rip),%rax
movb   $0x3c,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2c38(%rip),%rax
movb   $0x62,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2c1f(%rip),%rax
movb   $0x72,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2c06(%rip),%rax
movb   $0x3e,(%rax,%rcx,1)
jmp    1456 <firetalk_nhtmlentities+0x356>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2bdd(%rip),%rax
mov    %dl,(%rax,%rcx,1)
jmp    145b <firetalk_nhtmlentities+0x35b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <firetalk_nhtmlentities+0x19>
movslq -0x14(%rbp),%rcx
lea    0x2bbc(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2bb1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<firetalk_nhtmlentities>:
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1206 <firetalk_nhtmlentities+0x106>
movslq %esi,%r8
xor    %edx,%edx
lea    0x2f17(%rip),%r10
lea    0xee0(%rip),%r9
xor    %r14d,%r14d
xor    %r11d,%r11d
cs nopw 0x0(%rax,%rax,1)
test   %esi,%esi
js     113d <firetalk_nhtmlentities+0x3d>
cmp    %r8,%rdx
jge    1209 <firetalk_nhtmlentities+0x109>
movsbl %al,%ebx
lea    -0x22(%rbx),%ecx
cmp    $0x1c,%ecx
ja     1170 <firetalk_nhtmlentities+0x70>
movslq (%r9,%rcx,4),%rcx
add    %r9,%rcx
jmp    *%rcx
mov    %r11d,%eax
movb   $0x26,(%r14,%r10,1)
movl   $0x746f7571,0x1(%rax,%r10,1)
6f 74
lea    0x5(%r11),%r14d
add    $0x6,%r11d
jmp    11e1 <firetalk_nhtmlentities+0xe1>
nopl   0x0(%rax)
cmp    $0xa,%ebx
jne    1191 <firetalk_nhtmlentities+0x91>
mov    %r11d,%eax
movb   $0x3c,(%r14,%r10,1)
movw   $0x7262,0x1(%rax,%r10,1)
72
lea    0x3(%r11),%r14d
add    $0x4,%r11d
mov    $0x3e,%al
jmp    11e3 <firetalk_nhtmlentities+0xe3>
add    $0x1,%r11d
jmp    11e3 <firetalk_nhtmlentities+0xe3>
mov    %r11d,%eax
movb   $0x26,(%r14,%r10,1)
movw   $0x6d61,0x1(%rax,%r10,1)
6d
lea    0x4(%r11),%r14d
movb   $0x70,0x3(%rax,%r10,1)
add    $0x5,%r11d
jmp    11e1 <firetalk_nhtmlentities+0xe1>
mov    %r11d,%eax
movb   $0x26,(%r14,%r10,1)
movw   $0x746c,0x1(%rax,%r10,1)
74
jmp    11d9 <firetalk_nhtmlentities+0xd9>
mov    %r11d,%eax
movb   $0x26,(%r14,%r10,1)
movw   $0x7467,0x1(%rax,%r10,1)
74
lea    0x3(%r11),%r14d
add    $0x4,%r11d
mov    $0x3b,%al
mov    %al,(%r14,%r10,1)
movzbl 0x1(%rdi,%rdx,1),%eax
test   %al,%al
je     1209 <firetalk_nhtmlentities+0x109>
add    $0x1,%rdx
mov    %r11d,%r14d
cmp    $0x3f9,%r11d
jb     1130 <firetalk_nhtmlentities+0x30>
jmp    1209 <firetalk_nhtmlentities+0x109>
xor    %r11d,%r11d
mov    %r11d,%ecx
lea    0x2e1d(%rip),%rax
movb   $0x0,(%rcx,%rax,1)
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@firetalk_nhtmlentities.buf = internal global [1024 x i8] zeroinitializer
define i8* @firetalk_nhtmlentities(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %145, %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %7
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = icmp ult i64 %17, 1017
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 0
br i1 %21, label %26, label %22
22: ; preds = %19
%23 = load i32, i32* %5
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br label %26
26: ; preds = %22, %19
%27 = phi i1 [ true, %19 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %15, %7
%29 = phi i1 [ false, %15 ], [ false, %7 ], [ %27, %26 ]
br i1 %29, label %30, label %148
30: ; preds = %28
%31 = load i8*, i8** %3
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
switch i32 %36, label %134 [
i32 60, label %37
i32 62, label %54
i32 38, label %71
i32 34, label %92
i32 10, label %117
]
37: ; preds = %30
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
%40 = sext i32 %38 to i64
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %40
store i8 38, i8* %41
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
%44 = sext i32 %42 to i64
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %44
store i8 108, i8* %45
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
%48 = sext i32 %46 to i64
%49 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %48
store i8 116, i8* %49
%50 = load i32, i32* %6
%51 = add nsw i32 %50, 1
store i32 %51, i32* %6
%52 = sext i32 %50 to i64
%53 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %52
store i8 59, i8* %53
br label %144
54: ; preds = %30
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 1
store i32 %56, i32* %6
%57 = sext i32 %55 to i64
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %57
store i8 38, i8* %58
%59 = load i32, i32* %6
%60 = add nsw i32 %59, 1
store i32 %60, i32* %6
%61 = sext i32 %59 to i64
%62 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %61
store i8 103, i8* %62
%63 = load i32, i32* %6
%64 = add nsw i32 %63, 1
store i32 %64, i32* %6
%65 = sext i32 %63 to i64
%66 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %65
store i8 116, i8* %66
%67 = load i32, i32* %6
%68 = add nsw i32 %67, 1
store i32 %68, i32* %6
%69 = sext i32 %67 to i64
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %69
store i8 59, i8* %70
br label %144
71: ; preds = %30
%72 = load i32, i32* %6
%73 = add nsw i32 %72, 1
store i32 %73, i32* %6
%74 = sext i32 %72 to i64
%75 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %74
store i8 38, i8* %75
%76 = load i32, i32* %6
%77 = add nsw i32 %76, 1
store i32 %77, i32* %6
%78 = sext i32 %76 to i64
%79 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %78
store i8 97, i8* %79
%80 = load i32, i32* %6
%81 = add nsw i32 %80, 1
store i32 %81, i32* %6
%82 = sext i32 %80 to i64
%83 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %82
store i8 109, i8* %83
%84 = load i32, i32* %6
%85 = add nsw i32 %84, 1
store i32 %85, i32* %6
%86 = sext i32 %84 to i64
%87 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %86
store i8 112, i8* %87
%88 = load i32, i32* %6
%89 = add nsw i32 %88, 1
store i32 %89, i32* %6
%90 = sext i32 %88 to i64
%91 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %90
store i8 59, i8* %91
br label %144
92: ; preds = %30
%93 = load i32, i32* %6
%94 = add nsw i32 %93, 1
store i32 %94, i32* %6
%95 = sext i32 %93 to i64
%96 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %95
store i8 38, i8* %96
%97 = load i32, i32* %6
%98 = add nsw i32 %97, 1
store i32 %98, i32* %6
%99 = sext i32 %97 to i64
%100 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %99
store i8 113, i8* %100
%101 = load i32, i32* %6
%102 = add nsw i32 %101, 1
store i32 %102, i32* %6
%103 = sext i32 %101 to i64
%104 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %103
store i8 117, i8* %104
%105 = load i32, i32* %6
%106 = add nsw i32 %105, 1
store i32 %106, i32* %6
%107 = sext i32 %105 to i64
%108 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %107
store i8 111, i8* %108
%109 = load i32, i32* %6
%110 = add nsw i32 %109, 1
store i32 %110, i32* %6
%111 = sext i32 %109 to i64
%112 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %111
store i8 116, i8* %112
%113 = load i32, i32* %6
%114 = add nsw i32 %113, 1
store i32 %114, i32* %6
%115 = sext i32 %113 to i64
%116 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %115
store i8 59, i8* %116
br label %144
117: ; preds = %30
%118 = load i32, i32* %6
%119 = add nsw i32 %118, 1
store i32 %119, i32* %6
%120 = sext i32 %118 to i64
%121 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %120
store i8 60, i8* %121
%122 = load i32, i32* %6
%123 = add nsw i32 %122, 1
store i32 %123, i32* %6
%124 = sext i32 %122 to i64
%125 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %124
store i8 98, i8* %125
%126 = load i32, i32* %6
%127 = add nsw i32 %126, 1
store i32 %127, i32* %6
%128 = sext i32 %126 to i64
%129 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %128
store i8 114, i8* %129
%130 = load i32, i32* %6
%131 = add nsw i32 %130, 1
store i32 %131, i32* %6
%132 = sext i32 %130 to i64
%133 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %132
store i8 62, i8* %133
br label %144
134: ; preds = %30
%135 = load i8*, i8** %3
%136 = load i32, i32* %5
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i8, i8* %135, i64 %137
%139 = load i8, i8* %138
%140 = load i32, i32* %6
%141 = add nsw i32 %140, 1
store i32 %141, i32* %6
%142 = sext i32 %140 to i64
%143 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %142
store i8 %139, i8* %143
br label %144
144: ; preds = %134, %117, %92, %71, %54, %37
br label %145
145: ; preds = %144
%146 = load i32, i32* %5
%147 = add nsw i32 %146, 1
store i32 %147, i32* %5
br label %7
148: ; preds = %28
%149 = load i32, i32* %6
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %150
store i8 0, i8* %151
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@firetalk_nhtmlentities.buf = internal global [1024 x i8] zeroinitializer
define i8* @firetalk_nhtmlentities(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %95, label %5
5: ; preds = %2
%6 = icmp slt i32 %1, 0
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %5, %83
%9 = phi i64 [ 0, %5 ], [ %88, %83 ]
%10 = phi i64 [ 0, %5 ], [ %92, %83 ]
%11 = phi i8 [ %3, %5 ], [ %90, %83 ]
%12 = phi i32 [ 0, %5 ], [ %86, %83 ]
%13 = icmp slt i64 %9, %7
%14 = select i1 %6, i1 true, i1 %13
br i1 %14, label %15, label %95
15: ; preds = %8
%16 = sext i8 %11 to i32
switch i32 %16, label %81 [
i32 60, label %17
i32 62, label %28
i32 38, label %39
i32 34, label %53
i32 10, label %70
]
17: ; preds = %15
%18 = add nuw nsw i32 %12, 1
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %10
store i8 38, i8* %19
%20 = add nuw nsw i32 %12, 2
%21 = zext i32 %18 to i64
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %21
store i8 108, i8* %22
%23 = add nuw nsw i32 %12, 3
%24 = zext i32 %20 to i64
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %24
store i8 116, i8* %25
%26 = add nuw nsw i32 %12, 4
%27 = zext i32 %23 to i64
br label %83
28: ; preds = %15
%29 = add nuw nsw i32 %12, 1
%30 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %10
store i8 38, i8* %30
%31 = add nuw nsw i32 %12, 2
%32 = zext i32 %29 to i64
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %32
store i8 103, i8* %33
%34 = add nuw nsw i32 %12, 3
%35 = zext i32 %31 to i64
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %35
store i8 116, i8* %36
%37 = add nuw nsw i32 %12, 4
%38 = zext i32 %34 to i64
br label %83
39: ; preds = %15
%40 = add nuw nsw i32 %12, 1
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %10
store i8 38, i8* %41
%42 = add nuw nsw i32 %12, 2
%43 = zext i32 %40 to i64
%44 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %43
store i8 97, i8* %44
%45 = add nuw nsw i32 %12, 3
%46 = zext i32 %42 to i64
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %46
store i8 109, i8* %47
%48 = add nuw nsw i32 %12, 4
%49 = zext i32 %45 to i64
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %49
store i8 112, i8* %50
%51 = add nuw nsw i32 %12, 5
%52 = zext i32 %48 to i64
br label %83
53: ; preds = %15
%54 = add nuw nsw i32 %12, 1
%55 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %10
store i8 38, i8* %55
%56 = add nuw nsw i32 %12, 2
%57 = zext i32 %54 to i64
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %57
store i8 113, i8* %58
%59 = add nuw nsw i32 %12, 3
%60 = zext i32 %56 to i64
%61 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %60
store i8 117, i8* %61
%62 = add nuw nsw i32 %12, 4
%63 = zext i32 %59 to i64
%64 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %63
store i8 111, i8* %64
%65 = add nuw nsw i32 %12, 5
%66 = zext i32 %62 to i64
%67 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %66
store i8 116, i8* %67
%68 = add nuw nsw i32 %12, 6
%69 = zext i32 %65 to i64
br label %83
70: ; preds = %15
%71 = add nuw nsw i32 %12, 1
%72 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %10
store i8 60, i8* %72
%73 = add nuw nsw i32 %12, 2
%74 = zext i32 %71 to i64
%75 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %74
store i8 98, i8* %75
%76 = add nuw nsw i32 %12, 3
%77 = zext i32 %73 to i64
%78 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %77
store i8 114, i8* %78
%79 = add nuw nsw i32 %12, 4
%80 = zext i32 %76 to i64
br label %83
81: ; preds = %15
%82 = add nuw nsw i32 %12, 1
br label %83
83: ; preds = %17, %28, %39, %53, %70, %81
%84 = phi i64 [ %27, %17 ], [ %38, %28 ], [ %52, %39 ], [ %69, %53 ], [ %80, %70 ], [ %10, %81 ]
%85 = phi i8 [ 59, %17 ], [ 59, %28 ], [ 59, %39 ], [ 59, %53 ], [ 62, %70 ], [ %11, %81 ]
%86 = phi i32 [ %26, %17 ], [ %37, %28 ], [ %51, %39 ], [ %68, %53 ], [ %79, %70 ], [ %82, %81 ]
%87 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %84
store i8 %85, i8* %87
%88 = add nuw i64 %9, 1
%89 = getelementptr inbounds i8, i8* %0, i64 %88
%90 = load i8, i8* %89
%91 = icmp ne i8 %90, 0
%92 = zext i32 %86 to i64
%93 = icmp ult i32 %86, 1017
%94 = select i1 %91, i1 %93, i1 false
br i1 %94, label %8, label %95
95: ; preds = %8, %83, %2
%96 = phi i32 [ 0, %2 ], [ %86, %83 ], [ %12, %8 ]
%97 = zext i32 %96 to i64
%98 = getelementptr inbounds [1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 %97
store i8 0, i8* %98
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @firetalk_nhtmlentities.buf, i64 0, i64 0)
}