#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 */
unsigned int parse_hex4(unsigned char const *);
unsigned char utf16_literal_to_utf8(const unsigned char *const input_pointer,
                                    const unsigned char *const input_end,
                                    unsigned char **output_pointer,
                                    const unsigned char **error_pointer) {
  static const unsigned char firstByteMark[5] = {0x00, 0x00, 0xC0, 0xE0, 0xF0};
  long unsigned int codepoint = 0;
  unsigned int first_code = 0;
  const unsigned char *first_sequence = input_pointer;
  unsigned char utf8_length = 0;
  unsigned char sequence_length = 0;
  first_code = parse_hex4(first_sequence + 2);
  if ((input_end - first_sequence) < 6) {
    *error_pointer = first_sequence;
    goto fail;
  }
  if (((first_code >= 0xDC00) && (first_code <= 0xDFFF)) || (first_code == 0)) {
    *error_pointer = first_sequence;
    goto fail;
  }
  if ((first_code >= 0xD800) && (first_code <= 0xDBFF)) {
    const unsigned char *second_sequence = first_sequence + 6;
    unsigned int second_code = 0;
    sequence_length = 12;
    if ((input_end - second_sequence) < 6) {
      *error_pointer = first_sequence;
      goto fail;
    }
    if ((second_sequence[0] != '\\') || (second_sequence[1] != 'u')) {
      *error_pointer = first_sequence;
      goto fail;
    }
    second_code = parse_hex4(second_sequence + 2);
    if ((second_code < 0xDC00) || (second_code > 0xDFFF)) {
      *error_pointer = first_sequence;
      goto fail;
    }
    codepoint =
        0x10000 + (((first_code & 0x3FF) << 10) | (second_code & 0x3FF));
  } else {
    sequence_length = 6;
    codepoint = first_code;
  }
  if (codepoint < 0x80) {
    utf8_length = 1;
  } else if (codepoint < 0x800) {
    utf8_length = 2;
  } else if (codepoint < 0x10000) {
    utf8_length = 3;
  } else if (codepoint <= 0x10FFFF) {
    utf8_length = 4;
  } else {
    *error_pointer = first_sequence;
    goto fail;
  }
  switch (utf8_length) {
  case 4:
    (*output_pointer)[3] = (unsigned char)((codepoint | 0x80) & 0xBF);
    codepoint >>= 6;
  case 3:
    (*output_pointer)[2] = (unsigned char)((codepoint | 0x80) & 0xBF);
    codepoint >>= 6;
  case 2:
    (*output_pointer)[1] = (unsigned char)((codepoint | 0x80) & 0xBF);
    codepoint >>= 6;
  case 1:
    (*output_pointer)[0] =
        (unsigned char)((codepoint | firstByteMark[utf8_length]) & 0xFF);
    break;
  default:
    *error_pointer = first_sequence;
    goto fail;
  }
  *output_pointer += utf8_length;
  return sequence_length;
fail:
  return 0;
}


x86 assembly (clang, -O0):
<utf16_literal_to_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
movb   $0x0,-0x41(%rbp)
movb   $0x0,-0x42(%rbp)
mov    -0x40(%rbp),%rdi
add    $0x2,%rdi
call   1030 <parse_hex4@plt>
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x6,%rax
jge    117c <utf16_literal_to_utf8+0x6c>
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    141c <utf16_literal_to_utf8+0x30c>
cmpl   $0xdc00,-0x34(%rbp)
jb     1196 <utf16_literal_to_utf8+0x86>
cmpl   $0xdfff,-0x34(%rbp)
jbe    11a0 <utf16_literal_to_utf8+0x90>
cmpl   $0x0,-0x34(%rbp)
jne    11b0 <utf16_literal_to_utf8+0xa0>
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    141c <utf16_literal_to_utf8+0x30c>
cmpl   $0xd800,-0x34(%rbp)
jb     1297 <utf16_literal_to_utf8+0x187>
cmpl   $0xdbff,-0x34(%rbp)
ja     1297 <utf16_literal_to_utf8+0x187>
mov    -0x40(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
movb   $0xc,-0x42(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x6,%rax
jge    1206 <utf16_literal_to_utf8+0xf6>
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    141c <utf16_literal_to_utf8+0x30c>
mov    -0x50(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x5c,%eax
jne    1227 <utf16_literal_to_utf8+0x117>
mov    -0x50(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0x75,%eax
je     1237 <utf16_literal_to_utf8+0x127>
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    141c <utf16_literal_to_utf8+0x30c>
mov    -0x50(%rbp),%rdi
add    $0x2,%rdi
call   1030 <parse_hex4@plt>
mov    %eax,-0x54(%rbp)
cmpl   $0xdc00,-0x54(%rbp)
jb     1261 <utf16_literal_to_utf8+0x151>
cmpl   $0xdfff,-0x54(%rbp)
jbe    1271 <utf16_literal_to_utf8+0x161>
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    141c <utf16_literal_to_utf8+0x30c>
mov    -0x34(%rbp),%eax
and    $0x3ff,%eax
shl    $0xa,%eax
mov    -0x54(%rbp),%ecx
and    $0x3ff,%ecx
or     %ecx,%eax
add    $0x10000,%eax
mov    %eax,%eax
mov    %rax,-0x30(%rbp)
jmp    12a2 <utf16_literal_to_utf8+0x192>
movb   $0x6,-0x42(%rbp)
mov    -0x34(%rbp),%eax
mov    %rax,-0x30(%rbp)
cmpq   $0x80,-0x30(%rbp)
jae    12b9 <utf16_literal_to_utf8+0x1a9>
movb   $0x1,-0x41(%rbp)
jmp    131d <utf16_literal_to_utf8+0x20d>
cmpq   $0x800,-0x30(%rbp)
jae    12d0 <utf16_literal_to_utf8+0x1c0>
movb   $0x2,-0x41(%rbp)
jmp    1318 <utf16_literal_to_utf8+0x208>
cmpq   $0x10000,-0x30(%rbp)
jae    12e7 <utf16_literal_to_utf8+0x1d7>
movb   $0x3,-0x41(%rbp)
jmp    1313 <utf16_literal_to_utf8+0x203>
cmpq   $0x10ffff,-0x30(%rbp)
ja     12fe <utf16_literal_to_utf8+0x1ee>
movb   $0x4,-0x41(%rbp)
jmp    130e <utf16_literal_to_utf8+0x1fe>
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    141c <utf16_literal_to_utf8+0x30c>
jmp    1313 <utf16_literal_to_utf8+0x203>
jmp    1318 <utf16_literal_to_utf8+0x208>
jmp    131d <utf16_literal_to_utf8+0x20d>
movzbl -0x41(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x60(%rbp)
sub    $0x3,%eax
ja     13ed <utf16_literal_to_utf8+0x2dd>
mov    -0x60(%rbp),%rax
lea    0xcc2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x30(%rbp),%rax
or     $0x80,%rax
and    $0xbf,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %cl,0x3(%rax)
mov    -0x30(%rbp),%rax
shr    $0x6,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
or     $0x80,%rax
and    $0xbf,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %cl,0x2(%rax)
mov    -0x30(%rbp),%rax
shr    $0x6,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
or     $0x80,%rax
and    $0xbf,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %cl,0x1(%rax)
mov    -0x30(%rbp),%rax
shr    $0x6,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movzbl -0x41(%rbp),%ecx
mov    %ecx,%edx
lea    0xc40(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
or     %rcx,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
jmp    13fd <utf16_literal_to_utf8+0x2ed>
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    141c <utf16_literal_to_utf8+0x30c>
movzbl -0x41(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x42(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1420 <utf16_literal_to_utf8+0x310>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf16_literal_to_utf8>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r13
add    $0x2,%rdi
call   1030 <parse_hex4@plt>
mov    %eax,%r12d
mov    %rbx,%rax
sub    %r13,%rax
cmp    $0x5,%rax
jle    124c <utf16_literal_to_utf8+0x13c>
test   %r12d,%r12d
je     124c <utf16_literal_to_utf8+0x13c>
mov    %r12d,%eax
and    $0xfffffc00,%eax
cmp    $0xdc00,%eax
je     124c <utf16_literal_to_utf8+0x13c>
cmp    $0xd800,%eax
jne    11c2 <utf16_literal_to_utf8+0xb2>
lea    0x6(%r13),%rax
sub    %rax,%rbx
cmp    $0x5,%rbx
jle    124c <utf16_literal_to_utf8+0x13c>
cmpb   $0x5c,(%rax)
jne    124c <utf16_literal_to_utf8+0x13c>
cmpb   $0x75,0x7(%r13)
jne    124c <utf16_literal_to_utf8+0x13c>
lea    0x8(%r13),%rdi
call   1030 <parse_hex4@plt>
lea    -0xe000(%rax),%ecx
cmp    $0xfffffbff,%ecx
jbe    124c <utf16_literal_to_utf8+0x13c>
shl    $0xa,%r12d
and    $0xffc00,%r12d
and    $0x3ff,%eax
lea    (%r12,%rax,1),%ecx
add    $0x10000,%ecx
mov    $0xc,%al
jmp    11f5 <utf16_literal_to_utf8+0xe5>
mov    %r12d,%ecx
mov    $0x6,%al
cmp    $0x80,%r12d
jae    11d7 <utf16_literal_to_utf8+0xc7>
mov    $0x1,%edx
jmp    1238 <utf16_literal_to_utf8+0x128>
cmp    $0x800,%r12d
jae    11e7 <utf16_literal_to_utf8+0xd7>
mov    $0x2,%edx
jmp    1226 <utf16_literal_to_utf8+0x116>
mov    $0x3,%edx
cmp    $0x10000,%r12d
jb     1214 <utf16_literal_to_utf8+0x104>
cmp    $0x110000,%ecx
jae    124c <utf16_literal_to_utf8+0x13c>
mov    %ecx,%edx
and    $0x3f,%dl
or     $0x80,%dl
mov    (%r14),%rsi
mov    %dl,0x3(%rsi)
shr    $0x6,%rcx
mov    $0x4,%edx
mov    %ecx,%ebx
and    $0x3f,%bl
or     $0x80,%bl
mov    (%r14),%rsi
mov    %bl,0x2(%rsi)
shr    $0x6,%rcx
mov    %ecx,%ebx
and    $0x3f,%bl
or     $0x80,%bl
mov    (%r14),%rsi
mov    %bl,0x1(%rsi)
shr    $0x6,%rcx
lea    0xdc1(%rip),%rsi
or     (%rdx,%rsi,1),%cl
mov    (%r14),%rsi
mov    %cl,(%rsi)
add    %rdx,(%r14)
jmp    1251 <utf16_literal_to_utf8+0x141>
mov    %r13,(%r15)
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@utf16_literal_to_utf8.firstByteMark = internal unnamed_addr constant [5 x i8] c"\00\00\C0\E0\F0"
define zeroext i8 @utf16_literal_to_utf8(i8* %0, i8* %1, i8** nocapture %2, i8** nocapture writeonly %3) {
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = tail call i32 @parse_hex4(i8* %5)
%7 = ptrtoint i8* %1 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
%10 = icmp slt i64 %9, 6
br i1 %10, label %11, label %12
11: ; preds = %4
store i8* %0, i8** %3
br label %97
12: ; preds = %4
%13 = and i32 %6, -1024
%14 = icmp eq i32 %13, 56320
%15 = icmp eq i32 %6, 0
%16 = or i1 %15, %14
br i1 %16, label %17, label %18
17: ; preds = %12
store i8* %0, i8** %3
br label %97
18: ; preds = %12
%19 = icmp eq i32 %13, 55296
br i1 %19, label %20, label %47
20: ; preds = %18
%21 = getelementptr inbounds i8, i8* %0, i64 6
%22 = ptrtoint i8* %21 to i64
%23 = sub i64 %7, %22
%24 = icmp slt i64 %23, 6
br i1 %24, label %25, label %26
25: ; preds = %20
store i8* %0, i8** %3
br label %97
26: ; preds = %20
%27 = load i8, i8* %21
%28 = icmp eq i8 %27, 92
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = getelementptr inbounds i8, i8* %0, i64 7
%31 = load i8, i8* %30
%32 = icmp eq i8 %31, 117
br i1 %32, label %34, label %33
33: ; preds = %29, %26
store i8* %0, i8** %3
br label %97
34: ; preds = %29
%35 = getelementptr inbounds i8, i8* %0, i64 8
%36 = tail call i32 @parse_hex4(i8* %35)
%37 = add i32 %36, -57344
%38 = icmp ult i32 %37, -1024
br i1 %38, label %39, label %40
39: ; preds = %34
store i8* %0, i8** %3
br label %97
40: ; preds = %34
%41 = shl nuw nsw i32 %6, 10
%42 = and i32 %41, 1047552
%43 = and i32 %36, 1023
%44 = add nuw nsw i32 %42, 65536
%45 = or i32 %44, %43
%46 = zext i32 %45 to i64
br label %54
47: ; preds = %18
%48 = zext i32 %6 to i64
%49 = icmp ult i32 %6, 128
br i1 %49, label %86, label %50
50: ; preds = %47
%51 = icmp ult i32 %6, 2048
br i1 %51, label %76, label %52
52: ; preds = %50
%53 = icmp ult i32 %6, 65536
br i1 %53, label %66, label %54
54: ; preds = %40, %52
%55 = phi i8 [ 12, %40 ], [ 6, %52 ]
%56 = phi i64 [ %46, %40 ], [ %48, %52 ]
%57 = icmp ult i64 %56, 1114112
br i1 %57, label %59, label %58
58: ; preds = %54
store i8* %0, i8** %3
br label %97
59: ; preds = %54
%60 = trunc i64 %56 to i8
%61 = and i8 %60, 63
%62 = or i8 %61, -128
%63 = load i8*, i8** %2
%64 = getelementptr inbounds i8, i8* %63, i64 3
store i8 %62, i8* %64
%65 = lshr i64 %56, 6
br label %66
66: ; preds = %52, %59
%67 = phi i64 [ 4, %59 ], [ 3, %52 ]
%68 = phi i8 [ %55, %59 ], [ 6, %52 ]
%69 = phi i64 [ %65, %59 ], [ %48, %52 ]
%70 = trunc i64 %69 to i8
%71 = and i8 %70, 63
%72 = or i8 %71, -128
%73 = load i8*, i8** %2
%74 = getelementptr inbounds i8, i8* %73, i64 2
store i8 %72, i8* %74
%75 = lshr i64 %69, 6
br label %76
76: ; preds = %50, %66
%77 = phi i64 [ %67, %66 ], [ 2, %50 ]
%78 = phi i8 [ %68, %66 ], [ 6, %50 ]
%79 = phi i64 [ %75, %66 ], [ %48, %50 ]
%80 = trunc i64 %79 to i8
%81 = and i8 %80, 63
%82 = or i8 %81, -128
%83 = load i8*, i8** %2
%84 = getelementptr inbounds i8, i8* %83, i64 1
store i8 %82, i8* %84
%85 = lshr i64 %79, 6
br label %86
86: ; preds = %47, %76
%87 = phi i64 [ %77, %76 ], [ 1, %47 ]
%88 = phi i8 [ %78, %76 ], [ 6, %47 ]
%89 = phi i64 [ %85, %76 ], [ %48, %47 ]
%90 = getelementptr inbounds [5 x i8], [5 x i8]* @utf16_literal_to_utf8.firstByteMark, i64 0, i64 %87
%91 = load i8, i8* %90
%92 = trunc i64 %89 to i8
%93 = or i8 %91, %92
%94 = load i8*, i8** %2
store i8 %93, i8* %94
%95 = load i8*, i8** %2
%96 = getelementptr inbounds i8, i8* %95, i64 %87
store i8* %96, i8** %2
br label %97
97: ; preds = %39, %33, %25, %11, %17, %58, %86
%98 = phi i8 [ %88, %86 ], [ 0, %58 ], [ 0, %17 ], [ 0, %11 ], [ 0, %25 ], [ 0, %33 ], [ 0, %39 ]
ret i8 %98
}