char *_xos_utf8_get_char(const char *in, int *chr) {
  if ((in[0] & 0xe0) == 0xc0 && (((in[1]) & 0xc0) == 0x80)) {
    *chr = ((in[0] & 0x1f) << 6) | ((in[1] & 0x3f) << 0);
    return (char *)in + 2;
  }
  if ((in[0] & 0xf0) == 0xe0 && (((in[1]) & 0xc0) == 0x80) &&
      (((in[1]) & 0xc0) == 0x80)) {
    *chr =
        ((in[0] & 0xf) << 12) | ((in[1] & 0x3f) << 6) | ((in[2] & 0x3f) << 0);
    return (char *)in + 3;
  }
  if ((in[0] & 0xf8) == 0xf0 && (((in[1]) & 0xc0) == 0x80) &&
      (((in[1]) & 0xc0) == 0x80) && (((in[1]) & 0xc0) == 0x80)) {
    *chr = ((in[0] & 0x7) << 18) | ((in[1] & 0x3f) << 12) |
           ((in[2] & 0x3f) << 6) | ((in[3] & 0x3f) << 0);
    return (char *)in + 4;
  }
  if ((in[0] & 0xfc) == 0xf8 && (((in[1]) & 0xc0) == 0x80) &&
      (((in[1]) & 0xc0) == 0x80) && (((in[1]) & 0xc0) == 0x80) &&
      (((in[1]) & 0xc0) == 0x80)) {
    *chr = ((in[0] & 0x3) << 24) | ((in[1] & 0x3f) << 18) |
           ((in[2] & 0x3f) << 12) | ((in[3] & 0x3f) << 6) |
           ((in[4] & 0x3f) << 0);
    return (char *)in + 5;
  }
  if ((in[0] & 0xfe) == 0xfc && (((in[1]) & 0xc0) == 0x80) &&
      (((in[1]) & 0xc0) == 0x80) && (((in[1]) & 0xc0) == 0x80) &&
      (((in[1]) & 0xc0) == 0x80) && (((in[1]) & 0xc0) == 0x80)) {
    *chr = ((in[0] & 0x1) << 30) | ((in[1] & 0x3f) << 24) |
           ((in[2] & 0x3f) << 18) | ((in[3] & 0x3f) << 12) |
           ((in[4] & 0x3f) << 6) | ((in[5] & 0x3f) << 0);
    return (char *)in + 4;
  }
  *chr = *in;
  return (char *)in + 1;
}


x86 assembly (clang, -O0):
<_xos_utf8_get_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xe0,%eax
cmp    $0xc0,%eax
jne    116f <_xos_utf8_get_char+0x6f>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    116f <_xos_utf8_get_char+0x6f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
and    $0x1f,%ecx
shl    $0x6,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0x3f,%eax
shl    $0x0,%eax
or     %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    14a4 <_xos_utf8_get_char+0x3a4>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xf0,%eax
cmp    $0xe0,%eax
jne    11fa <_xos_utf8_get_char+0xfa>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    11fa <_xos_utf8_get_char+0xfa>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    11fa <_xos_utf8_get_char+0xfa>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
and    $0xf,%ecx
shl    $0xc,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0x3f,%eax
shl    $0x6,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
and    $0x3f,%eax
shl    $0x0,%eax
or     %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x8(%rbp)
jmp    14a4 <_xos_utf8_get_char+0x3a4>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xf8,%eax
cmp    $0xf0,%eax
jne    12ad <_xos_utf8_get_char+0x1ad>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    12ad <_xos_utf8_get_char+0x1ad>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    12ad <_xos_utf8_get_char+0x1ad>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    12ad <_xos_utf8_get_char+0x1ad>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
and    $0x7,%ecx
shl    $0x12,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0x3f,%eax
shl    $0xc,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
and    $0x3f,%eax
shl    $0x6,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
and    $0x3f,%eax
shl    $0x0,%eax
or     %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    14a4 <_xos_utf8_get_char+0x3a4>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xfc,%eax
cmp    $0xf8,%eax
jne    1388 <_xos_utf8_get_char+0x288>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1388 <_xos_utf8_get_char+0x288>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1388 <_xos_utf8_get_char+0x288>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1388 <_xos_utf8_get_char+0x288>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1388 <_xos_utf8_get_char+0x288>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
and    $0x3,%ecx
shl    $0x18,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0x3f,%eax
shl    $0x12,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
and    $0x3f,%eax
shl    $0xc,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
and    $0x3f,%eax
shl    $0x6,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x4(%rax),%eax
and    $0x3f,%eax
shl    $0x0,%eax
or     %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x8(%rbp)
jmp    14a4 <_xos_utf8_get_char+0x3a4>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xfe,%eax
cmp    $0xfc,%eax
jne    148b <_xos_utf8_get_char+0x38b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    148b <_xos_utf8_get_char+0x38b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    148b <_xos_utf8_get_char+0x38b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    148b <_xos_utf8_get_char+0x38b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    148b <_xos_utf8_get_char+0x38b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    148b <_xos_utf8_get_char+0x38b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
and    $0x1,%ecx
shl    $0x1e,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0x3f,%eax
shl    $0x18,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
and    $0x3f,%eax
shl    $0x12,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
and    $0x3f,%eax
shl    $0xc,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x4(%rax),%eax
and    $0x3f,%eax
shl    $0x6,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
movsbl 0x5(%rax),%eax
and    $0x3f,%eax
shl    $0x0,%eax
or     %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    14a4 <_xos_utf8_get_char+0x3a4>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xos_utf8_get_char>:
mov    %rdi,%rax
movsbl (%rdi),%ecx
mov    %ecx,%edx
and    $0xe0,%edx
cmp    $0xc0,%edx
jne    1139 <_xos_utf8_get_char+0x39>
movzbl 0x1(%rax),%edx
mov    %edx,%edi
and    $0xffffffc0,%edi
cmp    $0x80,%edi
jne    1139 <_xos_utf8_get_char+0x39>
and    $0x1f,%ecx
shl    $0x6,%ecx
and    $0x3f,%edx
or     %ecx,%edx
mov    %edx,(%rsi)
add    $0x2,%rax
ret
mov    %ecx,%edx
and    $0xf0,%edx
cmp    $0xe0,%edx
jne    117b <_xos_utf8_get_char+0x7b>
movsbl 0x1(%rax),%edx
mov    %edx,%edi
and    $0xc0,%edi
cmp    $0x80,%edi
jne    117b <_xos_utf8_get_char+0x7b>
shl    $0xc,%ecx
movzwl %cx,%ecx
and    $0x3f,%edx
shl    $0x6,%edx
or     %ecx,%edx
movzbl 0x2(%rax),%ecx
and    $0x3f,%ecx
or     %edx,%ecx
mov    %ecx,(%rsi)
add    $0x3,%rax
ret
mov    %ecx,%edx
and    $0xf8,%edx
cmp    $0xf0,%edx
jne    11c9 <_xos_utf8_get_char+0xc9>
movsbl 0x1(%rax),%edx
mov    %edx,%edi
and    $0xc0,%edi
cmp    $0x80,%edi
jne    11c9 <_xos_utf8_get_char+0xc9>
and    $0x7,%ecx
shl    $0x12,%ecx
and    $0x3f,%edx
shl    $0xc,%edx
or     %ecx,%edx
movzbl 0x2(%rax),%ecx
and    $0x3f,%ecx
shl    $0x6,%ecx
or     %edx,%ecx
movzbl 0x3(%rax),%edx
and    $0x3f,%edx
or     %ecx,%edx
mov    %edx,(%rsi)
add    $0x4,%rax
ret
mov    %ecx,%edx
and    $0xfc,%edx
cmp    $0xf8,%edx
jne    1223 <_xos_utf8_get_char+0x123>
movsbl 0x1(%rax),%edx
mov    %edx,%edi
and    $0xc0,%edi
cmp    $0x80,%edi
jne    1223 <_xos_utf8_get_char+0x123>
and    $0x3,%ecx
shl    $0x18,%ecx
and    $0x3f,%edx
shl    $0x12,%edx
or     %ecx,%edx
movzbl 0x2(%rax),%ecx
and    $0x3f,%ecx
shl    $0xc,%ecx
or     %edx,%ecx
movzbl 0x3(%rax),%edx
and    $0x3f,%edx
shl    $0x6,%edx
or     %ecx,%edx
movzbl 0x4(%rax),%ecx
and    $0x3f,%ecx
or     %edx,%ecx
mov    %ecx,(%rsi)
add    $0x5,%rax
ret
mov    %ecx,%edx
and    $0xfe,%edx
cmp    $0xfc,%edx
jne    1289 <_xos_utf8_get_char+0x189>
movsbl 0x1(%rax),%edx
mov    %edx,%edi
and    $0xc0,%edi
cmp    $0x80,%edi
jne    1289 <_xos_utf8_get_char+0x189>
and    $0x1,%ecx
shl    $0x1e,%ecx
and    $0x3f,%edx
shl    $0x18,%edx
or     %ecx,%edx
movzbl 0x2(%rax),%ecx
and    $0x3f,%ecx
shl    $0x12,%ecx
or     %edx,%ecx
movzbl 0x3(%rax),%edx
and    $0x3f,%edx
shl    $0xc,%edx
or     %ecx,%edx
movzbl 0x4(%rax),%ecx
movzbl 0x5(%rax),%edi
add    $0x4,%rax
and    $0x3f,%ecx
shl    $0x6,%ecx
or     %edx,%ecx
and    $0x3f,%edi
or     %ecx,%edi
mov    %edi,(%rsi)
ret
mov    %ecx,(%rsi)
add    $0x1,%rax
ret

LLVM IR (-O0):
define i8* @_xos_utf8_get_char(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = and i32 %9, 224
%11 = icmp eq i32 %10, 192
br i1 %11, label %12, label %36
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = and i32 %16, 192
%18 = icmp eq i32 %17, 128
br i1 %18, label %19, label %36
19: ; preds = %12
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = and i32 %23, 31
%25 = shl i32 %24, 6
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = and i32 %29, 63
%31 = shl i32 %30, 0
%32 = or i32 %25, %31
%33 = load i32*, i32** %5
store i32 %32, i32* %33
%34 = load i8*, i8** %4
%35 = getelementptr inbounds i8, i8* %34, i64 2
store i8* %35, i8** %3
br label %307
36: ; preds = %12, %2
%37 = load i8*, i8** %4
%38 = getelementptr inbounds i8, i8* %37, i64 0
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = and i32 %40, 240
%42 = icmp eq i32 %41, 224
br i1 %42, label %43, label %81
43: ; preds = %36
%44 = load i8*, i8** %4
%45 = getelementptr inbounds i8, i8* %44, i64 1
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = and i32 %47, 192
%49 = icmp eq i32 %48, 128
br i1 %49, label %50, label %81
50: ; preds = %43
%51 = load i8*, i8** %4
%52 = getelementptr inbounds i8, i8* %51, i64 1
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = and i32 %54, 192
%56 = icmp eq i32 %55, 128
br i1 %56, label %57, label %81
57: ; preds = %50
%58 = load i8*, i8** %4
%59 = getelementptr inbounds i8, i8* %58, i64 0
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = and i32 %61, 15
%63 = shl i32 %62, 12
%64 = load i8*, i8** %4
%65 = getelementptr inbounds i8, i8* %64, i64 1
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = and i32 %67, 63
%69 = shl i32 %68, 6
%70 = or i32 %63, %69
%71 = load i8*, i8** %4
%72 = getelementptr inbounds i8, i8* %71, i64 2
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = and i32 %74, 63
%76 = shl i32 %75, 0
%77 = or i32 %70, %76
%78 = load i32*, i32** %5
store i32 %77, i32* %78
%79 = load i8*, i8** %4
%80 = getelementptr inbounds i8, i8* %79, i64 3
store i8* %80, i8** %3
br label %307
81: ; preds = %50, %43, %36
%82 = load i8*, i8** %4
%83 = getelementptr inbounds i8, i8* %82, i64 0
%84 = load i8, i8* %83
%85 = sext i8 %84 to i32
%86 = and i32 %85, 248
%87 = icmp eq i32 %86, 240
br i1 %87, label %88, label %140
88: ; preds = %81
%89 = load i8*, i8** %4
%90 = getelementptr inbounds i8, i8* %89, i64 1
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = and i32 %92, 192
%94 = icmp eq i32 %93, 128
br i1 %94, label %95, label %140
95: ; preds = %88
%96 = load i8*, i8** %4
%97 = getelementptr inbounds i8, i8* %96, i64 1
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = and i32 %99, 192
%101 = icmp eq i32 %100, 128
br i1 %101, label %102, label %140
102: ; preds = %95
%103 = load i8*, i8** %4
%104 = getelementptr inbounds i8, i8* %103, i64 1
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = and i32 %106, 192
%108 = icmp eq i32 %107, 128
br i1 %108, label %109, label %140
109: ; preds = %102
%110 = load i8*, i8** %4
%111 = getelementptr inbounds i8, i8* %110, i64 0
%112 = load i8, i8* %111
%113 = sext i8 %112 to i32
%114 = and i32 %113, 7
%115 = shl i32 %114, 18
%116 = load i8*, i8** %4
%117 = getelementptr inbounds i8, i8* %116, i64 1
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = and i32 %119, 63
%121 = shl i32 %120, 12
%122 = or i32 %115, %121
%123 = load i8*, i8** %4
%124 = getelementptr inbounds i8, i8* %123, i64 2
%125 = load i8, i8* %124
%126 = sext i8 %125 to i32
%127 = and i32 %126, 63
%128 = shl i32 %127, 6
%129 = or i32 %122, %128
%130 = load i8*, i8** %4
%131 = getelementptr inbounds i8, i8* %130, i64 3
%132 = load i8, i8* %131
%133 = sext i8 %132 to i32
%134 = and i32 %133, 63
%135 = shl i32 %134, 0
%136 = or i32 %129, %135
%137 = load i32*, i32** %5
store i32 %136, i32* %137
%138 = load i8*, i8** %4
%139 = getelementptr inbounds i8, i8* %138, i64 4
store i8* %139, i8** %3
br label %307
140: ; preds = %102, %95, %88, %81
%141 = load i8*, i8** %4
%142 = getelementptr inbounds i8, i8* %141, i64 0
%143 = load i8, i8* %142
%144 = sext i8 %143 to i32
%145 = and i32 %144, 252
%146 = icmp eq i32 %145, 248
br i1 %146, label %147, label %213
147: ; preds = %140
%148 = load i8*, i8** %4
%149 = getelementptr inbounds i8, i8* %148, i64 1
%150 = load i8, i8* %149
%151 = sext i8 %150 to i32
%152 = and i32 %151, 192
%153 = icmp eq i32 %152, 128
br i1 %153, label %154, label %213
154: ; preds = %147
%155 = load i8*, i8** %4
%156 = getelementptr inbounds i8, i8* %155, i64 1
%157 = load i8, i8* %156
%158 = sext i8 %157 to i32
%159 = and i32 %158, 192
%160 = icmp eq i32 %159, 128
br i1 %160, label %161, label %213
161: ; preds = %154
%162 = load i8*, i8** %4
%163 = getelementptr inbounds i8, i8* %162, i64 1
%164 = load i8, i8* %163
%165 = sext i8 %164 to i32
%166 = and i32 %165, 192
%167 = icmp eq i32 %166, 128
br i1 %167, label %168, label %213
168: ; preds = %161
%169 = load i8*, i8** %4
%170 = getelementptr inbounds i8, i8* %169, i64 1
%171 = load i8, i8* %170
%172 = sext i8 %171 to i32
%173 = and i32 %172, 192
%174 = icmp eq i32 %173, 128
br i1 %174, label %175, label %213
175: ; preds = %168
%176 = load i8*, i8** %4
%177 = getelementptr inbounds i8, i8* %176, i64 0
%178 = load i8, i8* %177
%179 = sext i8 %178 to i32
%180 = and i32 %179, 3
%181 = shl i32 %180, 24
%182 = load i8*, i8** %4
%183 = getelementptr inbounds i8, i8* %182, i64 1
%184 = load i8, i8* %183
%185 = sext i8 %184 to i32
%186 = and i32 %185, 63
%187 = shl i32 %186, 18
%188 = or i32 %181, %187
%189 = load i8*, i8** %4
%190 = getelementptr inbounds i8, i8* %189, i64 2
%191 = load i8, i8* %190
%192 = sext i8 %191 to i32
%193 = and i32 %192, 63
%194 = shl i32 %193, 12
%195 = or i32 %188, %194
%196 = load i8*, i8** %4
%197 = getelementptr inbounds i8, i8* %196, i64 3
%198 = load i8, i8* %197
%199 = sext i8 %198 to i32
%200 = and i32 %199, 63
%201 = shl i32 %200, 6
%202 = or i32 %195, %201
%203 = load i8*, i8** %4
%204 = getelementptr inbounds i8, i8* %203, i64 4
%205 = load i8, i8* %204
%206 = sext i8 %205 to i32
%207 = and i32 %206, 63
%208 = shl i32 %207, 0
%209 = or i32 %202, %208
%210 = load i32*, i32** %5
store i32 %209, i32* %210
%211 = load i8*, i8** %4
%212 = getelementptr inbounds i8, i8* %211, i64 5
store i8* %212, i8** %3
br label %307
213: ; preds = %168, %161, %154, %147, %140
%214 = load i8*, i8** %4
%215 = getelementptr inbounds i8, i8* %214, i64 0
%216 = load i8, i8* %215
%217 = sext i8 %216 to i32
%218 = and i32 %217, 254
%219 = icmp eq i32 %218, 252
br i1 %219, label %220, label %300
220: ; preds = %213
%221 = load i8*, i8** %4
%222 = getelementptr inbounds i8, i8* %221, i64 1
%223 = load i8, i8* %222
%224 = sext i8 %223 to i32
%225 = and i32 %224, 192
%226 = icmp eq i32 %225, 128
br i1 %226, label %227, label %300
227: ; preds = %220
%228 = load i8*, i8** %4
%229 = getelementptr inbounds i8, i8* %228, i64 1
%230 = load i8, i8* %229
%231 = sext i8 %230 to i32
%232 = and i32 %231, 192
%233 = icmp eq i32 %232, 128
br i1 %233, label %234, label %300
234: ; preds = %227
%235 = load i8*, i8** %4
%236 = getelementptr inbounds i8, i8* %235, i64 1
%237 = load i8, i8* %236
%238 = sext i8 %237 to i32
%239 = and i32 %238, 192
%240 = icmp eq i32 %239, 128
br i1 %240, label %241, label %300
241: ; preds = %234
%242 = load i8*, i8** %4
%243 = getelementptr inbounds i8, i8* %242, i64 1
%244 = load i8, i8* %243
%245 = sext i8 %244 to i32
%246 = and i32 %245, 192
%247 = icmp eq i32 %246, 128
br i1 %247, label %248, label %300
248: ; preds = %241
%249 = load i8*, i8** %4
%250 = getelementptr inbounds i8, i8* %249, i64 1
%251 = load i8, i8* %250
%252 = sext i8 %251 to i32
%253 = and i32 %252, 192
%254 = icmp eq i32 %253, 128
br i1 %254, label %255, label %300
255: ; preds = %248
%256 = load i8*, i8** %4
%257 = getelementptr inbounds i8, i8* %256, i64 0
%258 = load i8, i8* %257
%259 = sext i8 %258 to i32
%260 = and i32 %259, 1
%261 = shl i32 %260, 30
%262 = load i8*, i8** %4
%263 = getelementptr inbounds i8, i8* %262, i64 1
%264 = load i8, i8* %263
%265 = sext i8 %264 to i32
%266 = and i32 %265, 63
%267 = shl i32 %266, 24
%268 = or i32 %261, %267
%269 = load i8*, i8** %4
%270 = getelementptr inbounds i8, i8* %269, i64 2
%271 = load i8, i8* %270
%272 = sext i8 %271 to i32
%273 = and i32 %272, 63
%274 = shl i32 %273, 18
%275 = or i32 %268, %274
%276 = load i8*, i8** %4
%277 = getelementptr inbounds i8, i8* %276, i64 3
%278 = load i8, i8* %277
%279 = sext i8 %278 to i32
%280 = and i32 %279, 63
%281 = shl i32 %280, 12
%282 = or i32 %275, %281
%283 = load i8*, i8** %4
%284 = getelementptr inbounds i8, i8* %283, i64 4
%285 = load i8, i8* %284
%286 = sext i8 %285 to i32
%287 = and i32 %286, 63
%288 = shl i32 %287, 6
%289 = or i32 %282, %288
%290 = load i8*, i8** %4
%291 = getelementptr inbounds i8, i8* %290, i64 5
%292 = load i8, i8* %291
%293 = sext i8 %292 to i32
%294 = and i32 %293, 63
%295 = shl i32 %294, 0
%296 = or i32 %289, %295
%297 = load i32*, i32** %5
store i32 %296, i32* %297
%298 = load i8*, i8** %4
%299 = getelementptr inbounds i8, i8* %298, i64 4
store i8* %299, i8** %3
br label %307
300: ; preds = %248, %241, %234, %227, %220, %213
%301 = load i8*, i8** %4
%302 = load i8, i8* %301
%303 = sext i8 %302 to i32
%304 = load i32*, i32** %5
store i32 %303, i32* %304
%305 = load i8*, i8** %4
%306 = getelementptr inbounds i8, i8* %305, i64 1
store i8* %306, i8** %3
br label %307
307: ; preds = %300, %255, %175, %109, %57, %19
%308 = load i8*, i8** %3
ret i8* %308
}

LLVM IR (-O2):
define i8* @_xos_utf8_get_char(i8* %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = and i32 %4, 224
%6 = icmp eq i32 %5, 192
br i1 %6, label %7, label %19
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = and i32 %10, 192
%12 = icmp eq i32 %11, 128
br i1 %12, label %13, label %19
13: ; preds = %7
%14 = shl nsw i32 %4, 6
%15 = and i32 %14, 1984
%16 = and i32 %10, 63
%17 = or i32 %16, %15
store i32 %17, i32* %1
%18 = getelementptr inbounds i8, i8* %0, i64 2
br label %140
19: ; preds = %7, %2
%20 = and i32 %4, 240
%21 = icmp eq i32 %20, 224
br i1 %21, label %22, label %40
22: ; preds = %19
%23 = getelementptr inbounds i8, i8* %0, i64 1
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = and i32 %25, 192
%27 = icmp eq i32 %26, 128
br i1 %27, label %28, label %40
28: ; preds = %22
%29 = shl nsw i32 %4, 12
%30 = and i32 %29, 61440
%31 = shl nsw i32 %25, 6
%32 = and i32 %31, 4032
%33 = or i32 %32, %30
%34 = getelementptr inbounds i8, i8* %0, i64 2
%35 = load i8, i8* %34
%36 = and i8 %35, 63
%37 = zext i8 %36 to i32
%38 = or i32 %33, %37
store i32 %38, i32* %1
%39 = getelementptr inbounds i8, i8* %0, i64 3
br label %140
40: ; preds = %22, %19
%41 = and i32 %4, 248
%42 = icmp eq i32 %41, 240
br i1 %42, label %43, label %67
43: ; preds = %40
%44 = getelementptr inbounds i8, i8* %0, i64 1
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = and i32 %46, 192
%48 = icmp eq i32 %47, 128
br i1 %48, label %49, label %67
49: ; preds = %43
%50 = shl nsw i32 %4, 18
%51 = and i32 %50, 1835008
%52 = shl nsw i32 %46, 12
%53 = and i32 %52, 258048
%54 = or i32 %51, %53
%55 = getelementptr inbounds i8, i8* %0, i64 2
%56 = load i8, i8* %55
%57 = and i8 %56, 63
%58 = zext i8 %57 to i32
%59 = shl nuw nsw i32 %58, 6
%60 = or i32 %59, %54
%61 = getelementptr inbounds i8, i8* %0, i64 3
%62 = load i8, i8* %61
%63 = and i8 %62, 63
%64 = zext i8 %63 to i32
%65 = or i32 %60, %64
store i32 %65, i32* %1
%66 = getelementptr inbounds i8, i8* %0, i64 4
br label %140
67: ; preds = %43, %40
%68 = and i32 %4, 252
%69 = icmp eq i32 %68, 248
br i1 %69, label %70, label %100
70: ; preds = %67
%71 = getelementptr inbounds i8, i8* %0, i64 1
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = and i32 %73, 192
%75 = icmp eq i32 %74, 128
br i1 %75, label %76, label %100
76: ; preds = %70
%77 = shl nsw i32 %4, 24
%78 = and i32 %77, 50331648
%79 = shl nsw i32 %73, 18
%80 = and i32 %79, 16515072
%81 = or i32 %78, %80
%82 = getelementptr inbounds i8, i8* %0, i64 2
%83 = load i8, i8* %82
%84 = and i8 %83, 63
%85 = zext i8 %84 to i32
%86 = shl nuw nsw i32 %85, 12
%87 = or i32 %86, %81
%88 = getelementptr inbounds i8, i8* %0, i64 3
%89 = load i8, i8* %88
%90 = and i8 %89, 63
%91 = zext i8 %90 to i32
%92 = shl nuw nsw i32 %91, 6
%93 = or i32 %87, %92
%94 = getelementptr inbounds i8, i8* %0, i64 4
%95 = load i8, i8* %94
%96 = and i8 %95, 63
%97 = zext i8 %96 to i32
%98 = or i32 %93, %97
store i32 %98, i32* %1
%99 = getelementptr inbounds i8, i8* %0, i64 5
br label %140
100: ; preds = %70, %67
%101 = and i32 %4, 254
%102 = icmp eq i32 %101, 252
br i1 %102, label %103, label %138
103: ; preds = %100
%104 = getelementptr inbounds i8, i8* %0, i64 1
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = and i32 %106, 192
%108 = icmp eq i32 %107, 128
br i1 %108, label %109, label %138
109: ; preds = %103
%110 = shl i32 %4, 30
%111 = and i32 %110, 1073741824
%112 = shl nsw i32 %106, 24
%113 = and i32 %112, 1056964608
%114 = or i32 %111, %113
%115 = getelementptr inbounds i8, i8* %0, i64 2
%116 = load i8, i8* %115
%117 = and i8 %116, 63
%118 = zext i8 %117 to i32
%119 = shl nuw nsw i32 %118, 18
%120 = or i32 %119, %114
%121 = getelementptr inbounds i8, i8* %0, i64 3
%122 = load i8, i8* %121
%123 = and i8 %122, 63
%124 = zext i8 %123 to i32
%125 = shl nuw nsw i32 %124, 12
%126 = or i32 %120, %125
%127 = getelementptr inbounds i8, i8* %0, i64 4
%128 = load i8, i8* %127
%129 = and i8 %128, 63
%130 = zext i8 %129 to i32
%131 = shl nuw nsw i32 %130, 6
%132 = or i32 %126, %131
%133 = getelementptr inbounds i8, i8* %0, i64 5
%134 = load i8, i8* %133
%135 = and i8 %134, 63
%136 = zext i8 %135 to i32
%137 = or i32 %132, %136
store i32 %137, i32* %1
br label %140
138: ; preds = %103, %100
store i32 %4, i32* %1
%139 = getelementptr inbounds i8, i8* %0, i64 1
br label %140
140: ; preds = %138, %109, %76, %49, %28, %13
%141 = phi i8* [ %18, %13 ], [ %39, %28 ], [ %66, %49 ], [ %99, %76 ], [ %127, %109 ], [ %139, %138 ]
ret i8* %141
}