#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 /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
main(int argc, char **argv) {
  int i, j, k, d, cnt;
  char c, *p, data[10000], *name;
  unsigned char h, w;
  FILE *f;
  if (argc < 2) {
    printf("usage is: convert <bmp filename>\n");
    exit(0);
  }
  f = fopen(argv[1], "rb");
  if (f == NULL) {
    printf("file %s not found\n", argv[1]);
    exit(0);
  }
  if (fscanf(f, "BM%c", &i) != 1) {
    printf("%s does not have bitmap format\n");
    exit(0);
  }
  for (i = 0; i < 15; i++)
    fgetc(f);
  fscanf(f, "%c%c%c%c%c", &h, &i, &i, &i, &w);
  for (i = 0; i < 39; i++)
    fgetc(f);
  p = data;
  for (i = 0; i < h; i++) {
    for (j = 0; j < w; j += 32) {
      c = fgetc(f);
      for (k = 0; k < 8; k++) {
        d = (d >> 1) | (c & 0x80);
        c <<= 1;
      }
      *p++ = d;
      c = fgetc(f);
      for (k = 0; k < 8; k++) {
        d = (d >> 1) | (c & 0x80);
        c <<= 1;
      }
      *p++ = d;
      c = fgetc(f);
      for (k = 0; k < 8; k++) {
        d = (d >> 1) | (c & 0x80);
        c <<= 1;
      }
      *p++ = d;
      c = fgetc(f);
      for (k = 0; k < 8; k++) {
        d = (d >> 1) | (c & 0x80);
        c <<= 1;
      }
      *p++ = d;
    }
  }
  fclose(f);
  name = argv[1];
  for (i = 0; argv[1][i]; i++)
    if (argv[1][i] == '\\')
      name = argv[1] + i + 1;
  for (i = 0; name[i]; i++)
    if (name[i] == '.')
      name[i] = 0;
  printf("#define %s_width %d\n", name, w);
  printf("#define %s_height %d\n", name, h);
  printf("static unsigned char %s_bits[] = {\n", name);
  cnt = 0;
  for (i = h - 1; i >= 0; i--) {
    for (j = 0; j < w; j += 8) {
      c = ~data[i * ((w + 31) / 8 & ~3) + j / 8];
      if (w - j < 8)
        c &= 255 >> (8 + j - w);
      if (cnt != 0)
        printf(",");
      printf("0x%02x", c & 255);
      if (++cnt % 15 == 0) {
        printf("\n");
      }
    }
  }
  printf("\n};\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2770,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1198 <main+0x38>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7b(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x2758(%rbp)
cmpq   $0x0,-0x2758(%rbp)
jne    11de <main+0x7e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    -0x2758(%rbp),%rdi
lea    0xe4c(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     1215 <main+0xb5>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xf,-0x14(%rbp)
jge    1240 <main+0xe0>
mov    -0x2758(%rbp),%rdi
call   1060 <fgetc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    121c <main+0xbc>
mov    -0x2758(%rbp),%rdi
lea    0xe0f(%rip),%rsi
lea    -0x2749(%rbp),%rdx
lea    -0x14(%rbp),%r9
lea    -0x274a(%rbp),%rax
mov    %r9,%rcx
mov    %r9,%r8
mov    %rax,(%rsp)
mov    $0x0,%al
call   1050 <fscanf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x27,-0x14(%rbp)
jge    129c <main+0x13c>
mov    -0x2758(%rbp),%rdi
call   1060 <fgetc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1278 <main+0x118>
lea    -0x2740(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movzbl -0x2749(%rbp),%ecx
cmp    %ecx,%eax
jge    1486 <main+0x326>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
movzbl -0x274a(%rbp),%ecx
cmp    %ecx,%eax
jge    1473 <main+0x313>
mov    -0x2758(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %al,-0x25(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    1326 <main+0x1c6>
mov    -0x20(%rbp),%eax
sar    $0x1,%eax
movsbl -0x25(%rbp),%ecx
and    $0x80,%ecx
or     %ecx,%eax
mov    %eax,-0x20(%rbp)
movsbl -0x25(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x25(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12ef <main+0x18f>
mov    -0x20(%rbp),%eax
mov    %al,%cl
mov    -0x30(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
mov    %cl,(%rax)
mov    -0x2758(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %al,-0x25(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    1389 <main+0x229>
mov    -0x20(%rbp),%eax
sar    $0x1,%eax
movsbl -0x25(%rbp),%ecx
and    $0x80,%ecx
or     %ecx,%eax
mov    %eax,-0x20(%rbp)
movsbl -0x25(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x25(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1352 <main+0x1f2>
mov    -0x20(%rbp),%eax
mov    %al,%cl
mov    -0x30(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
mov    %cl,(%rax)
mov    -0x2758(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %al,-0x25(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    13ec <main+0x28c>
mov    -0x20(%rbp),%eax
sar    $0x1,%eax
movsbl -0x25(%rbp),%ecx
and    $0x80,%ecx
or     %ecx,%eax
mov    %eax,-0x20(%rbp)
movsbl -0x25(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x25(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    13b5 <main+0x255>
mov    -0x20(%rbp),%eax
mov    %al,%cl
mov    -0x30(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
mov    %cl,(%rax)
mov    -0x2758(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %al,-0x25(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    144f <main+0x2ef>
mov    -0x20(%rbp),%eax
sar    $0x1,%eax
movsbl -0x25(%rbp),%ecx
and    $0x80,%ecx
or     %ecx,%eax
mov    %eax,-0x20(%rbp)
movsbl -0x25(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x25(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1418 <main+0x2b8>
mov    -0x20(%rbp),%eax
mov    %al,%cl
mov    -0x30(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x18(%rbp)
jmp    12c7 <main+0x167>
jmp    1478 <main+0x318>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12ae <main+0x14e>
mov    -0x2758(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x2748(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1504 <main+0x3a4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    14f1 <main+0x391>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x2748(%rbp)
jmp    14f6 <main+0x396>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    14a8 <main+0x348>
movl   $0x0,-0x14(%rbp)
mov    -0x2748(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     155a <main+0x3fa>
mov    -0x2748(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    1547 <main+0x3e7>
mov    -0x2748(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    154c <main+0x3ec>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    150b <main+0x3ab>
mov    -0x2748(%rbp),%rsi
movzbl -0x274a(%rbp),%edx
lea    0xaf9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2748(%rbp),%rsi
movzbl -0x2749(%rbp),%edx
lea    0xaf2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2748(%rbp),%rsi
lea    0xaf3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
movzbl -0x2749(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     16e4 <main+0x584>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
movzbl -0x274a(%rbp),%ecx
cmp    %ecx,%eax
jge    16d1 <main+0x571>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2760(%rbp)
movzbl -0x274a(%rbp),%eax
add    $0x1f,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2760(%rbp),%eax
and    $0xfffffffc,%ecx
imul   %ecx,%eax
mov    %eax,-0x275c(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x275c(%rbp),%eax
add    %ecx,%eax
cltq
movsbl -0x2740(%rbp,%rax,1),%eax
ff
xor    $0xffffffff,%eax
mov    %al,-0x25(%rbp)
movzbl -0x274a(%rbp),%eax
sub    -0x18(%rbp),%eax
cmp    $0x8,%eax
jge    1666 <main+0x506>
mov    -0x18(%rbp),%ecx
add    $0x8,%ecx
movzbl -0x274a(%rbp),%eax
sub    %eax,%ecx
mov    $0xff,%eax
sar    %cl,%eax
mov    %eax,%ecx
movsbl -0x25(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x25(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     167e <main+0x51e>
lea    0xa40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x25(%rbp),%esi
and    $0xff,%esi
lea    0xa2a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    $0xf,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    16be <main+0x55e>
lea    0xa0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    16c3 <main+0x563>
mov    -0x18(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x18(%rbp)
jmp    15cc <main+0x46c>
jmp    16d6 <main+0x576>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    15bb <main+0x45b>
lea    0x9d5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2770,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2728,%rsp
cmp    $0x1,%edi
jle    162b <main+0x4ab>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
lea    0xe58(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     163e <main+0x4be>
mov    %rax,%r15
lea    0xe56(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1070 <fscanf@plt>
cmp    $0x1,%eax
jne    1657 <main+0x4d7>
movl   $0x0,0xc(%rsp)
mov    %r15,%rdi
call   1080 <fgetc@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0xe,%eax
jl     11e0 <main+0x60>
lea    0xa(%rsp),%rax
mov    %rax,(%rsp)
lea    0xe33(%rip),%rsi
lea    0xb(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %r15,%rdi
mov    %rcx,%r8
mov    %rcx,%r9
xor    %eax,%eax
call   1070 <fscanf@plt>
movl   $0x0,0xc(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1080 <fgetc@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x26,%eax
jl     1230 <main+0xb0>
movl   $0x0,0xc(%rsp)
mov    0xb(%rsp),%al
test   %al,%al
je     147d <main+0x2fd>
lea    0x10(%rsp),%r13
xor    %edx,%edx
mov    0xa(%rsp),%cl
jmp    1284 <main+0x104>
nopl   0x0(%rax)
xor    %ecx,%ecx
add    $0x1,%edx
mov    %edx,0xc(%rsp)
movzbl %al,%esi
cmp    %esi,%edx
jge    147d <main+0x2fd>
xor    %r12d,%r12d
test   %cl,%cl
je     1270 <main+0xf0>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1080 <fgetc@plt>
lea    (%rax,%rax,1),%ecx
sar    $0x2,%ebp
mov    %eax,%edx
shr    %dl
and    $0x40,%dl
movzbl %dl,%edx
or     %ebp,%edx
mov    %ecx,%ebx
and    $0x80,%bl
movzbl %bl,%esi
or     %edx,%esi
lea    0x0(,%rax,8),%edx
sar    $0x2,%esi
and    $0x40,%cl
movzbl %cl,%ecx
mov    %edx,%ebx
and    $0x80,%bl
movzbl %bl,%edi
or     %ecx,%edi
or     %esi,%edi
mov    %eax,%ebx
shl    $0x5,%bl
sar    $0x2,%edi
and    $0x40,%dl
movzbl %dl,%edx
mov    %ebx,%ecx
and    $0x80,%cl
movzbl %cl,%ecx
or     %edx,%ecx
or     %edi,%ecx
shl    $0x7,%al
sar    $0x2,%ecx
and    $0x40,%bl
movzbl %bl,%edx
movzbl %al,%ebx
or     %edx,%ebx
or     %ecx,%ebx
mov    %bl,0x0(%r13)
mov    %r15,%rdi
call   1080 <fgetc@plt>
lea    (%rax,%rax,1),%ecx
sar    $0x2,%ebx
mov    %eax,%edx
shr    %dl
and    $0x40,%dl
movzbl %dl,%esi
mov    %ecx,%edx
and    $0x80,%dl
movzbl %dl,%edx
or     %esi,%edx
or     %ebx,%edx
lea    0x0(,%rax,8),%esi
sar    $0x2,%edx
and    $0x40,%cl
movzbl %cl,%ecx
mov    %esi,%ebx
and    $0x80,%bl
movzbl %bl,%edi
or     %ecx,%edi
or     %edx,%edi
mov    %eax,%ebx
shl    $0x5,%bl
sar    $0x2,%edi
and    $0x40,%sil
movzbl %sil,%edx
mov    %ebx,%ecx
and    $0x80,%cl
movzbl %cl,%ecx
or     %edx,%ecx
or     %edi,%ecx
shl    $0x7,%al
sar    $0x2,%ecx
and    $0x40,%bl
movzbl %bl,%edx
movzbl %al,%ebx
or     %edx,%ebx
or     %ecx,%ebx
mov    %bl,0x1(%r13)
mov    %r15,%rdi
call   1080 <fgetc@plt>
lea    (%rax,%rax,1),%ecx
sar    $0x2,%ebx
mov    %eax,%edx
shr    %dl
and    $0x40,%dl
movzbl %dl,%esi
mov    %ecx,%edx
and    $0x80,%dl
movzbl %dl,%edx
or     %esi,%edx
or     %ebx,%edx
lea    0x0(,%rax,8),%esi
sar    $0x2,%edx
and    $0x40,%cl
movzbl %cl,%ecx
mov    %esi,%ebx
and    $0x80,%bl
movzbl %bl,%edi
or     %ecx,%edi
or     %edx,%edi
mov    %eax,%ebx
shl    $0x5,%bl
sar    $0x2,%edi
and    $0x40,%sil
movzbl %sil,%edx
mov    %ebx,%ecx
and    $0x80,%cl
movzbl %cl,%ecx
or     %edx,%ecx
or     %edi,%ecx
shl    $0x7,%al
sar    $0x2,%ecx
and    $0x40,%bl
movzbl %bl,%edx
movzbl %al,%ebx
or     %edx,%ebx
or     %ecx,%ebx
mov    %bl,0x2(%r13)
mov    %r15,%rdi
call   1080 <fgetc@plt>
lea    (%rax,%rax,1),%ecx
sar    $0x2,%ebx
mov    %eax,%edx
shr    %dl
and    $0x40,%dl
movzbl %dl,%esi
mov    %ecx,%edx
and    $0x80,%dl
movzbl %dl,%edx
or     %esi,%edx
or     %ebx,%edx
lea    0x0(,%rax,8),%esi
sar    $0x2,%edx
and    $0x40,%cl
movzbl %cl,%ecx
mov    %esi,%ebx
and    $0x80,%bl
movzbl %bl,%edi
or     %ecx,%edi
or     %edx,%edi
mov    %eax,%ebx
shl    $0x5,%bl
sar    $0x2,%edi
and    $0x40,%sil
movzbl %sil,%edx
mov    %ebx,%ecx
and    $0x80,%cl
movzbl %cl,%ecx
or     %edx,%ecx
or     %edi,%ecx
shl    $0x7,%al
sar    $0x2,%ecx
and    $0x40,%bl
movzbl %bl,%edx
movzbl %al,%ebp
or     %edx,%ebp
or     %ecx,%ebp
mov    %bpl,0x3(%r13)
add    $0x4,%r13
add    $0x20,%r12d
movzbl 0xa(%rsp),%ecx
cmp    %ecx,%r12d
jb     1290 <main+0x110>
mov    0xc(%rsp),%edx
mov    0xb(%rsp),%al
jmp    1272 <main+0xf2>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    0x8(%r14),%rbx
lea    0x1(%rbx),%rax
xor    %ecx,%ecx
jmp    14aa <main+0x32a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,%rbx
add    $0x1,%rax
add    $0x1,%ecx
mov    %ecx,0xc(%rsp)
movzbl -0x1(%rax),%edx
cmp    $0x5c,%dl
je     14a0 <main+0x320>
test   %dl,%dl
jne    14a3 <main+0x323>
xor    %eax,%eax
jmp    14cb <main+0x34b>
nop
movb   $0x0,(%rbx,%rcx,1)
mov    0xc(%rsp),%eax
add    $0x1,%eax
mov    %eax,0xc(%rsp)
movslq %eax,%rcx
movzbl (%rbx,%rcx,1),%edx
cmp    $0x2e,%dl
je     14c0 <main+0x340>
test   %dl,%dl
jne    14c8 <main+0x348>
movzbl 0xa(%rsp),%edx
lea    0xb5b(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0xb(%rsp),%edx
lea    0xb5a(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xb5f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0xb(%rsp),%ecx
lea    -0x1(%rcx),%eax
mov    %eax,0xc(%rsp)
test   %ecx,%ecx
je     160b <main+0x48b>
mov    0xa(%rsp),%cl
lea    0xb5a(%rip),%r12
xor    %r13d,%r13d
jmp    1553 <main+0x3d3>
xor    %ecx,%ecx
lea    -0x1(%rax),%edx
mov    %edx,0xc(%rsp)
test   %eax,%eax
mov    %edx,%eax
jle    160b <main+0x48b>
xor    %ebx,%ebx
test   %cl,%cl
je     1540 <main+0x3c0>
movzbl %cl,%edx
lea    0x10(%rsp),%rbp
xor    %r14d,%r14d
jmp    1588 <main+0x408>
cs nopw 0x0(%rax,%rax,1)
movzbl 0xa(%rsp),%ecx
movzbl %cl,%edx
mov    0xc(%rsp),%eax
add    $0xfffffff8,%ebx
add    $0x1,%rbp
cmp    %edx,%r14d
jae    1542 <main+0x3c2>
lea    0x1f(%rdx),%ecx
shr    $0x3,%ecx
and    $0x3c,%ecx
imul   %eax,%ecx
movslq %ecx,%rax
movzbl 0x0(%rbp,%rax,1),%eax
not    %al
mov    %r14d,%ecx
sub    %edx,%ecx
add    %ebx,%edx
add    $0x8,%cl
mov    $0xff,%r15d
shr    %cl,%r15d
cmp    $0x8,%edx
mov    $0xff,%ecx
cmovge %ecx,%r15d
and    %al,%r15b
test   %r13d,%r13d
je     15cf <main+0x44f>
mov    $0x2c,%edi
call   1030 <putchar@plt>
add    $0x8,%r14d
movzbl %r15b,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%r13d
imul   $0xeeeeeeef,%r13d,%eax
add    $0x8888888,%eax
cmp    $0x11111110,%eax
ja     1570 <main+0x3f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1570 <main+0x3f0>
lea    0xa8a(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x2728,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa6e(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
mov    0x8(%r14),%rsi
lea    0x9ba(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
lea    0x9bd(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

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

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