#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
scalar_t__ calloc(int, int);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int rle_two(FILE *ansi, FILE *output) {
  int ch, oldchar, byte_count = 0, run, digit, i, j, miss;
  int bufsize = 4096;
  int buffer_pointer = 0;
  unsigned char *buffer;
  unsigned char ansi_table[128][8];
  unsigned char temp_ansi[8];
  int ansi_table_entries = 0, temp_ansi_pointer;
  buffer = (unsigned char *)calloc(bufsize, sizeof(char));
loop_w_read:
  ch = fgetc(ansi);
loop_no_read:
  if (ch == EOF)
    goto finished;
  if (ch == 27) {
    ch = fgetc(ansi);
    temp_ansi_pointer = 0;
    for (i = 0; i < 8; i++)
      temp_ansi[i] = 0;
    do {
      ch = fgetc(ansi);
      digit = 0;
      do {
        temp_ansi[temp_ansi_pointer] *= 10;
        temp_ansi[temp_ansi_pointer] += (ch - 0x30);
        digit++;
        if (temp_ansi_pointer > 3)
          printf("ERROR digit!\n");
        ch = fgetc(ansi);
      } while ((ch >= '0') && (ch <= '9'));
      temp_ansi_pointer++;
      if (temp_ansi_pointer > (8 - 2))
        printf("ERROR ANSI_POINTER!\n");
    } while (ch == ';');
    temp_ansi[temp_ansi_pointer] = ch;
    temp_ansi[8 - 1] = temp_ansi_pointer;
    i = 0;
    miss = 0;
    for (i = 0; i < ansi_table_entries; i++) {
      miss = 0;
      for (j = 0; j < 8; j++) {
        if (temp_ansi[j] != ansi_table[i][j])
          miss++;
      }
      if (!miss) {
        buffer[buffer_pointer] = i + 128;
        buffer_pointer++;
        printf("MATCH: %d\n", i);
        goto skip_add;
      }
    }
    for (i = 0; i < 8; i++) {
      ansi_table[ansi_table_entries][i] = temp_ansi[i];
    }
    buffer[buffer_pointer] = ansi_table_entries + 128;
    buffer_pointer++;
    ansi_table_entries++;
    printf("%i: ", ansi_table_entries - 1);
    for (j = 0; j < 8; j++)
      printf(" %i", temp_ansi[j]);
    printf("\n");
  skip_add:;
  } else {
    run = 1;
  run_loop:
    oldchar = ch;
    ch = fgetc(ansi);
    if (ch == oldchar) {
      run++;
      goto run_loop;
    }
    buffer[buffer_pointer] = run;
    buffer[buffer_pointer + 1] = oldchar;
    buffer_pointer += 2;
    goto loop_no_read;
  }
  goto loop_w_read;
finished:
  fprintf(output, "newest_logo:\n");
  fprintf(output, "\t.byte\t%i\n", ansi_table_entries);
  byte_count++;
  for (i = 0; i < ansi_table_entries; i++) {
    fprintf(output, "\t.byte\t");
    for (j = 0; j < 8; j++) {
      fprintf(output, "%i%c", ansi_table[i][j], j == 8 - 1 ? '\n' : ',');
    }
  }
  byte_count += (8 * ansi_table_entries);
  fprintf(output, "\t.byte\t");
  for (i = 0; i < buffer_pointer; i++) {
    fprintf(output, "%i%c", buffer[i], i == buffer_pointer - 1 ? '\n' : ',');
  }
  byte_count += buffer_pointer;
  fprintf(output, "\t.byte\t0,0\n");
  byte_count += 2;
  return byte_count;
}


x86 assembly (clang, -O0):
<rle_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1000,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x44c(%rbp)
mov    -0x34(%rbp),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e4f(%rip),%rcx
cmp    (%rcx),%eax
jne    11a6 <rle_two+0x66>
jmp    1510 <rle_two+0x3d0>
cmpl   $0x1b,-0x14(%rbp)
jne    14a5 <rle_two+0x365>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x450(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x8,-0x28(%rbp)
jge    11f1 <rle_two+0xb1>
movslq -0x28(%rbp),%rax
movb   $0x0,-0x448(%rbp,%rax,1)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11cd <rle_two+0x8d>
jmp    11f6 <rle_two+0xb6>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x450(%rbp),%rax
movzbl -0x448(%rbp,%rax,1),%ecx
ff
imul   $0xa,%ecx,%ecx
mov    %cl,-0x448(%rbp,%rax,1)
mov    -0x14(%rbp),%edx
sub    $0x30,%edx
movslq -0x450(%rbp),%rax
movzbl -0x448(%rbp,%rax,1),%ecx
ff
add    %edx,%ecx
mov    %cl,-0x448(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x3,-0x450(%rbp)
jle    1264 <rle_two+0x124>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x14(%rbp)
mov    %al,-0x451(%rbp)
jl     128f <rle_two+0x14f>
cmpl   $0x39,-0x14(%rbp)
setle  %al
mov    %al,-0x451(%rbp)
mov    -0x451(%rbp),%al
test   $0x1,%al
jne    1209 <rle_two+0xc9>
mov    -0x450(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x450(%rbp)
cmpl   $0x6,-0x450(%rbp)
jle    12c7 <rle_two+0x187>
lea    0xd4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cc <rle_two+0x18c>
cmpl   $0x3b,-0x14(%rbp)
je     11f6 <rle_two+0xb6>
mov    -0x14(%rbp),%eax
mov    %al,%cl
movslq -0x450(%rbp),%rax
mov    %cl,-0x448(%rbp,%rax,1)
mov    -0x450(%rbp),%eax
mov    %al,-0x441(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x44c(%rbp),%eax
jge    13cc <rle_two+0x28c>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x8,-0x2c(%rbp)
jge    137b <rle_two+0x23b>
movslq -0x2c(%rbp),%rax
movzbl -0x448(%rbp,%rax,1),%eax
ff
movslq -0x28(%rbp),%rdx
lea    -0x440(%rbp),%rcx
shl    $0x3,%rdx
add    %rdx,%rcx
movslq -0x2c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1368 <rle_two+0x228>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    136d <rle_two+0x22d>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1327 <rle_two+0x1e7>
cmpl   $0x0,-0x30(%rbp)
jne    13b9 <rle_two+0x279>
mov    -0x28(%rbp),%eax
add    $0x80,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%esi
lea    0xc76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    14a0 <rle_two+0x360>
jmp    13be <rle_two+0x27e>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    130a <rle_two+0x1ca>
movl   $0x0,-0x28(%rbp)
cmpl   $0x8,-0x28(%rbp)
jge    1412 <rle_two+0x2d2>
movslq -0x28(%rbp),%rax
mov    -0x448(%rbp,%rax,1),%dl
movslq -0x44c(%rbp),%rcx
lea    -0x440(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13d3 <rle_two+0x293>
mov    -0x44c(%rbp),%eax
add    $0x80,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x44c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44c(%rbp)
mov    -0x44c(%rbp),%esi
sub    $0x1,%esi
lea    0xbdc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x8,-0x2c(%rbp)
jge    1492 <rle_two+0x352>
movslq -0x2c(%rbp),%rax
movzbl -0x448(%rbp,%rax,1),%esi
ff
lea    0xbb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1460 <rle_two+0x320>
lea    0xb88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    150b <rle_two+0x3cb>
movl   $0x1,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    14d8 <rle_two+0x398>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    14ac <rle_two+0x36c>
mov    -0x20(%rbp),%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x38(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x38(%rbp)
jmp    118f <rle_two+0x4f>
jmp    1183 <rle_two+0x43>
mov    -0x10(%rbp),%rdi
lea    0xb1c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x44c(%rbp),%edx
lea    0xb12(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x44c(%rbp),%eax
jge    15dc <rle_two+0x49c>
mov    -0x10(%rbp),%rdi
lea    0xaec(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x8,-0x2c(%rbp)
jge    15c9 <rle_two+0x489>
mov    -0x10(%rbp),%rdi
movslq -0x28(%rbp),%rcx
lea    -0x440(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
mov    -0x2c(%rbp),%esi
mov    $0x2c,%ecx
mov    $0xa,%eax
cmp    $0x7,%esi
cmove  %eax,%ecx
lea    0xaa4(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1572 <rle_two+0x432>
jmp    15ce <rle_two+0x48e>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    154a <rle_two+0x40a>
mov    -0x44c(%rbp),%eax
shl    $0x3,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xa5a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1657 <rle_two+0x517>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rax
movslq -0x28(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
mov    -0x28(%rbp),%esi
mov    -0x38(%rbp),%r8d
sub    $0x1,%r8d
mov    $0x2c,%ecx
mov    $0xa,%eax
cmp    %r8d,%esi
cmove  %eax,%ecx
lea    0xa16(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1604 <rle_two+0x4c4>
mov    -0x38(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0x9f2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rle_two>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    %rsi,%r12
mov    %rdi,%r13
mov    $0x1000,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,%r14
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebp
mov    0x2e3e(%rip),%rax
xor    %ebx,%ebx
mov    $0x0,%r15d
cmp    (%rax),%ebp
je     1470 <rle_two+0x300>
xor    %ebx,%ebx
xor    %r15d,%r15d
mov    %rbx,0x8(%rsp)
mov    %ebx,%eax
mov    %rax,0x10(%rsp)
movslq %r15d,%r15
xchg   %ax,%ax
cmp    $0x1b,%ebp
je     1210 <rle_two+0xa0>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1060 <fgetc@plt>
add    $0x1,%bl
cmp    %ebp,%eax
je     11e0 <rle_two+0x70>
mov    %bl,(%r14,%r15,1)
mov    %bpl,0x1(%r14,%r15,1)
add    $0x2,%r15
mov    %eax,%ebp
mov    0x2de3(%rip),%rcx
cmp    (%rcx),%eax
jne    11d0 <rle_two+0x60>
jmp    146b <rle_two+0x2fb>
xchg   %ax,%ax
mov    %r15,%rbx
mov    %r14,0x18(%rsp)
mov    %r13,%rdi
call   1060 <fgetc@plt>
movq   $0x0,(%rsp)
xor    %r14d,%r14d
jmp    1239 <rle_two+0xc9>
nopl   (%rax)
add    $0x1,%r14
cmp    $0x3b,%ebp
jne    12b0 <rle_two+0x140>
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebp
mov    (%rsp,%r14,1),%r15b
jmp    1266 <rle_two+0xf6>
nopl   0x0(%rax)
add    $0xd0,%r15b
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebp
lea    -0x30(%rbp),%eax
cmp    $0xa,%eax
jae    1290 <rle_two+0x120>
movzbl %r15b,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %ebp,%r15d
add    %al,%r15b
cmp    $0x4,%r14
jb     1250 <rle_two+0xe0>
lea    0xdd8(%rip),%rdi
call   1040 <puts@plt>
jmp    1250 <rle_two+0xe0>
nopl   0x0(%rax)
mov    %r15b,(%rsp,%r14,1)
cmp    $0x6,%r14
jb     1230 <rle_two+0xc0>
lea    0xda5(%rip),%rdi
call   1040 <puts@plt>
jmp    1230 <rle_two+0xc0>
nopl   0x0(%rax,%rax,1)
mov    %r14d,%eax
mov    %bpl,(%rsp,%rax,1)
mov    %r14b,0x7(%rsp)
cmpl   $0x0,0x8(%rsp)
mov    %rbx,%r15
pcmpeqd %xmm2,%xmm2
mov    0x10(%rsp),%r10
jle    136e <rle_two+0x1fe>
movq   (%rsp),%xmm0
mov    0x4(%rsp),%r8b
mov    0x5(%rsp),%r9b
mov    0x6(%rsp),%dl
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
movq   0x20(%rsp,%rsi,8),%xmm1
pcmpeqb %xmm0,%xmm1
pxor   %xmm2,%xmm1
punpcklbw %xmm1,%xmm1
xor    %edi,%edi
cmp    0x24(%rsp,%rsi,8),%r8b
setne  %dil
xor    %ebp,%ebp
cmp    0x25(%rsp,%rsi,8),%r9b
setne  %bpl
xor    %eax,%eax
cmp    0x26(%rsp,%rsi,8),%dl
punpcklwd %xmm1,%xmm1
setne  %al
movmskps %xmm1,%ebx
mov    %ebx,%ecx
shr    %cl
and    $0x5,%cl
sub    %cl,%bl
mov    %ebx,%ecx
and    $0x33,%cl
shr    $0x2,%bl
and    $0x33,%bl
add    %cl,%bl
mov    %ebx,%ecx
shr    $0x4,%cl
add    %bl,%cl
and    $0xf,%cl
movzbl %cl,%ecx
add    %edi,%ecx
add    %ebp,%ecx
add    %eax,%ecx
xor    %eax,%eax
cmp    %r14b,0x27(%rsp,%rsi,8)
setne  %al
neg    %eax
cmp    %eax,%ecx
je     142c <rle_two+0x2bc>
add    $0x1,%rsi
cmp    %rsi,%r10
jne    12f0 <rle_two+0x180>
mov    0x8(%rsp),%rbx
movslq %ebx,%rax
mov    (%rsp),%rcx
mov    %rcx,0x20(%rsp,%rax,8)
mov    %ebx,%eax
xor    $0x80,%al
movslq %r15d,%rcx
mov    0x18(%rsp),%r14
mov    %al,(%r14,%rcx,1)
lea    0xc75(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl (%rsp),%esi
lea    0xc66(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x2(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x3(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x4(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x5(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x6(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x7(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    144c <rle_two+0x2dc>
movslq %r15d,%rax
lea    -0x80(%rsi),%ecx
mov    0x18(%rsp),%r14
mov    %cl,(%r14,%rax,1)
lea    0xbbe(%rip),%rdi
xor    %eax,%eax
mov    %r10,%rbx
call   1050 <printf@plt>
add    $0x1,%r15d
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebp
mov    0x2b87(%rip),%rax
cmp    (%rax),%ebp
jne    11bf <rle_two+0x4f>
jmp    1470 <rle_two+0x300>
mov    0x8(%rsp),%rbx
mov    %r15,0x10(%rsp)
mov    %r14,%r15
lea    0xb95(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1090 <fwrite@plt>
lea    0xb8a(%rip),%rsi
mov    %r12,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbx,%rax
mov    %rbx,0x8(%rsp)
test   %ebx,%ebx
jle    15aa <rle_two+0x43a>
mov    0x8(%rsp),%r13d
lea    0xb6d(%rip),%r14
lea    0xb6e(%rip),%rbp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %r12,%rcx
call   1090 <fwrite@plt>
movzbl 0x20(%rsp,%rbx,8),%edx
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x2c,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
movzbl 0x21(%rsp,%rbx,8),%edx
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x2c,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
movzbl 0x22(%rsp,%rbx,8),%edx
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x2c,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
movzbl 0x23(%rsp,%rbx,8),%edx
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x2c,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
movzbl 0x24(%rsp,%rbx,8),%edx
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x2c,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
movzbl 0x25(%rsp,%rbx,8),%edx
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x2c,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
movzbl 0x26(%rsp,%rbx,8),%edx
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x2c,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
movzbl 0x27(%rsp,%rbx,8),%edx
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0xa,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    14d0 <rle_two+0x360>
lea    0xa7c(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1090 <fwrite@plt>
cmpl   $0x0,0x10(%rsp)
jle    160b <rle_two+0x49b>
mov    0x10(%rsp),%rax
lea    -0x1(%rax),%r13d
mov    %eax,%ebx
lea    0xa59(%rip),%r14
xor    %ebp,%ebp
xchg   %ax,%ax
movzbl (%r15,%rbp,1),%edx
cmp    %rbp,%r13
mov    $0x2c,%ecx
mov    $0xa,%eax
cmove  %eax,%ecx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    15e0 <rle_two+0x470>
lea    0xa28(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1090 <fwrite@plt>
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rcx
lea    (%rax,%rcx,8),%eax
add    $0x3,%eax
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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