#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 */
scalar_t__ EOF;
scalar_t__ MIDI_Fpeek(int /*<<< orphan*/ *);
unsigned int MIDI_ReadV(int /*<<< orphan*/ *);
char *MIDI_ToString(unsigned char);
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
unsigned char ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int process(const char *filename) {
  long len;
  unsigned long chunk_identifier;
  unsigned long chunk_length;
  unsigned int val16;
  unsigned char val8;
  unsigned int deltaTime;
  unsigned char command;
  unsigned int byteCount;
  long chunk_nextPos = 0;
  FILE *fp = fopen(filename, "rb");
  if (!fp) {
    printf("Unable to open file.\n");
    return 0;
  }
  fseek(fp, 0, SEEK_END);
  len = ftell(fp);
  fseek(fp, 0, SEEK_SET);
  printf("File is %ld bytes\n", len);
  do {
    fseek(fp, chunk_nextPos, SEEK_SET);
    printf("\n");
    if (EOF == MIDI_Fpeek(fp)) {
      printf("EOF.\n");
      return 0;
    }
    chunk_identifier =
        (((((fgetc(fp) & 0x00ff) << 8) + (fgetc(fp) & 0x00ff)) << 16) +
         (((fgetc(fp) & 0x00ff) << 8) + (fgetc(fp) & 0x00ff)));
    chunk_length =
        (((((fgetc(fp) & 0x00ff) << 8) + (fgetc(fp) & 0x00ff)) << 16) +
         (((fgetc(fp) & 0x00ff) << 8) + (fgetc(fp) & 0x00ff)));
    printf("Chunk ID: 0x%08lx  (%ld bytes)\n", chunk_identifier, chunk_length);
    chunk_nextPos = ftell(fp) + chunk_length;
    if (chunk_identifier == (0x4d546864)) {
      printf(" -- Header\n");
      val16 = (((fgetc(fp) & 0x00ff) << 8) + (fgetc(fp) & 0x00ff));
      printf("    Format: %d - ", val16);
      if (val16 == 0)
        printf("single track format\n");
      if (val16 == 1)
        printf("multiple track format\n");
      if (val16 == 2)
        printf("multiple song format\n");
      val16 = (((fgetc(fp) & 0x00ff) << 8) + (fgetc(fp) & 0x00ff));
      printf("    Track Chunks: %d\n", val16);
      val16 = (((fgetc(fp) & 0x00ff) << 8) + (fgetc(fp) & 0x00ff));
      printf("    Division: %d ", (signed)val16);
      if (((signed)val16) > 0) {
        printf("(units per beat)\n");
      } else {
        printf("(SMPTE compatible units)\n");
      }
      val8 = (fgetc(fp) & 0x00ff);
    } else if (chunk_identifier == (0x4d54726b)) {
      printf(" -- Track\n  ");
      while (1) {
        printf("\n");
        printf("(%ld) ", ftell(fp));
        deltaTime = MIDI_ReadV(fp);
        printf("0x%04x: ", deltaTime);
        command = (fgetc(fp) & 0x00ff);
        printf("%02x %s: ", command, MIDI_ToString(command));
        switch (command & 0xF0) {
        case (0xF0):
          printf("%02x", command);
          if (command == 0xff || command == 0xF0) {
          }
          if (command == 0xff) {
            val8 = (fgetc(fp) & 0x00ff);
            printf("%02x ", val8);
          }
          byteCount = (fgetc(fp) & 0x00ff);
          printf("(c=%02x) ", byteCount);
          printf("|");
          while (byteCount > 0) {
            val8 = (fgetc(fp) & 0x00ff);
            printf("%c", val8);
            byteCount--;
          }
          printf("|");
          break;
        case (0xC0):
        case (0xD0):
          val8 = (fgetc(fp) & 0x00ff);
          printf("%02x ", val8);
          break;
        case (0x80):
        case (0x90):
        case (0xA0):
        case (0xB0):
        case (0xE0):
          val8 = (fgetc(fp) & 0x00ff);
          printf("%02x ", val8);
          val8 = (fgetc(fp) & 0x00ff);
          printf("%02x ", val8);
          break;
        default:
          break;
        }
      }
    }
  } while (1);
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe4e(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    11e0 <process+0x50>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    17b9 <process+0x629>
mov    -0x50(%rbp),%rdi
mov    0x2dfd(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1080 <fseek@plt>
mov    -0x50(%rbp),%rdi
call   1070 <ftell@plt>
movzbl %al,%eax
mov    %rax,-0x18(%rbp)
mov    -0x50(%rbp),%rdi
mov    0x2dbf(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1080 <fseek@plt>
mov    -0x18(%rbp),%rsi
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    0x2d93(%rip),%rax
mov    (%rax),%edx
call   1080 <fseek@plt>
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0x50(%rbp),%rdi
call   1030 <MIDI_Fpeek@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
cmp    %rcx,%rax
jne    1293 <process+0x103>
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    17b9 <process+0x629>
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
shl    $0x8,%eax
mov    %eax,-0x70(%rbp)
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,%ecx
mov    -0x70(%rbp),%eax
and    $0xff,%ecx
add    %ecx,%eax
shl    $0x10,%eax
mov    %eax,-0x68(%rbp)
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
shl    $0x8,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
mov    -0x6c(%rbp),%ecx
mov    %eax,%edx
mov    -0x68(%rbp),%eax
and    $0xff,%edx
add    %edx,%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
shl    $0x8,%eax
mov    %eax,-0x64(%rbp)
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,%ecx
mov    -0x64(%rbp),%eax
and    $0xff,%ecx
add    %ecx,%eax
shl    $0x10,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
shl    $0x8,%eax
mov    %eax,-0x60(%rbp)
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
mov    -0x60(%rbp),%ecx
mov    %eax,%edx
mov    -0x5c(%rbp),%eax
and    $0xff,%edx
add    %edx,%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xcc6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
call   1070 <ftell@plt>
movzbl %al,%eax
add    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
cmpq   $0x4d546864,-0x20(%rbp)
4d
jne    14e6 <process+0x356>
lea    0xcb6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
shl    $0x8,%eax
mov    %eax,-0x74(%rbp)
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xc84(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x2c(%rbp)
jne    13f9 <process+0x269>
lea    0xc7e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x1,-0x2c(%rbp)
jne    1411 <process+0x281>
lea    0xc7b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x2,-0x2c(%rbp)
jne    1429 <process+0x299>
lea    0xc7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
shl    $0x8,%eax
mov    %eax,-0x7c(%rbp)
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,%ecx
mov    -0x7c(%rbp),%eax
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xc52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
shl    $0x8,%eax
mov    %eax,-0x78(%rbp)
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,%ecx
mov    -0x78(%rbp),%eax
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xc2a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    14c2 <process+0x332>
lea    0xc24(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14d0 <process+0x340>
lea    0xc23(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
mov    %al,-0x2d(%rbp)
jmp    1795 <process+0x605>
cmpq   $0x4d54726b,-0x20(%rbp)
4d
jne    1790 <process+0x600>
lea    0xc0b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xb47(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x81(%rbp)
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
call   1070 <ftell@plt>
mov    %al,%cl
mov    -0x81(%rbp),%al
movzbl %cl,%esi
lea    0xbe2(%rip),%rdi
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
call   10a0 <MIDI_ReadV@plt>
mov    %eax,%ecx
mov    -0x81(%rbp),%al
mov    %ecx,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xbc6(%rip),%rdi
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %al,-0x35(%rbp)
movzbl -0x35(%rbp),%edi
mov    %edi,-0x88(%rbp)
call   1090 <MIDI_ToString@plt>
mov    -0x88(%rbp),%esi
mov    %rax,%rdx
mov    -0x81(%rbp),%al
lea    0xb99(%rip),%rdi
call   1050 <printf@plt>
movzbl -0x35(%rbp),%eax
and    $0xfffffff0,%eax
mov    %eax,-0x80(%rbp)
sub    $0x80,%eax
je     173b <process+0x5ab>
jmp    15a9 <process+0x419>
mov    -0x80(%rbp),%eax
sub    $0x90,%eax
je     173b <process+0x5ab>
jmp    15bc <process+0x42c>
mov    -0x80(%rbp),%eax
sub    $0xa0,%eax
je     173b <process+0x5ab>
jmp    15cf <process+0x43f>
mov    -0x80(%rbp),%eax
sub    $0xb0,%eax
je     173b <process+0x5ab>
jmp    15e2 <process+0x452>
mov    -0x80(%rbp),%eax
sub    $0xc0,%eax
je     1713 <process+0x583>
jmp    15f5 <process+0x465>
mov    -0x80(%rbp),%eax
sub    $0xd0,%eax
je     1713 <process+0x583>
jmp    1608 <process+0x478>
mov    -0x80(%rbp),%eax
sub    $0xe0,%eax
je     173b <process+0x5ab>
jmp    161b <process+0x48b>
mov    -0x80(%rbp),%eax
sub    $0xf0,%eax
jne    1786 <process+0x5f6>
jmp    162e <process+0x49e>
movzbl -0x35(%rbp),%esi
lea    0xaf4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movzbl -0x35(%rbp),%eax
cmp    $0xff,%eax
je     165e <process+0x4ce>
movzbl -0x35(%rbp),%eax
cmp    $0xf0,%eax
jne    1663 <process+0x4d3>
jmp    1663 <process+0x4d3>
movzbl -0x35(%rbp),%eax
cmp    $0xff,%eax
jne    1695 <process+0x505>
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
mov    %al,-0x2d(%rbp)
movzbl -0x2d(%rbp),%esi
lea    0xaa4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xa88(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xa84(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x3c(%rbp)
jbe    1700 <process+0x570>
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
mov    %al,-0x2d(%rbp)
movzbl -0x2d(%rbp),%esi
lea    0xa59(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
jmp    16c5 <process+0x535>
lea    0xa3b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    178b <process+0x5fb>
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
mov    %al,-0x2d(%rbp)
movzbl -0x2d(%rbp),%esi
lea    0xa03(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    178b <process+0x5fb>
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
mov    %al,-0x2d(%rbp)
movzbl -0x2d(%rbp),%esi
lea    0x9db(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x50(%rbp),%rdi
call   1060 <fgetc@plt>
and    $0xff,%eax
mov    %al,-0x2d(%rbp)
movzbl -0x2d(%rbp),%esi
lea    0x9b8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    178b <process+0x5fb>
jmp    178b <process+0x5fb>
jmp    1502 <process+0x372>
jmp    1795 <process+0x605>
jmp    179a <process+0x60a>
mov    $0x1,%al
test   $0x1,%al
jne    122e <process+0x9e>
jmp    17a9 <process+0x619>
mov    -0x50(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe4e(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1420 <process+0x280>
mov    %rax,%r15
mov    0x2e1e(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %r15,%rdi
call   1080 <ftell@plt>
movzbl %al,%ebx
mov    0x2de8(%rip),%rbp
mov    0x0(%rbp),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
lea    0xe07(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x0(%rbp),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2dbc(%rip),%rax
mov    (%rax),%rbx
mov    %r15,%rdi
call   1050 <MIDI_Fpeek@plt>
lea    0xeff(%rip),%rdi
cmp    %rax,%rbx
jne    1306 <process+0x166>
jmp    1430 <process+0x290>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
call   1070 <fgetc@plt>
shl    $0x8,%eax
movzwl %ax,%ebx
mov    %r15,%rdi
call   1070 <fgetc@plt>
movzbl %al,%esi
or     %ebx,%esi
lea    0xdd6(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1070 <fgetc@plt>
shl    $0x8,%eax
movzwl %ax,%ebx
mov    %r15,%rdi
call   1070 <fgetc@plt>
movzbl %al,%esi
or     %ebx,%esi
lea    0xe4a(%rip),%rbx
lea    0xe2a(%rip),%rax
cmove  %rax,%rbx
lea    0xdb1(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1070 <fgetc@plt>
mov    %r14d,%eax
movzbl %al,%eax
add    %rax,%r12
mov    0x2cfc(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1090 <fseek@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2cee(%rip),%rax
mov    (%rax),%rbx
mov    %r15,%rdi
call   1050 <MIDI_Fpeek@plt>
cmp    %rax,%rbx
je     1429 <process+0x289>
mov    %r15,%rdi
call   1070 <fgetc@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1070 <fgetc@plt>
shl    $0x18,%ebp
movzbl %al,%ebx
shl    $0x10,%ebx
or     %ebp,%ebx
mov    %r15,%rdi
call   1070 <fgetc@plt>
shl    $0x8,%eax
movzwl %ax,%ebp
mov    %r15,%rdi
call   1070 <fgetc@plt>
movzbl %al,%r14d
or     %ebp,%r14d
or     %ebx,%r14d
movslq %r14d,%r13
mov    %r15,%rdi
call   1070 <fgetc@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1070 <fgetc@plt>
shl    $0x18,%ebx
movzbl %al,%ebp
shl    $0x10,%ebp
or     %ebx,%ebp
mov    %r15,%rdi
call   1070 <fgetc@plt>
shl    $0x8,%eax
movzwl %ax,%ebx
mov    %r15,%rdi
call   1070 <fgetc@plt>
movzbl %al,%eax
or     %ebx,%eax
or     %ebp,%eax
movslq %eax,%r12
lea    0xc8c(%rip),%rdi
mov    %r13,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <ftell@plt>
cmp    $0x4d546864,%r13d
je     13c0 <process+0x220>
cmp    $0x4d54726b,%r14d
jne    12c7 <process+0x127>
jmp    1446 <process+0x2a6>
nopw   0x0(%rax,%rax,1)
mov    %eax,%r14d
lea    0xcf7(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1070 <fgetc@plt>
shl    $0x8,%eax
movzwl %ax,%ebx
mov    %r15,%rdi
call   1070 <fgetc@plt>
movzbl %al,%ebp
or     %ebx,%ebp
lea    0xc45(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x2,%bp
ja     1250 <process+0xb0>
movswq %bp,%rax
lea    0xd2d(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1040 <puts@plt>
jmp    1250 <process+0xb0>
lea    0xc85(%rip),%rdi
jmp    1430 <process+0x290>
lea    0xd05(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc23(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc22(%rip),%r13
lea    0xc2b(%rip),%r12
lea    0xc33(%rip),%r14
jmp    149a <process+0x2fa>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1070 <fgetc@plt>
movzbl %al,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1070 <fgetc@plt>
movzbl %al,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
call   1080 <ftell@plt>
movzbl %al,%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   10b0 <MIDI_ReadV@plt>
lea    0xbbc(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1070 <fgetc@plt>
mov    %eax,%ebx
movzbl %bl,%ebp
mov    %ebp,%edi
call   10a0 <MIDI_ToString@plt>
mov    %r12,%rdi
mov    %ebp,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
and    $0xf0,%ebx
add    $0xffffff80,%ebx
shr    $0x4,%ebx
cmp    $0x7,%ebx
ja     149a <process+0x2fa>
mov    $0x4f,%eax
bt     %ebx,%eax
jb     1470 <process+0x2d0>
mov    $0x30,%eax
bt     %ebx,%eax
jb     1485 <process+0x2e5>
mov    %r13,%rbx
lea    0xb6c(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0xff,%ebp
jne    1551 <process+0x3b1>
mov    %r15,%rdi
call   1070 <fgetc@plt>
movzbl %al,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1070 <fgetc@plt>
mov    %eax,%r13d
mov    %eax,%esi
and    $0xff,%esi
lea    0xb37(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
and    $0xff,%r13d
je     15a6 <process+0x406>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
call   1070 <fgetc@plt>
movzbl %al,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r13d
jne    1590 <process+0x3f0>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    %rbx,%r13
jmp    149a <process+0x2fa>

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [22 x i8] c"Unable to open file.\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.2 = [19 x i8] c"File is %ld bytes\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
@EOF = global i64 0
@.str.4 = [6 x i8] c"EOF.\0A\00"
@.str.5 = [32 x i8] c"Chunk ID: 0x%08lx (%ld bytes)\0A\00"
@.str.6 = [12 x i8] c" -- Header\0A\00"
@.str.7 = [18 x i8] c" Format: %d - \00"
@.str.8 = [21 x i8] c"single track format\0A\00"
@.str.9 = [23 x i8] c"multiple track format\0A\00"
@.str.10 = [22 x i8] c"multiple song format\0A\00"
@.str.11 = [22 x i8] c" Track Chunks: %d\0A\00"
@.str.12 = [18 x i8] c" Division: %d \00"
@.str.13 = [18 x i8] c"(units per beat)\0A\00"
@.str.14 = [26 x i8] c"(SMPTE compatible units)\0A\00"
@.str.15 = [13 x i8] c" -- Track\0A \00"
@.str.16 = [7 x i8] c"(%ld) \00"
@.str.17 = [9 x i8] c"0x%04x: \00"
@.str.18 = [10 x i8] c"%02x %s: \00"
@.str.19 = [5 x i8] c"%02x\00"
@.str.20 = [6 x i8] c"%02x \00"
@.str.21 = [10 x i8] c"(c=%02x) \00"
@.str.22 = [2 x i8] c"|\00"
@.str.23 = [3 x i8] c"%c\00"
define i32 @process(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8
%9 = alloca i32
%10 = alloca i8
%11 = alloca i32
%12 = alloca i64
%13 = alloca i32*
store i8* %0, i8** %3
store i64 0, i64* %12
%14 = load i8*, i8** %3
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %15, i32** %13
%16 = load i32*, i32** %13
%17 = icmp ne i32* %16, null
br i1 %17, label %20, label %18
18: ; preds = %1
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %255
20: ; preds = %1
%21 = load i32*, i32** %13
%22 = load i32, i32* @SEEK_END
%23 = call i32 @fseek(i32* %21, i64 0, i32 %22)
%24 = load i32*, i32** %13
%25 = call zeroext i8 @ftell(i32* %24)
%26 = zext i8 %25 to i64
store i64 %26, i64* %4
%27 = load i32*, i32** %13
%28 = load i32, i32* @SEEK_SET
%29 = call i32 @fseek(i32* %27, i64 0, i32 %28)
%30 = load i64, i64* %4
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i64 %30)
br label %32
32: ; preds = %251, %20
%33 = load i32*, i32** %13
%34 = load i64, i64* %12
%35 = load i32, i32* @SEEK_SET
%36 = call i32 @fseek(i32* %33, i64 %34, i32 %35)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%38 = load i64, i64* @EOF
%39 = load i32*, i32** %13
%40 = call i64 @MIDI_Fpeek(i32* %39)
%41 = icmp eq i64 %38, %40
br i1 %41, label %42, label %44
42: ; preds = %32
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %2
br label %255
44: ; preds = %32
%45 = load i32*, i32** %13
%46 = call i32 @fgetc(i32* %45)
%47 = and i32 %46, 255
%48 = shl i32 %47, 8
%49 = load i32*, i32** %13
%50 = call i32 @fgetc(i32* %49)
%51 = and i32 %50, 255
%52 = add nsw i32 %48, %51
%53 = shl i32 %52, 16
%54 = load i32*, i32** %13
%55 = call i32 @fgetc(i32* %54)
%56 = and i32 %55, 255
%57 = shl i32 %56, 8
%58 = load i32*, i32** %13
%59 = call i32 @fgetc(i32* %58)
%60 = and i32 %59, 255
%61 = add nsw i32 %57, %60
%62 = add nsw i32 %53, %61
%63 = sext i32 %62 to i64
store i64 %63, i64* %5
%64 = load i32*, i32** %13
%65 = call i32 @fgetc(i32* %64)
%66 = and i32 %65, 255
%67 = shl i32 %66, 8
%68 = load i32*, i32** %13
%69 = call i32 @fgetc(i32* %68)
%70 = and i32 %69, 255
%71 = add nsw i32 %67, %70
%72 = shl i32 %71, 16
%73 = load i32*, i32** %13
%74 = call i32 @fgetc(i32* %73)
%75 = and i32 %74, 255
%76 = shl i32 %75, 8
%77 = load i32*, i32** %13
%78 = call i32 @fgetc(i32* %77)
%79 = and i32 %78, 255
%80 = add nsw i32 %76, %79
%81 = add nsw i32 %72, %80
%82 = sext i32 %81 to i64
store i64 %82, i64* %6
%83 = load i64, i64* %5
%84 = load i64, i64* %6
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i64 %83, i64 %84)
%86 = load i32*, i32** %13
%87 = call zeroext i8 @ftell(i32* %86)
%88 = zext i8 %87 to i64
%89 = load i64, i64* %6
%90 = add i64 %88, %89
store i64 %90, i64* %12
%91 = load i64, i64* %5
%92 = icmp eq i64 %91, 1297377380
br i1 %92, label %93, label %151
93: ; preds = %44
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%95 = load i32*, i32** %13
%96 = call i32 @fgetc(i32* %95)
%97 = and i32 %96, 255
%98 = shl i32 %97, 8
%99 = load i32*, i32** %13
%100 = call i32 @fgetc(i32* %99)
%101 = and i32 %100, 255
%102 = add nsw i32 %98, %101
store i32 %102, i32* %7
%103 = load i32, i32* %7
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32 %103)
%105 = load i32, i32* %7
%106 = icmp eq i32 %105, 0
br i1 %106, label %107, label %109
107: ; preds = %93
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
br label %109
109: ; preds = %107, %93
%110 = load i32, i32* %7
%111 = icmp eq i32 %110, 1
br i1 %111, label %112, label %114
112: ; preds = %109
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
br label %114
114: ; preds = %112, %109
%115 = load i32, i32* %7
%116 = icmp eq i32 %115, 2
br i1 %116, label %117, label %119
117: ; preds = %114
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
br label %119
119: ; preds = %117, %114
%120 = load i32*, i32** %13
%121 = call i32 @fgetc(i32* %120)
%122 = and i32 %121, 255
%123 = shl i32 %122, 8
%124 = load i32*, i32** %13
%125 = call i32 @fgetc(i32* %124)
%126 = and i32 %125, 255
%127 = add nsw i32 %123, %126
store i32 %127, i32* %7
%128 = load i32, i32* %7
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 %128)
%130 = load i32*, i32** %13
%131 = call i32 @fgetc(i32* %130)
%132 = and i32 %131, 255
%133 = shl i32 %132, 8
%134 = load i32*, i32** %13
%135 = call i32 @fgetc(i32* %134)
%136 = and i32 %135, 255
%137 = add nsw i32 %133, %136
store i32 %137, i32* %7
%138 = load i32, i32* %7
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %138)
%140 = load i32, i32* %7
%141 = icmp sgt i32 %140, 0
br i1 %141, label %142, label %144
142: ; preds = %119
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0))
br label %146
144: ; preds = %119
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0))
br label %146
146: ; preds = %144, %142
%147 = load i32*, i32** %13
%148 = call i32 @fgetc(i32* %147)
%149 = and i32 %148, 255
%150 = trunc i32 %149 to i8
store i8 %150, i8* %8
br label %250
151: ; preds = %44
%152 = load i64, i64* %5
%153 = icmp eq i64 %152, 1297379947
br i1 %153, label %154, label %249
154: ; preds = %151
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0))
br label %156
156: ; preds = %154, %248
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%158 = load i32*, i32** %13
%159 = call zeroext i8 @ftell(i32* %158)
%160 = zext i8 %159 to i32
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i32 %160)
%162 = load i32*, i32** %13
%163 = call i32 @MIDI_ReadV(i32* %162)
store i32 %163, i32* %9
%164 = load i32, i32* %9
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i32 %164)
%166 = load i32*, i32** %13
%167 = call i32 @fgetc(i32* %166)
%168 = and i32 %167, 255
%169 = trunc i32 %168 to i8
store i8 %169, i8* %10
%170 = load i8, i8* %10
%171 = zext i8 %170 to i32
%172 = load i8, i8* %10
%173 = call i8* @MIDI_ToString(i8 zeroext %172)
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 %171, i8* %173)
%175 = load i8, i8* %10
%176 = zext i8 %175 to i32
%177 = and i32 %176, 240
switch i32 %177, label %247 [
i32 240, label %178
i32 192, label %224
i32 208, label %224
i32 128, label %232
i32 144, label %232
i32 160, label %232
i32 176, label %232
i32 224, label %232
]
178: ; preds = %156
%179 = load i8, i8* %10
%180 = zext i8 %179 to i32
%181 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i32 %180)
%182 = load i8, i8* %10
%183 = zext i8 %182 to i32
%184 = icmp eq i32 %183, 255
br i1 %184, label %189, label %185
185: ; preds = %178
%186 = load i8, i8* %10
%187 = zext i8 %186 to i32
%188 = icmp eq i32 %187, 240
br i1 %188, label %189, label %190
189: ; preds = %185, %178
br label %190
190: ; preds = %189, %185
%191 = load i8, i8* %10
%192 = zext i8 %191 to i32
%193 = icmp eq i32 %192, 255
br i1 %193, label %194, label %202
194: ; preds = %190
%195 = load i32*, i32** %13
%196 = call i32 @fgetc(i32* %195)
%197 = and i32 %196, 255
%198 = trunc i32 %197 to i8
store i8 %198, i8* %8
%199 = load i8, i8* %8
%200 = zext i8 %199 to i32
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %200)
br label %202
202: ; preds = %194, %190
%203 = load i32*, i32** %13
%204 = call i32 @fgetc(i32* %203)
%205 = and i32 %204, 255
store i32 %205, i32* %11
%206 = load i32, i32* %11
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.21, i64 0, i64 0), i32 %206)
%208 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0))
br label %209
209: ; preds = %212, %202
%210 = load i32, i32* %11
%211 = icmp ugt i32 %210, 0
br i1 %211, label %212, label %222
212: ; preds = %209
%213 = load i32*, i32** %13
%214 = call i32 @fgetc(i32* %213)
%215 = and i32 %214, 255
%216 = trunc i32 %215 to i8
store i8 %216, i8* %8
%217 = load i8, i8* %8
%218 = zext i8 %217 to i32
%219 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.23, i64 0, i64 0), i32 %218)
%220 = load i32, i32* %11
%221 = add i32 %220, -1
store i32 %221, i32* %11
br label %209
222: ; preds = %209
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0))
br label %248
224: ; preds = %156, %156
%225 = load i32*, i32** %13
%226 = call i32 @fgetc(i32* %225)
%227 = and i32 %226, 255
%228 = trunc i32 %227 to i8
store i8 %228, i8* %8
%229 = load i8, i8* %8
%230 = zext i8 %229 to i32
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %230)
br label %248
232: ; preds = %156, %156, %156, %156, %156
%233 = load i32*, i32** %13
%234 = call i32 @fgetc(i32* %233)
%235 = and i32 %234, 255
%236 = trunc i32 %235 to i8
store i8 %236, i8* %8
%237 = load i8, i8* %8
%238 = zext i8 %237 to i32
%239 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %238)
%240 = load i32*, i32** %13
%241 = call i32 @fgetc(i32* %240)
%242 = and i32 %241, 255
%243 = trunc i32 %242 to i8
store i8 %243, i8* %8
%244 = load i8, i8* %8
%245 = zext i8 %244 to i32
%246 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %245)
br label %248
247: ; preds = %156
br label %248
248: ; preds = %247, %232, %224, %222
br label %156
249: ; preds = %151
br label %250
250: ; preds = %249, %146
br label %251
251: ; preds = %250
br i1 true, label %32, label %252
252: ; preds = %251
%253 = load i32*, i32** %13
%254 = call i32 @fclose(i32* %253)
store i32 0, i32* %2
br label %255
255: ; preds = %252, %42, %18
%256 = load i32, i32* %2
ret i32 %256
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.2 = [19 x i8] c"File is %ld bytes\0A\00"
@EOF = global i64 0
@.str.5 = [32 x i8] c"Chunk ID: 0x%08lx (%ld bytes)\0A\00"
@.str.7 = [18 x i8] c" Format: %d - \00"
@.str.11 = [22 x i8] c" Track Chunks: %d\0A\00"
@.str.12 = [18 x i8] c" Division: %d \00"
@.str.15 = [13 x i8] c" -- Track\0A \00"
@.str.16 = [7 x i8] c"(%ld) \00"
@.str.17 = [9 x i8] c"0x%04x: \00"
@.str.18 = [10 x i8] c"%02x %s: \00"
@.str.19 = [5 x i8] c"%02x\00"
@.str.20 = [6 x i8] c"%02x \00"
@.str.21 = [10 x i8] c"(c=%02x) \00"
@str = [21 x i8] c"Unable to open file.\00"
@str.24 = [11 x i8] c" -- Header\00"
@str.25 = [25 x i8] c"(SMPTE compatible units)\00"
@str.26 = [17 x i8] c"(units per beat)\00"
@str.27 = [21 x i8] c"multiple song format\00"
@str.28 = [22 x i8] c"multiple track format\00"
@str.29 = [20 x i8] c"single track format\00"
@str.30 = [5 x i8] c"EOF.\00"
@reltable.process = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @str.29 to i64), i64 ptrtoint ([3 x i32]* @reltable.process to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @str.28 to i64), i64 ptrtoint ([3 x i32]* @reltable.process to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @str.27 to i64), i64 ptrtoint ([3 x i32]* @reltable.process to i64)) to i32)]
define i32 @process(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %144, label %4
4: ; preds = %1
%5 = load i32, i32* @SEEK_END
%6 = tail call i32 @fseek(i32* %2, i64 0, i32 %5)
%7 = tail call zeroext i8 @ftell(i32* %2)
%8 = zext i8 %7 to i64
%9 = load i32, i32* @SEEK_SET
%10 = tail call i32 @fseek(i32* %2, i64 0, i32 %9)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i64 %8)
%12 = load i32, i32* @SEEK_SET
%13 = tail call i32 @fseek(i32* %2, i64 0, i32 %12)
%14 = tail call i32 @putchar(i32 10)
%15 = load i64, i64* @EOF
%16 = tail call i64 @MIDI_Fpeek(i32* %2)
%17 = icmp eq i64 %15, %16
br i1 %17, label %144, label %18
18: ; preds = %4, %137
%19 = tail call i32 @fgetc(i32* %2)
%20 = tail call i32 @fgetc(i32* %2)
%21 = shl i32 %19, 24
%22 = shl i32 %20, 16
%23 = and i32 %22, 16711680
%24 = or i32 %23, %21
%25 = tail call i32 @fgetc(i32* %2)
%26 = shl i32 %25, 8
%27 = and i32 %26, 65280
%28 = tail call i32 @fgetc(i32* %2)
%29 = and i32 %28, 255
%30 = or i32 %27, %29
%31 = or i32 %30, %24
%32 = sext i32 %31 to i64
%33 = tail call i32 @fgetc(i32* %2)
%34 = tail call i32 @fgetc(i32* %2)
%35 = shl i32 %33, 24
%36 = shl i32 %34, 16
%37 = and i32 %36, 16711680
%38 = or i32 %37, %35
%39 = tail call i32 @fgetc(i32* %2)
%40 = shl i32 %39, 8
%41 = and i32 %40, 65280
%42 = tail call i32 @fgetc(i32* %2)
%43 = and i32 %42, 255
%44 = or i32 %41, %43
%45 = or i32 %44, %38
%46 = sext i32 %45 to i64
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i64 %32, i64 %46)
%48 = tail call zeroext i8 @ftell(i32* %2)
%49 = zext i8 %48 to i64
%50 = add nsw i64 %46, %49
switch i32 %31, label %137 [
i32 1297377380, label %51
i32 1297379947, label %86
]
51: ; preds = %18
%52 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.24, i64 0, i64 0))
%53 = tail call i32 @fgetc(i32* %2)
%54 = shl i32 %53, 8
%55 = and i32 %54, 65280
%56 = tail call i32 @fgetc(i32* %2)
%57 = and i32 %56, 255
%58 = or i32 %55, %57
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32 %58)
%60 = trunc i32 %58 to i16
%61 = icmp ult i16 %60, 3
br i1 %61, label %62, label %67
62: ; preds = %51
%63 = sext i16 %60 to i64
%64 = shl i64 %63, 2
%65 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.process to i8*), i64 %64)
%66 = tail call i32 @puts(i8* dereferenceable(1) %65)
br label %67
67: ; preds = %51, %62
%68 = tail call i32 @fgetc(i32* %2)
%69 = shl i32 %68, 8
%70 = and i32 %69, 65280
%71 = tail call i32 @fgetc(i32* %2)
%72 = and i32 %71, 255
%73 = or i32 %70, %72
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 %73)
%75 = tail call i32 @fgetc(i32* %2)
%76 = shl i32 %75, 8
%77 = and i32 %76, 65280
%78 = tail call i32 @fgetc(i32* %2)
%79 = and i32 %78, 255
%80 = or i32 %77, %79
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %80)
%82 = icmp eq i32 %80, 0
%83 = select i1 %82, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.25, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.26, i64 0, i64 0)
%84 = tail call i32 @puts(i8* dereferenceable(1) %83)
%85 = tail call i32 @fgetc(i32* %2)
br label %137
86: ; preds = %18
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0))
br label %88
88: ; preds = %103, %86
%89 = tail call i32 @putchar(i32 10)
%90 = tail call zeroext i8 @ftell(i32* %2)
%91 = zext i8 %90 to i32
%92 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i32 %91)
%93 = tail call i32 @MIDI_ReadV(i32* %2)
%94 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i32 %93)
%95 = tail call i32 @fgetc(i32* %2)
%96 = trunc i32 %95 to i8
%97 = and i32 %95, 255
%98 = tail call i8* @MIDI_ToString(i8 zeroext %96)
%99 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 %97, i8* %98)
%100 = and i32 %95, 240
%101 = add nsw i32 %100, -128
%102 = lshr exact i32 %101, 4
switch i32 %102, label %103 [
i32 7, label %104
i32 4, label %126
i32 5, label %126
i32 0, label %130
i32 1, label %130
i32 2, label %130
i32 3, label %130
i32 6, label %130
]
103: ; preds = %88, %130, %126, %124
br label %88
104: ; preds = %88
%105 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i32 %97)
%106 = icmp eq i32 %97, 255
br i1 %106, label %107, label %111
107: ; preds = %104
%108 = tail call i32 @fgetc(i32* %2)
%109 = and i32 %108, 255
%110 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %109)
br label %111
111: ; preds = %107, %104
%112 = tail call i32 @fgetc(i32* %2)
%113 = and i32 %112, 255
%114 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.21, i64 0, i64 0), i32 %113)
%115 = tail call i32 @putchar(i32 124)
%116 = icmp eq i32 %113, 0
br i1 %116, label %124, label %117
117: ; preds = %111, %117
%118 = phi i32 [ %122, %117 ], [ %113, %111 ]
%119 = tail call i32 @fgetc(i32* %2)
%120 = and i32 %119, 255
%121 = tail call i32 @putchar(i32 %120)
%122 = add nsw i32 %118, -1
%123 = icmp eq i32 %122, 0
br i1 %123, label %124, label %117
124: ; preds = %117, %111
%125 = tail call i32 @putchar(i32 124)
br label %103
126: ; preds = %88, %88
%127 = tail call i32 @fgetc(i32* %2)
%128 = and i32 %127, 255
%129 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %128)
br label %103
130: ; preds = %88, %88, %88, %88, %88
%131 = tail call i32 @fgetc(i32* %2)
%132 = and i32 %131, 255
%133 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %132)
%134 = tail call i32 @fgetc(i32* %2)
%135 = and i32 %134, 255
%136 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %135)
br label %103
137: ; preds = %18, %67
%138 = load i32, i32* @SEEK_SET
%139 = tail call i32 @fseek(i32* %2, i64 %50, i32 %138)
%140 = tail call i32 @putchar(i32 10)
%141 = load i64, i64* @EOF
%142 = tail call i64 @MIDI_Fpeek(i32* %2)
%143 = icmp eq i64 %141, %142
br i1 %143, label %144, label %18
144: ; preds = %137, %4, %1
%145 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.30, i64 0, i64 0), %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.30, i64 0, i64 0), %137 ]
%146 = tail call i32 @puts(i8* dereferenceable(1) %145)
ret i32 0
}