#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 */
int gcr_decode(unsigned const char *gcr, unsigned char *decoded) {
  static const unsigned char lo[] = {
      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0x00,
      0x01, 0xff, 0x0c, 0x04, 0x05, 0xff, 0xff, 0x02, 0x03, 0xff, 0x0f,
      0x06, 0x07, 0xff, 0x09, 0x0a, 0x0b, 0xff, 0x0d, 0x0e, 0xff};
  static const unsigned char hi[] = {
      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
      0x10, 0xff, 0xc0, 0x40, 0x50, 0xff, 0xff, 0x20, 0x30, 0xff, 0xf0,
      0x60, 0x70, 0xff, 0x90, 0xa0, 0xb0, 0xff, 0xd0, 0xe0, 0xff};
  unsigned char ref, chk = 0, hdr, *c = NULL;
  register unsigned char g0, g1, g2, g3, g4;
  int i;
  g0 = *(gcr++);
  g1 = *(gcr++);
  hdr = hi[(g0 >> 3) & 0x1f] | lo[((g0 & 0x07) << 2) | ((g1 >> 6) & 0x03)];
  if (hdr != 0x07) {
    return 4;
  }
  for (i = 0; i < 256; i += 4) {
    g2 = *(gcr++);
    g3 = *(gcr++);
    g4 = *(gcr++);
    if (c) {
      chk ^= *c++ =
          hi[(g0 >> 3) & 0x1f] | lo[((g0 & 0x07) << 2) | ((g1 >> 6) & 0x03)];
    } else {
      c = decoded;
    }
    chk ^= *c++ =
        hi[(g1 >> 1) & 0x1f] | lo[((g1 & 0x01) << 4) | ((g2 >> 4) & 0x0f)];
    chk ^= *c++ =
        hi[((g2 & 0x0f) << 1) | ((g3 >> 7) & 0x01)] | lo[(g3 >> 2) & 0x1f];
    chk ^= *c++ = hi[((g3 & 0x03) << 3) | ((g4 >> 5) & 0x07)] | lo[g4 & 0x1f];
    g0 = *(gcr++);
    g1 = *(gcr++);
  }
  chk ^= *c =
      hi[(g0 >> 3) & 0x1f] | lo[((g0 & 0x07) << 2) | ((g1 >> 6) & 0x03)];
  g2 = *gcr;
  ref = hi[(g1 >> 1) & 0x1f] | lo[((g1 & 0x01) << 4) | ((g2 >> 4) & 0x0f)];
  return (chk != ref) ? 5 : 0;
}


x86 assembly (clang, -O0):
<gcr_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movb   $0x0,-0x1a(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x29(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x2a(%rbp)
movzbl -0x29(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0xecc(%rip),%rax
movzbl (%rax,%rcx,1),%eax
movzbl -0x29(%rbp),%ecx
and    $0x7,%ecx
shl    $0x2,%ecx
movzbl -0x2a(%rbp),%edx
sar    $0x6,%edx
and    $0x3,%edx
or     %edx,%ecx
movslq %ecx,%rdx
lea    0xe88(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    %al,-0x1b(%rbp)
movzbl -0x1b(%rbp),%eax
cmp    $0x7,%eax
je     119a <gcr_decode+0x9a>
movl   $0x4,-0x4(%rbp)
jmp    1452 <gcr_decode+0x352>
movl   $0x0,-0x34(%rbp)
cmpl   $0x100,-0x34(%rbp)
jge    13a1 <gcr_decode+0x2a1>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x2b(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x2d(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1255 <gcr_decode+0x155>
movzbl -0x29(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0xe17(%rip),%rax
movzbl (%rax,%rcx,1),%eax
movzbl -0x29(%rbp),%ecx
and    $0x7,%ecx
shl    $0x2,%ecx
movzbl -0x2a(%rbp),%edx
sar    $0x6,%edx
and    $0x3,%edx
or     %edx,%ecx
movslq %ecx,%rdx
lea    0xdd3(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %al,(%rcx)
movzbl %al,%ecx
movzbl -0x1a(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x1a(%rbp)
jmp    125d <gcr_decode+0x15d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
movzbl -0x2a(%rbp),%eax
sar    $0x1,%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0xdaf(%rip),%rax
movzbl (%rax,%rcx,1),%eax
movzbl -0x2a(%rbp),%ecx
and    $0x1,%ecx
shl    $0x4,%ecx
movzbl -0x2b(%rbp),%edx
sar    $0x4,%edx
and    $0xf,%edx
or     %edx,%ecx
movslq %ecx,%rdx
lea    0xd6b(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %al,(%rcx)
movzbl %al,%ecx
movzbl -0x1a(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x1a(%rbp)
movzbl -0x2b(%rbp),%eax
and    $0xf,%eax
shl    $0x1,%eax
movzbl -0x2c(%rbp),%ecx
sar    $0x7,%ecx
and    $0x1,%ecx
or     %ecx,%eax
movslq %eax,%rcx
lea    0xd48(%rip),%rax
movzbl (%rax,%rcx,1),%eax
movzbl -0x2c(%rbp),%ecx
sar    $0x2,%ecx
and    $0x1f,%ecx
movslq %ecx,%rdx
lea    0xd10(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %al,(%rcx)
movzbl %al,%ecx
movzbl -0x1a(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x1a(%rbp)
movzbl -0x2c(%rbp),%eax
and    $0x3,%eax
shl    $0x3,%eax
movzbl -0x2d(%rbp),%ecx
sar    $0x5,%ecx
and    $0x7,%ecx
or     %ecx,%eax
movslq %eax,%rcx
lea    0xced(%rip),%rax
movzbl (%rax,%rcx,1),%eax
movzbl -0x2d(%rbp),%ecx
and    $0x1f,%ecx
movslq %ecx,%rdx
lea    0xcb8(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %al,(%rcx)
movzbl %al,%ecx
movzbl -0x1a(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x1a(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x29(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x2a(%rbp)
mov    -0x34(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
jmp    11a1 <gcr_decode+0xa1>
movzbl -0x29(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0xc6b(%rip),%rax
movzbl (%rax,%rcx,1),%eax
movzbl -0x29(%rbp),%ecx
and    $0x7,%ecx
shl    $0x2,%ecx
movzbl -0x2a(%rbp),%edx
sar    $0x6,%edx
and    $0x3,%edx
or     %edx,%ecx
movslq %ecx,%rdx
lea    0xc27(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    -0x28(%rbp),%rcx
mov    %al,(%rcx)
movzbl %al,%ecx
movzbl -0x1a(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x1a(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x2b(%rbp)
movzbl -0x2a(%rbp),%eax
sar    $0x1,%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0xc12(%rip),%rax
movzbl (%rax,%rcx,1),%eax
movzbl -0x2a(%rbp),%ecx
and    $0x1,%ecx
shl    $0x4,%ecx
movzbl -0x2b(%rbp),%edx
sar    $0x4,%edx
and    $0xf,%edx
or     %edx,%ecx
movslq %ecx,%rdx
lea    0xbce(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    %al,-0x19(%rbp)
movzbl -0x1a(%rbp),%edx
movzbl -0x19(%rbp),%esi
xor    %eax,%eax
mov    $0x5,%ecx
cmp    %esi,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcr_decode>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
movzbl (%rdi),%r15d
movzbl 0x1(%rdi),%ebx
mov    %r15,%rax
shr    $0x3,%rax
lea    0xf00(%rip),%r8
mov    %r15d,%ecx
and    $0x7,%ecx
mov    %rbx,%rdx
shr    $0x6,%rdx
lea    (%rdx,%rcx,4),%rcx
lea    0xec8(%rip),%r9
mov    (%r9,%rcx,1),%cl
or     (%rax,%r8,1),%cl
mov    $0x4,%eax
cmp    $0x7,%cl
jne    12a3 <gcr_decode+0x1a3>
add    $0x2,%rdi
mov    $0xfffffffc,%r11d
xor    %ebp,%ebp
xor    %ecx,%ecx
jmp    122d <gcr_decode+0x12d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %r15b,%edx
mov    %rdx,%rdi
shr    $0x3,%rdi
shl    $0x2,%edx
and    $0x1c,%edx
mov    %ebx,%eax
shr    $0x6,%al
movzbl %al,%eax
or     %rdx,%rax
movzbl (%r9,%rax,1),%eax
or     (%rdi,%r8,1),%al
mov    %al,0x0(%rbp)
add    $0x1,%rbp
xor    %al,%cl
movzbl %bl,%eax
shr    %bl
movzbl %bl,%edi
and    $0x1f,%edi
shl    $0x4,%eax
and    $0x10,%eax
mov    %r12,%rdx
shr    $0x4,%rdx
or     %rax,%rdx
movzbl (%r9,%rdx,1),%edx
or     (%rdi,%r8,1),%dl
mov    %dl,0x0(%rbp)
xor    %cl,%dl
and    $0xf,%r12d
mov    %r13,%rax
shr    $0x7,%rax
lea    (%rax,%r12,2),%rax
mov    %r13d,%ecx
shr    $0x2,%ecx
and    $0x1f,%ecx
movzbl (%rcx,%r9,1),%ebx
or     (%r8,%rax,1),%bl
mov    %bl,0x1(%rbp)
and    $0x3,%r13d
mov    %r14,%rax
shr    $0x5,%rax
lea    (%rax,%r13,8),%rax
and    $0x1f,%r14d
movzbl (%r14,%r9,1),%ecx
or     (%r8,%rax,1),%cl
mov    %cl,0x2(%rbp)
add    $0x3,%rbp
xor    %bl,%cl
xor    %dl,%cl
movzbl 0x3(%r10),%r15d
movzbl 0x4(%r10),%ebx
add    $0x4,%r11d
lea    0x5(%r10),%rdi
cmp    $0xfc,%r11d
jae    124f <gcr_decode+0x14f>
mov    %rdi,%r10
movzbl (%rdi),%r12d
movzbl 0x1(%rdi),%r13d
movzbl 0x2(%rdi),%r14d
test   %rbp,%rbp
jne    1170 <gcr_decode+0x70>
mov    %rsi,%rbp
jmp    119e <gcr_decode+0x9e>
movzbl %r15b,%eax
movzbl %bl,%edx
mov    %rax,%rsi
shr    $0x3,%rsi
and    $0x7,%eax
mov    %rdx,%rdi
shr    $0x6,%rdi
lea    (%rdi,%rax,4),%rax
mov    (%r9,%rax,1),%al
or     (%rsi,%r8,1),%al
mov    %al,0x0(%rbp)
xor    %cl,%al
movzbl 0x5(%r10),%ecx
mov    %edx,%esi
shr    %esi
and    $0x1f,%esi
shl    $0x4,%edx
and    $0x10,%edx
shr    $0x4,%rcx
or     %rdx,%rcx
mov    (%r9,%rcx,1),%cl
or     (%rsi,%r8,1),%cl
xor    %edx,%edx
cmp    %cl,%al
setne  %dl
lea    (%rdx,%rdx,4),%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@gcr_decode.lo = internal constant [32 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\FF\08\00\01\FF\0C\04\05\FF\FF\02\03\FF\0F\06\07\FF\09\0A\0B\FF\0D\0E\FF"
@gcr_decode.hi = internal constant [32 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\FF\80\00\10\FF\C0@P\FF\FF 0\FF\F0`p\FF\90\A0\B0\FF\D0\E0\FF"
define i32 @gcr_decode(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
%15 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 0, i8* %7
store i8* null, i8** %9
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
%18 = load i8, i8* %16
store i8 %18, i8* %10
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %4
%21 = load i8, i8* %19
store i8 %21, i8* %11
%22 = load i8, i8* %10
%23 = zext i8 %22 to i32
%24 = ashr i32 %23, 3
%25 = and i32 %24, 31
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = load i8, i8* %10
%31 = zext i8 %30 to i32
%32 = and i32 %31, 7
%33 = shl i32 %32, 2
%34 = load i8, i8* %11
%35 = zext i8 %34 to i32
%36 = ashr i32 %35, 6
%37 = and i32 %36, 3
%38 = or i32 %33, %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = or i32 %29, %42
%44 = trunc i32 %43 to i8
store i8 %44, i8* %8
%45 = load i8, i8* %8
%46 = zext i8 %45 to i32
%47 = icmp ne i32 %46, 7
br i1 %47, label %48, label %49
48: ; preds = %2
store i32 4, i32* %3
br label %259
49: ; preds = %2
store i32 0, i32* %15
br label %50
50: ; preds = %194, %49
%51 = load i32, i32* %15
%52 = icmp slt i32 %51, 256
br i1 %52, label %53, label %197
53: ; preds = %50
%54 = load i8*, i8** %4
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %4
%56 = load i8, i8* %54
store i8 %56, i8* %12
%57 = load i8*, i8** %4
%58 = getelementptr inbounds i8, i8* %57, i32 1
store i8* %58, i8** %4
%59 = load i8, i8* %57
store i8 %59, i8* %13
%60 = load i8*, i8** %4
%61 = getelementptr inbounds i8, i8* %60, i32 1
store i8* %61, i8** %4
%62 = load i8, i8* %60
store i8 %62, i8* %14
%63 = load i8*, i8** %9
%64 = icmp ne i8* %63, null
br i1 %64, label %65, label %96
65: ; preds = %53
%66 = load i8, i8* %10
%67 = zext i8 %66 to i32
%68 = ashr i32 %67, 3
%69 = and i32 %68, 31
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %70
%72 = load i8, i8* %71
%73 = zext i8 %72 to i32
%74 = load i8, i8* %10
%75 = zext i8 %74 to i32
%76 = and i32 %75, 7
%77 = shl i32 %76, 2
%78 = load i8, i8* %11
%79 = zext i8 %78 to i32
%80 = ashr i32 %79, 6
%81 = and i32 %80, 3
%82 = or i32 %77, %81
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %83
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
%87 = or i32 %73, %86
%88 = trunc i32 %87 to i8
%89 = load i8*, i8** %9
%90 = getelementptr inbounds i8, i8* %89, i32 1
store i8* %90, i8** %9
store i8 %88, i8* %89
%91 = zext i8 %88 to i32
%92 = load i8, i8* %7
%93 = zext i8 %92 to i32
%94 = xor i32 %93, %91
%95 = trunc i32 %94 to i8
store i8 %95, i8* %7
br label %98
96: ; preds = %53
%97 = load i8*, i8** %5
store i8* %97, i8** %9
br label %98
98: ; preds = %96, %65
%99 = load i8, i8* %11
%100 = zext i8 %99 to i32
%101 = ashr i32 %100, 1
%102 = and i32 %101, 31
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %103
%105 = load i8, i8* %104
%106 = zext i8 %105 to i32
%107 = load i8, i8* %11
%108 = zext i8 %107 to i32
%109 = and i32 %108, 1
%110 = shl i32 %109, 4
%111 = load i8, i8* %12
%112 = zext i8 %111 to i32
%113 = ashr i32 %112, 4
%114 = and i32 %113, 15
%115 = or i32 %110, %114
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %116
%118 = load i8, i8* %117
%119 = zext i8 %118 to i32
%120 = or i32 %106, %119
%121 = trunc i32 %120 to i8
%122 = load i8*, i8** %9
%123 = getelementptr inbounds i8, i8* %122, i32 1
store i8* %123, i8** %9
store i8 %121, i8* %122
%124 = zext i8 %121 to i32
%125 = load i8, i8* %7
%126 = zext i8 %125 to i32
%127 = xor i32 %126, %124
%128 = trunc i32 %127 to i8
store i8 %128, i8* %7
%129 = load i8, i8* %12
%130 = zext i8 %129 to i32
%131 = and i32 %130, 15
%132 = shl i32 %131, 1
%133 = load i8, i8* %13
%134 = zext i8 %133 to i32
%135 = ashr i32 %134, 7
%136 = and i32 %135, 1
%137 = or i32 %132, %136
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %138
%140 = load i8, i8* %139
%141 = zext i8 %140 to i32
%142 = load i8, i8* %13
%143 = zext i8 %142 to i32
%144 = ashr i32 %143, 2
%145 = and i32 %144, 31
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %146
%148 = load i8, i8* %147
%149 = zext i8 %148 to i32
%150 = or i32 %141, %149
%151 = trunc i32 %150 to i8
%152 = load i8*, i8** %9
%153 = getelementptr inbounds i8, i8* %152, i32 1
store i8* %153, i8** %9
store i8 %151, i8* %152
%154 = zext i8 %151 to i32
%155 = load i8, i8* %7
%156 = zext i8 %155 to i32
%157 = xor i32 %156, %154
%158 = trunc i32 %157 to i8
store i8 %158, i8* %7
%159 = load i8, i8* %13
%160 = zext i8 %159 to i32
%161 = and i32 %160, 3
%162 = shl i32 %161, 3
%163 = load i8, i8* %14
%164 = zext i8 %163 to i32
%165 = ashr i32 %164, 5
%166 = and i32 %165, 7
%167 = or i32 %162, %166
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %168
%170 = load i8, i8* %169
%171 = zext i8 %170 to i32
%172 = load i8, i8* %14
%173 = zext i8 %172 to i32
%174 = and i32 %173, 31
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %175
%177 = load i8, i8* %176
%178 = zext i8 %177 to i32
%179 = or i32 %171, %178
%180 = trunc i32 %179 to i8
%181 = load i8*, i8** %9
%182 = getelementptr inbounds i8, i8* %181, i32 1
store i8* %182, i8** %9
store i8 %180, i8* %181
%183 = zext i8 %180 to i32
%184 = load i8, i8* %7
%185 = zext i8 %184 to i32
%186 = xor i32 %185, %183
%187 = trunc i32 %186 to i8
store i8 %187, i8* %7
%188 = load i8*, i8** %4
%189 = getelementptr inbounds i8, i8* %188, i32 1
store i8* %189, i8** %4
%190 = load i8, i8* %188
store i8 %190, i8* %10
%191 = load i8*, i8** %4
%192 = getelementptr inbounds i8, i8* %191, i32 1
store i8* %192, i8** %4
%193 = load i8, i8* %191
store i8 %193, i8* %11
br label %194
194: ; preds = %98
%195 = load i32, i32* %15
%196 = add nsw i32 %195, 4
store i32 %196, i32* %15
br label %50
197: ; preds = %50
%198 = load i8, i8* %10
%199 = zext i8 %198 to i32
%200 = ashr i32 %199, 3
%201 = and i32 %200, 31
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %202
%204 = load i8, i8* %203
%205 = zext i8 %204 to i32
%206 = load i8, i8* %10
%207 = zext i8 %206 to i32
%208 = and i32 %207, 7
%209 = shl i32 %208, 2
%210 = load i8, i8* %11
%211 = zext i8 %210 to i32
%212 = ashr i32 %211, 6
%213 = and i32 %212, 3
%214 = or i32 %209, %213
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %215
%217 = load i8, i8* %216
%218 = zext i8 %217 to i32
%219 = or i32 %205, %218
%220 = trunc i32 %219 to i8
%221 = load i8*, i8** %9
store i8 %220, i8* %221
%222 = zext i8 %220 to i32
%223 = load i8, i8* %7
%224 = zext i8 %223 to i32
%225 = xor i32 %224, %222
%226 = trunc i32 %225 to i8
store i8 %226, i8* %7
%227 = load i8*, i8** %4
%228 = load i8, i8* %227
store i8 %228, i8* %12
%229 = load i8, i8* %11
%230 = zext i8 %229 to i32
%231 = ashr i32 %230, 1
%232 = and i32 %231, 31
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %233
%235 = load i8, i8* %234
%236 = zext i8 %235 to i32
%237 = load i8, i8* %11
%238 = zext i8 %237 to i32
%239 = and i32 %238, 1
%240 = shl i32 %239, 4
%241 = load i8, i8* %12
%242 = zext i8 %241 to i32
%243 = ashr i32 %242, 4
%244 = and i32 %243, 15
%245 = or i32 %240, %244
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %246
%248 = load i8, i8* %247
%249 = zext i8 %248 to i32
%250 = or i32 %236, %249
%251 = trunc i32 %250 to i8
store i8 %251, i8* %6
%252 = load i8, i8* %7
%253 = zext i8 %252 to i32
%254 = load i8, i8* %6
%255 = zext i8 %254 to i32
%256 = icmp ne i32 %253, %255
%257 = zext i1 %256 to i64
%258 = select i1 %256, i32 5, i32 0
store i32 %258, i32* %3
br label %259
259: ; preds = %197, %48
%260 = load i32, i32* %3
ret i32 %260
}

LLVM IR (-O2):
@gcr_decode.lo = internal unnamed_addr constant [32 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\FF\08\00\01\FF\0C\04\05\FF\FF\02\03\FF\0F\06\07\FF\09\0A\0B\FF\0D\0E\FF"
@gcr_decode.hi = internal unnamed_addr constant [32 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\FF\80\00\10\FF\C0@P\FF\FF 0\FF\F0`p\FF\90\A0\B0\FF\D0\E0\FF"
define i32 @gcr_decode(i8* nocapture %0, i8* writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %0
%5 = load i8, i8* %3
%6 = zext i8 %4 to i32
%7 = lshr i32 %6, 3
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = shl nuw nsw i32 %6, 2
%12 = and i32 %11, 28
%13 = lshr i8 %5, 6
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = or i8 %18, %10
%20 = icmp eq i8 %19, 7
br i1 %20, label %21, label %144
21: ; preds = %2
%22 = getelementptr inbounds i8, i8* %0, i64 2
br label %23
23: ; preds = %21, %54
%24 = phi i32 [ 0, %21 ], [ %109, %54 ]
%25 = phi i8* [ %22, %21 ], [ %107, %54 ]
%26 = phi i8 [ %5, %21 ], [ %108, %54 ]
%27 = phi i8 [ %4, %21 ], [ %106, %54 ]
%28 = phi i8* [ null, %21 ], [ %103, %54 ]
%29 = phi i8 [ 0, %21 ], [ %104, %54 ]
%30 = getelementptr inbounds i8, i8* %25, i64 1
%31 = load i8, i8* %25
%32 = getelementptr inbounds i8, i8* %25, i64 2
%33 = load i8, i8* %30
%34 = getelementptr inbounds i8, i8* %25, i64 3
%35 = load i8, i8* %32
%36 = icmp eq i8* %28, null
br i1 %36, label %54, label %37
37: ; preds = %23
%38 = zext i8 %27 to i32
%39 = lshr i32 %38, 3
%40 = zext i32 %39 to i64
%41 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = shl nuw nsw i32 %38, 2
%44 = and i32 %43, 28
%45 = lshr i8 %26, 6
%46 = zext i8 %45 to i32
%47 = or i32 %44, %46
%48 = zext i32 %47 to i64
%49 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = or i8 %50, %42
%52 = getelementptr inbounds i8, i8* %28, i64 1
store i8 %51, i8* %28
%53 = xor i8 %51, %29
br label %54
54: ; preds = %23, %37
%55 = phi i8 [ %53, %37 ], [ %29, %23 ]
%56 = phi i8* [ %52, %37 ], [ %1, %23 ]
%57 = zext i8 %26 to i32
%58 = lshr i32 %57, 1
%59 = and i32 %58, 31
%60 = zext i32 %59 to i64
%61 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = shl nuw nsw i32 %57, 4
%64 = and i32 %63, 16
%65 = zext i8 %31 to i32
%66 = lshr i32 %65, 4
%67 = or i32 %66, %64
%68 = zext i32 %67 to i64
%69 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %68
%70 = load i8, i8* %69
%71 = or i8 %70, %62
%72 = getelementptr inbounds i8, i8* %56, i64 1
store i8 %71, i8* %56
%73 = xor i8 %71, %55
%74 = shl nuw nsw i32 %65, 1
%75 = and i32 %74, 30
%76 = zext i8 %33 to i32
%77 = lshr i32 %76, 7
%78 = or i32 %75, %77
%79 = zext i32 %78 to i64
%80 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %79
%81 = load i8, i8* %80
%82 = lshr i32 %76, 2
%83 = and i32 %82, 31
%84 = zext i32 %83 to i64
%85 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %84
%86 = load i8, i8* %85
%87 = or i8 %86, %81
%88 = getelementptr inbounds i8, i8* %56, i64 2
store i8 %87, i8* %72
%89 = xor i8 %73, %87
%90 = shl nuw nsw i32 %76, 3
%91 = and i32 %90, 24
%92 = zext i8 %35 to i32
%93 = lshr i32 %92, 5
%94 = or i32 %91, %93
%95 = zext i32 %94 to i64
%96 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %95
%97 = load i8, i8* %96
%98 = and i32 %92, 31
%99 = zext i32 %98 to i64
%100 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %99
%101 = load i8, i8* %100
%102 = or i8 %101, %97
%103 = getelementptr inbounds i8, i8* %56, i64 3
store i8 %102, i8* %88
%104 = xor i8 %89, %102
%105 = getelementptr inbounds i8, i8* %25, i64 4
%106 = load i8, i8* %34
%107 = getelementptr inbounds i8, i8* %25, i64 5
%108 = load i8, i8* %105
%109 = add nuw nsw i32 %24, 4
%110 = icmp ult i32 %24, 252
br i1 %110, label %23, label %111
111: ; preds = %54
%112 = zext i8 %106 to i32
%113 = lshr i32 %112, 3
%114 = zext i32 %113 to i64
%115 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %114
%116 = load i8, i8* %115
%117 = shl nuw nsw i32 %112, 2
%118 = and i32 %117, 28
%119 = zext i8 %108 to i32
%120 = lshr i32 %119, 6
%121 = or i32 %118, %120
%122 = zext i32 %121 to i64
%123 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %122
%124 = load i8, i8* %123
%125 = or i8 %124, %116
store i8 %125, i8* %103
%126 = xor i8 %125, %104
%127 = load i8, i8* %107
%128 = lshr i32 %119, 1
%129 = and i32 %128, 31
%130 = zext i32 %129 to i64
%131 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.hi, i64 0, i64 %130
%132 = load i8, i8* %131
%133 = shl nuw nsw i32 %119, 4
%134 = and i32 %133, 16
%135 = lshr i8 %127, 4
%136 = zext i8 %135 to i32
%137 = or i32 %134, %136
%138 = zext i32 %137 to i64
%139 = getelementptr inbounds [32 x i8], [32 x i8]* @gcr_decode.lo, i64 0, i64 %138
%140 = load i8, i8* %139
%141 = or i8 %140, %132
%142 = icmp eq i8 %126, %141
%143 = select i1 %142, i32 0, i32 5
br label %144
144: ; preds = %2, %111
%145 = phi i32 [ %143, %111 ], [ 4, %2 ]
ret i32 %145
}