#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 uint8_t;
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
uint32_t utf8_to_utf32(const uint8_t *input, int32_t *bytes_in_sequence) {
  uint8_t c1, c2, c3, c4, c5, c6;
  *bytes_in_sequence = 1;
  if (!input) {
    return 0;
  }
  c1 = input[0];
  if ((c1 & 0x80) == 0x00) {
    return c1;
  }
  if ((c1 & 0xc0) == 0x80) {
    return 0;
  }
  if (c1 == 0xfe || c1 == 0xFF) {
    return 0;
  }
  c2 = input[1];
  if (((c1 & 0xe0) == 0xc0) && ((c2 & 0xc0) == 0x80)) {
    *bytes_in_sequence = 2;
    return ((c1 & 0x1f) << 6) | (c2 & 0x3f);
  }
  c3 = input[2];
  if (((c1 & 0xf0) == 0xe0) && ((c2 & 0xc0) == 0x80) && ((c3 & 0xc0) == 0x80)) {
    *bytes_in_sequence = 3;
    return ((c1 & 0x0f) << 12) | ((c2 & 0x3f) << 6) | (c3 & 0x3f);
  }
  c4 = input[3];
  if (((c1 & 0xf8) == 0xf0) && ((c2 & 0xc0) == 0x80) && ((c3 & 0xc0) == 0x80) &&
      ((c4 & 0xc0) == 0x80)) {
    *bytes_in_sequence = 4;
    return ((c1 & 0x07) << 18) | ((c2 & 0x3f) << 12) | ((c3 & 0x3f) << 6) |
           (c4 & 0x3f);
  }
  c5 = input[4];
  if (((c1 & 0xfc) == 0xf0) && ((c2 & 0xc0) == 0x80) && ((c3 & 0xc0) == 0x80) &&
      ((c4 & 0xc0) == 0x80) && ((c5 & 0xc0) == 0x80)) {
    *bytes_in_sequence = 4;
    return ((c1 & 0x03) << 24) | ((c2 & 0x3f) << 18) | ((c3 & 0x3f) << 12) |
           ((c4 & 0x3f) << 6) | (c5 & 0x3f);
  }
  c6 = input[5];
  if (((c1 & 0xfe) == 0xf0) && ((c2 & 0xc0) == 0x80) && ((c3 & 0xc0) == 0x80) &&
      ((c4 & 0xc0) == 0x80) && ((c5 & 0xc0) == 0x80) && ((c6 & 0xc0) == 0x80)) {
    *bytes_in_sequence = 4;
    return ((c1 & 0x01) << 30) | ((c2 & 0x3f) << 24) | ((c3 & 0x3f) << 18) |
           ((c4 & 0x3f) << 12) | ((c5 & 0x3f) << 6) | (c6 & 0x3f);
  }
  return 0;
}


x86 assembly (clang, -O0):
<utf8_to_utf32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x10(%rbp)
jne    112d <utf8_to_utf32+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1469 <utf8_to_utf32+0x369>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1152 <utf8_to_utf32+0x52>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1469 <utf8_to_utf32+0x369>
mov    -0x1c(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1171 <utf8_to_utf32+0x71>
movl   $0x0,-0x4(%rbp)
jmp    1469 <utf8_to_utf32+0x369>
cmpl   $0xfe,-0x1c(%rbp)
je     118b <utf8_to_utf32+0x8b>
cmpl   $0xff,-0x1c(%rbp)
jne    1197 <utf8_to_utf32+0x97>
movl   $0x0,-0x4(%rbp)
jmp    1469 <utf8_to_utf32+0x369>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
and    $0xe0,%eax
cmp    $0xc0,%eax
jne    11ea <utf8_to_utf32+0xea>
mov    -0x20(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    11ea <utf8_to_utf32+0xea>
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x1c(%rbp),%eax
and    $0x1f,%eax
shl    $0x6,%eax
mov    -0x20(%rbp),%ecx
and    $0x3f,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1469 <utf8_to_utf32+0x369>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
and    $0xf0,%eax
cmp    $0xe0,%eax
jne    125b <utf8_to_utf32+0x15b>
mov    -0x20(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    125b <utf8_to_utf32+0x15b>
mov    -0x24(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    125b <utf8_to_utf32+0x15b>
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x1c(%rbp),%eax
and    $0xf,%eax
shl    $0xc,%eax
mov    -0x20(%rbp),%ecx
and    $0x3f,%ecx
shl    $0x6,%ecx
or     %ecx,%eax
mov    -0x24(%rbp),%ecx
and    $0x3f,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1469 <utf8_to_utf32+0x369>
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
and    $0xf8,%eax
cmp    $0xf0,%eax
jne    12ea <utf8_to_utf32+0x1ea>
mov    -0x20(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    12ea <utf8_to_utf32+0x1ea>
mov    -0x24(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    12ea <utf8_to_utf32+0x1ea>
mov    -0x28(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    12ea <utf8_to_utf32+0x1ea>
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x1c(%rbp),%eax
and    $0x7,%eax
shl    $0x12,%eax
mov    -0x20(%rbp),%ecx
and    $0x3f,%ecx
shl    $0xc,%ecx
or     %ecx,%eax
mov    -0x24(%rbp),%ecx
and    $0x3f,%ecx
shl    $0x6,%ecx
or     %ecx,%eax
mov    -0x28(%rbp),%ecx
and    $0x3f,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1469 <utf8_to_utf32+0x369>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x1c(%rbp),%eax
and    $0xfc,%eax
cmp    $0xf0,%eax
jne    1397 <utf8_to_utf32+0x297>
mov    -0x20(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1397 <utf8_to_utf32+0x297>
mov    -0x24(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1397 <utf8_to_utf32+0x297>
mov    -0x28(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1397 <utf8_to_utf32+0x297>
mov    -0x2c(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1397 <utf8_to_utf32+0x297>
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x1c(%rbp),%eax
and    $0x3,%eax
shl    $0x18,%eax
mov    -0x20(%rbp),%ecx
and    $0x3f,%ecx
shl    $0x12,%ecx
or     %ecx,%eax
mov    -0x24(%rbp),%ecx
and    $0x3f,%ecx
shl    $0xc,%ecx
or     %ecx,%eax
mov    -0x28(%rbp),%ecx
and    $0x3f,%ecx
shl    $0x6,%ecx
or     %ecx,%eax
mov    -0x2c(%rbp),%ecx
and    $0x3f,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1469 <utf8_to_utf32+0x369>
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
and    $0xfe,%eax
cmp    $0xf0,%eax
jne    1462 <utf8_to_utf32+0x362>
mov    -0x20(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1462 <utf8_to_utf32+0x362>
mov    -0x24(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1462 <utf8_to_utf32+0x362>
mov    -0x28(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1462 <utf8_to_utf32+0x362>
mov    -0x2c(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1462 <utf8_to_utf32+0x362>
mov    -0x30(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1462 <utf8_to_utf32+0x362>
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
shl    $0x1e,%eax
mov    -0x20(%rbp),%ecx
and    $0x3f,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x24(%rbp),%ecx
and    $0x3f,%ecx
shl    $0x12,%ecx
or     %ecx,%eax
mov    -0x28(%rbp),%ecx
and    $0x3f,%ecx
shl    $0xc,%ecx
or     %ecx,%eax
mov    -0x2c(%rbp),%ecx
and    $0x3f,%ecx
shl    $0x6,%ecx
or     %ecx,%eax
mov    -0x30(%rbp),%ecx
and    $0x3f,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1469 <utf8_to_utf32+0x369>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_to_utf32>:
push   %rbp
push   %r15
push   %r14
push   %rbx
movl   $0x1,(%rsi)
xor    %eax,%eax
test   %rdi,%rdi
je     111d <utf8_to_utf32+0x1d>
mov    (%rdi),%ebp
test   $0x80,%bpl
jne    1124 <utf8_to_utf32+0x24>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ebp,%ecx
and    $0xc0,%ecx
cmp    $0x80,%ecx
je     111d <utf8_to_utf32+0x1d>
mov    %ebp,%ecx
and    $0xfffffffe,%ecx
cmp    $0xfe,%ecx
je     111d <utf8_to_utf32+0x1d>
mov    0x4(%rdi),%r11d
mov    %ebp,%edx
and    $0xe0,%edx
mov    %r11d,%ecx
and    $0xc0,%ecx
cmp    $0xc0,%edx
jne    117e <utf8_to_utf32+0x7e>
cmp    $0x80,%ecx
jne    117e <utf8_to_utf32+0x7e>
movl   $0x2,(%rsi)
and    $0x1f,%ebp
shl    $0x6,%ebp
and    $0x3f,%r11d
or     %ebp,%r11d
mov    %r11d,%eax
jmp    111d <utf8_to_utf32+0x1d>
mov    0x8(%rdi),%r8d
mov    %ebp,%edx
and    $0xf0,%edx
mov    %r8d,%ebx
and    $0xc0,%ebx
cmp    $0xe0,%edx
jne    11d1 <utf8_to_utf32+0xd1>
cmp    $0x80,%ecx
jne    11d1 <utf8_to_utf32+0xd1>
cmp    $0x80,%ebx
jne    11d1 <utf8_to_utf32+0xd1>
movl   $0x3,(%rsi)
shl    $0xc,%ebp
movzwl %bp,%eax
and    $0x3f,%r11d
shl    $0x6,%r11d
or     %eax,%r11d
and    $0x3f,%r8d
or     %r11d,%r8d
mov    %r8d,%eax
jmp    111d <utf8_to_utf32+0x1d>
mov    0xc(%rdi),%r9d
mov    %ebp,%edx
and    $0xf8,%edx
mov    %r9d,%r15d
and    $0xc0,%r15d
cmp    $0xf0,%edx
jne    1239 <utf8_to_utf32+0x139>
cmp    $0x80,%ecx
jne    1239 <utf8_to_utf32+0x139>
cmp    $0x80,%ebx
jne    1239 <utf8_to_utf32+0x139>
cmp    $0x80,%r15d
jne    1239 <utf8_to_utf32+0x139>
movl   $0x4,(%rsi)
and    $0x7,%ebp
shl    $0x12,%ebp
and    $0x3f,%r11d
shl    $0xc,%r11d
or     %ebp,%r11d
and    $0x3f,%r8d
shl    $0x6,%r8d
or     %r11d,%r8d
and    $0x3f,%r9d
or     %r8d,%r9d
mov    %r9d,%eax
jmp    111d <utf8_to_utf32+0x1d>
mov    0x10(%rdi),%r10d
mov    %ebp,%edx
and    $0xfc,%edx
mov    %r10d,%r14d
and    $0xc0,%r14d
cmp    $0xf0,%edx
jne    12b5 <utf8_to_utf32+0x1b5>
cmp    $0x80,%ecx
jne    12b5 <utf8_to_utf32+0x1b5>
cmp    $0x80,%ebx
jne    12b5 <utf8_to_utf32+0x1b5>
cmp    $0x80,%r15d
jne    12b5 <utf8_to_utf32+0x1b5>
cmp    $0x80,%r14d
jne    12b5 <utf8_to_utf32+0x1b5>
movl   $0x4,(%rsi)
and    $0x3,%ebp
shl    $0x18,%ebp
and    $0x3f,%r11d
shl    $0x12,%r11d
or     %ebp,%r11d
and    $0x3f,%r8d
shl    $0xc,%r8d
or     %r11d,%r8d
and    $0x3f,%r9d
shl    $0x6,%r9d
or     %r8d,%r9d
and    $0x3f,%r10d
or     %r9d,%r10d
mov    %r10d,%eax
jmp    111d <utf8_to_utf32+0x1d>
mov    %ebp,%edx
and    $0xfe,%edx
cmp    $0xf0,%edx
jne    111d <utf8_to_utf32+0x1d>
cmp    $0x80,%ecx
jne    111d <utf8_to_utf32+0x1d>
cmp    $0x80,%ebx
jne    111d <utf8_to_utf32+0x1d>
cmp    $0x80,%r15d
jne    111d <utf8_to_utf32+0x1d>
cmp    $0x80,%r14d
jne    111d <utf8_to_utf32+0x1d>
mov    0x14(%rdi),%ecx
mov    %ecx,%edx
and    $0xc0,%edx
cmp    $0x80,%edx
jne    111d <utf8_to_utf32+0x1d>
movl   $0x4,(%rsi)
and    $0x1,%ebp
shl    $0x1e,%ebp
and    $0x3f,%r11d
shl    $0x18,%r11d
or     %ebp,%r11d
and    $0x3f,%r8d
shl    $0x12,%r8d
or     %r11d,%r8d
and    $0x3f,%r9d
shl    $0xc,%r9d
or     %r8d,%r9d
and    $0x3f,%r10d
shl    $0x6,%r10d
or     %r9d,%r10d
and    $0x3f,%ecx
or     %r10d,%ecx
mov    %ecx,%eax
jmp    111d <utf8_to_utf32+0x1d>

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

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