#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 EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, ...);
int getchar();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int c, cl;
  int ioffset = 0;
  int ooffset = 0;
  while ((c = getchar()) != EOF) {
    ioffset++;
    cl = c;
    if (c == 0) {
      if ((c = getchar()) == EOF) {
        fprintf(stderr,
                "Unexpected end of file while reading number of consecutive "
                "zero bytes (0x%x -> %02x).\n\n",
                ioffset, cl);
        exit(1);
      }
      ioffset++;
      if (c == 0)
        break;
      while (c > 0) {
        putchar(0);
        ooffset++;
        c--;
      }
    } else if (c == 128) {
      int cnt;
      if ((cnt = getchar()) == EOF) {
        fprintf(stderr,
                "Unexpected end of file while reading repetition length (0x%x "
                "-> %02x).\n\n",
                ioffset, cl);
        exit(1);
      }
      ioffset++;
      if ((c = getchar()) == EOF) {
        fprintf(stderr,
                "Unexpected end of file while reading byte value to repeat "
                "(0x%x -> %02x %02x).\n\n",
                ioffset, cl, cnt);
        exit(1);
      }
      ioffset++;
      while (cnt > 0) {
        putchar(c);
        ooffset++;
        cnt--;
      }
    } else if (c == 129) {
      int len = 2;
      int shift = 0;
      int cnt = 0;
      while (len > 0) {
        int b;
        if ((b = getchar()) == EOF) {
          fprintf(stderr,
                  "Unexpected end of file while reading repetition length "
                  "(0x%x -> %02x).\n\n",
                  ioffset, cl);
          exit(1);
        }
        ioffset++;
        cnt += (b << shift);
        shift += 8;
        len--;
      }
      if ((c = getchar()) == EOF) {
        fprintf(stderr,
                "Unexpected end of file while reading byte value to repeat "
                "(0x%x -> %02x %04x).\n\n",
                ioffset, cl, cnt);
        exit(1);
      }
      ioffset++;
      while (cnt > 0) {
        putchar(c);
        ooffset++;
        cnt--;
      }
    } else if (c == 130) {
      int cnt;
      if ((cnt = getchar()) == EOF) {
        fprintf(stderr,
                "Unexpected end of file while reading repetition length (0x%x "
                "-> %02x).\n\n",
                ioffset, cl);
        exit(1);
      }
      ioffset++;
      c = 0x20;
      while (cnt > 0) {
        putchar(c);
        ooffset++;
        cnt--;
      }
    } else if (c > 130) {
      int cnt = c - 128;
      if ((c = getchar()) == EOF) {
        fprintf(stderr,
                "Unexpected end of file while reading byte value to repeat "
                "(0x%x -> %02x).\n\n",
                ioffset, cl);
        exit(1);
      }
      ioffset++;
      while (cnt > 0) {
        putchar(c);
        ooffset++;
        cnt--;
      }
    } else {
      int ilog = ioffset;
      while (c > 0) {
        int chr;
        if ((chr = getchar()) == EOF) {
          fprintf(stderr,
                  "Unexpected end of file while reading consecutive unique "
                  "bytes (0x%x -> %02x -> 0x%d).\n\n",
                  ilog, cl, ioffset - ilog);
          exit(1);
        }
        ioffset++;
        putchar(chr);
        ooffset++;
        c--;
      }
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e73(%rip),%rcx
cmp    (%rcx),%eax
je     15be <main+0x47e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1220 <main+0xe0>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e41(%rip),%rcx
cmp    (%rcx),%eax
jne    11d6 <main+0x96>
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe3b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11ee <main+0xae>
jmp    15be <main+0x47e>
jmp    11f3 <main+0xb3>
cmpl   $0x0,-0x14(%rbp)
jle    121b <main+0xdb>
xor    %edi,%edi
call   1030 <putchar@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    11f3 <main+0xb3>
jmp    15b9 <main+0x479>
cmpl   $0x80,-0x14(%rbp)
jne    12f1 <main+0x1b1>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x24(%rbp)
mov    0x2daa(%rip),%rcx
cmp    (%rcx),%eax
jne    126d <main+0x12d>
mov    0x2d8b(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xdfc(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2d61(%rip),%rcx
cmp    (%rcx),%eax
jne    12ba <main+0x17a>
mov    0x2d42(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xdf8(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    12ec <main+0x1ac>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    12c3 <main+0x183>
jmp    15b4 <main+0x474>
cmpl   $0x81,-0x14(%rbp)
jne    1406 <main+0x2c6>
movl   $0x2,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
cmpl   $0x0,-0x28(%rbp)
jle    138b <main+0x24b>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x34(%rbp)
mov    0x2cba(%rip),%rcx
cmp    (%rcx),%eax
jne    135d <main+0x21d>
mov    0x2c9b(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xd0c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x2c(%rbp),%ecx
shl    %cl,%eax
add    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x28(%rbp)
jmp    1313 <main+0x1d3>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2c4c(%rip),%rcx
cmp    (%rcx),%eax
jne    13cf <main+0x28f>
mov    0x2c2d(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x30(%rbp),%r8d
lea    0xd34(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x30(%rbp)
jle    1401 <main+0x2c1>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x30(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x30(%rbp)
jmp    13d8 <main+0x298>
jmp    15af <main+0x46f>
cmpl   $0x82,-0x14(%rbp)
jne    1491 <main+0x351>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x38(%rbp)
mov    0x2bc4(%rip),%rcx
cmp    (%rcx),%eax
jne    1453 <main+0x313>
mov    0x2ba5(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xc16(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x20,-0x14(%rbp)
cmpl   $0x0,-0x38(%rbp)
jle    148c <main+0x34c>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x38(%rbp)
jmp    1463 <main+0x323>
jmp    15aa <main+0x46a>
cmpl   $0x82,-0x14(%rbp)
jle    1520 <main+0x3e0>
mov    -0x14(%rbp),%eax
sub    $0x80,%eax
mov    %eax,-0x3c(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2b2e(%rip),%rcx
cmp    (%rcx),%eax
jne    14e9 <main+0x3a9>
mov    0x2b0f(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xc6b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jle    151b <main+0x3db>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
jmp    14f2 <main+0x3b2>
jmp    15a5 <main+0x465>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    15a0 <main+0x460>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x44(%rbp)
mov    0x2aa7(%rip),%rcx
cmp    (%rcx),%eax
jne    1578 <main+0x438>
mov    0x2a88(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
sub    -0x40(%rbp),%r8d
lea    0xc28(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x44(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1526 <main+0x3e6>
jmp    15a5 <main+0x465>
jmp    15aa <main+0x46a>
jmp    15af <main+0x46f>
jmp    15b4 <main+0x474>
jmp    15b9 <main+0x479>
jmp    1164 <main+0x24>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2e8f(%rip),%r13
cmp    0x0(%r13),%eax
jne    1166 <main+0x26>
xor    %edi,%edi
call   1060 <exit@plt>
mov    %eax,%ebp
xor    %r15d,%r15d
jmp    117f <main+0x3f>
mov    %r14d,%r15d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
cmp    0x0(%r13),%eax
je     115f <main+0x1f>
lea    0x1(%r15),%r14d
cmp    $0x80,%ebp
jg     11f0 <main+0xb0>
test   %ebp,%ebp
je     1280 <main+0x140>
cmp    $0x80,%ebp
jne    1320 <main+0x1e0>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    0x0(%r13),%eax
je     13ce <main+0x28e>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    0x0(%r13),%eax
je     13eb <main+0x2ab>
add    $0x3,%r15d
test   %ebp,%ebp
jle    1170 <main+0x30>
mov    %eax,%ebx
add    $0x1,%ebp
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     11d0 <main+0x90>
jmp    1170 <main+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x82,%ebp
je     12d0 <main+0x190>
cmp    $0x81,%ebp
jne    1320 <main+0x1e0>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    0x0(%r13),%eax
je     1413 <main+0x2d3>
mov    %eax,%r12d
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    0x0(%r13),%eax
je     140c <main+0x2cc>
mov    %eax,%ebp
shl    $0x8,%ebp
lea    (%r12,%rbp,1),%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    0x0(%r13),%eax
je     142d <main+0x2ed>
add    $0x4,%r15d
test   %r14d,%r14d
jle    1170 <main+0x30>
mov    %eax,%ebx
add    %r12d,%ebp
add    $0x1,%ebp
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1260 <main+0x120>
jmp    1170 <main+0x30>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    0x0(%r13),%eax
je     1451 <main+0x311>
mov    %eax,%ebx
add    $0x2,%r15d
test   %eax,%eax
je     115f <main+0x1f>
jle    1170 <main+0x30>
add    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     12b0 <main+0x170>
jmp    1170 <main+0x30>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    0x0(%r13),%eax
je     1468 <main+0x328>
mov    %eax,%ebx
add    $0x2,%r15d
test   %eax,%eax
jle    1170 <main+0x30>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1300 <main+0x1c0>
jmp    1170 <main+0x30>
nopw   0x0(%rax,%rax,1)
cmp    $0x82,%ebp
jle    1364 <main+0x224>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    0x0(%r13),%eax
je     1482 <main+0x342>
mov    %eax,%ebx
add    $0x2,%r15d
add    $0xffffff81,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1350 <main+0x210>
jmp    1170 <main+0x30>
test   %ebp,%ebp
jle    116d <main+0x2d>
lea    0x1(%rbp),%ebx
add    %ebp,%r15d
add    $0x1,%r15d
xor    %r12d,%r12d
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    0x0(%r13),%eax
je     13a5 <main+0x265>
mov    %eax,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
add    $0x1,%r12d
cmp    $0x1,%ebx
jg     1380 <main+0x240>
jmp    1170 <main+0x30>
mov    0x2c2c(%rip),%rax
mov    (%rax),%edi
lea    0xdda(%rip),%rsi
mov    %r14d,%edx
mov    %ebp,%ecx
mov    %r12d,%r8d
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    0x2c03(%rip),%rax
mov    (%rax),%edi
lea    0xc7a(%rip),%rsi
mov    %r14d,%edx
mov    $0x80,%ecx
jmp    1497 <main+0x357>
add    $0x2,%r15d
mov    0x2be2(%rip),%rax
mov    (%rax),%edi
lea    0xca2(%rip),%rsi
mov    %r15d,%edx
mov    $0x80,%ecx
mov    %ebp,%r8d
jmp    13bd <main+0x27d>
add    $0x2,%r15d
mov    %r15d,%r14d
mov    0x2bbe(%rip),%rax
mov    (%rax),%edi
lea    0xc35(%rip),%rsi
mov    %r14d,%edx
mov    $0x81,%ecx
jmp    1497 <main+0x357>
add    $0x3,%r15d
mov    0x2ba0(%rip),%rax
mov    (%rax),%edi
lea    0xcb1(%rip),%rsi
mov    %r15d,%edx
mov    $0x81,%ecx
mov    %r14d,%r8d
jmp    13bd <main+0x27d>
mov    0x2b80(%rip),%rax
mov    (%rax),%edi
lea    0xb9f(%rip),%rsi
mov    %r14d,%edx
xor    %ecx,%ecx
jmp    1497 <main+0x357>
mov    0x2b69(%rip),%rax
mov    (%rax),%edi
lea    0xbe0(%rip),%rsi
mov    %r14d,%edx
mov    $0x82,%ecx
jmp    1497 <main+0x357>
mov    0x2b4f(%rip),%rax
mov    (%rax),%edi
lea    0xcb1(%rip),%rsi
mov    %r14d,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
@stderr = global i32 0
@.str = [88 x i8] c"Unexpected end of file while reading number of consecutive zero bytes (0x%x -> %02x).\0A\0A\00"
@.str.1 = [73 x i8] c"Unexpected end of file while reading repetition length (0x%x -> %02x).\0A\0A\00"
@.str.2 = [81 x i8] c"Unexpected end of file while reading byte value to repeat (0x%x -> %02x %02x).\0A\0A\00"
@.str.3 = [81 x i8] c"Unexpected end of file while reading byte value to repeat (0x%x -> %02x %04x).\0A\0A\00"
@.str.4 = [76 x i8] c"Unexpected end of file while reading byte value to repeat (0x%x -> %02x).\0A\0A\00"
@.str.5 = [88 x i8] c"Unexpected end of file while reading consecutive unique bytes (0x%x -> %02x -> 0x%d).\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 0, i32* %9
br label %19
19: ; preds = %238, %2
%20 = call i32 (...) @getchar()
store i32 %20, i32* %6
%21 = load i32, i32* @EOF
%22 = icmp ne i32 %20, %21
br i1 %22, label %23, label %239
23: ; preds = %19
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
%26 = load i32, i32* %6
store i32 %26, i32* %7
%27 = load i32, i32* %6
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %56
29: ; preds = %23
%30 = call i32 (...) @getchar()
store i32 %30, i32* %6
%31 = load i32, i32* @EOF
%32 = icmp eq i32 %30, %31
br i1 %32, label %33, label %39
33: ; preds = %29
%34 = load i32, i32* @stderr
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0), i32 %35, i32 %36)
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %29
%40 = load i32, i32* %8
%41 = add nsw i32 %40, 1
store i32 %41, i32* %8
%42 = load i32, i32* %6
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %45
44: ; preds = %39
br label %239
45: ; preds = %39
br label %46
46: ; preds = %49, %45
%47 = load i32, i32* %6
%48 = icmp sgt i32 %47, 0
br i1 %48, label %49, label %55
49: ; preds = %46
%50 = call i32 @putchar(i32 0)
%51 = load i32, i32* %9
%52 = add nsw i32 %51, 1
store i32 %52, i32* %9
%53 = load i32, i32* %6
%54 = add nsw i32 %53, -1
store i32 %54, i32* %6
br label %46
55: ; preds = %46
br label %238
56: ; preds = %23
%57 = load i32, i32* %6
%58 = icmp eq i32 %57, 128
br i1 %58, label %59, label %96
59: ; preds = %56
%60 = call i32 (...) @getchar()
store i32 %60, i32* %10
%61 = load i32, i32* @EOF
%62 = icmp eq i32 %60, %61
br i1 %62, label %63, label %69
63: ; preds = %59
%64 = load i32, i32* @stderr
%65 = load i32, i32* %8
%66 = load i32, i32* %7
%67 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 %65, i32 %66)
%68 = call i32 @exit(i32 1)
unreachable
69: ; preds = %59
%70 = load i32, i32* %8
%71 = add nsw i32 %70, 1
store i32 %71, i32* %8
%72 = call i32 (...) @getchar()
store i32 %72, i32* %6
%73 = load i32, i32* @EOF
%74 = icmp eq i32 %72, %73
br i1 %74, label %75, label %82
75: ; preds = %69
%76 = load i32, i32* @stderr
%77 = load i32, i32* %8
%78 = load i32, i32* %7
%79 = load i32, i32* %10
%80 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0), i32 %77, i32 %78, i32 %79)
%81 = call i32 @exit(i32 1)
unreachable
82: ; preds = %69
%83 = load i32, i32* %8
%84 = add nsw i32 %83, 1
store i32 %84, i32* %8
br label %85
85: ; preds = %88, %82
%86 = load i32, i32* %10
%87 = icmp sgt i32 %86, 0
br i1 %87, label %88, label %95
88: ; preds = %85
%89 = load i32, i32* %6
%90 = call i32 @putchar(i32 %89)
%91 = load i32, i32* %9
%92 = add nsw i32 %91, 1
store i32 %92, i32* %9
%93 = load i32, i32* %10
%94 = add nsw i32 %93, -1
store i32 %94, i32* %10
br label %85
95: ; preds = %85
br label %237
96: ; preds = %56
%97 = load i32, i32* %6
%98 = icmp eq i32 %97, 129
br i1 %98, label %99, label %150
99: ; preds = %96
store i32 2, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
br label %100
100: ; preds = %113, %99
%101 = load i32, i32* %11
%102 = icmp sgt i32 %101, 0
br i1 %102, label %103, label %125
103: ; preds = %100
%104 = call i32 (...) @getchar()
store i32 %104, i32* %14
%105 = load i32, i32* @EOF
%106 = icmp eq i32 %104, %105
br i1 %106, label %107, label %113
107: ; preds = %103
%108 = load i32, i32* @stderr
%109 = load i32, i32* %8
%110 = load i32, i32* %7
%111 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 %109, i32 %110)
%112 = call i32 @exit(i32 1)
unreachable
113: ; preds = %103
%114 = load i32, i32* %8
%115 = add nsw i32 %114, 1
store i32 %115, i32* %8
%116 = load i32, i32* %14
%117 = load i32, i32* %12
%118 = shl i32 %116, %117
%119 = load i32, i32* %13
%120 = add nsw i32 %119, %118
store i32 %120, i32* %13
%121 = load i32, i32* %12
%122 = add nsw i32 %121, 8
store i32 %122, i32* %12
%123 = load i32, i32* %11
%124 = add nsw i32 %123, -1
store i32 %124, i32* %11
br label %100
125: ; preds = %100
%126 = call i32 (...) @getchar()
store i32 %126, i32* %6
%127 = load i32, i32* @EOF
%128 = icmp eq i32 %126, %127
br i1 %128, label %129, label %136
129: ; preds = %125
%130 = load i32, i32* @stderr
%131 = load i32, i32* %8
%132 = load i32, i32* %7
%133 = load i32, i32* %13
%134 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.3, i64 0, i64 0), i32 %131, i32 %132, i32 %133)
%135 = call i32 @exit(i32 1)
unreachable
136: ; preds = %125
%137 = load i32, i32* %8
%138 = add nsw i32 %137, 1
store i32 %138, i32* %8
br label %139
139: ; preds = %142, %136
%140 = load i32, i32* %13
%141 = icmp sgt i32 %140, 0
br i1 %141, label %142, label %149
142: ; preds = %139
%143 = load i32, i32* %6
%144 = call i32 @putchar(i32 %143)
%145 = load i32, i32* %9
%146 = add nsw i32 %145, 1
store i32 %146, i32* %9
%147 = load i32, i32* %13
%148 = add nsw i32 %147, -1
store i32 %148, i32* %13
br label %139
149: ; preds = %139
br label %236
150: ; preds = %96
%151 = load i32, i32* %6
%152 = icmp eq i32 %151, 130
br i1 %152, label %153, label %177
153: ; preds = %150
%154 = call i32 (...) @getchar()
store i32 %154, i32* %15
%155 = load i32, i32* @EOF
%156 = icmp eq i32 %154, %155
br i1 %156, label %157, label %163
157: ; preds = %153
%158 = load i32, i32* @stderr
%159 = load i32, i32* %8
%160 = load i32, i32* %7
%161 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %158, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 %159, i32 %160)
%162 = call i32 @exit(i32 1)
unreachable
163: ; preds = %153
%164 = load i32, i32* %8
%165 = add nsw i32 %164, 1
store i32 %165, i32* %8
store i32 32, i32* %6
br label %166
166: ; preds = %169, %163
%167 = load i32, i32* %15
%168 = icmp sgt i32 %167, 0
br i1 %168, label %169, label %176
169: ; preds = %166
%170 = load i32, i32* %6
%171 = call i32 @putchar(i32 %170)
%172 = load i32, i32* %9
%173 = add nsw i32 %172, 1
store i32 %173, i32* %9
%174 = load i32, i32* %15
%175 = add nsw i32 %174, -1
store i32 %175, i32* %15
br label %166
176: ; preds = %166
br label %235
177: ; preds = %150
%178 = load i32, i32* %6
%179 = icmp sgt i32 %178, 130
br i1 %179, label %180, label %206
180: ; preds = %177
%181 = load i32, i32* %6
%182 = sub nsw i32 %181, 128
store i32 %182, i32* %16
%183 = call i32 (...) @getchar()
store i32 %183, i32* %6
%184 = load i32, i32* @EOF
%185 = icmp eq i32 %183, %184
br i1 %185, label %186, label %192
186: ; preds = %180
%187 = load i32, i32* @stderr
%188 = load i32, i32* %8
%189 = load i32, i32* %7
%190 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %187, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.4, i64 0, i64 0), i32 %188, i32 %189)
%191 = call i32 @exit(i32 1)
unreachable
192: ; preds = %180
%193 = load i32, i32* %8
%194 = add nsw i32 %193, 1
store i32 %194, i32* %8
br label %195
195: ; preds = %198, %192
%196 = load i32, i32* %16
%197 = icmp sgt i32 %196, 0
br i1 %197, label %198, label %205
198: ; preds = %195
%199 = load i32, i32* %6
%200 = call i32 @putchar(i32 %199)
%201 = load i32, i32* %9
%202 = add nsw i32 %201, 1
store i32 %202, i32* %9
%203 = load i32, i32* %16
%204 = add nsw i32 %203, -1
store i32 %204, i32* %16
br label %195
205: ; preds = %195
br label %234
206: ; preds = %177
%207 = load i32, i32* %8
store i32 %207, i32* %17
br label %208
208: ; preds = %224, %206
%209 = load i32, i32* %6
%210 = icmp sgt i32 %209, 0
br i1 %210, label %211, label %233
211: ; preds = %208
%212 = call i32 (...) @getchar()
store i32 %212, i32* %18
%213 = load i32, i32* @EOF
%214 = icmp eq i32 %212, %213
br i1 %214, label %215, label %224
215: ; preds = %211
%216 = load i32, i32* @stderr
%217 = load i32, i32* %17
%218 = load i32, i32* %7
%219 = load i32, i32* %8
%220 = load i32, i32* %17
%221 = sub nsw i32 %219, %220
%222 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %216, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.5, i64 0, i64 0), i32 %217, i32 %218, i32 %221)
%223 = call i32 @exit(i32 1)
unreachable
224: ; preds = %211
%225 = load i32, i32* %8
%226 = add nsw i32 %225, 1
store i32 %226, i32* %8
%227 = load i32, i32* %18
%228 = call i32 @putchar(i32 %227)
%229 = load i32, i32* %9
%230 = add nsw i32 %229, 1
store i32 %230, i32* %9
%231 = load i32, i32* %6
%232 = add nsw i32 %231, -1
store i32 %232, i32* %6
br label %208
233: ; preds = %208
br label %234
234: ; preds = %233, %205
br label %235
235: ; preds = %234, %176
br label %236
236: ; preds = %235, %149
br label %237
237: ; preds = %236, %95
br label %238
238: ; preds = %237, %55
br label %19
239: ; preds = %44, %19
%240 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@EOF = global i32 0
@stderr = global i32 0
@.str = [88 x i8] c"Unexpected end of file while reading number of consecutive zero bytes (0x%x -> %02x).\0A\0A\00"
@.str.1 = [73 x i8] c"Unexpected end of file while reading repetition length (0x%x -> %02x).\0A\0A\00"
@.str.2 = [81 x i8] c"Unexpected end of file while reading byte value to repeat (0x%x -> %02x %02x).\0A\0A\00"
@.str.3 = [81 x i8] c"Unexpected end of file while reading byte value to repeat (0x%x -> %02x %04x).\0A\0A\00"
@.str.4 = [76 x i8] c"Unexpected end of file while reading byte value to repeat (0x%x -> %02x).\0A\0A\00"
@.str.5 = [88 x i8] c"Unexpected end of file while reading consecutive unique bytes (0x%x -> %02x -> 0x%d).\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %147, label %6
6: ; preds = %2, %142
%7 = phi i32 [ %144, %142 ], [ %3, %2 ]
%8 = phi i32 [ %143, %142 ], [ 0, %2 ]
%9 = add nsw i32 %8, 1
switch i32 %7, label %103 [
i32 0, label %14
i32 128, label %32
i32 129, label %10
i32 130, label %87
]
10: ; preds = %6
%11 = tail call i32 (...) @getchar()
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %59, label %64
14: ; preds = %6
%15 = tail call i32 (...) @getchar()
%16 = load i32, i32* @EOF
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i32, i32* @stderr
%20 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0), i32 %9, i32 0)
%21 = tail call i32 @exit(i32 1)
unreachable
22: ; preds = %14
%23 = add nsw i32 %8, 2
%24 = icmp eq i32 %15, 0
br i1 %24, label %147, label %25
25: ; preds = %22
%26 = icmp sgt i32 %15, 0
br i1 %26, label %27, label %142
27: ; preds = %25, %27
%28 = phi i32 [ %30, %27 ], [ %15, %25 ]
%29 = tail call i32 @putchar(i32 0)
%30 = add nsw i32 %28, -1
%31 = icmp ugt i32 %28, 1
br i1 %31, label %27, label %142
32: ; preds = %6
%33 = tail call i32 (...) @getchar()
%34 = load i32, i32* @EOF
%35 = icmp eq i32 %33, %34
br i1 %35, label %36, label %40
36: ; preds = %32
%37 = load i32, i32* @stderr
%38 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 128)
%39 = tail call i32 @exit(i32 1)
unreachable
40: ; preds = %32
%41 = tail call i32 (...) @getchar()
%42 = load i32, i32* @EOF
%43 = icmp eq i32 %41, %42
br i1 %43, label %44, label %49
44: ; preds = %40
%45 = add nsw i32 %8, 2
%46 = load i32, i32* @stderr
%47 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0), i32 %45, i32 128, i32 %33)
%48 = tail call i32 @exit(i32 1)
unreachable
49: ; preds = %40
%50 = add nsw i32 %8, 3
%51 = icmp sgt i32 %33, 0
br i1 %51, label %52, label %142
52: ; preds = %49, %52
%53 = phi i32 [ %55, %52 ], [ %33, %49 ]
%54 = tail call i32 @putchar(i32 %41)
%55 = add nsw i32 %53, -1
%56 = icmp ugt i32 %53, 1
br i1 %56, label %52, label %142
57: ; preds = %64
%58 = add nsw i32 %8, 2
br label %59
59: ; preds = %10, %57
%60 = phi i32 [ %58, %57 ], [ %9, %10 ]
%61 = load i32, i32* @stderr
%62 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 %60, i32 129)
%63 = tail call i32 @exit(i32 1)
unreachable
64: ; preds = %10
%65 = tail call i32 (...) @getchar()
%66 = load i32, i32* @EOF
%67 = icmp eq i32 %65, %66
br i1 %67, label %57, label %68
68: ; preds = %64
%69 = shl i32 %65, 8
%70 = add nsw i32 %69, %11
%71 = tail call i32 (...) @getchar()
%72 = load i32, i32* @EOF
%73 = icmp eq i32 %71, %72
br i1 %73, label %74, label %79
74: ; preds = %68
%75 = add i32 %8, 3
%76 = load i32, i32* @stderr
%77 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.3, i64 0, i64 0), i32 %75, i32 129, i32 %70)
%78 = tail call i32 @exit(i32 1)
unreachable
79: ; preds = %68
%80 = add i32 %8, 4
%81 = icmp sgt i32 %70, 0
br i1 %81, label %82, label %142
82: ; preds = %79, %82
%83 = phi i32 [ %85, %82 ], [ %70, %79 ]
%84 = tail call i32 @putchar(i32 %71)
%85 = add nsw i32 %83, -1
%86 = icmp ugt i32 %83, 1
br i1 %86, label %82, label %142
87: ; preds = %6
%88 = tail call i32 (...) @getchar()
%89 = load i32, i32* @EOF
%90 = icmp eq i32 %88, %89
br i1 %90, label %91, label %95
91: ; preds = %87
%92 = load i32, i32* @stderr
%93 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 130)
%94 = tail call i32 @exit(i32 1)
unreachable
95: ; preds = %87
%96 = add nsw i32 %8, 2
%97 = icmp sgt i32 %88, 0
br i1 %97, label %98, label %142
98: ; preds = %95, %98
%99 = phi i32 [ %101, %98 ], [ %88, %95 ]
%100 = tail call i32 @putchar(i32 32)
%101 = add nsw i32 %99, -1
%102 = icmp ugt i32 %99, 1
br i1 %102, label %98, label %142
103: ; preds = %6
%104 = icmp sgt i32 %7, 130
br i1 %104, label %110, label %105
105: ; preds = %103
%106 = icmp sgt i32 %7, 0
br i1 %106, label %107, label %142
107: ; preds = %105
%108 = add nuw nsw i32 %7, 1
%109 = add i32 %108, %8
br label %126
110: ; preds = %103
%111 = tail call i32 (...) @getchar()
%112 = load i32, i32* @EOF
%113 = icmp eq i32 %111, %112
br i1 %113, label %114, label %118
114: ; preds = %110
%115 = load i32, i32* @stderr
%116 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.4, i64 0, i64 0), i32 %9, i32 %7)
%117 = tail call i32 @exit(i32 1)
unreachable
118: ; preds = %110
%119 = add nsw i32 %8, 2
%120 = add nsw i32 %7, -128
br label %121
121: ; preds = %118, %121
%122 = phi i32 [ %124, %121 ], [ %120, %118 ]
%123 = tail call i32 @putchar(i32 %111)
%124 = add nsw i32 %122, -1
%125 = icmp ugt i32 %122, 1
br i1 %125, label %121, label %142
126: ; preds = %107, %137
%127 = phi i32 [ %140, %137 ], [ %7, %107 ]
%128 = phi i32 [ %138, %137 ], [ %9, %107 ]
%129 = tail call i32 (...) @getchar()
%130 = load i32, i32* @EOF
%131 = icmp eq i32 %129, %130
br i1 %131, label %132, label %137
132: ; preds = %126
%133 = load i32, i32* @stderr
%134 = sub nsw i32 %128, %9
%135 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %133, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.5, i64 0, i64 0), i32 %9, i32 %7, i32 %134)
%136 = tail call i32 @exit(i32 1)
unreachable
137: ; preds = %126
%138 = add nsw i32 %128, 1
%139 = tail call i32 @putchar(i32 %129)
%140 = add nsw i32 %127, -1
%141 = icmp sgt i32 %127, 1
br i1 %141, label %126, label %142
142: ; preds = %98, %82, %52, %27, %137, %121, %95, %79, %49, %25, %105
%143 = phi i32 [ %9, %105 ], [ %23, %25 ], [ %50, %49 ], [ %80, %79 ], [ %96, %95 ], [ %119, %121 ], [ %109, %137 ], [ %23, %27 ], [ %50, %52 ], [ %80, %82 ], [ %96, %98 ]
%144 = tail call i32 (...) @getchar()
%145 = load i32, i32* @EOF
%146 = icmp eq i32 %144, %145
br i1 %146, label %147, label %6
147: ; preds = %142, %22, %2
%148 = tail call i32 @exit(i32 0)
unreachable
}