#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*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ read_file(unsigned char **, size_t *, size_t *,
                             int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdout;
void diagnose_bie(FILE *f) {
  unsigned char *bie, *p;
  size_t buflen = 0, len;
  unsigned long xd, yd, l0;
  FILE *d = stdout;
  extern unsigned char *jbg_next_pscdms(unsigned char *p, size_t len);
  unsigned long stripes;
  int layers, planes, sde = 0;
  read_file(&bie, &buflen, &len, f);
  if (len < 20) {
    fprintf(d,
            "Error: Input file is %d < 20 bytes long and therefore "
            "does not contain an intact BIE header!\n",
            len);
    return;
  }
  fprintf(d,
          "BIH:\n\n  DL = %d\n  D  = %d\n  P  = %d\n"
          "  -  = %d\n  XD = %lu\n  YD = %lu\n  L0 = %lu\n  MX = %d\n"
          "  MY = %d\n",
          bie[0], bie[1], bie[2], bie[3],
          xd = ((unsigned long)bie[4] << 24) | ((unsigned long)bie[5] << 16) |
               ((unsigned long)bie[6] << 8) | ((unsigned long)bie[7]),
          yd = ((unsigned long)bie[8] << 24) | ((unsigned long)bie[9] << 16) |
               ((unsigned long)bie[10] << 8) | ((unsigned long)bie[11]),
          l0 = ((unsigned long)bie[12] << 24) | ((unsigned long)bie[13] << 16) |
               ((unsigned long)bie[14] << 8) | ((unsigned long)bie[15]),
          bie[16], bie[17]);
  fprintf(d, "  order   = %d %s%s%s%s%s\n", bie[18],
          bie[18] & 0x08 ? " HITOLO" : "", bie[18] & 0x04 ? " SEQ" : "",
          bie[18] & 0x02 ? " ILEAVE" : "", bie[18] & 0x01 ? " SMID" : "",
          bie[18] & 0xf0 ? " other" : "");
  fprintf(d, "  options = %d %s%s%s%s%s%s%s%s\n", bie[19],
          bie[19] & 0x40 ? " LRLTWO" : "", bie[19] & 0x20 ? " VLENGTH" : "",
          bie[19] & 0x10 ? " TPDON" : "", bie[19] & 0x08 ? " TPBON" : "",
          bie[19] & 0x04 ? " DPON" : "", bie[19] & 0x02 ? " DPPRIV" : "",
          bie[19] & 0x01 ? " DPLAST" : "", bie[19] & 0x80 ? " other" : "");
  stripes =
      ((yd >> bie[1]) + ((((1UL << bie[1]) - 1) & xd) != 0) + l0 - 1) / l0;
  layers = bie[1] - bie[0] + 1;
  planes = bie[2];
  fprintf(d, "\n  %lu stripes, %d layers, %d planes = %lu SDEs\n\n", stripes,
          layers, planes, stripes * layers * planes);
  fprintf(d, "BID:\n\n");
  p = bie + 20;
  if ((bie[19] & (0x04 | 0x02 | 0x01)) == (0x04 | 0x02))
    p += 1728;
  if (p > bie + len) {
    fprintf(d,
            "Error: Input file is %d < 20+1728 bytes long and therefore "
            "does not contain an intact BIE header with DPTABLE!\n",
            len);
    return;
  }
  while (p != bie + len) {
    if (p > bie + len - 2) {
      fprintf(d, "%06x: Error: single byte 0x%02x left\n", p - bie, *p);
      return;
    }
    if (p[0] != 0xff || p[1] == 0x00) {
      fprintf(d, "%06x: PSCD\n", p - bie);
    } else
      switch (p[1]) {
      case 0x02:
        fprintf(d, "%06x: ESC SDNORM #%d\n", p - bie, sde++);
        break;
      case 0x03:
        fprintf(d, "%06x: ESC SDRST #%d\n", p - bie, sde++);
        break;
      case 0x04:
        fprintf(d, "%06x: ESC ABORT\n", p - bie);
        break;
      case 0x05:
        fprintf(d, "%06x: ESC NEWLEN ", p - bie);
        if (p + 5 < bie + len)
          fprintf(d, "YD = %lu\n",
                  (((long)p[2] << 24) | ((long)p[3] << 16) | ((long)p[4] << 8) |
                   (long)p[5]));
        else
          fprintf(d, "unexpected EOF\n");
        break;
      case 0x06:
        fprintf(d, "%06x: ESC ATMOVE ", p - bie);
        if (p + 7 < bie + len)
          fprintf(d, "YAT = %lu, tX = %d, tY = %d\n",
                  (((long)p[2] << 24) | ((long)p[3] << 16) | ((long)p[4] << 8) |
                   (long)p[5]),
                  p[6], p[7]);
        else
          fprintf(d, "unexpected EOF\n");
        break;
      case 0x07:
        fprintf(d, "%06x: ESC COMMENT ", p - bie);
        if (p + 5 < bie + len)
          fprintf(d, "LC = %lu\n",
                  (((long)p[2] << 24) | ((long)p[3] << 16) | ((long)p[4] << 8) |
                   (long)p[5]));
        else
          fprintf(d, "unexpected EOF\n");
        break;
      default:
        fprintf(d, "%06x: ESC 0x%02x\n", p - bie, p[1]);
      }
    p = jbg_next_pscdms(p, len - (p - bie));
    if (!p) {
      fprintf(d, "Error encountered!\n");
      return;
    }
  }
  free(bie);
  return;
}


x86 assembly (clang, -O0):
<diagnose_bie>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    %rdi,-0x20(%rbp)
movq   $0x0,-0x38(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1050 <read_file@plt>
cmpq   $0x14,-0x40(%rbp)
jae    11ac <diagnose_bie+0x6c>
mov    -0x60(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xe78(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1979 <diagnose_bie+0x839>
mov    -0x60(%rbp),%rdi
mov    -0x28(%rbp),%rax
movzbl (%rax),%edx
mov    -0x28(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    -0x28(%rbp),%rax
movzbl 0x2(%rax),%r8d
mov    -0x28(%rbp),%rax
movzbl 0x3(%rax),%r9d
mov    -0x28(%rbp),%rax
movzbl 0x4(%rax),%eax
mov    %eax,%r14d
shl    $0x18,%r14
mov    -0x28(%rbp),%rax
movzbl 0x5(%rax),%eax
shl    $0x10,%rax
or     %rax,%r14
mov    -0x28(%rbp),%rax
movzbl 0x6(%rax),%eax
shl    $0x8,%rax
or     %rax,%r14
mov    -0x28(%rbp),%rax
movzbl 0x7(%rax),%eax
or     %rax,%r14
mov    %r14,-0x48(%rbp)
mov    -0x28(%rbp),%rax
movzbl 0x8(%rax),%eax
mov    %eax,%ebx
shl    $0x18,%rbx
mov    -0x28(%rbp),%rax
movzbl 0x9(%rax),%eax
shl    $0x10,%rax
or     %rax,%rbx
mov    -0x28(%rbp),%rax
movzbl 0xa(%rax),%eax
shl    $0x8,%rax
or     %rax,%rbx
mov    -0x28(%rbp),%rax
movzbl 0xb(%rax),%eax
or     %rax,%rbx
mov    %rbx,-0x50(%rbp)
mov    -0x28(%rbp),%rax
movzbl 0xc(%rax),%eax
mov    %eax,%r11d
shl    $0x18,%r11
mov    -0x28(%rbp),%rax
movzbl 0xd(%rax),%eax
shl    $0x10,%rax
or     %rax,%r11
mov    -0x28(%rbp),%rax
movzbl 0xe(%rax),%eax
shl    $0x8,%rax
or     %rax,%r11
mov    -0x28(%rbp),%rax
movzbl 0xf(%rax),%eax
or     %rax,%r11
mov    %r11,-0x58(%rbp)
mov    -0x28(%rbp),%rax
movzbl 0x10(%rax),%r10d
mov    -0x28(%rbp),%rax
movzbl 0x11(%rax),%eax
lea    0xdda(%rip),%rsi
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x60(%rbp),%rdi
mov    -0x28(%rbp),%rax
movzbl 0x12(%rax),%edx
mov    -0x28(%rbp),%rax
movzbl 0x12(%rax),%esi
and    $0x8,%esi
lea    0xecd(%rip),%rcx
lea    0xe16(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rcx
mov    -0x28(%rbp),%rax
movzbl 0x12(%rax),%esi
and    $0x4,%esi
lea    0xead(%rip),%r8
lea    0xdfe(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r8
mov    -0x28(%rbp),%rax
movzbl 0x12(%rax),%esi
and    $0x2,%esi
lea    0xe8d(%rip),%r9
lea    0xde3(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r9
mov    -0x28(%rbp),%rax
movzbl 0x12(%rax),%esi
and    $0x1,%esi
lea    0xe6d(%rip),%r10
lea    0xdcb(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r10
mov    -0x28(%rbp),%rax
movzbl 0x12(%rax),%r11d
and    $0xf0,%r11d
lea    0xe48(%rip),%rax
lea    0xdac(%rip),%rsi
cmp    $0x0,%r11d
cmovne %rsi,%rax
lea    0xd67(%rip),%rsi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x60(%rbp),%rdi
mov    -0x28(%rbp),%rax
movzbl 0x13(%rax),%edx
mov    -0x28(%rbp),%rax
movzbl 0x13(%rax),%esi
and    $0x40,%esi
lea    0xe04(%rip),%rcx
lea    0xd90(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rcx
mov    -0x28(%rbp),%rax
movzbl 0x13(%rax),%esi
and    $0x20,%esi
lea    0xde4(%rip),%r8
lea    0xd78(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r8
mov    -0x28(%rbp),%rax
movzbl 0x13(%rax),%esi
and    $0x10,%esi
lea    0xdc4(%rip),%r9
lea    0xd61(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r9
mov    -0x28(%rbp),%rax
movzbl 0x13(%rax),%esi
and    $0x8,%esi
lea    0xda4(%rip),%r14
lea    0xd48(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r14
mov    -0x28(%rbp),%rax
movzbl 0x13(%rax),%esi
and    $0x4,%esi
lea    0xd84(%rip),%rbx
lea    0xd2f(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rbx
mov    -0x28(%rbp),%rax
movzbl 0x13(%rax),%esi
and    $0x2,%esi
lea    0xd64(%rip),%r11
lea    0xd15(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r11
mov    -0x28(%rbp),%rax
movzbl 0x13(%rax),%esi
and    $0x1,%esi
lea    0xd44(%rip),%r10
lea    0xcfd(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r10
mov    -0x28(%rbp),%rax
movzbl 0x13(%rax),%r15d
and    $0x80,%r15d
lea    0xd1f(%rip),%rax
lea    0xc83(%rip),%rsi
cmp    $0x0,%r15d
cmovne %rsi,%rax
lea    0xc7b(%rip),%rsi
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x50(%rbp),%rax
mov    -0x28(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
mov    %ecx,%ecx
shr    %cl,%rax
mov    -0x28(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
mov    %ecx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
and    -0x48(%rbp),%rcx
cmp    $0x0,%rcx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    -0x58(%rbp),%rax
sub    $0x1,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x58(%rbp)
mov    %rax,-0x68(%rbp)
mov    -0x28(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    -0x28(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x28(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0x70(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rdx
mov    -0x6c(%rbp),%ecx
mov    -0x70(%rbp),%r8d
mov    -0x68(%rbp),%r9
movslq -0x6c(%rbp),%rax
imul   %rax,%r9
movslq -0x70(%rbp),%rax
imul   %rax,%r9
lea    0xc11(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x60(%rbp),%rdi
lea    0xc31(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x28(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movzbl 0x13(%rax),%eax
and    $0x7,%eax
cmp    $0x6,%eax
jne    15a3 <diagnose_bie+0x463>
mov    -0x30(%rbp),%rax
add    $0x6c0,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
add    -0x40(%rbp),%rcx
cmp    %rcx,%rax
jbe    15d3 <diagnose_bie+0x493>
mov    -0x60(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xbdf(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1979 <diagnose_bie+0x839>
jmp    15d8 <diagnose_bie+0x498>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
add    -0x40(%rbp),%rcx
cmp    %rcx,%rax
je     1970 <diagnose_bie+0x830>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
add    -0x40(%rbp),%rcx
add    $0xfffffffffffffffe,%rcx
cmp    %rcx,%rax
jbe    162f <diagnose_bie+0x4ef>
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rax
sub    %rax,%rdx
mov    -0x30(%rbp),%rax
movzbl (%rax),%ecx
lea    0xbf3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1979 <diagnose_bie+0x839>
mov    -0x30(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xff,%eax
jne    1652 <diagnose_bie+0x512>
mov    -0x30(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1674 <diagnose_bie+0x534>
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rax
sub    %rax,%rdx
lea    0xbd4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    192a <diagnose_bie+0x7ea>
mov    -0x30(%rbp),%rax
movzbl 0x1(%rax),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x80(%rbp)
sub    $0x5,%eax
ja     1900 <diagnose_bie+0x7c0>
mov    -0x80(%rbp),%rax
lea    0x967(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rax
sub    %rax,%rdx
mov    -0x74(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
lea    0xb85(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1925 <diagnose_bie+0x7e5>
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rax
sub    %rax,%rdx
mov    -0x74(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
lea    0xb6e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1925 <diagnose_bie+0x7e5>
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rax
sub    %rax,%rdx
lea    0xb61(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1925 <diagnose_bie+0x7e5>
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rax
sub    %rax,%rdx
lea    0xb50(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rax
add    $0x5,%rax
mov    -0x28(%rbp),%rcx
add    -0x40(%rbp),%rcx
cmp    %rcx,%rax
jae    17a2 <diagnose_bie+0x662>
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,%edx
shl    $0x18,%rdx
mov    -0x30(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x10,%rax
or     %rax,%rdx
mov    -0x30(%rbp),%rax
movzbl 0x4(%rax),%eax
shl    $0x8,%rax
or     %rax,%rdx
mov    -0x30(%rbp),%rax
movzbl 0x5(%rax),%eax
or     %rax,%rdx
lea    0xb00(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    17b4 <diagnose_bie+0x674>
mov    -0x60(%rbp),%rdi
lea    0xaf3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1925 <diagnose_bie+0x7e5>
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rax
sub    %rax,%rdx
lea    0xae1(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rax
add    $0x7,%rax
mov    -0x28(%rbp),%rcx
add    -0x40(%rbp),%rcx
cmp    %rcx,%rax
jae    184e <diagnose_bie+0x70e>
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,%edx
shl    $0x18,%rdx
mov    -0x30(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x10,%rax
or     %rax,%rdx
mov    -0x30(%rbp),%rax
movzbl 0x4(%rax),%eax
shl    $0x8,%rax
or     %rax,%rdx
mov    -0x30(%rbp),%rax
movzbl 0x5(%rax),%eax
or     %rax,%rdx
mov    -0x30(%rbp),%rax
movzbl 0x6(%rax),%ecx
mov    -0x30(%rbp),%rax
movzbl 0x7(%rax),%r8d
lea    0xa80(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1860 <diagnose_bie+0x720>
mov    -0x60(%rbp),%rdi
lea    0xa47(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1925 <diagnose_bie+0x7e5>
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rax
sub    %rax,%rdx
lea    0xa64(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rax
add    $0x5,%rax
mov    -0x28(%rbp),%rcx
add    -0x40(%rbp),%rcx
cmp    %rcx,%rax
jae    18e9 <diagnose_bie+0x7a9>
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,%edx
shl    $0x18,%rdx
mov    -0x30(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x10,%rax
or     %rax,%rdx
mov    -0x30(%rbp),%rax
movzbl 0x4(%rax),%eax
shl    $0x8,%rax
or     %rax,%rdx
mov    -0x30(%rbp),%rax
movzbl 0x5(%rax),%eax
or     %rax,%rdx
lea    0xa15(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    18fb <diagnose_bie+0x7bb>
mov    -0x60(%rbp),%rdi
lea    0x9ac(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1925 <diagnose_bie+0x7e5>
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rax
sub    %rax,%rdx
mov    -0x30(%rbp),%rax
movzbl 0x1(%rax),%ecx
lea    0x9de(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    192a <diagnose_bie+0x7ea>
mov    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    %rcx,%rax
sub    %rax,%rsi
call   1060 <jbg_next_pscdms@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    196b <diagnose_bie+0x82b>
mov    -0x60(%rbp),%rdi
lea    0x9af(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1979 <diagnose_bie+0x839>
jmp    15d8 <diagnose_bie+0x498>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<diagnose_bie>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rcx
movq   $0x0,0x20(%rsp)
mov    0x2e6f(%rip),%rax
mov    (%rax),%rbx
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <read_file@plt>
mov    0x8(%rsp),%rdx
cmp    $0x13,%rdx
ja     11a0 <diagnose_bie+0x50>
lea    0xea8(%rip),%rsi
mov    %rbx,%rdi
jmp    1400 <diagnose_bie+0x2b0>
mov    (%rsp),%rax
movzbl (%rax),%edx
movzbl 0x1(%rax),%ecx
movzbl 0x2(%rax),%r8d
movzbl 0x3(%rax),%r9d
mov    0x4(%rax),%r12d
mov    0x8(%rax),%r15d
shl    $0x20,%r12
bswap  %r12
shl    $0x20,%r15
bswap  %r15
mov    0xc(%rax),%esi
shl    $0x20,%rsi
bswap  %rsi
mov    %rsi,%rbp
mov    %rsi,0x18(%rsp)
movzbl 0x10(%rax),%r10d
mov    %rbx,%rdi
mov    %rbx,0x10(%rsp)
movzbl 0x11(%rax),%ebx
sub    $0x8,%rsp
lea    0xea5(%rip),%rsi
xor    %eax,%eax
push   %rbx
push   %r10
push   %rbp
push   %r15
push   %r12
call   1040 <fprintf@plt>
add    $0x30,%rsp
mov    (%rsp),%rax
movzbl 0x12(%rax),%edx
test   $0x8,%dl
lea    0xfaf(%rip),%r14
lea    0xef8(%rip),%rcx
cmove  %r14,%rcx
test   $0x4,%dl
lea    0xef2(%rip),%r8
cmove  %r14,%r8
test   $0x2,%dl
lea    0xee9(%rip),%r9
cmove  %r14,%r9
test   $0x1,%dl
lea    0xee3(%rip),%rbp
cmove  %r14,%rbp
test   $0xf0,%dl
lea    0xedb(%rip),%r13
mov    %r13,%rbx
cmove  %r14,%rbx
lea    0xe97(%rip),%rsi
mov    0x10(%rsp),%rdi
xor    %eax,%eax
push   %rbx
push   %rbp
call   1040 <fprintf@plt>
add    $0x10,%rsp
mov    (%rsp),%rax
movzbl 0x13(%rax),%edx
movd   %edx,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa 0xd6a(%rip),%xmm1
pand   %xmm0,%xmm1
pand   0xd6e(%rip),%xmm0
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%eax
lea    0xe9f(%rip),%rcx
test   $0x80,%al
cmovne %r14,%rcx
lea    0xe9a(%rip),%r8
test   $0x40,%al
cmovne %r14,%r8
lea    0xe96(%rip),%r9
test   $0x20,%al
cmovne %r14,%r9
lea    0xe90(%rip),%r10
test   $0x10,%al
cmovne %r14,%r10
lea    0xe8a(%rip),%r11
test   $0x8,%al
cmovne %r14,%r11
lea    0xe83(%rip),%rbp
test   $0x4,%al
cmovne %r14,%rbp
lea    0xe7e(%rip),%rbx
test   $0x2,%al
cmovne %r14,%rbx
test   $0x1,%al
cmovne %r14,%r13
sub    $0x8,%rsp
lea    0xe19(%rip),%rsi
mov    0x18(%rsp),%rdi
mov    %rdi,%r14
xor    %eax,%eax
push   %r13
push   %rbx
push   %rbp
push   %r11
push   %r10
call   1040 <fprintf@plt>
mov    0x48(%rsp),%rdi
add    $0x30,%rsp
mov    (%rsp),%rsi
movzbl 0x1(%rsi),%ecx
shr    %cl,%r15
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
not    %eax
and    %eax,%r12d
add    %rdi,%r15
cmp    $0x1,%r12d
sbb    $0xffffffffffffffff,%r15
add    $0xffffffffffffffff,%r15
mov    %r15,%rax
shr    $0x20,%rax
je     1382 <diagnose_bie+0x232>
mov    %r15,%rax
xor    %edx,%edx
div    %rdi
jmp    1389 <diagnose_bie+0x239>
mov    %r15d,%eax
xor    %edx,%edx
div    %edi
movzbl (%rsi),%edx
sub    %rdx,%rcx
add    $0x1,%rcx
movzbl 0x2(%rsi),%r8d
mov    %rcx,%r9
imul   %r8,%r9
imul   %rax,%r9
lea    0xdeb(%rip),%rsi
mov    %r14,%rbp
mov    %r14,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe06(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1070 <fwrite@plt>
mov    (%rsp),%rdi
mov    0x13(%rdi),%al
and    $0x7,%al
cmp    $0x6,%al
mov    $0x6d4,%eax
mov    $0x14,%ebx
cmove  %rax,%rbx
mov    0x8(%rsp),%rdx
cmp    %rdx,%rbx
jle    1416 <diagnose_bie+0x2c6>
lea    0xdd1(%rip),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
jne    141f <diagnose_bie+0x2cf>
call   1030 <free@plt>
jmp    1407 <diagnose_bie+0x2b7>
add    %rdi,%rdx
add    %rdi,%rbx
lea    0xbf4(%rip),%r13
lea    0xe31(%rip),%r15
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
add    $0xfffffffffffffffe,%rdx
cmp    %rdx,%rbx
ja     161b <diagnose_bie+0x4cb>
cmpb   $0xff,(%rbx)
je     14a0 <diagnose_bie+0x350>
mov    %rbx,%rdx
sub    %rdi,%rdx
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x8(%rsp),%rsi
sub    %rbx,%rsi
add    (%rsp),%rsi
mov    %rbx,%rdi
call   1060 <jbg_next_pscdms@plt>
test   %rax,%rax
je     163a <diagnose_bie+0x4ea>
mov    %rax,%rbx
mov    (%rsp),%rdi
mov    0x8(%rsp),%rdx
add    %rdi,%rdx
cmp    %rdx,%rax
jne    1440 <diagnose_bie+0x2f0>
jmp    1418 <diagnose_bie+0x2c8>
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%ecx
cmp    $0x7,%rcx
ja     14cb <diagnose_bie+0x37b>
movslq 0x0(%r13,%rcx,4),%rax
add    %r13,%rax
jmp    *%rax
mov    %rbx,%rdx
sub    %rdi,%rdx
lea    0x1(%r12),%ebp
mov    %r14,%rdi
lea    0xda7(%rip),%rsi
jmp    14f9 <diagnose_bie+0x3a9>
mov    %rbx,%rdx
sub    %rdi,%rdx
mov    %rbp,%rdi
lea    0xe49(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1465 <diagnose_bie+0x315>
mov    %rbx,%rdx
sub    %rdi,%rdx
lea    0x1(%r12),%ebp
mov    %r14,%rdi
lea    0xd8d(%rip),%rsi
mov    %r12d,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %ebp,%r12d
mov    %r14,%rbp
jmp    1465 <diagnose_bie+0x315>
mov    %rbx,%rdx
sub    %rdi,%rdx
mov    %rbp,%rdi
lea    0xd7d(%rip),%rsi
jmp    145e <diagnose_bie+0x30e>
mov    %rbx,%rdx
sub    %rdi,%rdx
mov    %rbp,%rdi
lea    0xda5(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0x7(%rbx),%rax
mov    (%rsp),%rcx
add    0x8(%rsp),%rcx
cmp    %rcx,%rax
jae    15fd <diagnose_bie+0x4ad>
mov    0x2(%rbx),%edx
shl    $0x20,%rdx
bswap  %rdx
movzbl 0x6(%rbx),%ecx
movzbl 0x7(%rbx),%r8d
mov    %rbp,%rdi
lea    0xd7d(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1465 <diagnose_bie+0x315>
mov    %rbx,%rdx
sub    %rdi,%rdx
mov    %rbp,%rdi
lea    0xd7e(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0x5(%rbx),%rax
mov    (%rsp),%rcx
add    0x8(%rsp),%rcx
cmp    %rcx,%rax
jae    15fd <diagnose_bie+0x4ad>
mov    0x2(%rbx),%edx
shl    $0x20,%rdx
bswap  %rdx
mov    %rbp,%rdi
lea    0xd64(%rip),%rsi
jmp    145e <diagnose_bie+0x30e>
mov    %rbx,%rdx
sub    %rdi,%rdx
mov    %rbp,%rdi
lea    0xce1(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0x5(%rbx),%rax
mov    (%rsp),%rcx
add    0x8(%rsp),%rcx
cmp    %rcx,%rax
jae    15fd <diagnose_bie+0x4ad>
mov    0x2(%rbx),%edx
shl    $0x20,%rdx
bswap  %rdx
mov    %rbp,%rdi
lea    0xcc6(%rip),%rsi
jmp    145e <diagnose_bie+0x30e>
mov    $0xf,%esi
mov    $0x1,%edx
lea    0xcba(%rip),%rdi
mov    %rbp,%rcx
call   1070 <fwrite@plt>
jmp    1465 <diagnose_bie+0x315>
movzbl (%rbx),%ecx
sub    %rdi,%rbx
lea    0xc16(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1407 <diagnose_bie+0x2b7>
lea    0xcf5(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1070 <fwrite@plt>
jmp    1407 <diagnose_bie+0x2b7>

LLVM IR (-O0):
@stdout = global i32* null
@.str = [94 x i8] c"Error: Input file is %d < 20 bytes long and therefore does not contain an intact BIE header!\0A\00"
@.str.1 = [100 x i8] c"BIH:\0A\0A DL = %d\0A D = %d\0A P = %d\0A - = %d\0A XD = %lu\0A YD = %lu\0A L0 = %lu\0A MX = %d\0A MY = %d\0A\00"
@.str.2 = [27 x i8] c" order = %d %s%s%s%s%s\0A\00"
@.str.3 = [8 x i8] c" HITOLO\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [5 x i8] c" SEQ\00"
@.str.6 = [8 x i8] c" ILEAVE\00"
@.str.7 = [6 x i8] c" SMID\00"
@.str.8 = [7 x i8] c" other\00"
@.str.9 = [33 x i8] c" options = %d %s%s%s%s%s%s%s%s\0A\00"
@.str.10 = [8 x i8] c" LRLTWO\00"
@.str.11 = [9 x i8] c" VLENGTH\00"
@.str.12 = [7 x i8] c" TPDON\00"
@.str.13 = [7 x i8] c" TPBON\00"
@.str.14 = [6 x i8] c" DPON\00"
@.str.15 = [8 x i8] c" DPPRIV\00"
@.str.16 = [8 x i8] c" DPLAST\00"
@.str.17 = [50 x i8] c"\0A %lu stripes, %d layers, %d planes = %lu SDEs\0A\0A\00"
@.str.18 = [7 x i8] c"BID:\0A\0A\00"
@.str.19 = [112 x i8] c"Error: Input file is %d < 20+1728 bytes long and therefore does not contain an intact BIE header with DPTABLE!\0A\00"
@.str.20 = [38 x i8] c"%06x: Error: single byte 0x%02x left\0A\00"
@.str.21 = [12 x i8] c"%06x: PSCD\0A\00"
@.str.22 = [22 x i8] c"%06x: ESC SDNORM #%d\0A\00"
@.str.23 = [21 x i8] c"%06x: ESC SDRST #%d\0A\00"
@.str.24 = [17 x i8] c"%06x: ESC ABORT\0A\00"
@.str.25 = [18 x i8] c"%06x: ESC NEWLEN \00"
@.str.26 = [10 x i8] c"YD = %lu\0A\00"
@.str.27 = [16 x i8] c"unexpected EOF\0A\00"
@.str.28 = [18 x i8] c"%06x: ESC ATMOVE \00"
@.str.29 = [29 x i8] c"YAT = %lu, tX = %d, tY = %d\0A\00"
@.str.30 = [19 x i8] c"%06x: ESC COMMENT \00"
@.str.31 = [10 x i8] c"LC = %lu\0A\00"
@.str.32 = [18 x i8] c"%06x: ESC 0x%02x\0A\00"
@.str.33 = [20 x i8] c"Error encountered!\0A\00"
define void @diagnose_bie(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32*
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %2
store i64 0, i64* %5
%15 = load i32*, i32** @stdout
store i32* %15, i32** %10
store i32 0, i32* %14
%16 = load i32*, i32** %2
%17 = call i32 @read_file(i8** %3, i64* %5, i64* %6, i32* %16)
%18 = load i64, i64* %6
%19 = icmp ult i64 %18, 20
br i1 %19, label %20, label %24
20: ; preds = %1
%21 = load i32*, i32** %10
%22 = load i64, i64* %6
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i64 %22)
br label %554
24: ; preds = %1
%25 = load i32*, i32** %10
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 0
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i64 2
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = load i8*, i8** %3
%39 = getelementptr inbounds i8, i8* %38, i64 3
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8*, i8** %3
%43 = getelementptr inbounds i8, i8* %42, i64 4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i64
%46 = shl i64 %45, 24
%47 = load i8*, i8** %3
%48 = getelementptr inbounds i8, i8* %47, i64 5
%49 = load i8, i8* %48
%50 = zext i8 %49 to i64
%51 = shl i64 %50, 16
%52 = or i64 %46, %51
%53 = load i8*, i8** %3
%54 = getelementptr inbounds i8, i8* %53, i64 6
%55 = load i8, i8* %54
%56 = zext i8 %55 to i64
%57 = shl i64 %56, 8
%58 = or i64 %52, %57
%59 = load i8*, i8** %3
%60 = getelementptr inbounds i8, i8* %59, i64 7
%61 = load i8, i8* %60
%62 = zext i8 %61 to i64
%63 = or i64 %58, %62
store i64 %63, i64* %7
%64 = load i8*, i8** %3
%65 = getelementptr inbounds i8, i8* %64, i64 8
%66 = load i8, i8* %65
%67 = zext i8 %66 to i64
%68 = shl i64 %67, 24
%69 = load i8*, i8** %3
%70 = getelementptr inbounds i8, i8* %69, i64 9
%71 = load i8, i8* %70
%72 = zext i8 %71 to i64
%73 = shl i64 %72, 16
%74 = or i64 %68, %73
%75 = load i8*, i8** %3
%76 = getelementptr inbounds i8, i8* %75, i64 10
%77 = load i8, i8* %76
%78 = zext i8 %77 to i64
%79 = shl i64 %78, 8
%80 = or i64 %74, %79
%81 = load i8*, i8** %3
%82 = getelementptr inbounds i8, i8* %81, i64 11
%83 = load i8, i8* %82
%84 = zext i8 %83 to i64
%85 = or i64 %80, %84
store i64 %85, i64* %8
%86 = load i8*, i8** %3
%87 = getelementptr inbounds i8, i8* %86, i64 12
%88 = load i8, i8* %87
%89 = zext i8 %88 to i64
%90 = shl i64 %89, 24
%91 = load i8*, i8** %3
%92 = getelementptr inbounds i8, i8* %91, i64 13
%93 = load i8, i8* %92
%94 = zext i8 %93 to i64
%95 = shl i64 %94, 16
%96 = or i64 %90, %95
%97 = load i8*, i8** %3
%98 = getelementptr inbounds i8, i8* %97, i64 14
%99 = load i8, i8* %98
%100 = zext i8 %99 to i64
%101 = shl i64 %100, 8
%102 = or i64 %96, %101
%103 = load i8*, i8** %3
%104 = getelementptr inbounds i8, i8* %103, i64 15
%105 = load i8, i8* %104
%106 = zext i8 %105 to i64
%107 = or i64 %102, %106
store i64 %107, i64* %9
%108 = load i8*, i8** %3
%109 = getelementptr inbounds i8, i8* %108, i64 16
%110 = load i8, i8* %109
%111 = zext i8 %110 to i32
%112 = load i8*, i8** %3
%113 = getelementptr inbounds i8, i8* %112, i64 17
%114 = load i8, i8* %113
%115 = zext i8 %114 to i32
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.1, i64 0, i64 0), i32 %29, i32 %33, i32 %37, i32 %41, i64 %63, i64 %85, i64 %107, i32 %111, i32 %115)
%117 = load i32*, i32** %10
%118 = load i8*, i8** %3
%119 = getelementptr inbounds i8, i8* %118, i64 18
%120 = load i8, i8* %119
%121 = zext i8 %120 to i32
%122 = load i8*, i8** %3
%123 = getelementptr inbounds i8, i8* %122, i64 18
%124 = load i8, i8* %123
%125 = zext i8 %124 to i32
%126 = and i32 %125, 8
%127 = icmp ne i32 %126, 0
%128 = zext i1 %127 to i64
%129 = select i1 %127, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%130 = load i8*, i8** %3
%131 = getelementptr inbounds i8, i8* %130, i64 18
%132 = load i8, i8* %131
%133 = zext i8 %132 to i32
%134 = and i32 %133, 4
%135 = icmp ne i32 %134, 0
%136 = zext i1 %135 to i64
%137 = select i1 %135, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%138 = load i8*, i8** %3
%139 = getelementptr inbounds i8, i8* %138, i64 18
%140 = load i8, i8* %139
%141 = zext i8 %140 to i32
%142 = and i32 %141, 2
%143 = icmp ne i32 %142, 0
%144 = zext i1 %143 to i64
%145 = select i1 %143, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%146 = load i8*, i8** %3
%147 = getelementptr inbounds i8, i8* %146, i64 18
%148 = load i8, i8* %147
%149 = zext i8 %148 to i32
%150 = and i32 %149, 1
%151 = icmp ne i32 %150, 0
%152 = zext i1 %151 to i64
%153 = select i1 %151, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%154 = load i8*, i8** %3
%155 = getelementptr inbounds i8, i8* %154, i64 18
%156 = load i8, i8* %155
%157 = zext i8 %156 to i32
%158 = and i32 %157, 240
%159 = icmp ne i32 %158, 0
%160 = zext i1 %159 to i64
%161 = select i1 %159, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%162 = call i32 (i32*, i8*, ...) @fprintf(i32* %117, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %121, i8* %129, i8* %137, i8* %145, i8* %153, i8* %161)
%163 = load i32*, i32** %10
%164 = load i8*, i8** %3
%165 = getelementptr inbounds i8, i8* %164, i64 19
%166 = load i8, i8* %165
%167 = zext i8 %166 to i32
%168 = load i8*, i8** %3
%169 = getelementptr inbounds i8, i8* %168, i64 19
%170 = load i8, i8* %169
%171 = zext i8 %170 to i32
%172 = and i32 %171, 64
%173 = icmp ne i32 %172, 0
%174 = zext i1 %173 to i64
%175 = select i1 %173, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%176 = load i8*, i8** %3
%177 = getelementptr inbounds i8, i8* %176, i64 19
%178 = load i8, i8* %177
%179 = zext i8 %178 to i32
%180 = and i32 %179, 32
%181 = icmp ne i32 %180, 0
%182 = zext i1 %181 to i64
%183 = select i1 %181, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%184 = load i8*, i8** %3
%185 = getelementptr inbounds i8, i8* %184, i64 19
%186 = load i8, i8* %185
%187 = zext i8 %186 to i32
%188 = and i32 %187, 16
%189 = icmp ne i32 %188, 0
%190 = zext i1 %189 to i64
%191 = select i1 %189, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%192 = load i8*, i8** %3
%193 = getelementptr inbounds i8, i8* %192, i64 19
%194 = load i8, i8* %193
%195 = zext i8 %194 to i32
%196 = and i32 %195, 8
%197 = icmp ne i32 %196, 0
%198 = zext i1 %197 to i64
%199 = select i1 %197, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%200 = load i8*, i8** %3
%201 = getelementptr inbounds i8, i8* %200, i64 19
%202 = load i8, i8* %201
%203 = zext i8 %202 to i32
%204 = and i32 %203, 4
%205 = icmp ne i32 %204, 0
%206 = zext i1 %205 to i64
%207 = select i1 %205, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%208 = load i8*, i8** %3
%209 = getelementptr inbounds i8, i8* %208, i64 19
%210 = load i8, i8* %209
%211 = zext i8 %210 to i32
%212 = and i32 %211, 2
%213 = icmp ne i32 %212, 0
%214 = zext i1 %213 to i64
%215 = select i1 %213, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%216 = load i8*, i8** %3
%217 = getelementptr inbounds i8, i8* %216, i64 19
%218 = load i8, i8* %217
%219 = zext i8 %218 to i32
%220 = and i32 %219, 1
%221 = icmp ne i32 %220, 0
%222 = zext i1 %221 to i64
%223 = select i1 %221, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%224 = load i8*, i8** %3
%225 = getelementptr inbounds i8, i8* %224, i64 19
%226 = load i8, i8* %225
%227 = zext i8 %226 to i32
%228 = and i32 %227, 128
%229 = icmp ne i32 %228, 0
%230 = zext i1 %229 to i64
%231 = select i1 %229, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%232 = call i32 (i32*, i8*, ...) @fprintf(i32* %163, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i32 %167, i8* %175, i8* %183, i8* %191, i8* %199, i8* %207, i8* %215, i8* %223, i8* %231)
%233 = load i64, i64* %8
%234 = load i8*, i8** %3
%235 = getelementptr inbounds i8, i8* %234, i64 1
%236 = load i8, i8* %235
%237 = zext i8 %236 to i32
%238 = zext i32 %237 to i64
%239 = lshr i64 %233, %238
%240 = load i8*, i8** %3
%241 = getelementptr inbounds i8, i8* %240, i64 1
%242 = load i8, i8* %241
%243 = zext i8 %242 to i32
%244 = zext i32 %243 to i64
%245 = shl i64 1, %244
%246 = sub i64 %245, 1
%247 = load i64, i64* %7
%248 = and i64 %246, %247
%249 = icmp ne i64 %248, 0
%250 = zext i1 %249 to i32
%251 = sext i32 %250 to i64
%252 = add i64 %239, %251
%253 = load i64, i64* %9
%254 = add i64 %252, %253
%255 = sub i64 %254, 1
%256 = load i64, i64* %9
%257 = udiv i64 %255, %256
store i64 %257, i64* %11
%258 = load i8*, i8** %3
%259 = getelementptr inbounds i8, i8* %258, i64 1
%260 = load i8, i8* %259
%261 = zext i8 %260 to i32
%262 = load i8*, i8** %3
%263 = getelementptr inbounds i8, i8* %262, i64 0
%264 = load i8, i8* %263
%265 = zext i8 %264 to i32
%266 = sub nsw i32 %261, %265
%267 = add nsw i32 %266, 1
store i32 %267, i32* %12
%268 = load i8*, i8** %3
%269 = getelementptr inbounds i8, i8* %268, i64 2
%270 = load i8, i8* %269
%271 = zext i8 %270 to i32
store i32 %271, i32* %13
%272 = load i32*, i32** %10
%273 = load i64, i64* %11
%274 = load i32, i32* %12
%275 = load i32, i32* %13
%276 = load i64, i64* %11
%277 = load i32, i32* %12
%278 = sext i32 %277 to i64
%279 = mul i64 %276, %278
%280 = load i32, i32* %13
%281 = sext i32 %280 to i64
%282 = mul i64 %279, %281
%283 = call i32 (i32*, i8*, ...) @fprintf(i32* %272, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.17, i64 0, i64 0), i64 %273, i32 %274, i32 %275, i64 %282)
%284 = load i32*, i32** %10
%285 = call i32 (i32*, i8*, ...) @fprintf(i32* %284, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0))
%286 = load i8*, i8** %3
%287 = getelementptr inbounds i8, i8* %286, i64 20
store i8* %287, i8** %4
%288 = load i8*, i8** %3
%289 = getelementptr inbounds i8, i8* %288, i64 19
%290 = load i8, i8* %289
%291 = zext i8 %290 to i32
%292 = and i32 %291, 7
%293 = icmp eq i32 %292, 6
br i1 %293, label %294, label %297
294: ; preds = %24
%295 = load i8*, i8** %4
%296 = getelementptr inbounds i8, i8* %295, i64 1728
store i8* %296, i8** %4
br label %297
297: ; preds = %294, %24
%298 = load i8*, i8** %4
%299 = load i8*, i8** %3
%300 = load i64, i64* %6
%301 = getelementptr inbounds i8, i8* %299, i64 %300
%302 = icmp ugt i8* %298, %301
br i1 %302, label %303, label %307
303: ; preds = %297
%304 = load i32*, i32** %10
%305 = load i64, i64* %6
%306 = call i32 (i32*, i8*, ...) @fprintf(i32* %304, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.19, i64 0, i64 0), i64 %305)
br label %554
307: ; preds = %297
br label %308
308: ; preds = %550, %307
%309 = load i8*, i8** %4
%310 = load i8*, i8** %3
%311 = load i64, i64* %6
%312 = getelementptr inbounds i8, i8* %310, i64 %311
%313 = icmp ne i8* %309, %312
br i1 %313, label %314, label %551
314: ; preds = %308
%315 = load i8*, i8** %4
%316 = load i8*, i8** %3
%317 = load i64, i64* %6
%318 = getelementptr inbounds i8, i8* %316, i64 %317
%319 = getelementptr inbounds i8, i8* %318, i64 -2
%320 = icmp ugt i8* %315, %319
br i1 %320, label %321, label %332
321: ; preds = %314
%322 = load i32*, i32** %10
%323 = load i8*, i8** %4
%324 = load i8*, i8** %3
%325 = ptrtoint i8* %323 to i64
%326 = ptrtoint i8* %324 to i64
%327 = sub i64 %325, %326
%328 = load i8*, i8** %4
%329 = load i8, i8* %328
%330 = zext i8 %329 to i32
%331 = call i32 (i32*, i8*, ...) @fprintf(i32* %322, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.20, i64 0, i64 0), i64 %327, i32 %330)
br label %554
332: ; preds = %314
%333 = load i8*, i8** %4
%334 = getelementptr inbounds i8, i8* %333, i64 0
%335 = load i8, i8* %334
%336 = zext i8 %335 to i32
%337 = icmp ne i32 %336, 255
br i1 %337, label %344, label %338
338: ; preds = %332
%339 = load i8*, i8** %4
%340 = getelementptr inbounds i8, i8* %339, i64 1
%341 = load i8, i8* %340
%342 = zext i8 %341 to i32
%343 = icmp eq i32 %342, 0
br i1 %343, label %344, label %352
344: ; preds = %338, %332
%345 = load i32*, i32** %10
%346 = load i8*, i8** %4
%347 = load i8*, i8** %3
%348 = ptrtoint i8* %346 to i64
%349 = ptrtoint i8* %347 to i64
%350 = sub i64 %348, %349
%351 = call i32 (i32*, i8*, ...) @fprintf(i32* %345, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0), i64 %350)
br label %535
352: ; preds = %338
%353 = load i8*, i8** %4
%354 = getelementptr inbounds i8, i8* %353, i64 1
%355 = load i8, i8* %354
%356 = zext i8 %355 to i32
switch i32 %356, label %522 [
i32 2, label %357
i32 3, label %367
i32 4, label %377
i32 5, label %385
i32 6, label %428
i32 7, label %479
]
357: ; preds = %352
%358 = load i32*, i32** %10
%359 = load i8*, i8** %4
%360 = load i8*, i8** %3
%361 = ptrtoint i8* %359 to i64
%362 = ptrtoint i8* %360 to i64
%363 = sub i64 %361, %362
%364 = load i32, i32* %14
%365 = add nsw i32 %364, 1
store i32 %365, i32* %14
%366 = call i32 (i32*, i8*, ...) @fprintf(i32* %358, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.22, i64 0, i64 0), i64 %363, i32 %364)
br label %534
367: ; preds = %352
%368 = load i32*, i32** %10
%369 = load i8*, i8** %4
%370 = load i8*, i8** %3
%371 = ptrtoint i8* %369 to i64
%372 = ptrtoint i8* %370 to i64
%373 = sub i64 %371, %372
%374 = load i32, i32* %14
%375 = add nsw i32 %374, 1
store i32 %375, i32* %14
%376 = call i32 (i32*, i8*, ...) @fprintf(i32* %368, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.23, i64 0, i64 0), i64 %373, i32 %374)
br label %534
377: ; preds = %352
%378 = load i32*, i32** %10
%379 = load i8*, i8** %4
%380 = load i8*, i8** %3
%381 = ptrtoint i8* %379 to i64
%382 = ptrtoint i8* %380 to i64
%383 = sub i64 %381, %382
%384 = call i32 (i32*, i8*, ...) @fprintf(i32* %378, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0), i64 %383)
br label %534
385: ; preds = %352
%386 = load i32*, i32** %10
%387 = load i8*, i8** %4
%388 = load i8*, i8** %3
%389 = ptrtoint i8* %387 to i64
%390 = ptrtoint i8* %388 to i64
%391 = sub i64 %389, %390
%392 = call i32 (i32*, i8*, ...) @fprintf(i32* %386, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.25, i64 0, i64 0), i64 %391)
%393 = load i8*, i8** %4
%394 = getelementptr inbounds i8, i8* %393, i64 5
%395 = load i8*, i8** %3
%396 = load i64, i64* %6
%397 = getelementptr inbounds i8, i8* %395, i64 %396
%398 = icmp ult i8* %394, %397
br i1 %398, label %399, label %424
399: ; preds = %385
%400 = load i32*, i32** %10
%401 = load i8*, i8** %4
%402 = getelementptr inbounds i8, i8* %401, i64 2
%403 = load i8, i8* %402
%404 = zext i8 %403 to i64
%405 = shl i64 %404, 24
%406 = load i8*, i8** %4
%407 = getelementptr inbounds i8, i8* %406, i64 3
%408 = load i8, i8* %407
%409 = zext i8 %408 to i64
%410 = shl i64 %409, 16
%411 = or i64 %405, %410
%412 = load i8*, i8** %4
%413 = getelementptr inbounds i8, i8* %412, i64 4
%414 = load i8, i8* %413
%415 = zext i8 %414 to i64
%416 = shl i64 %415, 8
%417 = or i64 %411, %416
%418 = load i8*, i8** %4
%419 = getelementptr inbounds i8, i8* %418, i64 5
%420 = load i8, i8* %419
%421 = zext i8 %420 to i64
%422 = or i64 %417, %421
%423 = call i32 (i32*, i8*, ...) @fprintf(i32* %400, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.26, i64 0, i64 0), i64 %422)
br label %427
424: ; preds = %385
%425 = load i32*, i32** %10
%426 = call i32 (i32*, i8*, ...) @fprintf(i32* %425, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.27, i64 0, i64 0))
br label %427
427: ; preds = %424, %399
br label %534
428: ; preds = %352
%429 = load i32*, i32** %10
%430 = load i8*, i8** %4
%431 = load i8*, i8** %3
%432 = ptrtoint i8* %430 to i64
%433 = ptrtoint i8* %431 to i64
%434 = sub i64 %432, %433
%435 = call i32 (i32*, i8*, ...) @fprintf(i32* %429, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.28, i64 0, i64 0), i64 %434)
%436 = load i8*, i8** %4
%437 = getelementptr inbounds i8, i8* %436, i64 7
%438 = load i8*, i8** %3
%439 = load i64, i64* %6
%440 = getelementptr inbounds i8, i8* %438, i64 %439
%441 = icmp ult i8* %437, %440
br i1 %441, label %442, label %475
442: ; preds = %428
%443 = load i32*, i32** %10
%444 = load i8*, i8** %4
%445 = getelementptr inbounds i8, i8* %444, i64 2
%446 = load i8, i8* %445
%447 = zext i8 %446 to i64
%448 = shl i64 %447, 24
%449 = load i8*, i8** %4
%450 = getelementptr inbounds i8, i8* %449, i64 3
%451 = load i8, i8* %450
%452 = zext i8 %451 to i64
%453 = shl i64 %452, 16
%454 = or i64 %448, %453
%455 = load i8*, i8** %4
%456 = getelementptr inbounds i8, i8* %455, i64 4
%457 = load i8, i8* %456
%458 = zext i8 %457 to i64
%459 = shl i64 %458, 8
%460 = or i64 %454, %459
%461 = load i8*, i8** %4
%462 = getelementptr inbounds i8, i8* %461, i64 5
%463 = load i8, i8* %462
%464 = zext i8 %463 to i64
%465 = or i64 %460, %464
%466 = load i8*, i8** %4
%467 = getelementptr inbounds i8, i8* %466, i64 6
%468 = load i8, i8* %467
%469 = zext i8 %468 to i32
%470 = load i8*, i8** %4
%471 = getelementptr inbounds i8, i8* %470, i64 7
%472 = load i8, i8* %471
%473 = zext i8 %472 to i32
%474 = call i32 (i32*, i8*, ...) @fprintf(i32* %443, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.29, i64 0, i64 0), i64 %465, i32 %469, i32 %473)
br label %478
475: ; preds = %428
%476 = load i32*, i32** %10
%477 = call i32 (i32*, i8*, ...) @fprintf(i32* %476, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.27, i64 0, i64 0))
br label %478
478: ; preds = %475, %442
br label %534
479: ; preds = %352
%480 = load i32*, i32** %10
%481 = load i8*, i8** %4
%482 = load i8*, i8** %3
%483 = ptrtoint i8* %481 to i64
%484 = ptrtoint i8* %482 to i64
%485 = sub i64 %483, %484
%486 = call i32 (i32*, i8*, ...) @fprintf(i32* %480, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.30, i64 0, i64 0), i64 %485)
%487 = load i8*, i8** %4
%488 = getelementptr inbounds i8, i8* %487, i64 5
%489 = load i8*, i8** %3
%490 = load i64, i64* %6
%491 = getelementptr inbounds i8, i8* %489, i64 %490
%492 = icmp ult i8* %488, %491
br i1 %492, label %493, label %518
493: ; preds = %479
%494 = load i32*, i32** %10
%495 = load i8*, i8** %4
%496 = getelementptr inbounds i8, i8* %495, i64 2
%497 = load i8, i8* %496
%498 = zext i8 %497 to i64
%499 = shl i64 %498, 24
%500 = load i8*, i8** %4
%501 = getelementptr inbounds i8, i8* %500, i64 3
%502 = load i8, i8* %501
%503 = zext i8 %502 to i64
%504 = shl i64 %503, 16
%505 = or i64 %499, %504
%506 = load i8*, i8** %4
%507 = getelementptr inbounds i8, i8* %506, i64 4
%508 = load i8, i8* %507
%509 = zext i8 %508 to i64
%510 = shl i64 %509, 8
%511 = or i64 %505, %510
%512 = load i8*, i8** %4
%513 = getelementptr inbounds i8, i8* %512, i64 5
%514 = load i8, i8* %513
%515 = zext i8 %514 to i64
%516 = or i64 %511, %515
%517 = call i32 (i32*, i8*, ...) @fprintf(i32* %494, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.31, i64 0, i64 0), i64 %516)
br label %521
518: ; preds = %479
%519 = load i32*, i32** %10
%520 = call i32 (i32*, i8*, ...) @fprintf(i32* %519, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.27, i64 0, i64 0))
br label %521
521: ; preds = %518, %493
br label %534
522: ; preds = %352
%523 = load i32*, i32** %10
%524 = load i8*, i8** %4
%525 = load i8*, i8** %3
%526 = ptrtoint i8* %524 to i64
%527 = ptrtoint i8* %525 to i64
%528 = sub i64 %526, %527
%529 = load i8*, i8** %4
%530 = getelementptr inbounds i8, i8* %529, i64 1
%531 = load i8, i8* %530
%532 = zext i8 %531 to i32
%533 = call i32 (i32*, i8*, ...) @fprintf(i32* %523, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.32, i64 0, i64 0), i64 %528, i32 %532)
br label %534
534: ; preds = %522, %521, %478, %427, %377, %367, %357
br label %535
535: ; preds = %534, %344
%536 = load i8*, i8** %4
%537 = load i64, i64* %6
%538 = load i8*, i8** %4
%539 = load i8*, i8** %3
%540 = ptrtoint i8* %538 to i64
%541 = ptrtoint i8* %539 to i64
%542 = sub i64 %540, %541
%543 = sub i64 %537, %542
%544 = call i8* @jbg_next_pscdms(i8* %536, i64 %543)
store i8* %544, i8** %4
%545 = load i8*, i8** %4
%546 = icmp ne i8* %545, null
br i1 %546, label %550, label %547
547: ; preds = %535
%548 = load i32*, i32** %10
%549 = call i32 (i32*, i8*, ...) @fprintf(i32* %548, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.33, i64 0, i64 0))
br label %554
550: ; preds = %535
br label %308
551: ; preds = %308
%552 = load i8*, i8** %3
%553 = call i32 @free(i8* %552)
br label %554
554: ; preds = %551, %547, %321, %303, %20
ret void
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [94 x i8] c"Error: Input file is %d < 20 bytes long and therefore does not contain an intact BIE header!\0A\00"
@.str.1 = [100 x i8] c"BIH:\0A\0A DL = %d\0A D = %d\0A P = %d\0A - = %d\0A XD = %lu\0A YD = %lu\0A L0 = %lu\0A MX = %d\0A MY = %d\0A\00"
@.str.2 = [27 x i8] c" order = %d %s%s%s%s%s\0A\00"
@.str.3 = [8 x i8] c" HITOLO\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [5 x i8] c" SEQ\00"
@.str.6 = [8 x i8] c" ILEAVE\00"
@.str.7 = [6 x i8] c" SMID\00"
@.str.8 = [7 x i8] c" other\00"
@.str.9 = [33 x i8] c" options = %d %s%s%s%s%s%s%s%s\0A\00"
@.str.10 = [8 x i8] c" LRLTWO\00"
@.str.11 = [9 x i8] c" VLENGTH\00"
@.str.12 = [7 x i8] c" TPDON\00"
@.str.13 = [7 x i8] c" TPBON\00"
@.str.14 = [6 x i8] c" DPON\00"
@.str.15 = [8 x i8] c" DPPRIV\00"
@.str.16 = [8 x i8] c" DPLAST\00"
@.str.17 = [50 x i8] c"\0A %lu stripes, %d layers, %d planes = %lu SDEs\0A\0A\00"
@.str.18 = [7 x i8] c"BID:\0A\0A\00"
@.str.19 = [112 x i8] c"Error: Input file is %d < 20+1728 bytes long and therefore does not contain an intact BIE header with DPTABLE!\0A\00"
@.str.20 = [38 x i8] c"%06x: Error: single byte 0x%02x left\0A\00"
@.str.21 = [12 x i8] c"%06x: PSCD\0A\00"
@.str.22 = [22 x i8] c"%06x: ESC SDNORM #%d\0A\00"
@.str.23 = [21 x i8] c"%06x: ESC SDRST #%d\0A\00"
@.str.24 = [17 x i8] c"%06x: ESC ABORT\0A\00"
@.str.25 = [18 x i8] c"%06x: ESC NEWLEN \00"
@.str.26 = [10 x i8] c"YD = %lu\0A\00"
@.str.27 = [16 x i8] c"unexpected EOF\0A\00"
@.str.28 = [18 x i8] c"%06x: ESC ATMOVE \00"
@.str.29 = [29 x i8] c"YAT = %lu, tX = %d, tY = %d\0A\00"
@.str.30 = [19 x i8] c"%06x: ESC COMMENT \00"
@.str.31 = [10 x i8] c"LC = %lu\0A\00"
@.str.32 = [18 x i8] c"%06x: ESC 0x%02x\0A\00"
@.str.33 = [20 x i8] c"Error encountered!\0A\00"
define void @diagnose_bie(i32* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i8** %2 to i8*
%6 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%7 = bitcast i64* %4 to i8*
%8 = load i32*, i32** @stdout
%9 = call i32 @read_file(i8** %2, i64* %3, i64* %4, i32* %0)
%10 = load i64, i64* %4
%11 = icmp ult i64 %10, 20
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %343
14: ; preds = %1
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = getelementptr inbounds i8, i8* %15, i64 1
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = getelementptr inbounds i8, i8* %15, i64 2
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = getelementptr inbounds i8, i8* %15, i64 3
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = getelementptr inbounds i8, i8* %15, i64 4
%28 = load i8, i8* %27
%29 = zext i8 %28 to i64
%30 = shl nuw nsw i64 %29, 24
%31 = getelementptr inbounds i8, i8* %15, i64 5
%32 = load i8, i8* %31
%33 = zext i8 %32 to i64
%34 = shl nuw nsw i64 %33, 16
%35 = or i64 %34, %30
%36 = getelementptr inbounds i8, i8* %15, i64 6
%37 = load i8, i8* %36
%38 = zext i8 %37 to i64
%39 = shl nuw nsw i64 %38, 8
%40 = or i64 %35, %39
%41 = getelementptr inbounds i8, i8* %15, i64 7
%42 = load i8, i8* %41
%43 = zext i8 %42 to i64
%44 = or i64 %40, %43
%45 = getelementptr inbounds i8, i8* %15, i64 8
%46 = load i8, i8* %45
%47 = zext i8 %46 to i64
%48 = shl nuw nsw i64 %47, 24
%49 = getelementptr inbounds i8, i8* %15, i64 9
%50 = load i8, i8* %49
%51 = zext i8 %50 to i64
%52 = shl nuw nsw i64 %51, 16
%53 = or i64 %52, %48
%54 = getelementptr inbounds i8, i8* %15, i64 10
%55 = load i8, i8* %54
%56 = zext i8 %55 to i64
%57 = shl nuw nsw i64 %56, 8
%58 = or i64 %53, %57
%59 = getelementptr inbounds i8, i8* %15, i64 11
%60 = load i8, i8* %59
%61 = zext i8 %60 to i64
%62 = or i64 %58, %61
%63 = getelementptr inbounds i8, i8* %15, i64 12
%64 = load i8, i8* %63
%65 = zext i8 %64 to i64
%66 = shl nuw nsw i64 %65, 24
%67 = getelementptr inbounds i8, i8* %15, i64 13
%68 = load i8, i8* %67
%69 = zext i8 %68 to i64
%70 = shl nuw nsw i64 %69, 16
%71 = or i64 %70, %66
%72 = getelementptr inbounds i8, i8* %15, i64 14
%73 = load i8, i8* %72
%74 = zext i8 %73 to i64
%75 = shl nuw nsw i64 %74, 8
%76 = or i64 %71, %75
%77 = getelementptr inbounds i8, i8* %15, i64 15
%78 = load i8, i8* %77
%79 = zext i8 %78 to i64
%80 = or i64 %76, %79
%81 = getelementptr inbounds i8, i8* %15, i64 16
%82 = load i8, i8* %81
%83 = zext i8 %82 to i32
%84 = getelementptr inbounds i8, i8* %15, i64 17
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %20, i32 %23, i32 %26, i64 %44, i64 %62, i64 %80, i32 %83, i32 %86)
%88 = load i8*, i8** %2
%89 = getelementptr inbounds i8, i8* %88, i64 18
%90 = load i8, i8* %89
%91 = zext i8 %90 to i32
%92 = and i32 %91, 8
%93 = icmp eq i32 %92, 0
%94 = select i1 %93, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0)
%95 = and i32 %91, 4
%96 = icmp eq i32 %95, 0
%97 = select i1 %96, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0)
%98 = and i32 %91, 2
%99 = icmp eq i32 %98, 0
%100 = select i1 %99, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0)
%101 = and i32 %91, 1
%102 = icmp eq i32 %101, 0
%103 = select i1 %102, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0)
%104 = and i32 %91, 240
%105 = icmp eq i32 %104, 0
%106 = select i1 %105, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0)
%107 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %91, i8* %94, i8* %97, i8* %100, i8* %103, i8* %106)
%108 = load i8*, i8** %2
%109 = getelementptr inbounds i8, i8* %108, i64 19
%110 = load i8, i8* %109
%111 = zext i8 %110 to i32
%112 = insertelement <8 x i32> poison, i32 %111, i64 0
%113 = shufflevector <8 x i32> %112, <8 x i32> poison, <8 x i32> zeroinitializer
%114 = and <8 x i32> %113, <i32 128, i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64>
%115 = icmp eq <8 x i32> %114, zeroinitializer
%116 = extractelement <8 x i1> %115, i64 7
%117 = select i1 %116, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0)
%118 = extractelement <8 x i1> %115, i64 6
%119 = select i1 %118, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0)
%120 = extractelement <8 x i1> %115, i64 5
%121 = select i1 %120, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0)
%122 = extractelement <8 x i1> %115, i64 4
%123 = select i1 %122, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0)
%124 = extractelement <8 x i1> %115, i64 3
%125 = select i1 %124, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0)
%126 = extractelement <8 x i1> %115, i64 2
%127 = select i1 %126, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0)
%128 = extractelement <8 x i1> %115, i64 1
%129 = select i1 %128, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0)
%130 = extractelement <8 x i1> %115, i64 0
%131 = select i1 %130, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0)
%132 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i32 %111, i8* %117, i8* %119, i8* %121, i8* %123, i8* %125, i8* %127, i8* %129, i8* %131)
%133 = load i8*, i8** %2
%134 = getelementptr inbounds i8, i8* %133, i64 1
%135 = load i8, i8* %134
%136 = zext i8 %135 to i32
%137 = zext i8 %135 to i64
%138 = lshr i64 %62, %137
%139 = shl nsw i64 -1, %137
%140 = xor i64 %139, -1
%141 = and i64 %44, %140
%142 = icmp ne i64 %141, 0
%143 = zext i1 %142 to i64
%144 = add nsw i64 %80, -1
%145 = add i64 %144, %138
%146 = add i64 %145, %143
%147 = udiv i64 %146, %80
%148 = load i8, i8* %133
%149 = zext i8 %148 to i32
%150 = sub nsw i32 %136, %149
%151 = add nsw i32 %150, 1
%152 = getelementptr inbounds i8, i8* %133, i64 2
%153 = load i8, i8* %152
%154 = zext i8 %153 to i32
%155 = sext i32 %151 to i64
%156 = zext i8 %153 to i64
%157 = mul i64 %147, %156
%158 = mul i64 %157, %155
%159 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.17, i64 0, i64 0), i64 %147, i32 %151, i32 %154, i64 %158)
%160 = call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i64 6, i64 1, i32* %8)
%161 = load i8*, i8** %2
%162 = getelementptr inbounds i8, i8* %161, i64 19
%163 = load i8, i8* %162
%164 = and i8 %163, 7
%165 = icmp eq i8 %164, 6
%166 = select i1 %165, i64 1748, i64 20
%167 = load i64, i64* %4
%168 = icmp sgt i64 %166, %167
br i1 %168, label %174, label %169
169: ; preds = %14
%170 = icmp eq i64 %166, %167
br i1 %170, label %340, label %171
171: ; preds = %169
%172 = getelementptr inbounds i8, i8* %161, i64 %167
%173 = getelementptr inbounds i8, i8* %161, i64 %166
br label %176
174: ; preds = %14
%175 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.19, i64 0, i64 0), i64 %167)
br label %343
176: ; preds = %171, %333
%177 = phi i8* [ %172, %171 ], [ %336, %333 ]
%178 = phi i32 [ 0, %171 ], [ %325, %333 ]
%179 = phi i8* [ %173, %171 ], [ %331, %333 ]
%180 = phi i8* [ %161, %171 ], [ %334, %333 ]
%181 = getelementptr inbounds i8, i8* %177, i64 -2
%182 = icmp ugt i8* %179, %181
br i1 %182, label %183, label %190
183: ; preds = %176
%184 = ptrtoint i8* %179 to i64
%185 = ptrtoint i8* %180 to i64
%186 = sub i64 %184, %185
%187 = load i8, i8* %179
%188 = zext i8 %187 to i32
%189 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.20, i64 0, i64 0), i64 %186, i32 %188)
br label %343
190: ; preds = %176
%191 = load i8, i8* %179
%192 = icmp eq i8 %191, -1
br i1 %192, label %193, label %196
193: ; preds = %190
%194 = getelementptr inbounds i8, i8* %179, i64 1
%195 = load i8, i8* %194
switch i8 %195, label %317 [
i8 0, label %196
i8 2, label %201
i8 3, label %207
i8 4, label %213
i8 5, label %218
i8 6, label %249
i8 7, label %286
]
196: ; preds = %193, %190
%197 = ptrtoint i8* %179 to i64
%198 = ptrtoint i8* %180 to i64
%199 = sub i64 %197, %198
%200 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0), i64 %199)
br label %323
201: ; preds = %193
%202 = ptrtoint i8* %179 to i64
%203 = ptrtoint i8* %180 to i64
%204 = sub i64 %202, %203
%205 = add nsw i32 %178, 1
%206 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.22, i64 0, i64 0), i64 %204, i32 %178)
br label %323
207: ; preds = %193
%208 = ptrtoint i8* %179 to i64
%209 = ptrtoint i8* %180 to i64
%210 = sub i64 %208, %209
%211 = add nsw i32 %178, 1
%212 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.23, i64 0, i64 0), i64 %210, i32 %178)
br label %323
213: ; preds = %193
%214 = ptrtoint i8* %179 to i64
%215 = ptrtoint i8* %180 to i64
%216 = sub i64 %214, %215
%217 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0), i64 %216)
br label %323
218: ; preds = %193
%219 = ptrtoint i8* %179 to i64
%220 = ptrtoint i8* %180 to i64
%221 = sub i64 %219, %220
%222 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.25, i64 0, i64 0), i64 %221)
%223 = getelementptr inbounds i8, i8* %179, i64 5
%224 = load i8*, i8** %2
%225 = load i64, i64* %4
%226 = getelementptr inbounds i8, i8* %224, i64 %225
%227 = icmp ult i8* %223, %226
br i1 %227, label %228, label %247
228: ; preds = %218
%229 = getelementptr inbounds i8, i8* %179, i64 2
%230 = load i8, i8* %229
%231 = zext i8 %230 to i64
%232 = shl nuw nsw i64 %231, 24
%233 = getelementptr inbounds i8, i8* %179, i64 3
%234 = load i8, i8* %233
%235 = zext i8 %234 to i64
%236 = shl nuw nsw i64 %235, 16
%237 = or i64 %236, %232
%238 = getelementptr inbounds i8, i8* %179, i64 4
%239 = load i8, i8* %238
%240 = zext i8 %239 to i64
%241 = shl nuw nsw i64 %240, 8
%242 = or i64 %237, %241
%243 = load i8, i8* %223
%244 = zext i8 %243 to i64
%245 = or i64 %242, %244
%246 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.26, i64 0, i64 0), i64 %245)
br label %323
247: ; preds = %218
%248 = call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.27, i64 0, i64 0), i64 15, i64 1, i32* %8)
br label %323
249: ; preds = %193
%250 = ptrtoint i8* %179 to i64
%251 = ptrtoint i8* %180 to i64
%252 = sub i64 %250, %251
%253 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.28, i64 0, i64 0), i64 %252)
%254 = getelementptr inbounds i8, i8* %179, i64 7
%255 = load i8*, i8** %2
%256 = load i64, i64* %4
%257 = getelementptr inbounds i8, i8* %255, i64 %256
%258 = icmp ult i8* %254, %257
br i1 %258, label %259, label %284
259: ; preds = %249
%260 = getelementptr inbounds i8, i8* %179, i64 2
%261 = load i8, i8* %260
%262 = zext i8 %261 to i64
%263 = shl nuw nsw i64 %262, 24
%264 = getelementptr inbounds i8, i8* %179, i64 3
%265 = load i8, i8* %264
%266 = zext i8 %265 to i64
%267 = shl nuw nsw i64 %266, 16
%268 = or i64 %267, %263
%269 = getelementptr inbounds i8, i8* %179, i64 4
%270 = load i8, i8* %269
%271 = zext i8 %270 to i64
%272 = shl nuw nsw i64 %271, 8
%273 = or i64 %268, %272
%274 = getelementptr inbounds i8, i8* %179, i64 5
%275 = load i8, i8* %274
%276 = zext i8 %275 to i64
%277 = or i64 %273, %276
%278 = getelementptr inbounds i8, i8* %179, i64 6
%279 = load i8, i8* %278
%280 = zext i8 %279 to i32
%281 = load i8, i8* %254
%282 = zext i8 %281 to i32
%283 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.29, i64 0, i64 0), i64 %277, i32 %280, i32 %282)
br label %323
284: ; preds = %249
%285 = call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.27, i64 0, i64 0), i64 15, i64 1, i32* %8)
br label %323
286: ; preds = %193
%287 = ptrtoint i8* %179 to i64
%288 = ptrtoint i8* %180 to i64
%289 = sub i64 %287, %288
%290 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.30, i64 0, i64 0), i64 %289)
%291 = getelementptr inbounds i8, i8* %179, i64 5
%292 = load i8*, i8** %2
%293 = load i64, i64* %4
%294 = getelementptr inbounds i8, i8* %292, i64 %293
%295 = icmp ult i8* %291, %294
br i1 %295, label %296, label %315
296: ; preds = %286
%297 = getelementptr inbounds i8, i8* %179, i64 2
%298 = load i8, i8* %297
%299 = zext i8 %298 to i64
%300 = shl nuw nsw i64 %299, 24
%301 = getelementptr inbounds i8, i8* %179, i64 3
%302 = load i8, i8* %301
%303 = zext i8 %302 to i64
%304 = shl nuw nsw i64 %303, 16
%305 = or i64 %304, %300
%306 = getelementptr inbounds i8, i8* %179, i64 4
%307 = load i8, i8* %306
%308 = zext i8 %307 to i64
%309 = shl nuw nsw i64 %308, 8
%310 = or i64 %305, %309
%311 = load i8, i8* %291
%312 = zext i8 %311 to i64
%313 = or i64 %310, %312
%314 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.31, i64 0, i64 0), i64 %313)
br label %323
315: ; preds = %286
%316 = call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.27, i64 0, i64 0), i64 15, i64 1, i32* %8)
br label %323
317: ; preds = %193
%318 = zext i8 %195 to i32
%319 = ptrtoint i8* %179 to i64
%320 = ptrtoint i8* %180 to i64
%321 = sub i64 %319, %320
%322 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.32, i64 0, i64 0), i64 %321, i32 %318)
br label %323
323: ; preds = %201, %207, %213, %317, %247, %228, %284, %259, %315, %296, %196
%324 = phi i64 [ %202, %201 ], [ %208, %207 ], [ %214, %213 ], [ %319, %317 ], [ %219, %247 ], [ %219, %228 ], [ %250, %284 ], [ %250, %259 ], [ %287, %315 ], [ %287, %296 ], [ %197, %196 ]
%325 = phi i32 [ %205, %201 ], [ %211, %207 ], [ %178, %213 ], [ %178, %317 ], [ %178, %247 ], [ %178, %228 ], [ %178, %284 ], [ %178, %259 ], [ %178, %315 ], [ %178, %296 ], [ %178, %196 ]
%326 = load i64, i64* %4
%327 = load i8*, i8** %2
%328 = ptrtoint i8* %327 to i64
%329 = sub i64 %326, %324
%330 = add i64 %329, %328
%331 = call i8* @jbg_next_pscdms(i8* %179, i64 %330)
%332 = icmp eq i8* %331, null
br i1 %332, label %338, label %333
333: ; preds = %323
%334 = load i8*, i8** %2
%335 = load i64, i64* %4
%336 = getelementptr inbounds i8, i8* %334, i64 %335
%337 = icmp eq i8* %331, %336
br i1 %337, label %340, label %176
338: ; preds = %323
%339 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.33, i64 0, i64 0), i64 19, i64 1, i32* %8)
br label %343
340: ; preds = %333, %169
%341 = phi i8* [ %161, %169 ], [ %334, %333 ]
%342 = call i32 @free(i8* %341)
br label %343
343: ; preds = %340, %338, %183, %174, %12
ret void
}