#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int convertNIB2DDL(char *source, char *target, int insertSync) {
  FILE *fpi;
  FILE *fpo;
  int success = 0;
  fpi = fopen(source, "rb");
  if (fpi) {
    fpo = fopen(target, "wt");
    if (fpo) {
      int trackIndex;
      fprintf(fpo, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
      fprintf(fpo, "<!DOCTYPE ddl PUBLIC \"-//DDL//DTD DDL 1.0//EN"
                   "http://www.openemulator.org/DTD/ddl-1.0.dtd\">\n");
      fprintf(fpo, "<ddl version=\"1.0\" creator=\"nib2ddl 1.0\" label=\"\" "
                   "description=\"\" medium=\"5.25 inch disk\" "
                   "tracksPerInch=\"48\" writeEnabled=\"1\">\n");
      for (trackIndex = 0; trackIndex < 35; trackIndex++) {
        unsigned char data[6656];
        fprintf(fpo, "<track index=\"%d\">\n", trackIndex);
        fprintf(fpo, "<side index=\"0\">\n");
        fprintf(fpo, "<data>\n");
        if (fread(data, 6656, 1, fpi)) {
          int i;
          int horizIndex = 0;
          int inData = 0;
          int linebreak = 1;
          int insertSectorInfo = 0;
          int sectorIndex;
          for (i = 0; i < 6656; i++) {
            if (!inData) {
              if ((data[(i + 0) % 6656] == 0xd5) &&
                  (data[(i + 1) % 6656] == 0xaa) &&
                  ((data[(i + 2) % 6656] == 0x96) ||
                   (data[(i + 2) % 6656] == 0xb5) ||
                   (data[(i + 2) % 6656] == 0xad))) {
                inData = 1;
                if (horizIndex)
                  horizIndex = 16;
                linebreak = 1;
                if (data[(i + 2) % 6656] != 0xad) {
                  insertSectorInfo = 1;
                  sectorIndex = (data[(i + 7) % 6656] << 1) | 0x01;
                  sectorIndex &= data[(i + 8) % 6656];
                }
              }
            } else {
              if ((data[(6656 + i - 3) % 6656] == 0xde) &&
                  (data[(6656 + i - 2) % 6656] == 0xaa)) {
                inData = 0;
                if (horizIndex)
                  horizIndex = 16;
                linebreak = 1;
              }
            }
            if ((horizIndex >= 16) ||
                (insertSync && !inData && (horizIndex >= 8))) {
              horizIndex = 0;
              fprintf(fpo, "\n");
            }
            if (linebreak) {
              horizIndex = 0;
              linebreak = 0;
              fprintf(fpo, "\n");
            }
            if (insertSectorInfo) {
              insertSectorInfo = 0;
              fprintf(fpo, "<!-- Track %d Sector %d -->\n\n", trackIndex,
                      sectorIndex);
            }
            if (horizIndex)
              fprintf(fpo, " ");
            fprintf(fpo, "%02x", data[i]);
            if (insertSync && !inData)
              fprintf(fpo, "--");
            horizIndex++;
          }
        }
        fprintf(fpo, "\n\n");
        fprintf(fpo, "</data>\n");
        fprintf(fpo, "</side>\n");
        fprintf(fpo, "</track>\n");
      }
      fprintf(fpo, "</ddl>\n");
      fclose(fpo);
    }
    fclose(fpi);
  }
  return success;
}


x86 assembly (clang, -O0):
<convertNIB2DDL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     164c <convertNIB2DDL+0x50c>
mov    -0x10(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1643 <convertNIB2DDL+0x503>
mov    -0x28(%rbp),%rdi
lea    0xe60(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x30(%rbp)
cmpl   $0x23,-0x30(%rbp)
jge    1628 <convertNIB2DDL+0x4e8>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%edx
lea    0xf19(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xf1b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xf1b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
lea    -0x1a30(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1a00,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x0,%rax
je     15d2 <convertNIB2DDL+0x492>
movl   $0x0,-0x1a38(%rbp)
movl   $0x0,-0x1a3c(%rbp)
movl   $0x1,-0x1a40(%rbp)
movl   $0x0,-0x1a44(%rbp)
movl   $0x0,-0x1a34(%rbp)
cmpl   $0x1a00,-0x1a34(%rbp)
jge    15cd <convertNIB2DDL+0x48d>
cmpl   $0x0,-0x1a3c(%rbp)
jne    1407 <convertNIB2DDL+0x2c7>
mov    -0x1a34(%rbp),%eax
add    $0x0,%eax
mov    $0x1a00,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movzbl -0x1a30(%rbp,%rax,1),%eax
ff
cmp    $0xd5,%eax
jne    1402 <convertNIB2DDL+0x2c2>
mov    -0x1a34(%rbp),%eax
add    $0x1,%eax
mov    $0x1a00,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movzbl -0x1a30(%rbp,%rax,1),%eax
ff
cmp    $0xaa,%eax
jne    1402 <convertNIB2DDL+0x2c2>
mov    -0x1a34(%rbp),%eax
add    $0x2,%eax
mov    $0x1a00,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movzbl -0x1a30(%rbp,%rax,1),%eax
ff
cmp    $0x96,%eax
je     1351 <convertNIB2DDL+0x211>
mov    -0x1a34(%rbp),%eax
add    $0x2,%eax
mov    $0x1a00,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movzbl -0x1a30(%rbp,%rax,1),%eax
ff
cmp    $0xb5,%eax
je     1351 <convertNIB2DDL+0x211>
mov    -0x1a34(%rbp),%eax
add    $0x2,%eax
mov    $0x1a00,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movzbl -0x1a30(%rbp,%rax,1),%eax
ff
cmp    $0xad,%eax
jne    1402 <convertNIB2DDL+0x2c2>
movl   $0x1,-0x1a3c(%rbp)
cmpl   $0x0,-0x1a38(%rbp)
je     1372 <convertNIB2DDL+0x232>
movl   $0x10,-0x1a38(%rbp)
movl   $0x1,-0x1a40(%rbp)
mov    -0x1a34(%rbp),%eax
add    $0x2,%eax
mov    $0x1a00,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movzbl -0x1a30(%rbp,%rax,1),%eax
ff
cmp    $0xad,%eax
je     13fd <convertNIB2DDL+0x2bd>
movl   $0x1,-0x1a44(%rbp)
mov    -0x1a34(%rbp),%eax
add    $0x7,%eax
mov    $0x1a00,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movzbl -0x1a30(%rbp,%rax,1),%eax
ff
shl    $0x1,%eax
or     $0x1,%eax
mov    %eax,-0x1a48(%rbp)
mov    -0x1a34(%rbp),%eax
add    $0x8,%eax
mov    $0x1a00,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movzbl -0x1a30(%rbp,%rax,1),%eax
ff
and    -0x1a48(%rbp),%eax
mov    %eax,-0x1a48(%rbp)
jmp    1402 <convertNIB2DDL+0x2c2>
jmp    148f <convertNIB2DDL+0x34f>
mov    -0x1a34(%rbp),%eax
add    $0x1a00,%eax
sub    $0x3,%eax
mov    $0x1a00,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movzbl -0x1a30(%rbp,%rax,1),%eax
ff
cmp    $0xde,%eax
jne    148a <convertNIB2DDL+0x34a>
mov    -0x1a34(%rbp),%eax
add    $0x1a00,%eax
sub    $0x2,%eax
mov    $0x1a00,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movzbl -0x1a30(%rbp,%rax,1),%eax
ff
cmp    $0xaa,%eax
jne    148a <convertNIB2DDL+0x34a>
movl   $0x0,-0x1a3c(%rbp)
cmpl   $0x0,-0x1a38(%rbp)
je     1480 <convertNIB2DDL+0x340>
movl   $0x10,-0x1a38(%rbp)
movl   $0x1,-0x1a40(%rbp)
jmp    148f <convertNIB2DDL+0x34f>
cmpl   $0x10,-0x1a38(%rbp)
jge    14c0 <convertNIB2DDL+0x380>
cmpl   $0x0,-0x14(%rbp)
je     14dc <convertNIB2DDL+0x39c>
cmpl   $0x0,-0x1a3c(%rbp)
jne    14dc <convertNIB2DDL+0x39c>
cmpl   $0x8,-0x1a38(%rbp)
jl     14dc <convertNIB2DDL+0x39c>
movl   $0x0,-0x1a38(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xc7e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmpl   $0x0,-0x1a40(%rbp)
je     150f <convertNIB2DDL+0x3cf>
movl   $0x0,-0x1a38(%rbp)
movl   $0x0,-0x1a40(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xc4b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmpl   $0x0,-0x1a44(%rbp)
je     1541 <convertNIB2DDL+0x401>
movl   $0x0,-0x1a44(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%edx
mov    -0x1a48(%rbp),%ecx
lea    0xbfd(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmpl   $0x0,-0x1a38(%rbp)
je     1560 <convertNIB2DDL+0x420>
mov    -0x28(%rbp),%rdi
lea    0xbfc(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
movslq -0x1a34(%rbp),%rax
movzbl -0x1a30(%rbp,%rax,1),%edx
ff
lea    0xbdd(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     15aa <convertNIB2DDL+0x46a>
cmpl   $0x0,-0x1a3c(%rbp)
jne    15aa <convertNIB2DDL+0x46a>
mov    -0x28(%rbp),%rdi
lea    0xbb9(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x1a38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a38(%rbp)
mov    -0x1a34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a34(%rbp)
jmp    1271 <convertNIB2DDL+0x131>
jmp    15d2 <convertNIB2DDL+0x492>
mov    -0x28(%rbp),%rdi
lea    0xb75(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xb70(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xb67(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xb5e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11d8 <convertNIB2DDL+0x98>
mov    -0x28(%rbp),%rdi
lea    0xb48(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x2c(%rbp),%eax
add    $0x1a50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertNIB2DDL>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a68,%rsp
mov    %edx,0x14(%rsp)
mov    %rsi,%rbx
lea    0xe81(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x30(%rsp)
test   %rax,%rax
je     16d6 <convertNIB2DDL+0x576>
lea    0xe6a(%rip),%rsi
mov    %rbx,%rdi
call   1070 <fopen@plt>
test   %rax,%rax
je     16cc <convertNIB2DDL+0x56c>
mov    %rax,%r14
lea    0xe52(%rip),%rdi
mov    $0x27,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1080 <fwrite@plt>
lea    0xe61(%rip),%rdi
mov    $0x5b,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0xea4(%rip),%rdi
mov    $0x7e,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
xor    %ebx,%ebx
mov    %r14,0x18(%rsp)
jmp    1284 <convertNIB2DDL+0x124>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xf31(%rip),%rdi
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    $0x8,%esi
mov    $0x1,%edx
lea    0xf23(%rip),%rdi
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    $0x8,%esi
mov    $0x1,%edx
lea    0xf13(%rip),%rdi
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    $0x9,%esi
mov    $0x1,%edx
lea    0xf03(%rip),%rdi
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    0x10(%rsp),%ebx
add    $0x1,%ebx
cmp    $0x23,%ebx
je     16ab <convertNIB2DDL+0x54b>
mov    %r14,%rdi
lea    0xe7b(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x11,%esi
mov    $0x1,%edx
lea    0xe75(%rip),%rdi
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    $0x7,%esi
mov    $0x1,%edx
lea    0xe6e(%rip),%rdi
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x60(%rsp),%rdi
mov    $0x1a00,%esi
mov    $0x1,%edx
mov    0x30(%rsp),%rcx
call   1030 <fread@plt>
test   %rax,%rax
mov    %ebx,0x10(%rsp)
je     1210 <convertNIB2DDL+0xb0>
xor    %ebp,%ebp
mov    $0x1,%r12d
mov    $0x19fe,%r10d
mov    $0x19fd,%r11d
mov    $0x1,%esi
mov    $0x2,%ebx
mov    $0x7,%r15d
mov    $0x8,%r9d
movl   $0x0,(%rsp)
movl   $0x0,0x4(%rsp)
jmp    1381 <convertNIB2DDL+0x221>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebx,0x4(%rsp)
mov    0x20(%rsp),%rbp
add    $0x1,%rbp
mov    0x38(%rsp),%r10
add    $0x1,%r10
mov    0x58(%rsp),%r11
add    $0x1,%r11
mov    0x50(%rsp),%rsi
add    $0x1,%rsi
mov    0x48(%rsp),%rbx
add    $0x1,%rbx
add    $0x1,%r15
mov    0x40(%rsp),%r9
add    $0x1,%r9
xor    %r12d,%r12d
cmp    $0x1a00,%rbp
je     1210 <convertNIB2DDL+0xb0>
mov    %r10,%rax
movabs $0x4ec4ec4ec4ec4ec5,%rdi
ec c4 4e
mul    %rdi
mov    %rdx,%r8
mov    %r11,%rax
mul    %rdi
mov    %rdx,%r13
mov    %rbp,%rax
mul    %rdi
mov    %rdx,%r14
mov    %rsi,0x50(%rsp)
mov    %rsi,%rax
mul    %rdi
mov    %rdx,%rcx
mov    %rbx,0x48(%rsp)
mov    %rbx,%rax
mul    %rdi
mov    %rdx,%rsi
mov    %r15,0x8(%rsp)
mov    %r15,%rax
mul    %rdi
mov    %rdx,%rbx
mov    %r9,0x40(%rsp)
mov    %r9,%rax
mul    %rdi
cmpl   $0x0,(%rsp)
mov    %r11,0x58(%rsp)
mov    %r10,0x38(%rsp)
mov    %rbp,0x20(%rsp)
je     1470 <convertNIB2DDL+0x310>
shr    $0xb,%r13
imul   $0xffffffffffffe600,%r13,%rax
lea    0x1a5d(%rsp),%rcx
add    %rcx,%rax
mov    $0x1,%r13b
cmpb   $0xde,(%rax,%rbp,1)
jne    1460 <convertNIB2DDL+0x300>
shr    $0xb,%r8
imul   $0xffffffffffffe600,%r8,%rax
lea    0x1a5e(%rsp),%rcx
add    %rcx,%rax
cmpb   $0xaa,(%rax,%rbp,1)
jne    1460 <convertNIB2DDL+0x300>
cmpl   $0x0,0x4(%rsp)
je     153d <convertNIB2DDL+0x3dd>
movl   $0x0,(%rsp)
mov    $0x1,%r12d
mov    $0x1,%r14b
xor    %r13d,%r13d
mov    0x8(%rsp),%r15
jmp    15c7 <convertNIB2DDL+0x467>
nopw   0x0(%rax,%rax,1)
movl   $0x1,(%rsp)
mov    $0x1,%dil
jmp    1527 <convertNIB2DDL+0x3c7>
nop
shr    $0xb,%r14
imul   $0xffffffffffffe600,%r14,%rax
add    %rsp,%rax
add    $0x60,%rax
mov    $0x1,%dil
xor    %r13d,%r13d
cmpb   $0xd5,(%rax,%rbp,1)
jne    1520 <convertNIB2DDL+0x3c0>
shr    $0xb,%rcx
imul   $0xffffffffffffe600,%rcx,%rax
lea    0x61(%rsp),%rcx
add    %rcx,%rax
xor    %r13d,%r13d
cmpb   $0xaa,(%rax,%rbp,1)
jne    1520 <convertNIB2DDL+0x3c0>
shr    $0xb,%rsi
imul   $0xffffffffffffe600,%rsi,%rax
lea    0x62(%rsp),%rcx
add    %rcx,%rax
movzbl (%rax,%rbp,1),%eax
xor    %r13d,%r13d
lea    0x6a(%rax),%ecx
cmp    $0x1f,%cl
ja     1520 <convertNIB2DDL+0x3c0>
movzbl %cl,%ecx
mov    $0x80800001,%esi
bt     %rcx,%rsi
mov    0x8(%rsp),%r15
jae    169f <convertNIB2DDL+0x53f>
mov    %rbx,%rbp
xor    %ecx,%ecx
cmpl   $0x0,0x4(%rsp)
setne  %cl
mov    %ecx,%ebx
shl    $0x4,%ebx
movl   $0x1,(%rsp)
mov    $0x1,%r13b
cmp    $0xad,%al
jne    155d <convertNIB2DDL+0x3fd>
mov    $0x1,%r12d
mov    $0x1,%dil
cmp    $0xf,%ebx
jle    15b0 <convertNIB2DDL+0x450>
jmp    1535 <convertNIB2DDL+0x3d5>
nopl   0x0(%rax,%rax,1)
movl   $0x0,(%rsp)
mov    0x8(%rsp),%r15
mov    0x4(%rsp),%ebx
cmp    $0xf,%ebx
jle    15b0 <convertNIB2DDL+0x450>
mov    %edi,%r14d
jmp    15c7 <convertNIB2DDL+0x467>
movl   $0x0,(%rsp)
mov    $0xa,%edi
xor    %r13d,%r13d
mov    0x18(%rsp),%r14
mov    0x8(%rsp),%r15
xor    %ebx,%ebx
jmp    163c <convertNIB2DDL+0x4dc>
shr    $0xb,%rbp
imul   $0xffffffffffffe600,%rbp,%rax
lea    0x67(%rsp),%rcx
add    %rcx,%rax
shr    $0xb,%rdx
imul   $0xffffffffffffe600,%rdx,%rcx
lea    0x68(%rsp),%rdx
add    %rdx,%rcx
mov    0x20(%rsp),%rdx
movzbl (%rax,%rdx,1),%eax
add    %eax,%eax
add    $0x1,%eax
movzbl (%rcx,%rdx,1),%ecx
and    %eax,%ecx
mov    %ecx,0x2c(%rsp)
xor    %edi,%edi
mov    $0x1,%r12d
cmp    $0xf,%ebx
jg     1535 <convertNIB2DDL+0x3d5>
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,0x14(%rsp)
sete   %al
or     %r13b,%al
cmp    $0x1,%al
je     15fb <convertNIB2DDL+0x49b>
cmp    $0x8,%ebx
mov    %edi,%r14d
jl     15d8 <convertNIB2DDL+0x478>
mov    $0xa,%edi
mov    0x18(%rsp),%rsi
call   1050 <fputc@plt>
xor    %ebx,%ebx
test   %r12d,%r12d
je     1610 <convertNIB2DDL+0x4b0>
mov    $0xa,%edi
mov    0x18(%rsp),%rbp
mov    %rbp,%rsi
call   1050 <fputc@plt>
xor    %ebx,%ebx
test   %r14b,%r14b
mov    %rbp,%r14
je     161a <convertNIB2DDL+0x4ba>
jmp    1652 <convertNIB2DDL+0x4f2>
mov    %edi,%r14d
test   %r12d,%r12d
jne    15dd <convertNIB2DDL+0x47d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %r14b,%r14b
mov    0x18(%rsp),%r14
jne    1633 <convertNIB2DDL+0x4d3>
mov    %r14,%rdi
lea    0xb13(%rip),%rsi
mov    0x10(%rsp),%edx
mov    0x2c(%rsp),%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x20,%edi
test   %ebx,%ebx
je     1650 <convertNIB2DDL+0x4f0>
mov    %r14,%rsi
call   1050 <fputc@plt>
jmp    1652 <convertNIB2DDL+0x4f2>
cs nopw 0x0(%rax,%rax,1)
xor    %ebx,%ebx
mov    0x20(%rsp),%rax
movzbl 0x60(%rsp,%rax,1),%edx
mov    %r14,%rdi
lea    0xaef(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
cmpl   $0x0,0x14(%rsp)
je     1330 <convertNIB2DDL+0x1d0>
test   %r13b,%r13b
jne    1330 <convertNIB2DDL+0x1d0>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xac8(%rip),%rdi
mov    %r14,%rcx
call   1080 <fwrite@plt>
jmp    1330 <convertNIB2DDL+0x1d0>
movl   $0x0,(%rsp)
jmp    152c <convertNIB2DDL+0x3cc>
lea    0xac7(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    0x30(%rsp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x1a68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [3 x i8] c"wt\00"
@.str.2 = [40 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A\00"
@.str.3 = [92 x i8] c"<!DOCTYPE ddl PUBLIC \22-//DDL//DTD DDL 1.0//ENhttp://www.openemulator.org/DTD/ddl-1.0.dtd\22>\0A\00"
@.str.4 = [127 x i8] c"<ddl version=\221.0\22 creator=\22nib2ddl 1.0\22 label=\22\22 description=\22\22 medium=\225.25 inch disk\22 tracksPerInch=\2248\22 writeEnabled=\221\22>\0A\00"
@.str.5 = [20 x i8] c"<track index=\22%d\22>\0A\00"
@.str.6 = [18 x i8] c"<side index=\220\22>\0A\00"
@.str.7 = [8 x i8] c"<data>\0A\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [30 x i8] c"<!-- Track %d Sector %d -->\0A\0A\00"
@.str.10 = [2 x i8] c" \00"
@.str.11 = [5 x i8] c"%02x\00"
@.str.12 = [3 x i8] c"--\00"
@.str.13 = [3 x i8] c"\0A\0A\00"
@.str.14 = [9 x i8] c"</data>\0A\00"
@.str.15 = [9 x i8] c"</side>\0A\00"
@.str.16 = [10 x i8] c"</track>\0A\00"
@.str.17 = [8 x i8] c"</ddl>\0A\00"
define i32 @convertNIB2DDL(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca [6656 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %9
%18 = load i8*, i8** %4
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %19, i32** %7
%20 = load i32*, i32** %7
%21 = icmp ne i32* %20, null
br i1 %21, label %22, label %239
22: ; preds = %3
%23 = load i8*, i8** %5
%24 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %24, i32** %8
%25 = load i32*, i32** %8
%26 = icmp ne i32* %25, null
br i1 %26, label %27, label %236
27: ; preds = %22
%28 = load i32*, i32** %8
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%30 = load i32*, i32** %8
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.3, i64 0, i64 0))
%32 = load i32*, i32** %8
%33 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %10
br label %34
34: ; preds = %228, %27
%35 = load i32, i32* %10
%36 = icmp slt i32 %35, 35
br i1 %36, label %37, label %231
37: ; preds = %34
%38 = load i32*, i32** %8
%39 = load i32, i32* %10
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %38, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %39)
%41 = load i32*, i32** %8
%42 = call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%43 = load i32*, i32** %8
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %43, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%45 = getelementptr inbounds [6656 x i8], [6656 x i8]* %11, i64 0, i64 0
%46 = load i32*, i32** %7
%47 = call i64 @fread(i8* %45, i32 6656, i32 1, i32* %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %219
49: ; preds = %37
store i32 0, i32* %13
store i32 0, i32* %14
store i32 1, i32* %15
store i32 0, i32* %16
store i32 0, i32* %12
br label %50
50: ; preds = %215, %49
%51 = load i32, i32* %12
%52 = icmp slt i32 %51, 6656
br i1 %52, label %53, label %218
53: ; preds = %50
%54 = load i32, i32* %14
%55 = icmp ne i32 %54, 0
br i1 %55, label %135, label %56
56: ; preds = %53
%57 = load i32, i32* %12
%58 = add nsw i32 %57, 0
%59 = srem i32 %58, 6656
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [6656 x i8], [6656 x i8]* %11, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = icmp eq i32 %63, 213
br i1 %64, label %65, label %134
65: ; preds = %56
%66 = load i32, i32* %12
%67 = add nsw i32 %66, 1
%68 = srem i32 %67, 6656
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [6656 x i8], [6656 x i8]* %11, i64 0, i64 %69
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = icmp eq i32 %72, 170
br i1 %73, label %74, label %134
74: ; preds = %65
%75 = load i32, i32* %12
%76 = add nsw i32 %75, 2
%77 = srem i32 %76, 6656
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [6656 x i8], [6656 x i8]* %11, i64 0, i64 %78
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = icmp eq i32 %81, 150
br i1 %82, label %101, label %83
83: ; preds = %74
%84 = load i32, i32* %12
%85 = add nsw i32 %84, 2
%86 = srem i32 %85, 6656
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [6656 x i8], [6656 x i8]* %11, i64 0, i64 %87
%89 = load i8, i8* %88
%90 = zext i8 %89 to i32
%91 = icmp eq i32 %90, 181
br i1 %91, label %101, label %92
92: ; preds = %83
%93 = load i32, i32* %12
%94 = add nsw i32 %93, 2
%95 = srem i32 %94, 6656
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [6656 x i8], [6656 x i8]* %11, i64 0, i64 %96
%98 = load i8, i8* %97
%99 = zext i8 %98 to i32
%100 = icmp eq i32 %99, 173
br i1 %100, label %101, label %134
101: ; preds = %92, %83, %74
store i32 1, i32* %14
%102 = load i32, i32* %13
%103 = icmp ne i32 %102, 0
br i1 %103, label %104, label %105
104: ; preds = %101
store i32 16, i32* %13
br label %105
105: ; preds = %104, %101
store i32 1, i32* %15
%106 = load i32, i32* %12
%107 = add nsw i32 %106, 2
%108 = srem i32 %107, 6656
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [6656 x i8], [6656 x i8]* %11, i64 0, i64 %109
%111 = load i8, i8* %110
%112 = zext i8 %111 to i32
%113 = icmp ne i32 %112, 173
br i1 %113, label %114, label %133
114: ; preds = %105
store i32 1, i32* %16
%115 = load i32, i32* %12
%116 = add nsw i32 %115, 7
%117 = srem i32 %116, 6656
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [6656 x i8], [6656 x i8]* %11, i64 0, i64 %118
%120 = load i8, i8* %119
%121 = zext i8 %120 to i32
%122 = shl i32 %121, 1
%123 = or i32 %122, 1
store i32 %123, i32* %17
%124 = load i32, i32* %12
%125 = add nsw i32 %124, 8
%126 = srem i32 %125, 6656
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [6656 x i8], [6656 x i8]* %11, i64 0, i64 %127
%129 = load i8, i8* %128
%130 = zext i8 %129 to i32
%131 = load i32, i32* %17
%132 = and i32 %131, %130
store i32 %132, i32* %17
br label %133
133: ; preds = %114, %105
br label %134
134: ; preds = %133, %92, %65, %56
br label %161
135: ; preds = %53
%136 = load i32, i32* %12
%137 = add nsw i32 6656, %136
%138 = sub nsw i32 %137, 3
%139 = srem i32 %138, 6656
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [6656 x i8], [6656 x i8]* %11, i64 0, i64 %140
%142 = load i8, i8* %141
%143 = zext i8 %142 to i32
%144 = icmp eq i32 %143, 222
br i1 %144, label %145, label %160
145: ; preds = %135
%146 = load i32, i32* %12
%147 = add nsw i32 6656, %146
%148 = sub nsw i32 %147, 2
%149 = srem i32 %148, 6656
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [6656 x i8], [6656 x i8]* %11, i64 0, i64 %150
%152 = load i8, i8* %151
%153 = zext i8 %152 to i32
%154 = icmp eq i32 %153, 170
br i1 %154, label %155, label %160
155: ; preds = %145
store i32 0, i32* %14
%156 = load i32, i32* %13
%157 = icmp ne i32 %156, 0
br i1 %157, label %158, label %159
158: ; preds = %155
store i32 16, i32* %13
br label %159
159: ; preds = %158, %155
store i32 1, i32* %15
br label %160
160: ; preds = %159, %145, %135
br label %161
161: ; preds = %160, %134
%162 = load i32, i32* %13
%163 = icmp sge i32 %162, 16
br i1 %163, label %173, label %164
164: ; preds = %161
%165 = load i32, i32* %6
%166 = icmp ne i32 %165, 0
br i1 %166, label %167, label %176
167: ; preds = %164
%168 = load i32, i32* %14
%169 = icmp ne i32 %168, 0
br i1 %169, label %176, label %170
170: ; preds = %167
%171 = load i32, i32* %13
%172 = icmp sge i32 %171, 8
br i1 %172, label %173, label %176
173: ; preds = %170, %161
store i32 0, i32* %13
%174 = load i32*, i32** %8
%175 = call i32 (i32*, i8*, ...) @fprintf(i32* %174, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %176
176: ; preds = %173, %170, %167, %164
%177 = load i32, i32* %15
%178 = icmp ne i32 %177, 0
br i1 %178, label %179, label %182
179: ; preds = %176
store i32 0, i32* %13
store i32 0, i32* %15
%180 = load i32*, i32** %8
%181 = call i32 (i32*, i8*, ...) @fprintf(i32* %180, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %182
182: ; preds = %179, %176
%183 = load i32, i32* %16
%184 = icmp ne i32 %183, 0
br i1 %184, label %185, label %190
185: ; preds = %182
store i32 0, i32* %16
%186 = load i32*, i32** %8
%187 = load i32, i32* %10
%188 = load i32, i32* %17
%189 = call i32 (i32*, i8*, ...) @fprintf(i32* %186, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %187, i32 %188)
br label %190
190: ; preds = %185, %182
%191 = load i32, i32* %13
%192 = icmp ne i32 %191, 0
br i1 %192, label %193, label %196
193: ; preds = %190
%194 = load i32*, i32** %8
%195 = call i32 (i32*, i8*, ...) @fprintf(i32* %194, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %196
196: ; preds = %193, %190
%197 = load i32*, i32** %8
%198 = load i32, i32* %12
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds [6656 x i8], [6656 x i8]* %11, i64 0, i64 %199
%201 = load i8, i8* %200
%202 = zext i8 %201 to i32
%203 = call i32 (i32*, i8*, ...) @fprintf(i32* %197, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 %202)
%204 = load i32, i32* %6
%205 = icmp ne i32 %204, 0
br i1 %205, label %206, label %212
206: ; preds = %196
%207 = load i32, i32* %14
%208 = icmp ne i32 %207, 0
br i1 %208, label %212, label %209
209: ; preds = %206
%210 = load i32*, i32** %8
%211 = call i32 (i32*, i8*, ...) @fprintf(i32* %210, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %212
212: ; preds = %209, %206, %196
%213 = load i32, i32* %13
%214 = add nsw i32 %213, 1
store i32 %214, i32* %13
br label %215
215: ; preds = %212
%216 = load i32, i32* %12
%217 = add nsw i32 %216, 1
store i32 %217, i32* %12
br label %50
218: ; preds = %50
br label %219
219: ; preds = %218, %37
%220 = load i32*, i32** %8
%221 = call i32 (i32*, i8*, ...) @fprintf(i32* %220, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%222 = load i32*, i32** %8
%223 = call i32 (i32*, i8*, ...) @fprintf(i32* %222, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
%224 = load i32*, i32** %8
%225 = call i32 (i32*, i8*, ...) @fprintf(i32* %224, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%226 = load i32*, i32** %8
%227 = call i32 (i32*, i8*, ...) @fprintf(i32* %226, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0))
br label %228
228: ; preds = %219
%229 = load i32, i32* %10
%230 = add nsw i32 %229, 1
store i32 %230, i32* %10
br label %34
231: ; preds = %34
%232 = load i32*, i32** %8
%233 = call i32 (i32*, i8*, ...) @fprintf(i32* %232, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%234 = load i32*, i32** %8
%235 = call i32 @fclose(i32* %234)
br label %236
236: ; preds = %231, %22
%237 = load i32*, i32** %7
%238 = call i32 @fclose(i32* %237)
br label %239
239: ; preds = %236, %3
%240 = load i32, i32* %9
ret i32 %240
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@.str.1 = [3 x i8] c"wt\00"
@.str.2 = [40 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A\00"
@.str.3 = [92 x i8] c"<!DOCTYPE ddl PUBLIC \22-//DDL//DTD DDL 1.0//ENhttp://www.openemulator.org/DTD/ddl-1.0.dtd\22>\0A\00"
@.str.4 = [127 x i8] c"<ddl version=\221.0\22 creator=\22nib2ddl 1.0\22 label=\22\22 description=\22\22 medium=\225.25 inch disk\22 tracksPerInch=\2248\22 writeEnabled=\221\22>\0A\00"
@.str.5 = [20 x i8] c"<track index=\22%d\22>\0A\00"
@.str.6 = [18 x i8] c"<side index=\220\22>\0A\00"
@.str.7 = [8 x i8] c"<data>\0A\00"
@.str.9 = [30 x i8] c"<!-- Track %d Sector %d -->\0A\0A\00"
@.str.11 = [5 x i8] c"%02x\00"
@.str.12 = [3 x i8] c"--\00"
@.str.13 = [3 x i8] c"\0A\0A\00"
@.str.14 = [9 x i8] c"</data>\0A\00"
@.str.15 = [9 x i8] c"</side>\0A\00"
@.str.16 = [10 x i8] c"</track>\0A\00"
@.str.17 = [8 x i8] c"</ddl>\0A\00"
define i32 @convertNIB2DDL(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = alloca [6656 x i8]
%5 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %160, label %7
7: ; preds = %3
%8 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %158, label %10
10: ; preds = %7
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i64 39, i64 1, i32* %8)
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.3, i64 0, i64 0), i64 91, i64 1, i32* %8)
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.4, i64 0, i64 0), i64 126, i64 1, i32* %8)
%14 = getelementptr inbounds [6656 x i8], [6656 x i8]* %4, i64 0, i64 0
%15 = icmp eq i32 %2, 0
br label %16
16: ; preds = %10, %147
%17 = phi i32 [ undef, %10 ], [ %148, %147 ]
%18 = phi i32 [ 0, %10 ], [ %153, %147 ]
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %18)
%20 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i64 17, i64 1, i32* %8)
%21 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i64 7, i64 1, i32* %8)
%22 = call i64 @fread(i8* %14, i32 6656, i32 1, i32* %5)
%23 = icmp eq i64 %22, 0
br i1 %23, label %147, label %24
24: ; preds = %16, %143
%25 = phi i64 [ %145, %143 ], [ 0, %16 ]
%26 = phi i32 [ %132, %143 ], [ %17, %16 ]
%27 = phi i32 [ 0, %143 ], [ 1, %16 ]
%28 = phi i32 [ %134, %143 ], [ 0, %16 ]
%29 = phi i32 [ %144, %143 ], [ 0, %16 ]
%30 = icmp eq i32 %28, 0
%31 = trunc i64 %25 to i16
br i1 %30, label %32, label %71
32: ; preds = %24
%33 = urem i16 %31, 6656
%34 = zext i16 %33 to i64
%35 = getelementptr inbounds [6656 x i8], [6656 x i8]* %4, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = icmp eq i8 %36, -43
br i1 %37, label %38, label %87
38: ; preds = %32
%39 = add i16 %31, 1
%40 = urem i16 %39, 6656
%41 = zext i16 %40 to i64
%42 = getelementptr inbounds [6656 x i8], [6656 x i8]* %4, i64 0, i64 %41
%43 = load i8, i8* %42
%44 = icmp eq i8 %43, -86
br i1 %44, label %45, label %87
45: ; preds = %38
%46 = add i16 %31, 2
%47 = urem i16 %46, 6656
%48 = zext i16 %47 to i64
%49 = getelementptr inbounds [6656 x i8], [6656 x i8]* %4, i64 0, i64 %48
%50 = load i8, i8* %49
switch i8 %50, label %87 [
i8 -106, label %51
i8 -75, label %51
i8 -83, label %51
]
51: ; preds = %45, %45, %45
%52 = icmp eq i32 %29, 0
%53 = select i1 %52, i32 0, i32 16
%54 = icmp eq i8 %50, -83
br i1 %54, label %87, label %55
55: ; preds = %51
%56 = add i16 %31, 7
%57 = urem i16 %56, 6656
%58 = zext i16 %57 to i64
%59 = getelementptr inbounds [6656 x i8], [6656 x i8]* %4, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = shl nuw nsw i32 %61, 1
%63 = or i32 %62, 1
%64 = add i16 %31, 8
%65 = urem i16 %64, 6656
%66 = zext i16 %65 to i64
%67 = getelementptr inbounds [6656 x i8], [6656 x i8]* %4, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = zext i8 %68 to i32
%70 = and i32 %63, %69
br label %87
71: ; preds = %24
%72 = add i16 %31, 6653
%73 = urem i16 %72, 6656
%74 = zext i16 %73 to i64
%75 = getelementptr inbounds [6656 x i8], [6656 x i8]* %4, i64 0, i64 %74
%76 = load i8, i8* %75
%77 = icmp eq i8 %76, -34
br i1 %77, label %78, label %87
78: ; preds = %71
%79 = add i16 %31, 6654
%80 = urem i16 %79, 6656
%81 = zext i16 %80 to i64
%82 = getelementptr inbounds [6656 x i8], [6656 x i8]* %4, i64 0, i64 %81
%83 = load i8, i8* %82
%84 = icmp eq i8 %83, -86
br i1 %84, label %85, label %87
85: ; preds = %78
%86 = icmp eq i32 %29, 0
br i1 %86, label %124, label %100
87: ; preds = %45, %71, %78, %32, %38, %55, %51
%88 = phi i32 [ %29, %78 ], [ %29, %71 ], [ %53, %55 ], [ %53, %51 ], [ %29, %38 ], [ %29, %32 ], [ %29, %45 ]
%89 = phi i1 [ true, %78 ], [ true, %71 ], [ true, %55 ], [ true, %51 ], [ false, %38 ], [ false, %32 ], [ false, %45 ]
%90 = phi i32 [ 1, %78 ], [ 1, %71 ], [ 1, %55 ], [ 1, %51 ], [ 0, %38 ], [ 0, %32 ], [ 0, %45 ]
%91 = phi i32 [ %27, %78 ], [ %27, %71 ], [ 1, %55 ], [ 1, %51 ], [ %27, %38 ], [ %27, %32 ], [ %27, %45 ]
%92 = phi i1 [ true, %78 ], [ true, %71 ], [ false, %55 ], [ true, %51 ], [ true, %38 ], [ true, %32 ], [ true, %45 ]
%93 = phi i32 [ %26, %78 ], [ %26, %71 ], [ %70, %55 ], [ %26, %51 ], [ %26, %38 ], [ %26, %32 ], [ %26, %45 ]
%94 = icmp sgt i32 %88, 15
br i1 %94, label %100, label %95
95: ; preds = %87
%96 = or i1 %15, %89
%97 = xor i1 %96, true
%98 = icmp sgt i32 %88, 7
%99 = select i1 %97, i1 %98, i1 false
br i1 %99, label %100, label %107
100: ; preds = %85, %95, %87
%101 = phi i32 [ %93, %95 ], [ %93, %87 ], [ %26, %85 ]
%102 = phi i1 [ %92, %95 ], [ %92, %87 ], [ true, %85 ]
%103 = phi i32 [ %91, %95 ], [ %91, %87 ], [ 1, %85 ]
%104 = phi i32 [ %90, %95 ], [ %90, %87 ], [ 0, %85 ]
%105 = phi i1 [ %89, %95 ], [ %89, %87 ], [ false, %85 ]
%106 = tail call i32 @fputc(i32 10, i32* %8)
br label %107
107: ; preds = %100, %95
%108 = phi i32 [ %101, %100 ], [ %93, %95 ]
%109 = phi i1 [ %102, %100 ], [ %92, %95 ]
%110 = phi i32 [ %103, %100 ], [ %91, %95 ]
%111 = phi i32 [ %104, %100 ], [ %90, %95 ]
%112 = phi i1 [ %105, %100 ], [ %89, %95 ]
%113 = phi i32 [ 0, %100 ], [ %88, %95 ]
%114 = icmp eq i32 %110, 0
br i1 %114, label %117, label %115
115: ; preds = %107
%116 = tail call i32 @fputc(i32 10, i32* %8)
br i1 %109, label %131, label %118
117: ; preds = %107
br i1 %109, label %121, label %118
118: ; preds = %115, %117
%119 = phi i32 [ 0, %115 ], [ %113, %117 ]
%120 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i32 %18, i32 %108)
br label %121
121: ; preds = %118, %117
%122 = phi i32 [ %119, %118 ], [ %113, %117 ]
%123 = icmp eq i32 %122, 0
br i1 %123, label %131, label %124
124: ; preds = %121, %85
%125 = phi i32 [ 10, %85 ], [ 32, %121 ]
%126 = phi i32 [ %26, %85 ], [ %108, %121 ]
%127 = phi i1 [ false, %85 ], [ %112, %121 ]
%128 = phi i32 [ 0, %85 ], [ %111, %121 ]
%129 = phi i32 [ 0, %85 ], [ %122, %121 ]
%130 = tail call i32 @fputc(i32 %125, i32* %8)
br label %131
131: ; preds = %124, %115, %121
%132 = phi i32 [ %108, %121 ], [ %108, %115 ], [ %126, %124 ]
%133 = phi i1 [ %112, %121 ], [ %112, %115 ], [ %127, %124 ]
%134 = phi i32 [ %111, %121 ], [ %111, %115 ], [ %128, %124 ]
%135 = phi i32 [ 0, %121 ], [ 0, %115 ], [ %129, %124 ]
%136 = getelementptr inbounds [6656 x i8], [6656 x i8]* %4, i64 0, i64 %25
%137 = load i8, i8* %136
%138 = zext i8 %137 to i32
%139 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 %138)
%140 = or i1 %15, %133
br i1 %140, label %143, label %141
141: ; preds = %131
%142 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i64 2, i64 1, i32* %8)
br label %143
143: ; preds = %141, %131
%144 = add nsw i32 %135, 1
%145 = add nuw nsw i64 %25, 1
%146 = icmp eq i64 %145, 6656
br i1 %146, label %147, label %24
147: ; preds = %143, %16
%148 = phi i32 [ %17, %16 ], [ %132, %143 ]
%149 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i64 2, i64 1, i32* %8)
%150 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i64 8, i64 1, i32* %8)
%151 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i64 8, i64 1, i32* %8)
%152 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i64 9, i64 1, i32* %8)
%153 = add nuw nsw i32 %18, 1
%154 = icmp eq i32 %153, 35
br i1 %154, label %155, label %16
155: ; preds = %147
%156 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i64 7, i64 1, i32* %8)
%157 = tail call i32 @fclose(i32* %8)
br label %158
158: ; preds = %155, %7
%159 = tail call i32 @fclose(i32* %5)
br label %160
160: ; preds = %158, %3
ret i32 0
}