#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 */
typedef int charnum;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
int /*<<< orphan*/ stderr;
int writeUTF8(unsigned int charnum, char *dest) {
  dest[0] = 0;
  if (charnum < 0x80) {
    dest[0] = charnum;
    dest[1] = 0;
    return 1;
  } else if (charnum < 0x800) {
    dest[0] = 0xc0 | (charnum >> 6);
    dest[1] = 0x80 | (charnum & 0x3f);
    dest[2] = 0;
    return 2;
  } else if (charnum < 0x10000) {
    dest[0] = 0xe0 | (charnum >> 12);
    dest[1] = 0x80 | ((charnum >> 6) & 0x3f);
    dest[2] = 0x80 | ((charnum)&0x3f);
    dest[3] = 0;
    return 3;
  } else if (charnum < 0x200000) {
    dest[0] = 0xf0 | (charnum >> 18);
    dest[1] = 0x80 | ((charnum >> 12) & 0x3f);
    dest[2] = 0x80 | ((charnum >> 6) & 0x3f);
    dest[3] = 0x80 | ((charnum)&0x3f);
    dest[4] = 0;
    return 4;
  } else if (charnum < 0x4000000) {
    dest[0] = 0xf8 | (charnum >> 24);
    dest[1] = 0x80 | ((charnum >> 18) & 0x3f);
    dest[2] = 0x80 | ((charnum >> 12) & 0x3f);
    dest[3] = 0x80 | ((charnum >> 6) & 0x3f);
    dest[4] = 0x80 | ((charnum)&0x3f);
    dest[5] = 0;
    return 5;
  } else if (charnum < 0x80000000) {
    dest[0] = 0xfc | (charnum >> 30);
    dest[1] = 0x80 | ((charnum >> 24) & 0x3f);
    dest[2] = 0x80 | ((charnum >> 18) & 0x3f);
    dest[3] = 0x80 | ((charnum >> 12) & 0x3f);
    dest[4] = 0x80 | ((charnum >> 6) & 0x3f);
    dest[5] = 0x80 | ((charnum)&0x3f);
    dest[6] = 0;
    return 6;
  } else {
    fprintf(stderr, "Illegal character: 0x%08x\n", charnum);
    dest[0] = 0;
    return 0;
  }
}


x86 assembly (clang, -O0):
<writeUTF8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x80,-0x8(%rbp)
jae    1152 <writeUTF8+0x42>
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
movl   $0x1,-0x4(%rbp)
jmp    13c6 <writeUTF8+0x2b6>
cmpl   $0x800,-0x8(%rbp)
jae    119a <writeUTF8+0x8a>
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
or     $0xc0,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x2(%rax)
movl   $0x2,-0x4(%rbp)
jmp    13c6 <writeUTF8+0x2b6>
cmpl   $0x10000,-0x8(%rbp)
jae    11f9 <writeUTF8+0xe9>
mov    -0x8(%rbp),%eax
shr    $0xc,%eax
or     $0xe0,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x3(%rax)
movl   $0x3,-0x4(%rbp)
jmp    13c6 <writeUTF8+0x2b6>
cmpl   $0x200000,-0x8(%rbp)
jae    126f <writeUTF8+0x15f>
mov    -0x8(%rbp),%eax
shr    $0x12,%eax
or     $0xf0,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%eax
shr    $0xc,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x4(%rax)
movl   $0x4,-0x4(%rbp)
jmp    13c6 <writeUTF8+0x2b6>
cmpl   $0x4000000,-0x8(%rbp)
jae    12fc <writeUTF8+0x1ec>
mov    -0x8(%rbp),%eax
shr    $0x18,%eax
or     $0xf8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%eax
shr    $0x12,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%eax
shr    $0xc,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x5(%rax)
movl   $0x5,-0x4(%rbp)
jmp    13c6 <writeUTF8+0x2b6>
cmpl   $0x80000000,-0x8(%rbp)
jae    13a0 <writeUTF8+0x290>
mov    -0x8(%rbp),%eax
shr    $0x1e,%eax
or     $0xfc,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%eax
shr    $0x18,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%eax
shr    $0x12,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%eax
shr    $0xc,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
or     $0x80,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x5(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x6(%rax)
movl   $0x6,-0x4(%rbp)
jmp    13c6 <writeUTF8+0x2b6>
mov    0x2c39(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xc4d(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeUTF8>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
movb   $0x0,(%rsi)
cmp    $0x7f,%edi
ja     112e <writeUTF8+0x1e>
mov    %dl,(%rbx)
add    $0x1,%rbx
mov    $0x1,%eax
jmp    127b <writeUTF8+0x16b>
cmp    $0x7ff,%edx
ja     1156 <writeUTF8+0x46>
mov    %edx,%eax
shr    $0x6,%eax
or     $0xc0,%al
mov    %al,(%rbx)
and    $0x3f,%dl
or     $0x80,%dl
mov    %dl,0x1(%rbx)
add    $0x2,%rbx
mov    $0x2,%eax
jmp    127b <writeUTF8+0x16b>
cmp    $0xffff,%edx
ja     118a <writeUTF8+0x7a>
mov    %edx,%eax
shr    $0xc,%eax
or     $0xe0,%al
mov    %al,(%rbx)
mov    %edx,%eax
shr    $0x6,%eax
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x1(%rbx)
and    $0x3f,%dl
or     $0x80,%dl
mov    %dl,0x2(%rbx)
add    $0x3,%rbx
mov    $0x3,%eax
jmp    127b <writeUTF8+0x16b>
cmp    $0x1fffff,%edx
ja     11ca <writeUTF8+0xba>
mov    %edx,%eax
shr    $0x12,%eax
or     $0xf0,%al
mov    %al,(%rbx)
mov    %edx,%eax
shr    $0xc,%eax
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x1(%rbx)
mov    %edx,%eax
shr    $0x6,%eax
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x2(%rbx)
and    $0x3f,%dl
or     $0x80,%dl
mov    %dl,0x3(%rbx)
add    $0x4,%rbx
mov    $0x4,%eax
jmp    127b <writeUTF8+0x16b>
cmp    $0x3ffffff,%edx
ja     1213 <writeUTF8+0x103>
mov    %edx,%eax
shr    $0x18,%eax
or     $0xf8,%al
mov    %al,(%rbx)
mov    %edx,%eax
shr    $0x12,%eax
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x1(%rbx)
mov    %edx,%eax
shr    $0xc,%eax
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x2(%rbx)
mov    %edx,%eax
shr    $0x6,%eax
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x3(%rbx)
and    $0x3f,%dl
or     $0x80,%dl
mov    %dl,0x4(%rbx)
add    $0x5,%rbx
mov    $0x5,%eax
jmp    127b <writeUTF8+0x16b>
test   %edx,%edx
js     1264 <writeUTF8+0x154>
mov    %edx,%eax
shr    $0x1e,%eax
or     $0xfc,%al
mov    %al,(%rbx)
mov    %edx,%eax
shr    $0x18,%eax
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x1(%rbx)
mov    %edx,%eax
shr    $0x12,%eax
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x2(%rbx)
mov    %edx,%eax
shr    $0xc,%eax
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x3(%rbx)
mov    %edx,%eax
shr    $0x6,%eax
and    $0x3f,%al
or     $0x80,%al
mov    %al,0x4(%rbx)
and    $0x3f,%dl
or     $0x80,%dl
mov    %dl,0x5(%rbx)
add    $0x6,%rbx
mov    $0x6,%eax
jmp    127b <writeUTF8+0x16b>
mov    0x2d75(%rip),%rax
mov    (%rax),%edi
lea    0xd8c(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
movb   $0x0,(%rbx)
pop    %rbx
ret

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

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