#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*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void main(int argc, char **argv) {
  char c;
  int i, j, sz, nstr;
  int total = 0;
  FILE *inf, *outf;
  if (argc != 3) {
    fprintf(stderr, "usage: %s <inputfile> <outputfile>\n", argv[0]);
    exit(1);
  }
  if ((inf = fopen(argv[1], "rb")) == NULL) {
    fprintf(stderr, "%s Could not open input file %s for reading\n", argv[0],
            argv[1]);
    exit(1);
  }
  if ((outf = fopen(argv[2], "w")) == NULL) {
    fprintf(stderr, "%s Could not open output file %s for writing\n", argv[0],
            argv[2]);
    exit(1);
  }
  fprintf(outf, "/*\n");
  fprintf(outf, " * DO NOT MODIFY:\n");
  fprintf(outf, " * THIS FILE WAS AUTO-GENERATED BY %s from %s */\n", argv[0],
          argv[1]);
  fprintf(outf, " */\n\n");
  fprintf(outf, "WORD squirtdata(WORD link)\n");
  fprintf(outf, "/* \n");
  fprintf(outf, " *\t'squirt' the B422 TRAM driver code down \n");
  fprintf(outf, " *\tthe specified link. This will then execute\n");
  fprintf(outf, " *\tand expect us to be an i-server capable of\n");
  fprintf(outf, " *\tgiving it's board size.\n");
  fprintf(outf, " */\n");
  fprintf(outf, "{\n");
  fprintf(outf, "\tBYTE\t\ts[10];\n");
  fprintf(outf, "\tWORD\t\tn;\n");
  fprintf(outf, "\tINT16\t\ti16;\n");
  fseek(inf, 0, SEEK_END);
  sz = ftell(inf);
  fseek(inf, 0, SEEK_SET);
  nstr = sz / 16;
  if (sz % 16)
    nstr++;
  fprintf(outf, "\tWORD\t\tsize = %d;\n", sz);
  fprintf(outf, "\tWORD\t\tnstr = %d;\n", nstr);
  fprintf(outf, "\tchar *\t\tdata[%d];\n", nstr);
  fprintf(outf, "\n");
  fprintf(outf, "\t/* Initialise the strings */\n");
  for (i = 0; i < (nstr - 1); i++) {
    fprintf(outf, "\tdata[%d] = \t\"", i);
    for (j = 0; j < 0x10; j++) {
      c = fgetc(inf);
      if (c < 0x10) {
        fprintf(outf, "\\x0%x", c);
      } else {
        fprintf(outf, "\\x%x", c);
      }
    }
    sz -= 0x10;
    fprintf(outf, "\";\n");
  }
  fprintf(outf, "\tdata[%d] = \t\"", i);
  while (sz) {
    c = fgetc(inf);
    if (c < 0x10) {
      fprintf(outf, "\\x0%x", c);
    } else {
      fprintf(outf, "\\x%x", c);
    }
    sz--;
  }
  fprintf(outf, "\";\n");
  fprintf(outf, "\n");
  fprintf(outf, "\t/* Send the completed data */\n");
  fprintf(outf, "\tfor (n=0; n<(nstr-1); n++) {\n");
  fprintf(outf, "\t\tLinkOut(%d, link, data[n], LINKTIMEOUT);\n", 0x10);
  fprintf(outf, "\t\tsize -= %d;\n", 0x10);
  fprintf(outf, "\t}\n");
  fprintf(outf, "\n");
  fprintf(outf, "\t/* Send the last string */\n");
  fprintf(outf, "\tLinkOut(size, link, data[n], LINKTIMEOUT);\n");
  fprintf(outf, "\n");
  fprintf(outf, "\t/* It thinks we're an i-server, so fool it! */\n");
  fprintf(outf, "\tLinkIn(sizeof(i16), link, &i16, LINKTIMEOUT);\n");
  fprintf(outf, "\tLinkIn(i16, link, data, LINKTIMEOUT);\n");
  fprintf(outf, "\n");
  fprintf(outf, "\t/* Magic! */\n");
  fprintf(outf, "\ts[0] = 9; s[1] = 0; s[2] = 0; s[3] = 6;\ts[4] = 0;\n");
  fprintf(outf,
          "\ts[5] = '#'; s[6] = '1'; s[7] = s[8] = s[9] = s[10] = '0';\n");
  fprintf(outf, "\n");
  fprintf(outf, "\t/* make the B422 a happy TRAM */\n");
  fprintf(outf, "\tLinkOut(11, link, s, LINKTIMEOUT);\n");
  fprintf(outf, "\n");
  fprintf(outf, "\treturn(TRUE);\n");
  fprintf(outf, "\n");
  fprintf(outf, "}\n");
  fclose(inf);
  fclose(outf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     11b9 <main+0x49>
mov    0x2e41(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe58(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5c(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    120c <main+0x9c>
mov    0x2df6(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xe2c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe39(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    125f <main+0xef>
mov    0x2da3(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xe08(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x38(%rbp),%rdi
lea    0xe1a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xe0c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xdfe(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xe1e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xe12(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xe1c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xe0f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xe2a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xe47(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xe64(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0x1068(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xf37(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xe4a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xe47(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xe40(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    0x2c61(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1070 <fseek@plt>
mov    -0x30(%rbp),%rdi
call   1060 <ftell@plt>
mov    %eax,-0x20(%rbp)
mov    -0x30(%rbp),%rdi
mov    0x2c29(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1070 <fseek@plt>
mov    -0x20(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     13db <main+0x26b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%edx
lea    0xdda(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xdd8(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xdd6(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xcac(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xdc6(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1502 <main+0x392>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xdb8(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    14d9 <main+0x369>
mov    -0x30(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x10,%eax
jge    14b0 <main+0x340>
mov    -0x38(%rbp),%rdi
movsbl -0x11(%rbp),%edx
lea    0xd87(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    14c6 <main+0x356>
mov    -0x38(%rbp),%rdi
movsbl -0x11(%rbp),%edx
lea    0xd72(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    14cb <main+0x35b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1472 <main+0x302>
mov    -0x20(%rbp),%eax
sub    $0x10,%eax
mov    %eax,-0x20(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xd49(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1445 <main+0x2d5>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xd0c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmpl   $0x0,-0x20(%rbp)
je     1579 <main+0x409>
mov    -0x30(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x10,%eax
jge    1555 <main+0x3e5>
mov    -0x38(%rbp),%rdi
movsbl -0x11(%rbp),%edx
lea    0xce2(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    156b <main+0x3fb>
mov    -0x38(%rbp),%rdi
movsbl -0x11(%rbp),%edx
lea    0xccd(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1517 <main+0x3a7>
mov    -0x38(%rbp),%rdi
lea    0xcb2(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xb3b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xc92(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xca0(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xcad(%rip),%rsi
mov    $0x10,%edx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xcc2(%rip),%rsi
mov    $0x10,%edx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xcba(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xac5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xc9a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xca5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xa8f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xcae(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xccd(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xceb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xa47(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xcef(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xcec(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xd0e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0x9ff(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xd26(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xd37(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0x9c9(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xd38(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0x9a5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xb77(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
cmp    $0x3,%edi
jne    18ea <main+0x75a>
mov    0x8(%rbp),%rdi
lea    0xe72(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1910 <main+0x780>
mov    %rax,%r14
mov    0x10(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     192b <main+0x79b>
mov    %rax,%rbx
lea    0xe9e(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10b0 <fwrite@plt>
lea    0xe89(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    0x0(%rbp),%rdx
mov    0x8(%rbp),%rcx
lea    0xe7b(%rip),%rsi
xor    %r12d,%r12d
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe99(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xe86(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xe89(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xe75(%rip),%rdi
mov    $0x2c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xe89(%rip),%rdi
mov    $0x2e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xe9f(%rip),%rdi
mov    $0x2e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xeb5(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0x10b2(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xf7a(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xe86(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xe7c(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xe6e(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    0x2c88(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1080 <fseek@plt>
mov    %r14,%rdi
call   1070 <ftell@plt>
mov    %eax,%r15d
mov    0x2c52(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1080 <fseek@plt>
lea    0xf(%r15),%ebp
test   %r15d,%r15d
cmovns %r15d,%ebp
sar    $0x4,%ebp
mov    %r15d,%eax
and    $0xf,%eax
cmp    $0x1,%eax
sbb    $0xffffffff,%ebp
lea    0xe18(%rip),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe17(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe17(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
lea    0xe0b(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
cmp    $0x2,%ebp
jl     1669 <main+0x4d9>
mov    %ebp,%eax
add    $0xffffffff,%eax
mov    %eax,(%rsp)
shl    $0x4,%eax
neg    %eax
mov    %eax,0x4(%rsp)
lea    0xe06(%rip),%r13
lea    0xe05(%rip),%rbp
xor    %r12d,%r12d
nop
mov    %rbx,%rdi
lea    0xde2(%rip),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r13,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xbf1(%rip),%rdi
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
add    $0x1,%r12d
cmp    %r12d,(%rsp)
jne    1430 <main+0x2a0>
mov    0x4(%rsp),%eax
add    %r15d,%eax
mov    %eax,%r15d
mov    (%rsp),%r12d
lea    0xbac(%rip),%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
test   %r15d,%r15d
je     16b5 <main+0x525>
lea    0xba2(%rip),%r12
lea    0xba1(%rip),%rbp
mov    %r14,%rdi
call   1040 <fgetc@plt>
movsbl %al,%edx
cmp    $0x10,%dl
mov    %rbp,%rsi
cmovl  %r12,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0xffffffff,%r15d
jne    1690 <main+0x500>
lea    0xb7a(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
lea    0xb58(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xb5f(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xb65(%rip),%rsi
mov    %rbx,%rdi
mov    $0x10,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xb7b(%rip),%rsi
mov    %rbx,%rdi
mov    $0x10,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xb74(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
lea    0xb52(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xb56(%rip),%rdi
mov    $0x2c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
lea    0xb5d(%rip),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xb75(%rip),%rdi
mov    $0x2f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xb8c(%rip),%rdi
mov    $0x27,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
lea    0xb8e(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xb84(%rip),%rdi
mov    $0x33,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xb9f(%rip),%rdi
mov    $0x3b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
lea    0xbb5(%rip),%rdi
mov    $0x22,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xbbf(%rip),%rdi
mov    $0x24,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
lea    0xbbe(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
lea    0x9fb(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fclose@plt>
mov    0x26e7(%rip),%rax
movslq (%rax),%rdi
mov    0x0(%rbp),%rdx
lea    0x701(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x26c1(%rip),%rax
movslq (%rax),%rdi
mov    0x0(%rbp),%rdx
mov    0x8(%rbp),%rcx
lea    0x6fe(%rip),%rsi
jmp    1944 <main+0x7b4>
mov    0x26a6(%rip),%rax
movslq (%rax),%rdi
mov    0x0(%rbp),%rdx
mov    0x10(%rbp),%rcx
lea    0x712(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"usage: %s <inputfile> <outputfile>\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [45 x i8] c"%s Could not open input file %s for reading\0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [46 x i8] c"%s Could not open output file %s for writing\0A\00"
@.str.5 = [4 x i8] c"/*\0A\00"
@.str.6 = [19 x i8] c" * DO NOT MODIFY:\0A\00"
@.str.7 = [50 x i8] c" * THIS FILE WAS AUTO-GENERATED BY %s from %s */\0A\00"
@.str.8 = [6 x i8] c" */\0A\0A\00"
@.str.9 = [28 x i8] c"WORD squirtdata(WORD link)\0A\00"
@.str.10 = [5 x i8] c"/* \0A\00"
@.str.11 = [45 x i8] c" *\09'squirt' the B422 TRAM driver code down \0A\00"
@.str.12 = [47 x i8] c" *\09the specified link. This will then execute\0A\00"
@.str.13 = [47 x i8] c" *\09and expect us to be an i-server capable of\0A\00"
@.str.14 = [28 x i8] c" *\09giving it's board size.\0A\00"
@.str.15 = [5 x i8] c" */\0A\00"
@.str.16 = [3 x i8] c"{\0A\00"
@.str.17 = [15 x i8] c"\09BYTE\09\09s[10];\0A\00"
@.str.18 = [11 x i8] c"\09WORD\09\09n;\0A\00"
@.str.19 = [14 x i8] c"\09INT16\09\09i16;\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.20 = [19 x i8] c"\09WORD\09\09size = %d;\0A\00"
@.str.21 = [19 x i8] c"\09WORD\09\09nstr = %d;\0A\00"
@.str.22 = [20 x i8] c"\09char *\09\09data[%d];\0A\00"
@.str.23 = [2 x i8] c"\0A\00"
@.str.24 = [31 x i8] c"\09/* Initialise the strings */\0A\00"
@.str.25 = [15 x i8] c"\09data[%d] = \09\22\00"
@.str.26 = [6 x i8] c"\\x0%x\00"
@.str.27 = [5 x i8] c"\\x%x\00"
@.str.28 = [4 x i8] c"\22;\0A\00"
@.str.29 = [32 x i8] c"\09/* Send the completed data */\0A\00"
@.str.30 = [31 x i8] c"\09for (n=0; n<(nstr-1); n++) {\0A\00"
@.str.31 = [44 x i8] c"\09\09LinkOut(%d, link, data[n], LINKTIMEOUT);\0A\00"
@.str.32 = [15 x i8] c"\09\09size -= %d;\0A\00"
@.str.33 = [4 x i8] c"\09}\0A\00"
@.str.34 = [29 x i8] c"\09/* Send the last string */\0A\00"
@.str.35 = [45 x i8] c"\09LinkOut(size, link, data[n], LINKTIMEOUT);\0A\00"
@.str.36 = [49 x i8] c"\09/* It thinks we're an i-server, so fool it! */\0A\00"
@.str.37 = [48 x i8] c"\09LinkIn(sizeof(i16), link, &i16, LINKTIMEOUT);\0A\00"
@.str.38 = [40 x i8] c"\09LinkIn(i16, link, data, LINKTIMEOUT);\0A\00"
@.str.39 = [15 x i8] c"\09/* Magic! */\0A\00"
@.str.40 = [52 x i8] c"\09s[0] = 9; s[1] = 0; s[2] = 0; s[3] = 6;\09s[4] = 0;\0A\00"
@.str.41 = [60 x i8] c"\09s[5] = '#'; s[6] = '1'; s[7] = s[8] = s[9] = s[10] = '0';\0A\00"
@.str.42 = [35 x i8] c"\09/* make the B422 a happy TRAM */\0A\00"
@.str.43 = [37 x i8] c"\09LinkOut(11, link, s, LINKTIMEOUT);\0A\00"
@.str.44 = [16 x i8] c"\09return(TRUE);\0A\00"
@.str.45 = [3 x i8] c"}\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %10
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %24
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load i8**, i8*** %4
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %2
%25 = load i8**, i8*** %4
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %28, i32** %11
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %42
30: ; preds = %24
%31 = load i32, i32* @stderr
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
%34 = load i8**, i8*** %4
%35 = getelementptr inbounds i8*, i8** %34, i64 0
%36 = load i8*, i8** %35
%37 = load i8**, i8*** %4
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* %36, i8* %39)
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %24
%43 = load i8**, i8*** %4
%44 = getelementptr inbounds i8*, i8** %43, i64 2
%45 = load i8*, i8** %44
%46 = call i32* @fopen(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %46, i32** %12
%47 = icmp eq i32* %46, null
br i1 %47, label %48, label %60
48: ; preds = %42
%49 = load i32, i32* @stderr
%50 = sext i32 %49 to i64
%51 = inttoptr i64 %50 to i32*
%52 = load i8**, i8*** %4
%53 = getelementptr inbounds i8*, i8** %52, i64 0
%54 = load i8*, i8** %53
%55 = load i8**, i8*** %4
%56 = getelementptr inbounds i8*, i8** %55, i64 2
%57 = load i8*, i8** %56
%58 = call i32 (i32*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i8* %54, i8* %57)
%59 = call i32 @exit(i32 1)
unreachable
60: ; preds = %42
%61 = load i32*, i32** %12
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%63 = load i32*, i32** %12
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%65 = load i32*, i32** %12
%66 = load i8**, i8*** %4
%67 = getelementptr inbounds i8*, i8** %66, i64 0
%68 = load i8*, i8** %67
%69 = load i8**, i8*** %4
%70 = getelementptr inbounds i8*, i8** %69, i64 1
%71 = load i8*, i8** %70
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), i8* %68, i8* %71)
%73 = load i32*, i32** %12
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %73, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%75 = load i32*, i32** %12
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%77 = load i32*, i32** %12
%78 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%79 = load i32*, i32** %12
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %79, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0))
%81 = load i32*, i32** %12
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.12, i64 0, i64 0))
%83 = load i32*, i32** %12
%84 = call i32 (i32*, i8*, ...) @fprintf(i32* %83, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.13, i64 0, i64 0))
%85 = load i32*, i32** %12
%86 = call i32 (i32*, i8*, ...) @fprintf(i32* %85, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
%87 = load i32*, i32** %12
%88 = call i32 (i32*, i8*, ...) @fprintf(i32* %87, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%89 = load i32*, i32** %12
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%91 = load i32*, i32** %12
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0))
%93 = load i32*, i32** %12
%94 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0))
%95 = load i32*, i32** %12
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %95, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0))
%97 = load i32*, i32** %11
%98 = load i32, i32* @SEEK_END
%99 = call i32 @fseek(i32* %97, i32 0, i32 %98)
%100 = load i32*, i32** %11
%101 = call i32 @ftell(i32* %100)
store i32 %101, i32* %8
%102 = load i32*, i32** %11
%103 = load i32, i32* @SEEK_SET
%104 = call i32 @fseek(i32* %102, i32 0, i32 %103)
%105 = load i32, i32* %8
%106 = sdiv i32 %105, 16
store i32 %106, i32* %9
%107 = load i32, i32* %8
%108 = srem i32 %107, 16
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %113
110: ; preds = %60
%111 = load i32, i32* %9
%112 = add nsw i32 %111, 1
store i32 %112, i32* %9
br label %113
113: ; preds = %110, %60
%114 = load i32*, i32** %12
%115 = load i32, i32* %8
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %114, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.20, i64 0, i64 0), i32 %115)
%117 = load i32*, i32** %12
%118 = load i32, i32* %9
%119 = call i32 (i32*, i8*, ...) @fprintf(i32* %117, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0), i32 %118)
%120 = load i32*, i32** %12
%121 = load i32, i32* %9
%122 = call i32 (i32*, i8*, ...) @fprintf(i32* %120, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0), i32 %121)
%123 = load i32*, i32** %12
%124 = call i32 (i32*, i8*, ...) @fprintf(i32* %123, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%125 = load i32*, i32** %12
%126 = call i32 (i32*, i8*, ...) @fprintf(i32* %125, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.24, i64 0, i64 0))
store i32 0, i32* %6
br label %127
127: ; preds = %164, %113
%128 = load i32, i32* %6
%129 = load i32, i32* %9
%130 = sub nsw i32 %129, 1
%131 = icmp slt i32 %128, %130
br i1 %131, label %132, label %167
132: ; preds = %127
%133 = load i32*, i32** %12
%134 = load i32, i32* %6
%135 = call i32 (i32*, i8*, ...) @fprintf(i32* %133, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.25, i64 0, i64 0), i32 %134)
store i32 0, i32* %7
br label %136
136: ; preds = %156, %132
%137 = load i32, i32* %7
%138 = icmp slt i32 %137, 16
br i1 %138, label %139, label %159
139: ; preds = %136
%140 = load i32*, i32** %11
%141 = call signext i8 @fgetc(i32* %140)
store i8 %141, i8* %5
%142 = load i8, i8* %5
%143 = sext i8 %142 to i32
%144 = icmp slt i32 %143, 16
br i1 %144, label %145, label %150
145: ; preds = %139
%146 = load i32*, i32** %12
%147 = load i8, i8* %5
%148 = sext i8 %147 to i32
%149 = call i32 (i32*, i8*, ...) @fprintf(i32* %146, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i32 %148)
br label %155
150: ; preds = %139
%151 = load i32*, i32** %12
%152 = load i8, i8* %5
%153 = sext i8 %152 to i32
%154 = call i32 (i32*, i8*, ...) @fprintf(i32* %151, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0), i32 %153)
br label %155
155: ; preds = %150, %145
br label %156
156: ; preds = %155
%157 = load i32, i32* %7
%158 = add nsw i32 %157, 1
store i32 %158, i32* %7
br label %136
159: ; preds = %136
%160 = load i32, i32* %8
%161 = sub nsw i32 %160, 16
store i32 %161, i32* %8
%162 = load i32*, i32** %12
%163 = call i32 (i32*, i8*, ...) @fprintf(i32* %162, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i64 0, i64 0))
br label %164
164: ; preds = %159
%165 = load i32, i32* %6
%166 = add nsw i32 %165, 1
store i32 %166, i32* %6
br label %127
167: ; preds = %127
%168 = load i32*, i32** %12
%169 = load i32, i32* %6
%170 = call i32 (i32*, i8*, ...) @fprintf(i32* %168, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.25, i64 0, i64 0), i32 %169)
br label %171
171: ; preds = %190, %167
%172 = load i32, i32* %8
%173 = icmp ne i32 %172, 0
br i1 %173, label %174, label %193
174: ; preds = %171
%175 = load i32*, i32** %11
%176 = call signext i8 @fgetc(i32* %175)
store i8 %176, i8* %5
%177 = load i8, i8* %5
%178 = sext i8 %177 to i32
%179 = icmp slt i32 %178, 16
br i1 %179, label %180, label %185
180: ; preds = %174
%181 = load i32*, i32** %12
%182 = load i8, i8* %5
%183 = sext i8 %182 to i32
%184 = call i32 (i32*, i8*, ...) @fprintf(i32* %181, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i32 %183)
br label %190
185: ; preds = %174
%186 = load i32*, i32** %12
%187 = load i8, i8* %5
%188 = sext i8 %187 to i32
%189 = call i32 (i32*, i8*, ...) @fprintf(i32* %186, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0), i32 %188)
br label %190
190: ; preds = %185, %180
%191 = load i32, i32* %8
%192 = add nsw i32 %191, -1
store i32 %192, i32* %8
br label %171
193: ; preds = %171
%194 = load i32*, i32** %12
%195 = call i32 (i32*, i8*, ...) @fprintf(i32* %194, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i64 0, i64 0))
%196 = load i32*, i32** %12
%197 = call i32 (i32*, i8*, ...) @fprintf(i32* %196, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%198 = load i32*, i32** %12
%199 = call i32 (i32*, i8*, ...) @fprintf(i32* %198, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.29, i64 0, i64 0))
%200 = load i32*, i32** %12
%201 = call i32 (i32*, i8*, ...) @fprintf(i32* %200, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.30, i64 0, i64 0))
%202 = load i32*, i32** %12
%203 = call i32 (i32*, i8*, ...) @fprintf(i32* %202, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.31, i64 0, i64 0), i32 16)
%204 = load i32*, i32** %12
%205 = call i32 (i32*, i8*, ...) @fprintf(i32* %204, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.32, i64 0, i64 0), i32 16)
%206 = load i32*, i32** %12
%207 = call i32 (i32*, i8*, ...) @fprintf(i32* %206, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.33, i64 0, i64 0))
%208 = load i32*, i32** %12
%209 = call i32 (i32*, i8*, ...) @fprintf(i32* %208, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%210 = load i32*, i32** %12
%211 = call i32 (i32*, i8*, ...) @fprintf(i32* %210, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.34, i64 0, i64 0))
%212 = load i32*, i32** %12
%213 = call i32 (i32*, i8*, ...) @fprintf(i32* %212, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.35, i64 0, i64 0))
%214 = load i32*, i32** %12
%215 = call i32 (i32*, i8*, ...) @fprintf(i32* %214, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%216 = load i32*, i32** %12
%217 = call i32 (i32*, i8*, ...) @fprintf(i32* %216, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.36, i64 0, i64 0))
%218 = load i32*, i32** %12
%219 = call i32 (i32*, i8*, ...) @fprintf(i32* %218, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.37, i64 0, i64 0))
%220 = load i32*, i32** %12
%221 = call i32 (i32*, i8*, ...) @fprintf(i32* %220, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.38, i64 0, i64 0))
%222 = load i32*, i32** %12
%223 = call i32 (i32*, i8*, ...) @fprintf(i32* %222, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%224 = load i32*, i32** %12
%225 = call i32 (i32*, i8*, ...) @fprintf(i32* %224, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.39, i64 0, i64 0))
%226 = load i32*, i32** %12
%227 = call i32 (i32*, i8*, ...) @fprintf(i32* %226, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.40, i64 0, i64 0))
%228 = load i32*, i32** %12
%229 = call i32 (i32*, i8*, ...) @fprintf(i32* %228, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.41, i64 0, i64 0))
%230 = load i32*, i32** %12
%231 = call i32 (i32*, i8*, ...) @fprintf(i32* %230, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%232 = load i32*, i32** %12
%233 = call i32 (i32*, i8*, ...) @fprintf(i32* %232, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.42, i64 0, i64 0))
%234 = load i32*, i32** %12
%235 = call i32 (i32*, i8*, ...) @fprintf(i32* %234, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.43, i64 0, i64 0))
%236 = load i32*, i32** %12
%237 = call i32 (i32*, i8*, ...) @fprintf(i32* %236, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%238 = load i32*, i32** %12
%239 = call i32 (i32*, i8*, ...) @fprintf(i32* %238, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.44, i64 0, i64 0))
%240 = load i32*, i32** %12
%241 = call i32 (i32*, i8*, ...) @fprintf(i32* %240, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%242 = load i32*, i32** %12
%243 = call i32 (i32*, i8*, ...) @fprintf(i32* %242, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.45, i64 0, i64 0))
%244 = load i32*, i32** %11
%245 = call i32 @fclose(i32* %244)
%246 = load i32*, i32** %12
%247 = call i32 @fclose(i32* %246)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"usage: %s <inputfile> <outputfile>\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [45 x i8] c"%s Could not open input file %s for reading\0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [46 x i8] c"%s Could not open output file %s for writing\0A\00"
@.str.5 = [4 x i8] c"/*\0A\00"
@.str.6 = [19 x i8] c" * DO NOT MODIFY:\0A\00"
@.str.7 = [50 x i8] c" * THIS FILE WAS AUTO-GENERATED BY %s from %s */\0A\00"
@.str.8 = [6 x i8] c" */\0A\0A\00"
@.str.9 = [28 x i8] c"WORD squirtdata(WORD link)\0A\00"
@.str.10 = [5 x i8] c"/* \0A\00"
@.str.11 = [45 x i8] c" *\09'squirt' the B422 TRAM driver code down \0A\00"
@.str.12 = [47 x i8] c" *\09the specified link. This will then execute\0A\00"
@.str.13 = [47 x i8] c" *\09and expect us to be an i-server capable of\0A\00"
@.str.14 = [28 x i8] c" *\09giving it's board size.\0A\00"
@.str.15 = [5 x i8] c" */\0A\00"
@.str.16 = [3 x i8] c"{\0A\00"
@.str.17 = [15 x i8] c"\09BYTE\09\09s[10];\0A\00"
@.str.18 = [11 x i8] c"\09WORD\09\09n;\0A\00"
@.str.19 = [14 x i8] c"\09INT16\09\09i16;\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.20 = [19 x i8] c"\09WORD\09\09size = %d;\0A\00"
@.str.21 = [19 x i8] c"\09WORD\09\09nstr = %d;\0A\00"
@.str.22 = [20 x i8] c"\09char *\09\09data[%d];\0A\00"
@.str.24 = [31 x i8] c"\09/* Initialise the strings */\0A\00"
@.str.25 = [15 x i8] c"\09data[%d] = \09\22\00"
@.str.26 = [6 x i8] c"\\x0%x\00"
@.str.27 = [5 x i8] c"\\x%x\00"
@.str.28 = [4 x i8] c"\22;\0A\00"
@.str.29 = [32 x i8] c"\09/* Send the completed data */\0A\00"
@.str.30 = [31 x i8] c"\09for (n=0; n<(nstr-1); n++) {\0A\00"
@.str.31 = [44 x i8] c"\09\09LinkOut(%d, link, data[n], LINKTIMEOUT);\0A\00"
@.str.32 = [15 x i8] c"\09\09size -= %d;\0A\00"
@.str.33 = [4 x i8] c"\09}\0A\00"
@.str.34 = [29 x i8] c"\09/* Send the last string */\0A\00"
@.str.35 = [45 x i8] c"\09LinkOut(size, link, data[n], LINKTIMEOUT);\0A\00"
@.str.36 = [49 x i8] c"\09/* It thinks we're an i-server, so fool it! */\0A\00"
@.str.37 = [48 x i8] c"\09LinkIn(sizeof(i16), link, &i16, LINKTIMEOUT);\0A\00"
@.str.38 = [40 x i8] c"\09LinkIn(i16, link, data, LINKTIMEOUT);\0A\00"
@.str.39 = [15 x i8] c"\09/* Magic! */\0A\00"
@.str.40 = [52 x i8] c"\09s[0] = 9; s[1] = 0; s[2] = 0; s[3] = 6;\09s[4] = 0;\0A\00"
@.str.41 = [60 x i8] c"\09s[5] = '#'; s[6] = '1'; s[7] = s[8] = s[9] = s[10] = '0';\0A\00"
@.str.42 = [35 x i8] c"\09/* make the B422 a happy TRAM */\0A\00"
@.str.43 = [37 x i8] c"\09LinkOut(11, link, s, LINKTIMEOUT);\0A\00"
@.str.44 = [16 x i8] c"\09return(TRUE);\0A\00"
@.str.45 = [3 x i8] c"}\0A\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load i8*, i8** %1
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %24
16: ; preds = %11
%17 = load i32, i32* @stderr
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load i8*, i8** %1
%21 = load i8*, i8** %12
%22 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* %20, i8* %21)
%23 = tail call i32 @exit(i32 1)
unreachable
24: ; preds = %11
%25 = getelementptr inbounds i8*, i8** %1, i64 2
%26 = load i8*, i8** %25
%27 = tail call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %37
29: ; preds = %24
%30 = load i32, i32* @stderr
%31 = sext i32 %30 to i64
%32 = inttoptr i64 %31 to i32*
%33 = load i8*, i8** %1
%34 = load i8*, i8** %25
%35 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i8* %33, i8* %34)
%36 = tail call i32 @exit(i32 1)
unreachable
37: ; preds = %24
%38 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64 3, i64 1, i32* %27)
%39 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i64 18, i64 1, i32* %27)
%40 = load i8*, i8** %1
%41 = load i8*, i8** %12
%42 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), i8* %40, i8* %41)
%43 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i64 5, i64 1, i32* %27)
%44 = tail call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i64 27, i64 1, i32* %27)
%45 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64 4, i64 1, i32* %27)
%46 = tail call i64 @fwrite(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0), i64 44, i64 1, i32* %27)
%47 = tail call i64 @fwrite(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.12, i64 0, i64 0), i64 46, i64 1, i32* %27)
%48 = tail call i64 @fwrite(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.13, i64 0, i64 0), i64 46, i64 1, i32* %27)
%49 = tail call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0), i64 27, i64 1, i32* %27)
%50 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i64 4, i64 1, i32* %27)
%51 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i64 2, i64 1, i32* %27)
%52 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0), i64 14, i64 1, i32* %27)
%53 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i64 10, i64 1, i32* %27)
%54 = tail call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), i64 13, i64 1, i32* %27)
%55 = load i32, i32* @SEEK_END
%56 = tail call i32 @fseek(i32* %14, i32 0, i32 %55)
%57 = tail call i32 @ftell(i32* %14)
%58 = load i32, i32* @SEEK_SET
%59 = tail call i32 @fseek(i32* %14, i32 0, i32 %58)
%60 = sdiv i32 %57, 16
%61 = and i32 %57, 15
%62 = icmp ne i32 %61, 0
%63 = zext i1 %62 to i32
%64 = add nsw i32 %60, %63
%65 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.20, i64 0, i64 0), i32 %57)
%66 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0), i32 %64)
%67 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0), i32 %64)
%68 = tail call i32 @fputc(i32 10, i32* %27)
%69 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.24, i64 0, i64 0), i64 30, i64 1, i32* %27)
%70 = icmp sgt i32 %64, 1
br i1 %70, label %71, label %162
71: ; preds = %37
%72 = add nsw i32 %64, -1
%73 = mul nsw i32 %72, -16
br label %74
74: ; preds = %71, %74
%75 = phi i32 [ %158, %74 ], [ 0, %71 ]
%76 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.25, i64 0, i64 0), i32 %75)
%77 = tail call signext i8 @fgetc(i32* %14)
%78 = sext i8 %77 to i32
%79 = icmp slt i8 %77, 16
%80 = select i1 %79, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%81 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %80, i32 %78)
%82 = tail call signext i8 @fgetc(i32* %14)
%83 = sext i8 %82 to i32
%84 = icmp slt i8 %82, 16
%85 = select i1 %84, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%86 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %85, i32 %83)
%87 = tail call signext i8 @fgetc(i32* %14)
%88 = sext i8 %87 to i32
%89 = icmp slt i8 %87, 16
%90 = select i1 %89, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%91 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %90, i32 %88)
%92 = tail call signext i8 @fgetc(i32* %14)
%93 = sext i8 %92 to i32
%94 = icmp slt i8 %92, 16
%95 = select i1 %94, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%96 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %95, i32 %93)
%97 = tail call signext i8 @fgetc(i32* %14)
%98 = sext i8 %97 to i32
%99 = icmp slt i8 %97, 16
%100 = select i1 %99, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%101 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %100, i32 %98)
%102 = tail call signext i8 @fgetc(i32* %14)
%103 = sext i8 %102 to i32
%104 = icmp slt i8 %102, 16
%105 = select i1 %104, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%106 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %105, i32 %103)
%107 = tail call signext i8 @fgetc(i32* %14)
%108 = sext i8 %107 to i32
%109 = icmp slt i8 %107, 16
%110 = select i1 %109, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%111 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %110, i32 %108)
%112 = tail call signext i8 @fgetc(i32* %14)
%113 = sext i8 %112 to i32
%114 = icmp slt i8 %112, 16
%115 = select i1 %114, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%116 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %115, i32 %113)
%117 = tail call signext i8 @fgetc(i32* %14)
%118 = sext i8 %117 to i32
%119 = icmp slt i8 %117, 16
%120 = select i1 %119, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%121 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %120, i32 %118)
%122 = tail call signext i8 @fgetc(i32* %14)
%123 = sext i8 %122 to i32
%124 = icmp slt i8 %122, 16
%125 = select i1 %124, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%126 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %125, i32 %123)
%127 = tail call signext i8 @fgetc(i32* %14)
%128 = sext i8 %127 to i32
%129 = icmp slt i8 %127, 16
%130 = select i1 %129, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%131 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %130, i32 %128)
%132 = tail call signext i8 @fgetc(i32* %14)
%133 = sext i8 %132 to i32
%134 = icmp slt i8 %132, 16
%135 = select i1 %134, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%136 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %135, i32 %133)
%137 = tail call signext i8 @fgetc(i32* %14)
%138 = sext i8 %137 to i32
%139 = icmp slt i8 %137, 16
%140 = select i1 %139, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%141 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %140, i32 %138)
%142 = tail call signext i8 @fgetc(i32* %14)
%143 = sext i8 %142 to i32
%144 = icmp slt i8 %142, 16
%145 = select i1 %144, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%146 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %145, i32 %143)
%147 = tail call signext i8 @fgetc(i32* %14)
%148 = sext i8 %147 to i32
%149 = icmp slt i8 %147, 16
%150 = select i1 %149, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%151 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %150, i32 %148)
%152 = tail call signext i8 @fgetc(i32* %14)
%153 = sext i8 %152 to i32
%154 = icmp slt i8 %152, 16
%155 = select i1 %154, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%156 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %155, i32 %153)
%157 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i64 0, i64 0), i64 3, i64 1, i32* %27)
%158 = add nuw nsw i32 %75, 1
%159 = icmp eq i32 %158, %72
br i1 %159, label %160, label %74
160: ; preds = %74
%161 = add i32 %73, %57
br label %162
162: ; preds = %160, %37
%163 = phi i32 [ %57, %37 ], [ %161, %160 ]
%164 = phi i32 [ 0, %37 ], [ %72, %160 ]
%165 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.25, i64 0, i64 0), i32 %164)
%166 = icmp eq i32 %163, 0
br i1 %166, label %176, label %167
167: ; preds = %162, %167
%168 = phi i32 [ %174, %167 ], [ %163, %162 ]
%169 = tail call signext i8 @fgetc(i32* %14)
%170 = sext i8 %169 to i32
%171 = icmp slt i8 %169, 16
%172 = select i1 %171, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.27, i64 0, i64 0)
%173 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* %172, i32 %170)
%174 = add nsw i32 %168, -1
%175 = icmp eq i32 %174, 0
br i1 %175, label %176, label %167
176: ; preds = %167, %162
%177 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i64 0, i64 0), i64 3, i64 1, i32* %27)
%178 = tail call i32 @fputc(i32 10, i32* %27)
%179 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.29, i64 0, i64 0), i64 31, i64 1, i32* %27)
%180 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.30, i64 0, i64 0), i64 30, i64 1, i32* %27)
%181 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.31, i64 0, i64 0), i32 16)
%182 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.32, i64 0, i64 0), i32 16)
%183 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.33, i64 0, i64 0), i64 3, i64 1, i32* %27)
%184 = tail call i32 @fputc(i32 10, i32* %27)
%185 = tail call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.34, i64 0, i64 0), i64 28, i64 1, i32* %27)
%186 = tail call i64 @fwrite(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.35, i64 0, i64 0), i64 44, i64 1, i32* %27)
%187 = tail call i32 @fputc(i32 10, i32* %27)
%188 = tail call i64 @fwrite(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.36, i64 0, i64 0), i64 48, i64 1, i32* %27)
%189 = tail call i64 @fwrite(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.37, i64 0, i64 0), i64 47, i64 1, i32* %27)
%190 = tail call i64 @fwrite(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.38, i64 0, i64 0), i64 39, i64 1, i32* %27)
%191 = tail call i32 @fputc(i32 10, i32* %27)
%192 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.39, i64 0, i64 0), i64 14, i64 1, i32* %27)
%193 = tail call i64 @fwrite(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.40, i64 0, i64 0), i64 51, i64 1, i32* %27)
%194 = tail call i64 @fwrite(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.41, i64 0, i64 0), i64 59, i64 1, i32* %27)
%195 = tail call i32 @fputc(i32 10, i32* %27)
%196 = tail call i64 @fwrite(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.42, i64 0, i64 0), i64 34, i64 1, i32* %27)
%197 = tail call i64 @fwrite(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.43, i64 0, i64 0), i64 36, i64 1, i32* %27)
%198 = tail call i32 @fputc(i32 10, i32* %27)
%199 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.44, i64 0, i64 0), i64 15, i64 1, i32* %27)
%200 = tail call i32 @fputc(i32 10, i32* %27)
%201 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.45, i64 0, i64 0), i64 2, i64 1, i32* %27)
%202 = tail call i32 @fclose(i32* %14)
%203 = tail call i32 @fclose(i32* %27)
ret void
}