#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
char *strchr(char *, char);
int /*<<< orphan*/ strncmp(char *, char *, int);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
void zipc_xml_unescape(char *buffer) {
  char *inptr, *outptr;
  if ((inptr = strchr(buffer, '&')) == NULL)
    return;
  for (outptr = inptr; *inptr;) {
    if (*inptr == '&' && strchr(inptr + 1, ';')) {
      inptr++;
      if (!strncmp(inptr, "amp;", 4)) {
        inptr += 4;
        *outptr++ = '&';
      } else if (!strncmp(inptr, "lt;", 3)) {
        inptr += 3;
        *outptr++ = '<';
      } else if (!strncmp(inptr, "gt;", 3)) {
        inptr += 3;
        *outptr++ = '>';
      } else if (!strncmp(inptr, "quot;", 5)) {
        inptr += 5;
        *outptr++ = '\"';
      } else if (!strncmp(inptr, "apos;", 5)) {
        inptr += 5;
        *outptr++ = '\'';
      } else if (*inptr == '#') {
        int ch;
        inptr++;
        if (*inptr == 'x')
          ch = (int)strtol(inptr, NULL, 16);
        else
          ch = (int)strtol(inptr, NULL, 10);
        if (ch < 0x80) {
          *outptr++ = ch;
        } else if (ch < 0x800) {
          *outptr++ = 0xc0 | (ch >> 6);
          *outptr++ = 0x80 | (ch & 0x3f);
        } else if (ch < 0x10000) {
          *outptr++ = 0xe0 | (ch >> 12);
          *outptr++ = 0x80 | ((ch >> 6) & 0x3f);
          *outptr++ = 0x80 | (ch & 0x3f);
        } else {
          *outptr++ = 0xf0 | (ch >> 18);
          *outptr++ = 0x80 | ((ch >> 12) & 0x3f);
          *outptr++ = 0x80 | ((ch >> 6) & 0x3f);
          *outptr++ = 0x80 | (ch & 0x3f);
        }
        inptr = strchr(inptr, ';') + 1;
      } else {
        *outptr++ = '&';
      }
    } else {
      *outptr++ = *inptr++;
    }
  }
  *outptr = '\0';
}


x86 assembly (clang, -O0):
<zipc_xml_unescape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x26,%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115d <zipc_xml_unescape+0x2d>
jmp    1530 <zipc_xml_unescape+0x400>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1529 <zipc_xml_unescape+0x3f9>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x26,%eax
jne    1502 <zipc_xml_unescape+0x3d2>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    $0x3b,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     1502 <zipc_xml_unescape+0x3d2>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe4b(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11eb <zipc_xml_unescape+0xbb>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x26,(%rax)
jmp    14fd <zipc_xml_unescape+0x3cd>
mov    -0x10(%rbp),%rdi
lea    0xe0f(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    122c <zipc_xml_unescape+0xfc>
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x3c,(%rax)
jmp    14f8 <zipc_xml_unescape+0x3c8>
mov    -0x10(%rbp),%rdi
lea    0xdd2(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    126d <zipc_xml_unescape+0x13d>
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x3e,(%rax)
jmp    14f3 <zipc_xml_unescape+0x3c3>
mov    -0x10(%rbp),%rdi
lea    0xd95(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    12ae <zipc_xml_unescape+0x17e>
mov    -0x10(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x22,(%rax)
jmp    14ee <zipc_xml_unescape+0x3be>
mov    -0x10(%rbp),%rdi
lea    0xd5a(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    12ef <zipc_xml_unescape+0x1bf>
mov    -0x10(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x27,(%rax)
jmp    14e9 <zipc_xml_unescape+0x3b9>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    14d2 <zipc_xml_unescape+0x3a2>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x78,%eax
jne    1335 <zipc_xml_unescape+0x205>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1050 <strtol@plt>
mov    %eax,-0x1c(%rbp)
jmp    134a <zipc_xml_unescape+0x21a>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x80,-0x1c(%rbp)
jge    1372 <zipc_xml_unescape+0x242>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    14b7 <zipc_xml_unescape+0x387>
cmpl   $0x800,-0x1c(%rbp)
jge    13c0 <zipc_xml_unescape+0x290>
mov    -0x1c(%rbp),%eax
sar    $0x6,%eax
or     $0xc0,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    14b2 <zipc_xml_unescape+0x382>
cmpl   $0x10000,-0x1c(%rbp)
jge    142f <zipc_xml_unescape+0x2ff>
mov    -0x1c(%rbp),%eax
sar    $0xc,%eax
or     $0xe0,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
sar    $0x6,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    14ad <zipc_xml_unescape+0x37d>
mov    -0x1c(%rbp),%eax
sar    $0x12,%eax
or     $0xf0,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
sar    $0xc,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
sar    $0x6,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    14b2 <zipc_xml_unescape+0x382>
jmp    14b7 <zipc_xml_unescape+0x387>
mov    -0x10(%rbp),%rdi
mov    $0x3b,%esi
call   1040 <strchr@plt>
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    14e4 <zipc_xml_unescape+0x3b4>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x26,(%rax)
jmp    14e9 <zipc_xml_unescape+0x3b9>
jmp    14ee <zipc_xml_unescape+0x3be>
jmp    14f3 <zipc_xml_unescape+0x3c3>
jmp    14f8 <zipc_xml_unescape+0x3c8>
jmp    14fd <zipc_xml_unescape+0x3cd>
jmp    1524 <zipc_xml_unescape+0x3f4>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1165 <zipc_xml_unescape+0x35>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zipc_xml_unescape>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x26,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1382 <zipc_xml_unescape+0x252>
mov    %rax,%rbp
lea    0xea8(%rip),%rbx
lea    0xea6(%rip),%r14
mov    %rax,%r12
jmp    1185 <zipc_xml_unescape+0x55>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %r15b,%r15b
je     137d <zipc_xml_unescape+0x24d>
add    $0x1,%rbp
mov    %r15b,(%r12)
add    $0x1,%r12
movzbl 0x0(%rbp),%r15d
cmp    $0x26,%r15b
jne    1170 <zipc_xml_unescape+0x40>
lea    0x1(%rbp),%r13
mov    %r13,%rdi
mov    $0x3b,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1179 <zipc_xml_unescape+0x49>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1266 <zipc_xml_unescape+0x136>
mov    %r13,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1278 <zipc_xml_unescape+0x148>
mov    %r13,%rdi
lea    0xe29(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     128a <zipc_xml_unescape+0x15a>
mov    %r13,%rdi
lea    0xe11(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     129c <zipc_xml_unescape+0x16c>
mov    %r13,%rdi
lea    0xdfb(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     12ae <zipc_xml_unescape+0x17e>
cmpb   $0x23,0x0(%r13)
jne    12c0 <zipc_xml_unescape+0x190>
cmpb   $0x78,0x2(%rbp)
lea    0x2(%rbp),%rbp
mov    $0xa,%edx
mov    $0x10,%eax
cmove  %eax,%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1050 <strtol@plt>
cmp    $0x7f,%eax
jg     12d1 <zipc_xml_unescape+0x1a1>
mov    %al,(%r12)
add    $0x1,%r12
jmp    1364 <zipc_xml_unescape+0x234>
add    $0x5,%rbp
movb   $0x26,(%r12)
add    $0x1,%r12
jmp    1185 <zipc_xml_unescape+0x55>
add    $0x4,%rbp
movb   $0x3c,(%r12)
add    $0x1,%r12
jmp    1185 <zipc_xml_unescape+0x55>
add    $0x4,%rbp
movb   $0x3e,(%r12)
add    $0x1,%r12
jmp    1185 <zipc_xml_unescape+0x55>
add    $0x6,%rbp
movb   $0x22,(%r12)
add    $0x1,%r12
jmp    1185 <zipc_xml_unescape+0x55>
add    $0x6,%rbp
movb   $0x27,(%r12)
add    $0x1,%r12
jmp    1185 <zipc_xml_unescape+0x55>
movb   $0x26,(%r12)
add    $0x1,%r12
mov    %r13,%rbp
jmp    1185 <zipc_xml_unescape+0x55>
mov    %rax,%rcx
cmp    $0x7ff,%eax
ja     12f5 <zipc_xml_unescape+0x1c5>
shr    $0x6,%rcx
or     $0xc0,%cl
mov    %cl,(%r12)
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x1(%r12)
add    $0x2,%r12
jmp    1364 <zipc_xml_unescape+0x234>
cmp    $0xffff,%eax
ja     1328 <zipc_xml_unescape+0x1f8>
shr    $0xc,%rcx
or     $0xe0,%cl
mov    %cl,(%r12)
mov    %rax,%rcx
shr    $0x6,%rcx
and    $0x3f,%cl
or     $0x80,%cl
mov    %cl,0x1(%r12)
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x2(%r12)
add    $0x3,%r12
jmp    1364 <zipc_xml_unescape+0x234>
shr    $0x12,%rcx
or     $0xf0,%cl
mov    %cl,(%r12)
mov    %rax,%rcx
shr    $0xc,%rcx
and    $0x3f,%cl
or     $0x80,%cl
mov    %cl,0x1(%r12)
mov    %rax,%rcx
shr    $0x6,%rcx
and    $0x3f,%cl
or     $0x80,%cl
mov    %cl,0x2(%r12)
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x3(%r12)
add    $0x4,%r12
mov    %rbp,%rdi
mov    $0x3b,%esi
call   1040 <strchr@plt>
mov    %rax,%rbp
add    $0x1,%rbp
jmp    1185 <zipc_xml_unescape+0x55>
movb   $0x0,(%r12)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"amp;\00"
@.str.1 = [4 x i8] c"lt;\00"
@.str.2 = [4 x i8] c"gt;\00"
@.str.3 = [6 x i8] c"quot;\00"
@.str.4 = [6 x i8] c"apos;\00"
define void @zipc_xml_unescape(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @strchr(i8* %6, i8 signext 38)
store i8* %7, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
br label %191
10: ; preds = %1
%11 = load i8*, i8** %3
store i8* %11, i8** %4
br label %12
12: ; preds = %188, %10
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %189
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 38
br i1 %20, label %21, label %182
21: ; preds = %16
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = call i8* @strchr(i8* %23, i8 signext 59)
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %182
26: ; preds = %21
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
%29 = load i8*, i8** %3
%30 = call i32 @strncmp(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%31 = icmp ne i32 %30, 0
br i1 %31, label %37, label %32
32: ; preds = %26
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 4
store i8* %34, i8** %3
%35 = load i8*, i8** %4
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %4
store i8 38, i8* %35
br label %181
37: ; preds = %26
%38 = load i8*, i8** %3
%39 = call i32 @strncmp(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%40 = icmp ne i32 %39, 0
br i1 %40, label %46, label %41
41: ; preds = %37
%42 = load i8*, i8** %3
%43 = getelementptr inbounds i8, i8* %42, i64 3
store i8* %43, i8** %3
%44 = load i8*, i8** %4
%45 = getelementptr inbounds i8, i8* %44, i32 1
store i8* %45, i8** %4
store i8 60, i8* %44
br label %180
46: ; preds = %37
%47 = load i8*, i8** %3
%48 = call i32 @strncmp(i8* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%49 = icmp ne i32 %48, 0
br i1 %49, label %55, label %50
50: ; preds = %46
%51 = load i8*, i8** %3
%52 = getelementptr inbounds i8, i8* %51, i64 3
store i8* %52, i8** %3
%53 = load i8*, i8** %4
%54 = getelementptr inbounds i8, i8* %53, i32 1
store i8* %54, i8** %4
store i8 62, i8* %53
br label %179
55: ; preds = %46
%56 = load i8*, i8** %3
%57 = call i32 @strncmp(i8* %56, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 5)
%58 = icmp ne i32 %57, 0
br i1 %58, label %64, label %59
59: ; preds = %55
%60 = load i8*, i8** %3
%61 = getelementptr inbounds i8, i8* %60, i64 5
store i8* %61, i8** %3
%62 = load i8*, i8** %4
%63 = getelementptr inbounds i8, i8* %62, i32 1
store i8* %63, i8** %4
store i8 34, i8* %62
br label %178
64: ; preds = %55
%65 = load i8*, i8** %3
%66 = call i32 @strncmp(i8* %65, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 5)
%67 = icmp ne i32 %66, 0
br i1 %67, label %73, label %68
68: ; preds = %64
%69 = load i8*, i8** %3
%70 = getelementptr inbounds i8, i8* %69, i64 5
store i8* %70, i8** %3
%71 = load i8*, i8** %4
%72 = getelementptr inbounds i8, i8* %71, i32 1
store i8* %72, i8** %4
store i8 39, i8* %71
br label %177
73: ; preds = %64
%74 = load i8*, i8** %3
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp eq i32 %76, 35
br i1 %77, label %78, label %173
78: ; preds = %73
%79 = load i8*, i8** %3
%80 = getelementptr inbounds i8, i8* %79, i32 1
store i8* %80, i8** %3
%81 = load i8*, i8** %3
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 120
br i1 %84, label %85, label %89
85: ; preds = %78
%86 = load i8*, i8** %3
%87 = call i64 @strtol(i8* %86, i32* null, i32 16)
%88 = trunc i64 %87 to i32
store i32 %88, i32* %5
br label %93
89: ; preds = %78
%90 = load i8*, i8** %3
%91 = call i64 @strtol(i8* %90, i32* null, i32 10)
%92 = trunc i64 %91 to i32
store i32 %92, i32* %5
br label %93
93: ; preds = %89, %85
%94 = load i32, i32* %5
%95 = icmp slt i32 %94, 128
br i1 %95, label %96, label %101
96: ; preds = %93
%97 = load i32, i32* %5
%98 = trunc i32 %97 to i8
%99 = load i8*, i8** %4
%100 = getelementptr inbounds i8, i8* %99, i32 1
store i8* %100, i8** %4
store i8 %98, i8* %99
br label %169
101: ; preds = %93
%102 = load i32, i32* %5
%103 = icmp slt i32 %102, 2048
br i1 %103, label %104, label %117
104: ; preds = %101
%105 = load i32, i32* %5
%106 = ashr i32 %105, 6
%107 = or i32 192, %106
%108 = trunc i32 %107 to i8
%109 = load i8*, i8** %4
%110 = getelementptr inbounds i8, i8* %109, i32 1
store i8* %110, i8** %4
store i8 %108, i8* %109
%111 = load i32, i32* %5
%112 = and i32 %111, 63
%113 = or i32 128, %112
%114 = trunc i32 %113 to i8
%115 = load i8*, i8** %4
%116 = getelementptr inbounds i8, i8* %115, i32 1
store i8* %116, i8** %4
store i8 %114, i8* %115
br label %168
117: ; preds = %101
%118 = load i32, i32* %5
%119 = icmp slt i32 %118, 65536
br i1 %119, label %120, label %140
120: ; preds = %117
%121 = load i32, i32* %5
%122 = ashr i32 %121, 12
%123 = or i32 224, %122
%124 = trunc i32 %123 to i8
%125 = load i8*, i8** %4
%126 = getelementptr inbounds i8, i8* %125, i32 1
store i8* %126, i8** %4
store i8 %124, i8* %125
%127 = load i32, i32* %5
%128 = ashr i32 %127, 6
%129 = and i32 %128, 63
%130 = or i32 128, %129
%131 = trunc i32 %130 to i8
%132 = load i8*, i8** %4
%133 = getelementptr inbounds i8, i8* %132, i32 1
store i8* %133, i8** %4
store i8 %131, i8* %132
%134 = load i32, i32* %5
%135 = and i32 %134, 63
%136 = or i32 128, %135
%137 = trunc i32 %136 to i8
%138 = load i8*, i8** %4
%139 = getelementptr inbounds i8, i8* %138, i32 1
store i8* %139, i8** %4
store i8 %137, i8* %138
br label %167
140: ; preds = %117
%141 = load i32, i32* %5
%142 = ashr i32 %141, 18
%143 = or i32 240, %142
%144 = trunc i32 %143 to i8
%145 = load i8*, i8** %4
%146 = getelementptr inbounds i8, i8* %145, i32 1
store i8* %146, i8** %4
store i8 %144, i8* %145
%147 = load i32, i32* %5
%148 = ashr i32 %147, 12
%149 = and i32 %148, 63
%150 = or i32 128, %149
%151 = trunc i32 %150 to i8
%152 = load i8*, i8** %4
%153 = getelementptr inbounds i8, i8* %152, i32 1
store i8* %153, i8** %4
store i8 %151, i8* %152
%154 = load i32, i32* %5
%155 = ashr i32 %154, 6
%156 = and i32 %155, 63
%157 = or i32 128, %156
%158 = trunc i32 %157 to i8
%159 = load i8*, i8** %4
%160 = getelementptr inbounds i8, i8* %159, i32 1
store i8* %160, i8** %4
store i8 %158, i8* %159
%161 = load i32, i32* %5
%162 = and i32 %161, 63
%163 = or i32 128, %162
%164 = trunc i32 %163 to i8
%165 = load i8*, i8** %4
%166 = getelementptr inbounds i8, i8* %165, i32 1
store i8* %166, i8** %4
store i8 %164, i8* %165
br label %167
167: ; preds = %140, %120
br label %168
168: ; preds = %167, %104
br label %169
169: ; preds = %168, %96
%170 = load i8*, i8** %3
%171 = call i8* @strchr(i8* %170, i8 signext 59)
%172 = getelementptr inbounds i8, i8* %171, i64 1
store i8* %172, i8** %3
br label %176
173: ; preds = %73
%174 = load i8*, i8** %4
%175 = getelementptr inbounds i8, i8* %174, i32 1
store i8* %175, i8** %4
store i8 38, i8* %174
br label %176
176: ; preds = %173, %169
br label %177
177: ; preds = %176, %68
br label %178
178: ; preds = %177, %59
br label %179
179: ; preds = %178, %50
br label %180
180: ; preds = %179, %41
br label %181
181: ; preds = %180, %32
br label %188
182: ; preds = %21, %16
%183 = load i8*, i8** %3
%184 = getelementptr inbounds i8, i8* %183, i32 1
store i8* %184, i8** %3
%185 = load i8, i8* %183
%186 = load i8*, i8** %4
%187 = getelementptr inbounds i8, i8* %186, i32 1
store i8* %187, i8** %4
store i8 %185, i8* %186
br label %188
188: ; preds = %182, %181
br label %12
189: ; preds = %12
%190 = load i8*, i8** %4
store i8 0, i8* %190
br label %191
191: ; preds = %189, %9
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"amp;\00"
@.str.1 = [4 x i8] c"lt;\00"
@.str.2 = [4 x i8] c"gt;\00"
@.str.3 = [6 x i8] c"quot;\00"
@.str.4 = [6 x i8] c"apos;\00"
define void @zipc_xml_unescape(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 38)
%3 = icmp eq i8* %2, null
br i1 %3, label %115, label %4
4: ; preds = %1, %18
%5 = phi i8* [ %19, %18 ], [ %2, %1 ]
%6 = phi i8* [ %20, %18 ], [ %2, %1 ]
%7 = load i8, i8* %5
switch i8 %7, label %111 [
i8 0, label %114
i8 38, label %8
]
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = tail call i8* @strchr(i8* %9, i8 signext 59)
%11 = icmp eq i8* %10, null
br i1 %11, label %111, label %12
12: ; preds = %8
%13 = tail call i32 @strncmp(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = getelementptr inbounds i8, i8* %5, i64 5
%17 = getelementptr inbounds i8, i8* %6, i64 1
store i8 38, i8* %6
br label %18
18: ; preds = %15, %30, %42, %109, %105, %36, %24, %111
%19 = phi i8* [ %108, %105 ], [ %9, %109 ], [ %43, %42 ], [ %37, %36 ], [ %31, %30 ], [ %25, %24 ], [ %16, %15 ], [ %112, %111 ]
%20 = phi i8* [ %106, %105 ], [ %110, %109 ], [ %44, %42 ], [ %38, %36 ], [ %32, %30 ], [ %26, %24 ], [ %17, %15 ], [ %113, %111 ]
br label %4
21: ; preds = %12
%22 = tail call i32 @strncmp(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = getelementptr inbounds i8, i8* %5, i64 4
%26 = getelementptr inbounds i8, i8* %6, i64 1
store i8 60, i8* %6
br label %18
27: ; preds = %21
%28 = tail call i32 @strncmp(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = getelementptr inbounds i8, i8* %5, i64 4
%32 = getelementptr inbounds i8, i8* %6, i64 1
store i8 62, i8* %6
br label %18
33: ; preds = %27
%34 = tail call i32 @strncmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 5)
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %33
%37 = getelementptr inbounds i8, i8* %5, i64 6
%38 = getelementptr inbounds i8, i8* %6, i64 1
store i8 34, i8* %6
br label %18
39: ; preds = %33
%40 = tail call i32 @strncmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 5)
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = getelementptr inbounds i8, i8* %5, i64 6
%44 = getelementptr inbounds i8, i8* %6, i64 1
store i8 39, i8* %6
br label %18
45: ; preds = %39
%46 = load i8, i8* %9
%47 = icmp eq i8 %46, 35
br i1 %47, label %48, label %109
48: ; preds = %45
%49 = getelementptr inbounds i8, i8* %5, i64 2
%50 = load i8, i8* %49
%51 = icmp eq i8 %50, 120
%52 = select i1 %51, i32 16, i32 10
%53 = tail call i64 @strtol(i8* nocapture %49, i32* null, i32 %52)
%54 = trunc i64 %53 to i32
%55 = icmp slt i32 %54, 128
br i1 %55, label %56, label %59
56: ; preds = %48
%57 = trunc i64 %53 to i8
%58 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %57, i8* %6
br label %105
59: ; preds = %48
%60 = icmp ult i32 %54, 2048
br i1 %60, label %61, label %70
61: ; preds = %59
%62 = lshr i64 %53, 6
%63 = trunc i64 %62 to i8
%64 = or i8 %63, -64
%65 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %64, i8* %6
%66 = trunc i64 %53 to i8
%67 = and i8 %66, 63
%68 = or i8 %67, -128
%69 = getelementptr inbounds i8, i8* %6, i64 2
store i8 %68, i8* %65
br label %105
70: ; preds = %59
%71 = icmp ult i32 %54, 65536
br i1 %71, label %72, label %86
72: ; preds = %70
%73 = lshr i64 %53, 12
%74 = trunc i64 %73 to i8
%75 = or i8 %74, -32
%76 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %75, i8* %6
%77 = lshr i64 %53, 6
%78 = trunc i64 %77 to i8
%79 = and i8 %78, 63
%80 = or i8 %79, -128
%81 = getelementptr inbounds i8, i8* %6, i64 2
store i8 %80, i8* %76
%82 = trunc i64 %53 to i8
%83 = and i8 %82, 63
%84 = or i8 %83, -128
%85 = getelementptr inbounds i8, i8* %6, i64 3
store i8 %84, i8* %81
br label %105
86: ; preds = %70
%87 = lshr i64 %53, 18
%88 = trunc i64 %87 to i8
%89 = or i8 %88, -16
%90 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %89, i8* %6
%91 = lshr i64 %53, 12
%92 = trunc i64 %91 to i8
%93 = and i8 %92, 63
%94 = or i8 %93, -128
%95 = getelementptr inbounds i8, i8* %6, i64 2
store i8 %94, i8* %90
%96 = lshr i64 %53, 6
%97 = trunc i64 %96 to i8
%98 = and i8 %97, 63
%99 = or i8 %98, -128
%100 = getelementptr inbounds i8, i8* %6, i64 3
store i8 %99, i8* %95
%101 = trunc i64 %53 to i8
%102 = and i8 %101, 63
%103 = or i8 %102, -128
%104 = getelementptr inbounds i8, i8* %6, i64 4
store i8 %103, i8* %100
br label %105
105: ; preds = %61, %86, %72, %56
%106 = phi i8* [ %58, %56 ], [ %69, %61 ], [ %85, %72 ], [ %104, %86 ]
%107 = tail call i8* @strchr(i8* %49, i8 signext 59)
%108 = getelementptr inbounds i8, i8* %107, i64 1
br label %18
109: ; preds = %45
%110 = getelementptr inbounds i8, i8* %6, i64 1
store i8 38, i8* %6
br label %18
111: ; preds = %4, %8
%112 = getelementptr inbounds i8, i8* %5, i64 1
%113 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %7, i8* %6
br label %18
114: ; preds = %4
store i8 0, i8* %6
br label %115
115: ; preds = %1, %114
ret void
}