#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getlength();
int getmarker();
scalar_t__ haslength(int);
char *malloc(int);
int /*<<< orphan*/ print_jfif();
int rb(int);
int rd(int, char *);
int skipdata(int, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  int m, len;
  m = getmarker();
  if (m != 0xd8) {
    fprintf(stderr, ":unknown, aborting.\n");
    return 1;
  }
  fprintf(stderr, ":SOI\n");
  while (1) {
    m = getmarker();
    if (m == -1) {
      fprintf(stderr, ":Error, end of file, aborting.\n");
      break;
    }
    if (haslength(m))
      len = getlength();
    else
      len = 0;
    switch (m) {
    case 0xfe: {
      char *comment;
      comment = malloc(len - 2 + 1);
      comment[len - 2] = '\0';
      if (-1 == rd(len - 2, comment))
        break;
      fprintf(stderr, ":COM(%s)\n", comment);
      break;
    }
    case 0xda: {
      int i, ns, ss, se, ahl, cs, td;
      ns = rb(1);
      if (ns == -1)
        break;
      fprintf(stderr, ":SOS ");
      for (i = 0; i < ns; i++) {
        cs = rb(1);
        if (cs == -1)
          break;
        td = rb(1);
        if (td == -1)
          break;
        fprintf(stderr, "[%d,%d:%d]", cs, (td >> 4), td & 0xf);
      }
      ss = rb(1);
      if (ss == -1)
        break;
      se = rb(1);
      if (se == -1)
        break;
      ahl = rb(1);
      if (ahl == -1)
        break;
      fprintf(stderr, "ss=%d, se=%d, h=%d,l=%d\n", ss, se, (ahl >> 4),
              ahl & 0xf);
      break;
    }
    case 0xc0: {
      int bitcnt, x, y, nf, i, c, hv, tq;
      m = rb(1);
      if (m == -1)
        break;
      bitcnt = m;
      y = rb(1);
      if (y == -1)
        break;
      m = rb(1);
      if (m == -1)
        break;
      y = (y << 8) | m;
      x = rb(1);
      if (x == -1)
        break;
      m = rb(1);
      if (m == -1)
        break;
      x = (x << 8) | m;
      nf = rb(1);
      if (nf == -1)
        break;
      fprintf(stderr, ":SOF0,bitcnt=%d,x=%d,y=%d:\n", bitcnt, x, y);
      for (i = 0; i < nf; i++) {
        c = rb(1);
        if (c == -1)
          break;
        hv = rb(1);
        if (hv == -1)
          break;
        tq = rb(1);
        if (tq == -1)
          break;
        fprintf(stderr, "\t %02x = %d:%d, tq=%d\n", c, (hv >> 4), hv & 0xf, tq);
      }
      break;
    }
    case 0xc4: {
      m = rb(1);
      if (m == -1)
        break;
      fprintf(stderr, ":DHT(0x%02x)\n", m);
      skipdata(len - 2 - 1, 1);
      break;
    }
    case 0xdb: {
      fprintf(stderr, ":DQT\n");
      skipdata(len - 2, 1);
      break;
    }
    case 0xe1:
    case 0xe2:
    case 0xe0: {
      char name[5];
      fprintf(stderr, ":APP0(");
      if (-1 == rd(4, name))
        break;
      name[4] = '\0';
      fprintf(stderr, "%s):", name);
      if (!strcmp(name, "JFIF")) {
        print_jfif();
      } else {
        if (-1 == skipdata(len - 2 - 4, 0)) {
          break;
        }
        fprintf(stderr, "\n");
      }
      break;
    }
    default:
      fprintf(stderr, ":Unknown marker\n");
      if (len) {
        if (-1 == skipdata(len - 2, 0)) {
          break;
        }
        fprintf(stderr, "\n");
      }
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getmarker@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xd8,-0x14(%rbp)
je     11f0 <main+0x50>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
lea    0xf1f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1758 <main+0x5b8>
mov    0x2de9(%rip),%rax
mov    (%rax),%edi
lea    0xf11(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1050 <getmarker@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1237 <main+0x97>
mov    0x2dbe(%rip),%rax
mov    (%rax),%edi
lea    0xeec(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1751 <main+0x5b1>
mov    -0x14(%rbp),%edi
call   10b0 <haslength@plt>
cmp    $0x0,%rax
je     1258 <main+0xb8>
mov    $0x0,%al
call   1040 <getlength@plt>
mov    %eax,-0x18(%rbp)
jmp    125f <main+0xbf>
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffff40,%eax
mov    %eax,%ecx
mov    %rcx,-0x70(%rbp)
sub    $0x3e,%eax
ja     16ee <main+0x54e>
mov    -0x70(%rbp),%rax
lea    0xd7f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%edi
sub    $0x2,%edi
add    $0x1,%edi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%edi
sub    $0x2,%edi
mov    -0x20(%rbp),%rsi
call   1080 <rd@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    12d0 <main+0x130>
jmp    174c <main+0x5ac>
mov    0x2d09(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xe53(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    174c <main+0x5ac>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0xffffffff,-0x28(%rbp)
jne    130c <main+0x16c>
jmp    174c <main+0x5ac>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
lea    0xe25(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    13a4 <main+0x204>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0xffffffff,-0x38(%rbp)
jne    1352 <main+0x1b2>
jmp    13a4 <main+0x204>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0xffffffff,-0x3c(%rbp)
jne    136e <main+0x1ce>
jmp    13a4 <main+0x204>
mov    0x2c6b(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
sar    $0x4,%ecx
mov    -0x3c(%rbp),%r8d
and    $0xf,%r8d
lea    0xdb8(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    132a <main+0x18a>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0xffffffff,-0x2c(%rbp)
jne    13c0 <main+0x220>
jmp    174c <main+0x5ac>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0xffffffff,-0x30(%rbp)
jne    13dc <main+0x23c>
jmp    174c <main+0x5ac>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    13f8 <main+0x258>
jmp    174c <main+0x5ac>
mov    0x2be1(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    -0x34(%rbp),%r8d
sar    $0x4,%r8d
mov    -0x34(%rbp),%r9d
and    $0xf,%r9d
lea    0xd34(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    174c <main+0x5ac>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1446 <main+0x2a6>
jmp    174c <main+0x5ac>
mov    -0x14(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0xffffffff,-0x48(%rbp)
jne    1468 <main+0x2c8>
jmp    174c <main+0x5ac>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1484 <main+0x2e4>
jmp    174c <main+0x5ac>
mov    -0x48(%rbp),%eax
shl    $0x8,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0xffffffff,-0x44(%rbp)
jne    14ac <main+0x30c>
jmp    174c <main+0x5ac>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    14c8 <main+0x328>
jmp    174c <main+0x5ac>
mov    -0x44(%rbp),%eax
shl    $0x8,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0xffffffff,-0x4c(%rbp)
jne    14f0 <main+0x350>
jmp    174c <main+0x5ac>
mov    0x2ae9(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%edx
mov    -0x44(%rbp),%ecx
mov    -0x48(%rbp),%r8d
lea    0xc61(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    15b2 <main+0x412>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x54(%rbp)
cmpl   $0xffffffff,-0x54(%rbp)
jne    1540 <main+0x3a0>
jmp    15b2 <main+0x412>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x58(%rbp)
cmpl   $0xffffffff,-0x58(%rbp)
jne    155c <main+0x3bc>
jmp    15b2 <main+0x412>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x5c(%rbp)
cmpl   $0xffffffff,-0x5c(%rbp)
jne    1578 <main+0x3d8>
jmp    15b2 <main+0x412>
mov    0x2a61(%rip),%rax
mov    (%rax),%edi
mov    -0x54(%rbp),%edx
mov    -0x58(%rbp),%ecx
sar    $0x4,%ecx
mov    -0x58(%rbp),%r8d
and    $0xf,%r8d
mov    -0x5c(%rbp),%r9d
lea    0xbea(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1518 <main+0x378>
jmp    174c <main+0x5ac>
mov    $0x1,%edi
call   10a0 <rb@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    15d3 <main+0x433>
jmp    174c <main+0x5ac>
mov    0x2a06(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xbb8(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%edi
sub    $0x2,%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <skipdata@plt>
jmp    174c <main+0x5ac>
mov    0x29d4(%rip),%rax
mov    (%rax),%edi
lea    0xb97(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%edi
sub    $0x2,%edi
mov    $0x1,%esi
call   1030 <skipdata@plt>
jmp    174c <main+0x5ac>
mov    0x29a8(%rip),%rax
mov    (%rax),%edi
lea    0xb71(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x61(%rbp),%rsi
mov    $0x4,%edi
call   1080 <rd@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    166a <main+0x4ca>
jmp    174c <main+0x5ac>
movb   $0x0,-0x5d(%rbp)
mov    0x296b(%rip),%rax
mov    (%rax),%edi
lea    -0x61(%rbp),%rdx
lea    0xb37(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x61(%rbp),%rdi
lea    0xb2a(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    16ae <main+0x50e>
mov    $0x0,%al
call   10c0 <print_jfif@plt>
jmp    16e9 <main+0x549>
mov    -0x18(%rbp),%edi
sub    $0x2,%edi
sub    $0x4,%edi
xor    %esi,%esi
call   1030 <skipdata@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    16d2 <main+0x532>
jmp    174c <main+0x5ac>
mov    0x2907(%rip),%rax
mov    (%rax),%edi
lea    0xa5d(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    174c <main+0x5ac>
mov    0x28eb(%rip),%rax
mov    (%rax),%edi
lea    0xac5(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmpl   $0x0,-0x18(%rbp)
je     1747 <main+0x5a7>
mov    -0x18(%rbp),%edi
sub    $0x2,%edi
xor    %esi,%esi
call   1030 <skipdata@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1730 <main+0x590>
jmp    174c <main+0x5ac>
mov    0x28a9(%rip),%rax
mov    (%rax),%edi
lea    0x9ff(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    174c <main+0x5ac>
jmp    1207 <main+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getmarker@plt>
mov    0x2e37(%rip),%rcx
mov    (%rcx),%edi
cmp    $0xd8,%eax
jne    15b4 <main+0x424>
lea    0xf54(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
xor    %eax,%eax
call   1050 <getmarker@plt>
cmp    $0xffffffff,%eax
je     15c9 <main+0x439>
mov    %eax,%ebx
lea    0xe23(%rip),%r13
jmp    1202 <main+0x72>
xor    %eax,%eax
call   10b0 <print_jfif@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getmarker@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     15c9 <main+0x439>
mov    %ebx,%edi
call   10a0 <haslength@plt>
mov    $0x0,%r15d
test   %rax,%rax
je     121e <main+0x8e>
xor    %eax,%eax
call   1040 <getlength@plt>
mov    %eax,%r15d
add    $0xffffff40,%ebx
cmp    $0x3e,%ebx
ja     13cf <main+0x23f>
movslq 0x0(%r13,%rbx,4),%rax
add    %r13,%rax
jmp    *%rax
mov    0x2da2(%rip),%rax
mov    (%rax),%edi
lea    0xf6b(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x4,%edi
lea    0x3(%rsp),%rsi
call   1070 <rd@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
movb   $0x0,0x7(%rsp)
mov    0x2d72(%rip),%rax
mov    (%rax),%edi
lea    0xf42(%rip),%rsi
lea    0x3(%rsp),%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x3(%rsp),%eax
mov    $0x4649464a,%ecx
xor    %ecx,%eax
movzbl 0x7(%rsp),%ecx
or     %eax,%ecx
je     11df <main+0x4f>
add    $0xfffffffa,%r15d
jmp    13f3 <main+0x263>
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    %eax,%ebx
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    %eax,%r12d
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    %eax,%r15d
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    %eax,%ebp
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    $0x1,%edi
mov    %eax,%r14d
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    %r14d,%ecx
mov    %eax,%r14d
shl    $0x8,%r12d
or     %r12d,%r15d
shl    $0x8,%ebp
or     %ebp,%ecx
mov    0x2ca4(%rip),%rax
mov    (%rax),%edi
lea    0xe26(%rip),%rsi
mov    %ebx,%edx
mov    %r15d,%r8d
xor    %eax,%eax
call   1060 <fprintf@plt>
test   %r14d,%r14d
jle    11f0 <main+0x60>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    %eax,%ebx
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    %eax,%ebp
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    0x2c3c(%rip),%rcx
mov    (%rcx),%edi
mov    %ebp,%ecx
sar    $0x4,%ecx
and    $0xf,%ebp
lea    0xdd2(%rip),%rsi
mov    %ebx,%edx
mov    %ebp,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0xffffffff,%r14d
jne    1360 <main+0x1d0>
jmp    11f0 <main+0x60>
mov    0x2c0a(%rip),%rax
mov    (%rax),%edi
lea    0xde4(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
test   %r15d,%r15d
je     11f0 <main+0x60>
add    $0xfffffffe,%r15d
mov    %r15d,%edi
xor    %esi,%esi
call   1030 <skipdata@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    0x2bd3(%rip),%rax
mov    (%rax),%edi
lea    0xd29(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    11f0 <main+0x60>
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    0x2ba4(%rip),%rcx
mov    (%rcx),%edi
lea    0xd59(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0xfffffffd,%r15d
jmp    1554 <main+0x3c4>
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    %eax,%ebx
mov    0x2b6d(%rip),%r14
mov    (%r14),%edi
lea    0xcc4(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
test   %ebx,%ebx
lea    0xcba(%rip),%r15
jle    14cf <main+0x33f>
nop
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     14cf <main+0x33f>
mov    %eax,%ebp
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     14cf <main+0x33f>
mov    (%r14),%edi
mov    %eax,%ecx
sar    $0x4,%ecx
and    $0xf,%eax
mov    %r15,%rsi
mov    %ebp,%edx
mov    %eax,%r8d
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0xffffffff,%ebx
jne    1490 <main+0x300>
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    %eax,%ebx
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    %eax,%ebp
mov    $0x1,%edi
call   1090 <rb@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    0x2acd(%rip),%rcx
mov    (%rcx),%edi
mov    %eax,%r8d
sar    $0x4,%r8d
and    $0xf,%eax
lea    0xc2c(%rip),%rsi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %eax,%r9d
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    11f0 <main+0x60>
mov    0x2aa0(%rip),%rax
mov    (%rax),%edi
lea    0xc63(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0xfffffffe,%r15d
mov    %r15d,%edi
mov    $0x1,%esi
call   1030 <skipdata@plt>
jmp    11f0 <main+0x60>
movslq %r15d,%rbp
lea    -0x2(%rbp),%r14
add    $0xffffffff,%r15d
mov    %r15d,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
movb   $0x0,-0x2(%rax,%rbp,1)
mov    %r14d,%edi
mov    %rax,%rsi
call   1070 <rd@plt>
cmp    $0xffffffff,%eax
je     11f0 <main+0x60>
mov    0x2a44(%rip),%rax
mov    (%rax),%edi
lea    0xb92(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    11f0 <main+0x60>
lea    0xb41(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%eax
jmp    15e2 <main+0x452>
mov    0x2a10(%rip),%rax
mov    (%rax),%edi
lea    0xb3e(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c":unknown, aborting.\0A\00"
@.str.1 = [6 x i8] c":SOI\0A\00"
@.str.2 = [32 x i8] c":Error, end of file, aborting.\0A\00"
@.str.3 = [10 x i8] c":COM(%s)\0A\00"
@.str.4 = [6 x i8] c":SOS \00"
@.str.5 = [11 x i8] c"[%d,%d:%d]\00"
@.str.6 = [25 x i8] c"ss=%d, se=%d, h=%d,l=%d\0A\00"
@.str.7 = [28 x i8] c":SOF0,bitcnt=%d,x=%d,y=%d:\0A\00"
@.str.8 = [23 x i8] c"\09 %02x = %d:%d, tq=%d\0A\00"
@.str.9 = [14 x i8] c":DHT(0x%02x)\0A\00"
@.str.10 = [6 x i8] c":DQT\0A\00"
@.str.11 = [7 x i8] c":APP0(\00"
@.str.12 = [5 x i8] c"%s):\00"
@.str.13 = [5 x i8] c"JFIF\00"
@.str.14 = [2 x i8] c"\0A\00"
@.str.15 = [17 x i8] c":Unknown marker\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 i8*
%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
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca [5 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%25 = call i32 (...) @getmarker()
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = icmp ne i32 %26, 216
br i1 %27, label %28, label %31
28: ; preds = %2
%29 = load i32, i32* @stderr
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %268
31: ; preds = %2
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %31, %266
%35 = call i32 (...) @getmarker()
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = icmp eq i32 %36, -1
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i32, i32* @stderr
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %267
41: ; preds = %34
%42 = load i32, i32* %6
%43 = call i64 @haslength(i32 %42)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = call i32 (...) @getlength()
store i32 %46, i32* %7
br label %48
47: ; preds = %41
store i32 0, i32* %7
br label %48
48: ; preds = %47, %45
%49 = load i32, i32* %6
switch i32 %49, label %251 [
i32 254, label %50
i32 218, label %70
i32 192, label %127
i32 196, label %204
i32 219, label %217
i32 225, label %223
i32 226, label %223
i32 224, label %223
]
50: ; preds = %48
%51 = load i32, i32* %7
%52 = sub nsw i32 %51, 2
%53 = add nsw i32 %52, 1
%54 = call i8* @malloc(i32 %53)
store i8* %54, i8** %8
%55 = load i8*, i8** %8
%56 = load i32, i32* %7
%57 = sub nsw i32 %56, 2
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %55, i64 %58
store i8 0, i8* %59
%60 = load i32, i32* %7
%61 = sub nsw i32 %60, 2
%62 = load i8*, i8** %8
%63 = call i32 @rd(i32 %61, i8* %62)
%64 = icmp eq i32 -1, %63
br i1 %64, label %65, label %66
65: ; preds = %50
br label %266
66: ; preds = %50
%67 = load i32, i32* @stderr
%68 = load i8*, i8** %8
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %68)
br label %266
70: ; preds = %48
%71 = call i32 @rb(i32 1)
store i32 %71, i32* %10
%72 = load i32, i32* %10
%73 = icmp eq i32 %72, -1
br i1 %73, label %74, label %75
74: ; preds = %70
br label %266
75: ; preds = %70
%76 = load i32, i32* @stderr
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %9
br label %78
78: ; preds = %100, %75
%79 = load i32, i32* %9
%80 = load i32, i32* %10
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %103
82: ; preds = %78
%83 = call i32 @rb(i32 1)
store i32 %83, i32* %14
%84 = load i32, i32* %14
%85 = icmp eq i32 %84, -1
br i1 %85, label %86, label %87
86: ; preds = %82
br label %103
87: ; preds = %82
%88 = call i32 @rb(i32 1)
store i32 %88, i32* %15
%89 = load i32, i32* %15
%90 = icmp eq i32 %89, -1
br i1 %90, label %91, label %92
91: ; preds = %87
br label %103
92: ; preds = %87
%93 = load i32, i32* @stderr
%94 = load i32, i32* %14
%95 = load i32, i32* %15
%96 = ashr i32 %95, 4
%97 = load i32, i32* %15
%98 = and i32 %97, 15
%99 = call i32 (i32, i8*, ...) @fprintf(i32 %93, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %94, i32 %96, i32 %98)
br label %100
100: ; preds = %92
%101 = load i32, i32* %9
%102 = add nsw i32 %101, 1
store i32 %102, i32* %9
br label %78
103: ; preds = %91, %86, %78
%104 = call i32 @rb(i32 1)
store i32 %104, i32* %11
%105 = load i32, i32* %11
%106 = icmp eq i32 %105, -1
br i1 %106, label %107, label %108
107: ; preds = %103
br label %266
108: ; preds = %103
%109 = call i32 @rb(i32 1)
store i32 %109, i32* %12
%110 = load i32, i32* %12
%111 = icmp eq i32 %110, -1
br i1 %111, label %112, label %113
112: ; preds = %108
br label %266
113: ; preds = %108
%114 = call i32 @rb(i32 1)
store i32 %114, i32* %13
%115 = load i32, i32* %13
%116 = icmp eq i32 %115, -1
br i1 %116, label %117, label %118
117: ; preds = %113
br label %266
118: ; preds = %113
%119 = load i32, i32* @stderr
%120 = load i32, i32* %11
%121 = load i32, i32* %12
%122 = load i32, i32* %13
%123 = ashr i32 %122, 4
%124 = load i32, i32* %13
%125 = and i32 %124, 15
%126 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %120, i32 %121, i32 %123, i32 %125)
br label %266
127: ; preds = %48
%128 = call i32 @rb(i32 1)
store i32 %128, i32* %6
%129 = load i32, i32* %6
%130 = icmp eq i32 %129, -1
br i1 %130, label %131, label %132
131: ; preds = %127
br label %266
132: ; preds = %127
%133 = load i32, i32* %6
store i32 %133, i32* %16
%134 = call i32 @rb(i32 1)
store i32 %134, i32* %18
%135 = load i32, i32* %18
%136 = icmp eq i32 %135, -1
br i1 %136, label %137, label %138
137: ; preds = %132
br label %266
138: ; preds = %132
%139 = call i32 @rb(i32 1)
store i32 %139, i32* %6
%140 = load i32, i32* %6
%141 = icmp eq i32 %140, -1
br i1 %141, label %142, label %143
142: ; preds = %138
br label %266
143: ; preds = %138
%144 = load i32, i32* %18
%145 = shl i32 %144, 8
%146 = load i32, i32* %6
%147 = or i32 %145, %146
store i32 %147, i32* %18
%148 = call i32 @rb(i32 1)
store i32 %148, i32* %17
%149 = load i32, i32* %17
%150 = icmp eq i32 %149, -1
br i1 %150, label %151, label %152
151: ; preds = %143
br label %266
152: ; preds = %143
%153 = call i32 @rb(i32 1)
store i32 %153, i32* %6
%154 = load i32, i32* %6
%155 = icmp eq i32 %154, -1
br i1 %155, label %156, label %157
156: ; preds = %152
br label %266
157: ; preds = %152
%158 = load i32, i32* %17
%159 = shl i32 %158, 8
%160 = load i32, i32* %6
%161 = or i32 %159, %160
store i32 %161, i32* %17
%162 = call i32 @rb(i32 1)
store i32 %162, i32* %19
%163 = load i32, i32* %19
%164 = icmp eq i32 %163, -1
br i1 %164, label %165, label %166
165: ; preds = %157
br label %266
166: ; preds = %157
%167 = load i32, i32* @stderr
%168 = load i32, i32* %16
%169 = load i32, i32* %17
%170 = load i32, i32* %18
%171 = call i32 (i32, i8*, ...) @fprintf(i32 %167, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i32 %168, i32 %169, i32 %170)
store i32 0, i32* %20
br label %172
172: ; preds = %200, %166
%173 = load i32, i32* %20
%174 = load i32, i32* %19
%175 = icmp slt i32 %173, %174
br i1 %175, label %176, label %203
176: ; preds = %172
%177 = call i32 @rb(i32 1)
store i32 %177, i32* %21
%178 = load i32, i32* %21
%179 = icmp eq i32 %178, -1
br i1 %179, label %180, label %181
180: ; preds = %176
br label %203
181: ; preds = %176
%182 = call i32 @rb(i32 1)
store i32 %182, i32* %22
%183 = load i32, i32* %22
%184 = icmp eq i32 %183, -1
br i1 %184, label %185, label %186
185: ; preds = %181
br label %203
186: ; preds = %181
%187 = call i32 @rb(i32 1)
store i32 %187, i32* %23
%188 = load i32, i32* %23
%189 = icmp eq i32 %188, -1
br i1 %189, label %190, label %191
190: ; preds = %186
br label %203
191: ; preds = %186
%192 = load i32, i32* @stderr
%193 = load i32, i32* %21
%194 = load i32, i32* %22
%195 = ashr i32 %194, 4
%196 = load i32, i32* %22
%197 = and i32 %196, 15
%198 = load i32, i32* %23
%199 = call i32 (i32, i8*, ...) @fprintf(i32 %192, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %193, i32 %195, i32 %197, i32 %198)
br label %200
200: ; preds = %191
%201 = load i32, i32* %20
%202 = add nsw i32 %201, 1
store i32 %202, i32* %20
br label %172
203: ; preds = %190, %185, %180, %172
br label %266
204: ; preds = %48
%205 = call i32 @rb(i32 1)
store i32 %205, i32* %6
%206 = load i32, i32* %6
%207 = icmp eq i32 %206, -1
br i1 %207, label %208, label %209
208: ; preds = %204
br label %266
209: ; preds = %204
%210 = load i32, i32* @stderr
%211 = load i32, i32* %6
%212 = call i32 (i32, i8*, ...) @fprintf(i32 %210, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 %211)
%213 = load i32, i32* %7
%214 = sub nsw i32 %213, 2
%215 = sub nsw i32 %214, 1
%216 = call i32 @skipdata(i32 %215, i32 1)
br label %266
217: ; preds = %48
%218 = load i32, i32* @stderr
%219 = call i32 (i32, i8*, ...) @fprintf(i32 %218, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%220 = load i32, i32* %7
%221 = sub nsw i32 %220, 2
%222 = call i32 @skipdata(i32 %221, i32 1)
br label %266
223: ; preds = %48, %48, %48
%224 = load i32, i32* @stderr
%225 = call i32 (i32, i8*, ...) @fprintf(i32 %224, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%226 = getelementptr inbounds [5 x i8], [5 x i8]* %24, i64 0, i64 0
%227 = call i32 @rd(i32 4, i8* %226)
%228 = icmp eq i32 -1, %227
br i1 %228, label %229, label %230
229: ; preds = %223
br label %266
230: ; preds = %223
%231 = getelementptr inbounds [5 x i8], [5 x i8]* %24, i64 0, i64 4
store i8 0, i8* %231
%232 = load i32, i32* @stderr
%233 = getelementptr inbounds [5 x i8], [5 x i8]* %24, i64 0, i64 0
%234 = call i32 (i32, i8*, ...) @fprintf(i32 %232, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* %233)
%235 = getelementptr inbounds [5 x i8], [5 x i8]* %24, i64 0, i64 0
%236 = call i32 @strcmp(i8* %235, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%237 = icmp ne i32 %236, 0
br i1 %237, label %240, label %238
238: ; preds = %230
%239 = call i32 (...) @print_jfif()
br label %250
240: ; preds = %230
%241 = load i32, i32* %7
%242 = sub nsw i32 %241, 2
%243 = sub nsw i32 %242, 4
%244 = call i32 @skipdata(i32 %243, i32 0)
%245 = icmp eq i32 -1, %244
br i1 %245, label %246, label %247
246: ; preds = %240
br label %266
247: ; preds = %240
%248 = load i32, i32* @stderr
%249 = call i32 (i32, i8*, ...) @fprintf(i32 %248, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
br label %250
250: ; preds = %247, %238
br label %266
251: ; preds = %48
%252 = load i32, i32* @stderr
%253 = call i32 (i32, i8*, ...) @fprintf(i32 %252, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0))
%254 = load i32, i32* %7
%255 = icmp ne i32 %254, 0
br i1 %255, label %256, label %265
256: ; preds = %251
%257 = load i32, i32* %7
%258 = sub nsw i32 %257, 2
%259 = call i32 @skipdata(i32 %258, i32 0)
%260 = icmp eq i32 -1, %259
br i1 %260, label %261, label %262
261: ; preds = %256
br label %266
262: ; preds = %256
%263 = load i32, i32* @stderr
%264 = call i32 (i32, i8*, ...) @fprintf(i32 %263, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
br label %265
265: ; preds = %262, %251
br label %266
266: ; preds = %265, %261, %250, %246, %229, %217, %209, %208, %203, %165, %156, %151, %142, %137, %131, %118, %117, %112, %107, %74, %66, %65
br label %34
267: ; preds = %38
store i32 0, i32* %3
br label %268
268: ; preds = %267, %28
%269 = load i32, i32* %3
ret i32 %269
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c":unknown, aborting.\0A\00"
@.str.1 = [6 x i8] c":SOI\0A\00"
@.str.2 = [32 x i8] c":Error, end of file, aborting.\0A\00"
@.str.3 = [10 x i8] c":COM(%s)\0A\00"
@.str.4 = [6 x i8] c":SOS \00"
@.str.5 = [11 x i8] c"[%d,%d:%d]\00"
@.str.6 = [25 x i8] c"ss=%d, se=%d, h=%d,l=%d\0A\00"
@.str.7 = [28 x i8] c":SOF0,bitcnt=%d,x=%d,y=%d:\0A\00"
@.str.8 = [23 x i8] c"\09 %02x = %d:%d, tq=%d\0A\00"
@.str.9 = [14 x i8] c":DHT(0x%02x)\0A\00"
@.str.10 = [6 x i8] c":DQT\0A\00"
@.str.11 = [7 x i8] c":APP0(\00"
@.str.12 = [5 x i8] c"%s):\00"
@.str.13 = [5 x i8] c"JFIF\00"
@.str.14 = [2 x i8] c"\0A\00"
@.str.15 = [17 x i8] c":Unknown marker\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i8]
%4 = tail call i32 (...) @getmarker()
%5 = icmp eq i32 %4, 216
%6 = load i32, i32* @stderr
br i1 %5, label %9, label %7
7: ; preds = %2
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %163
9: ; preds = %2
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (...) @getmarker()
%12 = icmp eq i32 %11, -1
br i1 %12, label %16, label %13
13: ; preds = %9
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%15 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 4
br label %19
16: ; preds = %160, %9
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %163
19: ; preds = %13, %160
%20 = phi i32 [ %11, %13 ], [ %161, %160 ]
%21 = call i64 @haslength(i32 %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %19
%24 = call i32 (...) @getlength()
br label %25
25: ; preds = %19, %23
%26 = phi i32 [ %24, %23 ], [ 0, %19 ]
switch i32 %20, label %149 [
i32 254, label %27
i32 218, label %38
i32 192, label %73
i32 196, label %116
i32 219, label %124
i32 225, label %129
i32 226, label %129
i32 224, label %129
]
27: ; preds = %25
%28 = add nsw i32 %26, -2
%29 = add nsw i32 %26, -1
%30 = call i8* @malloc(i32 %29)
%31 = sext i32 %28 to i64
%32 = getelementptr inbounds i8, i8* %30, i64 %31
store i8 0, i8* %32
%33 = call i32 @rd(i32 %28, i8* %30)
%34 = icmp eq i32 %33, -1
br i1 %34, label %160, label %35
35: ; preds = %27
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %30)
br label %160
38: ; preds = %25
%39 = call i32 @rb(i32 1)
%40 = icmp eq i32 %39, -1
br i1 %40, label %160, label %41
41: ; preds = %38
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp sgt i32 %39, 0
br i1 %44, label %45, label %59
45: ; preds = %41, %52
%46 = phi i32 [ %57, %52 ], [ 0, %41 ]
%47 = call i32 @rb(i32 1)
%48 = icmp eq i32 %47, -1
br i1 %48, label %59, label %49
49: ; preds = %45
%50 = call i32 @rb(i32 1)
%51 = icmp eq i32 %50, -1
br i1 %51, label %59, label %52
52: ; preds = %49
%53 = load i32, i32* @stderr
%54 = ashr i32 %50, 4
%55 = and i32 %50, 15
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %47, i32 %54, i32 %55)
%57 = add nuw nsw i32 %46, 1
%58 = icmp eq i32 %57, %39
br i1 %58, label %59, label %45
59: ; preds = %52, %45, %49, %41
%60 = call i32 @rb(i32 1)
%61 = icmp eq i32 %60, -1
br i1 %61, label %160, label %62
62: ; preds = %59
%63 = call i32 @rb(i32 1)
%64 = icmp eq i32 %63, -1
br i1 %64, label %160, label %65
65: ; preds = %62
%66 = call i32 @rb(i32 1)
%67 = icmp eq i32 %66, -1
br i1 %67, label %160, label %68
68: ; preds = %65
%69 = load i32, i32* @stderr
%70 = ashr i32 %66, 4
%71 = and i32 %66, 15
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %60, i32 %63, i32 %70, i32 %71)
br label %160
73: ; preds = %25
%74 = call i32 @rb(i32 1)
%75 = icmp eq i32 %74, -1
br i1 %75, label %160, label %76
76: ; preds = %73
%77 = call i32 @rb(i32 1)
%78 = icmp eq i32 %77, -1
br i1 %78, label %160, label %79
79: ; preds = %76
%80 = call i32 @rb(i32 1)
%81 = icmp eq i32 %80, -1
br i1 %81, label %160, label %82
82: ; preds = %79
%83 = shl i32 %77, 8
%84 = or i32 %80, %83
%85 = call i32 @rb(i32 1)
%86 = icmp eq i32 %85, -1
br i1 %86, label %160, label %87
87: ; preds = %82
%88 = call i32 @rb(i32 1)
%89 = icmp eq i32 %88, -1
br i1 %89, label %160, label %90
90: ; preds = %87
%91 = call i32 @rb(i32 1)
%92 = icmp eq i32 %91, -1
br i1 %92, label %160, label %93
93: ; preds = %90
%94 = shl i32 %85, 8
%95 = or i32 %88, %94
%96 = load i32, i32* @stderr
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i32 %74, i32 %95, i32 %84)
%98 = icmp sgt i32 %91, 0
br i1 %98, label %99, label %160
99: ; preds = %93, %109
%100 = phi i32 [ %114, %109 ], [ 0, %93 ]
%101 = call i32 @rb(i32 1)
%102 = icmp eq i32 %101, -1
br i1 %102, label %160, label %103
103: ; preds = %99
%104 = call i32 @rb(i32 1)
%105 = icmp eq i32 %104, -1
br i1 %105, label %160, label %106
106: ; preds = %103
%107 = call i32 @rb(i32 1)
%108 = icmp eq i32 %107, -1
br i1 %108, label %160, label %109
109: ; preds = %106
%110 = load i32, i32* @stderr
%111 = ashr i32 %104, 4
%112 = and i32 %104, 15
%113 = call i32 (i32, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %101, i32 %111, i32 %112, i32 %107)
%114 = add nuw nsw i32 %100, 1
%115 = icmp eq i32 %114, %91
br i1 %115, label %160, label %99
116: ; preds = %25
%117 = call i32 @rb(i32 1)
%118 = icmp eq i32 %117, -1
br i1 %118, label %160, label %119
119: ; preds = %116
%120 = load i32, i32* @stderr
%121 = call i32 (i32, i8*, ...) @fprintf(i32 %120, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 %117)
%122 = add nsw i32 %26, -3
%123 = call i32 @skipdata(i32 %122, i32 1)
br label %160
124: ; preds = %25
%125 = load i32, i32* @stderr
%126 = call i32 (i32, i8*, ...) @fprintf(i32 %125, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%127 = add nsw i32 %26, -2
%128 = call i32 @skipdata(i32 %127, i32 1)
br label %160
129: ; preds = %25, %25, %25
%130 = load i32, i32* @stderr
%131 = call i32 (i32, i8*, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%132 = call i32 @rd(i32 4, i8* %14)
%133 = icmp eq i32 %132, -1
br i1 %133, label %148, label %134
134: ; preds = %129
store i8 0, i8* %15
%135 = load i32, i32* @stderr
%136 = call i32 (i32, i8*, ...) @fprintf(i32 %135, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* %14)
%137 = call i32 @bcmp(i8* dereferenceable(5) %14, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i64 5)
%138 = icmp eq i32 %137, 0
br i1 %138, label %139, label %141
139: ; preds = %134
%140 = call i32 (...) @print_jfif()
br label %148
141: ; preds = %134
%142 = add nsw i32 %26, -6
%143 = call i32 @skipdata(i32 %142, i32 0)
%144 = icmp eq i32 %143, -1
br i1 %144, label %148, label %145
145: ; preds = %141
%146 = load i32, i32* @stderr
%147 = call i32 (i32, i8*, ...) @fprintf(i32 %146, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
br label %148
148: ; preds = %139, %145, %141, %129
br label %160
149: ; preds = %25
%150 = load i32, i32* @stderr
%151 = call i32 (i32, i8*, ...) @fprintf(i32 %150, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0))
%152 = icmp eq i32 %26, 0
br i1 %152, label %160, label %153
153: ; preds = %149
%154 = add nsw i32 %26, -2
%155 = call i32 @skipdata(i32 %154, i32 0)
%156 = icmp eq i32 %155, -1
br i1 %156, label %160, label %157
157: ; preds = %153
%158 = load i32, i32* @stderr
%159 = call i32 (i32, i8*, ...) @fprintf(i32 %158, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
br label %160
160: ; preds = %109, %99, %103, %106, %93, %73, %76, %79, %82, %87, %90, %68, %38, %59, %62, %65, %35, %27, %149, %157, %153, %116, %148, %124, %119
%161 = call i32 (...) @getmarker()
%162 = icmp eq i32 %161, -1
br i1 %162, label %16, label %19
163: ; preds = %16, %7
%164 = phi i32 [ 1, %7 ], [ 0, %16 ]
ret i32 %164
}