#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_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int get16bit(char *);
int get32bit(char *);
scalar_t__ memcmp(char *, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *, int, int);
char *strrchr(char *, char);
int main(int argc, char **argv) {
  FILE *infile, *outfile = NULL;
  int channel, chancount, frame, samplerate, size;
  int goround, searchstart, eos = 0;
  int channeltocopy, curaix, nextaix, done, i;
  char buf[0x24], namebase[256], filename[256 + 4];
  char *t;
  printf("AIX2ADX 0.1 by hcs\n");
  if (argc != 2) {
    printf("usage: %s AIXFILE.AIX\n", argv[0]);
    return 1;
  }
  infile = fopen(argv[1], "rb");
  if (!infile) {
    printf("error opening %s\n", argv[1]);
    return 1;
  }
  t = strrchr(argv[1], '\\');
  if (!t)
    t = argv[1];
  else
    t++;
  for (i = 0; t < strrchr(argv[1], '.'); t++, i++)
    namebase[i] = *t;
  namebase[i] = '\0';
  for (goround = 0; goround >= 0; goround++) {
    chancount = -1;
    searchstart = eos;
    for (channeltocopy = 0; chancount < 0 || channeltocopy < chancount;
         channeltocopy++) {
      fseek(infile, searchstart, SEEK_SET);
      curaix = searchstart;
      done = 0;
      while (!done) {
        if (fread(buf, 8, 1, infile) != 1) {
          channeltocopy = chancount = 0;
          goround = -2;
          break;
        }
        if (memcmp(buf, "AIX", 3)) {
          printf("malformed AIX header at %08x (bad signature)\n", curaix);
          return 1;
        }
        nextaix = curaix + 8 + get32bit(buf + 0x4);
        switch (buf[3]) {
        case 'F':
          printf("file header\n");
          break;
        case 'E':
          printf("end of section\n");
          done = 1;
          eos = nextaix;
          break;
        case 'P':
          fread(buf, 8, 1, infile);
          channel = buf[0];
          chancount = buf[1];
          frame = get32bit(buf + 4);
          size = get16bit(buf + 2);
          if (channel == channeltocopy) {
            if (!outfile) {
              sprintf(filename, "%s%02d%03d.adx", namebase, goround, channel);
              outfile = fopen(filename, "wb");
              if (!outfile) {
                printf("error opening %s\n", filename);
                return 1;
              }
            }
            printf("goround #%d\tchannel #%d/%d\tframe #%d\tsize: %#08x\n",
                   goround, channel + 1, chancount, frame, size);
            for (i = 0; i < size; i++) {
              fread(buf, 1, 1, infile);
              fwrite(buf, 1, 1, outfile);
            }
          }
          break;
        default:
          printf("malformed AIX header at %08x (bad type)\n", curaix);
        }
        fseek(infile, nextaix, SEEK_SET);
        curaix = nextaix;
      }
      if (outfile) {
        fclose(outfile);
        outfile = NULL;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x40(%rbp)
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
je     1211 <main+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1670 <main+0x4c0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe0b(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1256 <main+0xa6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1670 <main+0x4c0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x5c,%esi
call   1070 <strrchr@plt>
mov    %rax,-0x298(%rbp)
cmpq   $0x0,-0x298(%rbp)
jne    1291 <main+0xe1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x298(%rbp)
jmp    12a3 <main+0xf3>
mov    -0x298(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x298(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x298(%rbp),%rax
mov    %rax,-0x2a0(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x2e,%esi
call   1070 <strrchr@plt>
mov    %rax,%rcx
mov    -0x2a0(%rbp),%rax
cmp    %rcx,%rax
jae    1311 <main+0x161>
mov    -0x298(%rbp),%rax
mov    (%rax),%cl
movslq -0x54(%rbp),%rax
mov    %cl,-0x180(%rbp,%rax,1)
mov    -0x298(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x298(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    12aa <main+0xfa>
movslq -0x54(%rbp),%rax
movb   $0x0,-0x180(%rbp,%rax,1)
movl   $0x0,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jl     1669 <main+0x4b9>
movl   $0xffffffff,-0x28(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x44(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x28(%rbp)
mov    %al,-0x2a1(%rbp)
jl     1363 <main+0x1b3>
mov    -0x44(%rbp),%eax
cmp    -0x28(%rbp),%eax
setl   %al
mov    %al,-0x2a1(%rbp)
mov    -0x2a1(%rbp),%al
test   $0x1,%al
jne    1376 <main+0x1c6>
jmp    1656 <main+0x4a6>
mov    -0x18(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    0x2c5c(%rip),%rax
mov    (%rax),%edx
call   10a0 <fseek@plt>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x48(%rbp)
movl   $0x0,-0x50(%rbp)
cmpl   $0x0,-0x50(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13ae <main+0x1fe>
jmp    1627 <main+0x477>
lea    -0x80(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     13e8 <main+0x238>
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0xfffffffe,-0x38(%rbp)
jmp    1627 <main+0x477>
lea    -0x80(%rbp),%rdi
lea    0xc4d(%rip),%rsi
mov    $0x3,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%rax
je     1424 <main+0x274>
mov    -0x48(%rbp),%esi
lea    0xc33(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1670 <main+0x4c0>
mov    -0x48(%rbp),%eax
mov    %eax,-0x2ac(%rbp)
lea    -0x7c(%rbp),%rdi
call   1040 <get32bit@plt>
mov    -0x2ac(%rbp),%ecx
mov    %eax,%edx
mov    %ecx,%eax
mov    %edx,%ecx
lea    0x8(%rax,%rcx,1),%eax
mov    %eax,-0x4c(%rbp)
movsbl -0x7d(%rbp),%eax
mov    %eax,-0x2a8(%rbp)
sub    $0x45,%eax
je     149c <main+0x2ec>
jmp    1461 <main+0x2b1>
mov    -0x2a8(%rbp),%eax
sub    $0x46,%eax
je     1489 <main+0x2d9>
jmp    1475 <main+0x2c5>
mov    -0x2a8(%rbp),%eax
sub    $0x50,%eax
je     14bc <main+0x30c>
jmp    15f6 <main+0x446>
lea    0xbe2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1607 <main+0x457>
lea    0xbdc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x50(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    1607 <main+0x457>
lea    -0x80(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movsbl -0x80(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsbl -0x7f(%rbp),%eax
mov    %eax,-0x28(%rbp)
lea    -0x80(%rbp),%rdi
add    $0x4,%rdi
call   1040 <get32bit@plt>
mov    %eax,-0x2c(%rbp)
lea    -0x80(%rbp),%rdi
add    $0x2,%rdi
call   1080 <get16bit@plt>
mov    %eax,-0x34(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x44(%rbp),%eax
jne    15f1 <main+0x441>
cmpq   $0x0,-0x20(%rbp)
jne    1581 <main+0x3d1>
lea    -0x290(%rbp),%rdi
lea    -0x180(%rbp),%rdx
mov    -0x38(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xb5b(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0x290(%rbp),%rdi
lea    0xb57(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    157c <main+0x3cc>
lea    -0x290(%rbp),%rsi
lea    0xac5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1670 <main+0x4c0>
jmp    1581 <main+0x3d1>
mov    -0x38(%rbp),%esi
mov    -0x24(%rbp),%edx
add    $0x1,%edx
mov    -0x28(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
mov    -0x34(%rbp),%r9d
lea    0xb05(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    15ec <main+0x43c>
lea    -0x80(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
lea    -0x80(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   10d0 <fwrite@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    15aa <main+0x3fa>
jmp    15f1 <main+0x441>
jmp    1607 <main+0x457>
mov    -0x48(%rbp),%esi
lea    0xad3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    0x29cb(%rip),%rax
mov    (%rax),%edx
call   10a0 <fseek@plt>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x48(%rbp)
jmp    1398 <main+0x1e8>
cmpq   $0x0,-0x20(%rbp)
je     1643 <main+0x493>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
movq   $0x0,-0x20(%rbp)
jmp    1648 <main+0x498>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1342 <main+0x192>
jmp    165b <main+0x4ab>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1324 <main+0x174>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x268,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x2,%ebx
jne    1295 <main+0xd5>
mov    0x8(%rbp),%rdi
lea    0xe21(%rip),%rsi
call   10d0 <fopen@plt>
mov    0x8(%rbp),%rbp
test   %rax,%rax
je     12a2 <main+0xe2>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    $0x5c,%esi
call   1080 <strrchr@plt>
lea    0x1(%rax),%r14
test   %rax,%rax
cmove  %rbp,%r14
mov    %rbp,%rdi
mov    $0x2e,%esi
call   1080 <strrchr@plt>
cmp    %rax,%r14
jae    12b8 <main+0xf8>
mov    %rax,%r9
sub    %r14,%r9
cmp    $0x8,%r9
jb     1268 <main+0xa8>
lea    (%r14,%r9,1),%rdx
lea    0x60(%rsp),%rsi
cmp    %rdx,%rsi
jae    15ac <main+0x3ec>
lea    (%rsp,%r9,1),%rdx
add    $0x60,%rdx
cmp    %rdx,%r14
jae    15ac <main+0x3ec>
xor    %edx,%edx
mov    %r14,%rsi
lea    (%rsp,%rdx,1),%rdi
add    $0x60,%rdi
sub    %rdx,%rax
sub    %r14,%rax
xor    %edx,%edx
nopl   (%rax)
movzbl (%rsi,%rdx,1),%ecx
mov    %cl,(%rdi,%rdx,1)
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1280 <main+0xc0>
mov    %r9d,%eax
jmp    12ba <main+0xfa>
mov    0x0(%rbp),%rsi
lea    0xd60(%rip),%rdi
jmp    12ac <main+0xec>
lea    0xd71(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1595 <main+0x3d5>
xor    %eax,%eax
movb   $0x0,0x60(%rsp,%rax,1)
lea    0x34(%rsp),%r15
lea    0x30(%rsp),%r12
xor    %r14d,%r14d
xor    %eax,%eax
mov    %rax,0x10(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0xffffffff,0xc(%rsp)
ff
xor    %ebp,%ebp
mov    %r14d,0x1c(%rsp)
mov    0x2cef(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   10c0 <fseek@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
cmp    $0x1,%eax
jne    14d0 <main+0x310>
mov    %rbp,0x20(%rsp)
lea    0x1(%rbp),%eax
mov    %eax,0x28(%rsp)
xor    %r13d,%r13d
jmp    136e <main+0x1ae>
nopl   (%rax)
lea    0xdb6(%rip),%rdi
call   1030 <puts@plt>
mov    0x2c9d(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   10c0 <fseek@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
cmp    $0x1,%eax
jne    1510 <main+0x350>
mov    %r14d,%ebp
mov    %r12,%rdi
lea    0xcb1(%rip),%rsi
mov    $0x3,%edx
call   10b0 <memcmp@plt>
test   %rax,%rax
jne    1585 <main+0x3c5>
mov    %r15,%rdi
call   1050 <get32bit@plt>
lea    (%rax,%rbp,1),%r14d
add    $0x8,%r14d
movsbl 0x33(%rsp),%eax
cmp    $0x46,%eax
je     1330 <main+0x170>
cmp    $0x50,%eax
je     13d0 <main+0x210>
cmp    $0x45,%eax
je     1530 <main+0x370>
lea    0xce5(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    133c <main+0x17c>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
movsbl 0x30(%rsp),%ebp
movsbl 0x31(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    %r15,%rdi
call   1050 <get32bit@plt>
mov    %eax,0x2c(%rsp)
lea    0x32(%rsp),%rdi
call   1090 <get16bit@plt>
cmp    %ebp,0x20(%rsp)
jne    14b8 <main+0x2f8>
mov    %eax,%r15d
test   %r13,%r13
jne    145c <main+0x29c>
lea    0x160(%rsp),%rbp
mov    %rbp,%rdi
lea    0xc31(%rip),%rsi
lea    0x60(%rsp),%rdx
mov    0x10(%rsp),%rcx
mov    0x20(%rsp),%r8
call   10e0 <sprintf@plt>
mov    %rbp,%rdi
lea    0xc22(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%r13
test   %rax,%rax
je     15e3 <main+0x423>
lea    0xc0d(%rip),%rdi
mov    0x10(%rsp),%rsi
mov    0x28(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x2c(%rsp),%r8d
mov    %r15d,%r9d
xor    %eax,%eax
call   1070 <printf@plt>
test   %r15d,%r15d
jle    14b8 <main+0x2f8>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
movsbl 0x30(%rsp),%edi
mov    %r13,%rsi
call   10a0 <fputc@plt>
add    $0xffffffff,%r15d
jne    1490 <main+0x2d0>
lea    0x34(%rsp),%r15
jmp    133c <main+0x17c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %r13d,%r13d
movl   $0x0,0xc(%rsp)
mov    $0xfffffffe,%eax
mov    %rax,0x10(%rsp)
xor    %ebp,%ebp
test   %r13,%r13
je     14f4 <main+0x334>
mov    %r13,%rdi
call   1060 <fclose@plt>
add    $0x1,%ebp
cmpl   $0x0,0xc(%rsp)
js     12ea <main+0x12a>
cmp    0xc(%rsp),%ebp
jl     12ea <main+0x12a>
jmp    1566 <main+0x3a6>
xchg   %ax,%ax
movl   $0x0,0xc(%rsp)
mov    $0xfffffffe,%eax
mov    %rax,0x10(%rsp)
xor    %ebp,%ebp
mov    0x1c(%rsp),%r14d
test   %r13,%r13
jne    14ec <main+0x32c>
jmp    14f4 <main+0x334>
lea    0xba7(%rip),%rdi
call   1030 <puts@plt>
mov    0x2a9d(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   10c0 <fseek@plt>
mov    %r14d,0x18(%rsp)
mov    0x1c(%rsp),%r14d
mov    0x20(%rsp),%rbp
test   %r13,%r13
jne    14ec <main+0x32c>
jmp    14f4 <main+0x334>
mov    0x10(%rsp),%rdx
lea    0x1(%rdx),%ecx
xor    %eax,%eax
mov    0x18(%rsp),%r14d
cmp    $0xfffffffe,%edx
mov    %rcx,0x10(%rsp)
jg     12db <main+0x11b>
jmp    159a <main+0x3da>
lea    0xaa4(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%eax
add    $0x268,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x20,%r9
jae    15b9 <main+0x3f9>
xor    %edx,%edx
jmp    16bb <main+0x4fb>
mov    %r9,%rdx
and    $0xffffffffffffffe0,%rdx
lea    -0x20(%rdx),%rsi
mov    %rsi,%rdi
shr    $0x5,%rdi
add    $0x1,%rdi
mov    %edi,%r8d
and    $0x3,%r8d
cmp    $0x60,%rsi
jae    15f7 <main+0x437>
xor    %ebp,%ebp
jmp    1673 <main+0x4b3>
lea    0xa30(%rip),%rdi
lea    0x160(%rsp),%rsi
jmp    12ac <main+0xec>
and    $0xfffffffffffffffc,%rdi
xor    %ebp,%ebp
nopl   (%rax)
movups (%r14,%rbp,1),%xmm0
movups 0x10(%r14,%rbp,1),%xmm1
movaps %xmm0,0x60(%rsp,%rbp,1)
movaps %xmm1,0x70(%rsp,%rbp,1)
movups 0x20(%r14,%rbp,1),%xmm0
movups 0x30(%r14,%rbp,1),%xmm1
movaps %xmm0,0x80(%rsp,%rbp,1)
movaps %xmm1,0x90(%rsp,%rbp,1)
movups 0x40(%r14,%rbp,1),%xmm0
movups 0x50(%r14,%rbp,1),%xmm1
movaps %xmm0,0xa0(%rsp,%rbp,1)
movaps %xmm1,0xb0(%rsp,%rbp,1)
movups 0x60(%r14,%rbp,1),%xmm0
movups 0x70(%r14,%rbp,1),%xmm1
movaps %xmm0,0xc0(%rsp,%rbp,1)
movaps %xmm1,0xd0(%rsp,%rbp,1)
sub    $0xffffffffffffff80,%rbp
add    $0xfffffffffffffffc,%rdi
jne    1600 <main+0x440>
test   %r8,%r8
je     16ac <main+0x4ec>
lea    (%rsp,%rbp,1),%rdi
add    $0x70,%rdi
add    %r14,%rbp
add    $0x10,%rbp
shl    $0x5,%r8
xor    %esi,%esi
nopl   (%rax)
movups -0x10(%rbp,%rsi,1),%xmm0
movups 0x0(%rbp,%rsi,1),%xmm1
movaps %xmm0,-0x10(%rdi,%rsi,1)
movaps %xmm1,(%rdi,%rsi,1)
add    $0x20,%rsi
cmp    %rsi,%r8
jne    1690 <main+0x4d0>
cmp    %rdx,%r9
je     1290 <main+0xd0>
test   $0x18,%r9b
je     16f0 <main+0x530>
mov    %rdx,%rdi
mov    %r9,%rdx
and    $0xfffffffffffffff8,%rdx
lea    (%r14,%rdx,1),%rsi
nopl   0x0(%rax)
mov    (%r14,%rdi,1),%rbp
mov    %rbp,0x60(%rsp,%rdi,1)
add    $0x8,%rdi
cmp    %rdi,%rdx
jne    16d0 <main+0x510>
cmp    %rdx,%r9
jne    126d <main+0xad>
jmp    1290 <main+0xd0>
lea    (%r14,%rdx,1),%rsi
jmp    126d <main+0xad>

LLVM IR (-O0):
@.str = [20 x i8] c"AIX2ADX 0.1 by hcs\0A\00"
@.str.1 = [23 x i8] c"usage: %s AIXFILE.AIX\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [18 x i8] c"error opening %s\0A\00"
@SEEK_SET = global i32 0
@.str.4 = [4 x i8] c"AIX\00"
@.str.5 = [46 x i8] c"malformed AIX header at %08x (bad signature)\0A\00"
@.str.6 = [13 x i8] c"file header\0A\00"
@.str.7 = [16 x i8] c"end of section\0A\00"
@.str.8 = [15 x i8] c"%s%02d%03d.adx\00"
@.str.9 = [3 x i8] c"wb\00"
@.str.10 = [50 x i8] c"goround #%d\09channel #%d/%d\09frame #%d\09size: %x\0A\00"
@.str.11 = [41 x i8] c"malformed AIX header at %08x (bad type)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca [36 x i8]
%22 = alloca [256 x i8]
%23 = alloca [260 x i8]
%24 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %7
store i32 0, i32* %15
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%26 = load i32, i32* %4
%27 = icmp ne i32 %26, 2
br i1 %27, label %28, label %33
28: ; preds = %2
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 0
%31 = load i8*, i8** %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %31)
store i32 1, i32* %3
br label %218
33: ; preds = %2
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call i32* @fopen(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %37, i32** %6
%38 = load i32*, i32** %6
%39 = icmp ne i32* %38, null
br i1 %39, label %45, label %40
40: ; preds = %33
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 1
%43 = load i8*, i8** %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %43)
store i32 1, i32* %3
br label %218
45: ; preds = %33
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i8* @strrchr(i8* %48, i8 signext 92)
store i8* %49, i8** %24
%50 = load i8*, i8** %24
%51 = icmp ne i8* %50, null
br i1 %51, label %56, label %52
52: ; preds = %45
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 1
%55 = load i8*, i8** %54
store i8* %55, i8** %24
br label %59
56: ; preds = %45
%57 = load i8*, i8** %24
%58 = getelementptr inbounds i8, i8* %57, i32 1
store i8* %58, i8** %24
br label %59
59: ; preds = %56, %52
store i32 0, i32* %20
br label %60
60: ; preds = %73, %59
%61 = load i8*, i8** %24
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 1
%64 = load i8*, i8** %63
%65 = call i8* @strrchr(i8* %64, i8 signext 46)
%66 = icmp ult i8* %61, %65
br i1 %66, label %67, label %78
67: ; preds = %60
%68 = load i8*, i8** %24
%69 = load i8, i8* %68
%70 = load i32, i32* %20
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [256 x i8], [256 x i8]* %22, i64 0, i64 %71
store i8 %69, i8* %72
br label %73
73: ; preds = %67
%74 = load i8*, i8** %24
%75 = getelementptr inbounds i8, i8* %74, i32 1
store i8* %75, i8** %24
%76 = load i32, i32* %20
%77 = add nsw i32 %76, 1
store i32 %77, i32* %20
br label %60
78: ; preds = %60
%79 = load i32, i32* %20
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [256 x i8], [256 x i8]* %22, i64 0, i64 %80
store i8 0, i8* %81
store i32 0, i32* %13
br label %82
82: ; preds = %214, %78
%83 = load i32, i32* %13
%84 = icmp sge i32 %83, 0
br i1 %84, label %85, label %217
85: ; preds = %82
store i32 -1, i32* %9
%86 = load i32, i32* %15
store i32 %86, i32* %14
store i32 0, i32* %16
br label %87
87: ; preds = %210, %85
%88 = load i32, i32* %9
%89 = icmp slt i32 %88, 0
br i1 %89, label %94, label %90
90: ; preds = %87
%91 = load i32, i32* %16
%92 = load i32, i32* %9
%93 = icmp slt i32 %91, %92
br label %94
94: ; preds = %90, %87
%95 = phi i1 [ true, %87 ], [ %93, %90 ]
br i1 %95, label %96, label %213
96: ; preds = %94
%97 = load i32*, i32** %6
%98 = load i32, i32* %14
%99 = load i32, i32* @SEEK_SET
%100 = call i32 @fseek(i32* %97, i32 %98, i32 %99)
%101 = load i32, i32* %14
store i32 %101, i32* %17
store i32 0, i32* %19
br label %102
102: ; preds = %197, %96
%103 = load i32, i32* %19
%104 = icmp ne i32 %103, 0
%105 = xor i1 %104, true
br i1 %105, label %106, label %203
106: ; preds = %102
%107 = getelementptr inbounds [36 x i8], [36 x i8]* %21, i64 0, i64 0
%108 = load i32*, i32** %6
%109 = call i32 @fread(i8* %107, i32 8, i32 1, i32* %108)
%110 = icmp ne i32 %109, 1
br i1 %110, label %111, label %112
111: ; preds = %106
store i32 0, i32* %9
store i32 0, i32* %16
store i32 -2, i32* %13
br label %203
112: ; preds = %106
%113 = getelementptr inbounds [36 x i8], [36 x i8]* %21, i64 0, i64 0
%114 = call i64 @memcmp(i8* %113, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%115 = icmp ne i64 %114, 0
br i1 %115, label %116, label %119
116: ; preds = %112
%117 = load i32, i32* %17
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i32 %117)
store i32 1, i32* %3
br label %218
119: ; preds = %112
%120 = load i32, i32* %17
%121 = add nsw i32 %120, 8
%122 = getelementptr inbounds [36 x i8], [36 x i8]* %21, i64 0, i64 0
%123 = getelementptr inbounds i8, i8* %122, i64 4
%124 = call i32 @get32bit(i8* %123)
%125 = add nsw i32 %121, %124
store i32 %125, i32* %18
%126 = getelementptr inbounds [36 x i8], [36 x i8]* %21, i64 0, i64 3
%127 = load i8, i8* %126
%128 = sext i8 %127 to i32
switch i32 %128, label %194 [
i32 70, label %129
i32 69, label %131
i32 80, label %134
]
129: ; preds = %119
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %197
131: ; preds = %119
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %19
%133 = load i32, i32* %18
store i32 %133, i32* %15
br label %197
134: ; preds = %119
%135 = getelementptr inbounds [36 x i8], [36 x i8]* %21, i64 0, i64 0
%136 = load i32*, i32** %6
%137 = call i32 @fread(i8* %135, i32 8, i32 1, i32* %136)
%138 = getelementptr inbounds [36 x i8], [36 x i8]* %21, i64 0, i64 0
%139 = load i8, i8* %138
%140 = sext i8 %139 to i32
store i32 %140, i32* %8
%141 = getelementptr inbounds [36 x i8], [36 x i8]* %21, i64 0, i64 1
%142 = load i8, i8* %141
%143 = sext i8 %142 to i32
store i32 %143, i32* %9
%144 = getelementptr inbounds [36 x i8], [36 x i8]* %21, i64 0, i64 0
%145 = getelementptr inbounds i8, i8* %144, i64 4
%146 = call i32 @get32bit(i8* %145)
store i32 %146, i32* %10
%147 = getelementptr inbounds [36 x i8], [36 x i8]* %21, i64 0, i64 0
%148 = getelementptr inbounds i8, i8* %147, i64 2
%149 = call i32 @get16bit(i8* %148)
store i32 %149, i32* %12
%150 = load i32, i32* %8
%151 = load i32, i32* %16
%152 = icmp eq i32 %150, %151
br i1 %152, label %153, label %193
153: ; preds = %134
%154 = load i32*, i32** %7
%155 = icmp ne i32* %154, null
br i1 %155, label %170, label %156
156: ; preds = %153
%157 = getelementptr inbounds [260 x i8], [260 x i8]* %23, i64 0, i64 0
%158 = getelementptr inbounds [256 x i8], [256 x i8]* %22, i64 0, i64 0
%159 = load i32, i32* %13
%160 = load i32, i32* %8
%161 = call i32 @sprintf(i8* %157, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* %158, i32 %159, i32 %160)
%162 = getelementptr inbounds [260 x i8], [260 x i8]* %23, i64 0, i64 0
%163 = call i32* @fopen(i8* %162, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32* %163, i32** %7
%164 = load i32*, i32** %7
%165 = icmp ne i32* %164, null
br i1 %165, label %169, label %166
166: ; preds = %156
%167 = getelementptr inbounds [260 x i8], [260 x i8]* %23, i64 0, i64 0
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %167)
store i32 1, i32* %3
br label %218
169: ; preds = %156
br label %170
170: ; preds = %169, %153
%171 = load i32, i32* %13
%172 = load i32, i32* %8
%173 = add nsw i32 %172, 1
%174 = load i32, i32* %9
%175 = load i32, i32* %10
%176 = load i32, i32* %12
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i32 %171, i32 %173, i32 %174, i32 %175, i32 %176)
store i32 0, i32* %20
br label %178
178: ; preds = %189, %170
%179 = load i32, i32* %20
%180 = load i32, i32* %12
%181 = icmp slt i32 %179, %180
br i1 %181, label %182, label %192
182: ; preds = %178
%183 = getelementptr inbounds [36 x i8], [36 x i8]* %21, i64 0, i64 0
%184 = load i32*, i32** %6
%185 = call i32 @fread(i8* %183, i32 1, i32 1, i32* %184)
%186 = getelementptr inbounds [36 x i8], [36 x i8]* %21, i64 0, i64 0
%187 = load i32*, i32** %7
%188 = call i32 @fwrite(i8* %186, i32 1, i32 1, i32* %187)
br label %189
189: ; preds = %182
%190 = load i32, i32* %20
%191 = add nsw i32 %190, 1
store i32 %191, i32* %20
br label %178
192: ; preds = %178
br label %193
193: ; preds = %192, %134
br label %197
194: ; preds = %119
%195 = load i32, i32* %17
%196 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.11, i64 0, i64 0), i32 %195)
br label %197
197: ; preds = %194, %193, %131, %129
%198 = load i32*, i32** %6
%199 = load i32, i32* %18
%200 = load i32, i32* @SEEK_SET
%201 = call i32 @fseek(i32* %198, i32 %199, i32 %200)
%202 = load i32, i32* %18
store i32 %202, i32* %17
br label %102
203: ; preds = %111, %102
%204 = load i32*, i32** %7
%205 = icmp ne i32* %204, null
br i1 %205, label %206, label %209
206: ; preds = %203
%207 = load i32*, i32** %7
%208 = call i32 @fclose(i32* %207)
store i32* null, i32** %7
br label %209
209: ; preds = %206, %203
br label %210
210: ; preds = %209
%211 = load i32, i32* %16
%212 = add nsw i32 %211, 1
store i32 %212, i32* %16
br label %87
213: ; preds = %94
br label %214
214: ; preds = %213
%215 = load i32, i32* %13
%216 = add nsw i32 %215, 1
store i32 %216, i32* %13
br label %82
217: ; preds = %82
store i32 0, i32* %3
br label %218
218: ; preds = %217, %166, %116, %40, %28
%219 = load i32, i32* %3
ret i32 %219
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"usage: %s AIXFILE.AIX\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [18 x i8] c"error opening %s\0A\00"
@SEEK_SET = global i32 0
@.str.4 = [4 x i8] c"AIX\00"
@.str.5 = [46 x i8] c"malformed AIX header at %08x (bad signature)\0A\00"
@.str.8 = [15 x i8] c"%s%02d%03d.adx\00"
@.str.9 = [3 x i8] c"wb\00"
@.str.10 = [50 x i8] c"goround #%d\09channel #%d/%d\09frame #%d\09size: %x\0A\00"
@.str.11 = [41 x i8] c"malformed AIX header at %08x (bad type)\0A\00"
@str = [19 x i8] c"AIX2ADX 0.1 by hcs\00"
@str.12 = [15 x i8] c"end of section\00"
@str.13 = [12 x i8] c"file header\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [36 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = alloca [260 x i8]
%7 = getelementptr inbounds [36 x i8], [36 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [260 x i8], [260 x i8]* %6, i64 0, i64 0
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%11 = icmp eq i32 %0, 2
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %249
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i32* %18, null
%20 = load i8*, i8** %16
br i1 %19, label %21, label %23
21: ; preds = %15
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %20)
br label %249
23: ; preds = %15
%24 = tail call i8* @strrchr(i8* dereferenceable(1) %20, i8 signext 92)
%25 = icmp eq i8* %24, null
%26 = getelementptr inbounds i8, i8* %24, i64 1
%27 = select i1 %25, i8* %20, i8* %26
%28 = tail call i8* @strrchr(i8* dereferenceable(1) %20, i8 signext 46)
%29 = icmp ult i8* %27, %28
br i1 %29, label %30, label %154
30: ; preds = %23
%31 = ptrtoint i8* %28 to i64
%32 = ptrtoint i8* %27 to i64
%33 = sub i64 %31, %32
%34 = icmp ult i64 %33, 8
br i1 %34, label %141, label %35
35: ; preds = %30
%36 = getelementptr [256 x i8], [256 x i8]* %4, i64 0, i64 %33
%37 = getelementptr i8, i8* %27, i64 %33
%38 = icmp ult i8* %5, %37
%39 = icmp ult i8* %27, %36
%40 = and i1 %38, %39
br i1 %40, label %141, label %41
41: ; preds = %35
%42 = icmp ult i64 %33, 32
br i1 %42, label %126, label %43
43: ; preds = %41
%44 = and i64 %33, -32
%45 = add i64 %44, -32
%46 = lshr exact i64 %45, 5
%47 = add nuw nsw i64 %46, 1
%48 = and i64 %47, 3
%49 = icmp ult i64 %45, 96
br i1 %49, label %101, label %50
50: ; preds = %43
%51 = and i64 %47, 1152921504606846972
br label %52
52: ; preds = %52, %50
%53 = phi i64 [ 0, %50 ], [ %98, %52 ]
%54 = phi i64 [ 0, %50 ], [ %99, %52 ]
%55 = getelementptr i8, i8* %27, i64 %53
%56 = bitcast i8* %55 to <16 x i8>*
%57 = load <16 x i8>, <16 x i8>* %56
%58 = getelementptr i8, i8* %55, i64 16
%59 = bitcast i8* %58 to <16 x i8>*
%60 = load <16 x i8>, <16 x i8>* %59
%61 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %53
%62 = bitcast i8* %61 to <16 x i8>*
store <16 x i8> %57, <16 x i8>* %62
%63 = getelementptr inbounds i8, i8* %61, i64 16
%64 = bitcast i8* %63 to <16 x i8>*
store <16 x i8> %60, <16 x i8>* %64
%65 = or i64 %53, 32
%66 = getelementptr i8, i8* %27, i64 %65
%67 = bitcast i8* %66 to <16 x i8>*
%68 = load <16 x i8>, <16 x i8>* %67
%69 = getelementptr i8, i8* %66, i64 16
%70 = bitcast i8* %69 to <16 x i8>*
%71 = load <16 x i8>, <16 x i8>* %70
%72 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %65
%73 = bitcast i8* %72 to <16 x i8>*
store <16 x i8> %68, <16 x i8>* %73
%74 = getelementptr inbounds i8, i8* %72, i64 16
%75 = bitcast i8* %74 to <16 x i8>*
store <16 x i8> %71, <16 x i8>* %75
%76 = or i64 %53, 64
%77 = getelementptr i8, i8* %27, i64 %76
%78 = bitcast i8* %77 to <16 x i8>*
%79 = load <16 x i8>, <16 x i8>* %78
%80 = getelementptr i8, i8* %77, i64 16
%81 = bitcast i8* %80 to <16 x i8>*
%82 = load <16 x i8>, <16 x i8>* %81
%83 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %76
%84 = bitcast i8* %83 to <16 x i8>*
store <16 x i8> %79, <16 x i8>* %84
%85 = getelementptr inbounds i8, i8* %83, i64 16
%86 = bitcast i8* %85 to <16 x i8>*
store <16 x i8> %82, <16 x i8>* %86
%87 = or i64 %53, 96
%88 = getelementptr i8, i8* %27, i64 %87
%89 = bitcast i8* %88 to <16 x i8>*
%90 = load <16 x i8>, <16 x i8>* %89
%91 = getelementptr i8, i8* %88, i64 16
%92 = bitcast i8* %91 to <16 x i8>*
%93 = load <16 x i8>, <16 x i8>* %92
%94 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %87
%95 = bitcast i8* %94 to <16 x i8>*
store <16 x i8> %90, <16 x i8>* %95
%96 = getelementptr inbounds i8, i8* %94, i64 16
%97 = bitcast i8* %96 to <16 x i8>*
store <16 x i8> %93, <16 x i8>* %97
%98 = add nuw i64 %53, 128
%99 = add i64 %54, 4
%100 = icmp eq i64 %99, %51
br i1 %100, label %101, label %52
101: ; preds = %52, %43
%102 = phi i64 [ 0, %43 ], [ %98, %52 ]
%103 = icmp eq i64 %48, 0
br i1 %103, label %120, label %104
104: ; preds = %101, %104
%105 = phi i64 [ %117, %104 ], [ %102, %101 ]
%106 = phi i64 [ %118, %104 ], [ 0, %101 ]
%107 = getelementptr i8, i8* %27, i64 %105
%108 = bitcast i8* %107 to <16 x i8>*
%109 = load <16 x i8>, <16 x i8>* %108
%110 = getelementptr i8, i8* %107, i64 16
%111 = bitcast i8* %110 to <16 x i8>*
%112 = load <16 x i8>, <16 x i8>* %111
%113 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %105
%114 = bitcast i8* %113 to <16 x i8>*
store <16 x i8> %109, <16 x i8>* %114
%115 = getelementptr inbounds i8, i8* %113, i64 16
%116 = bitcast i8* %115 to <16 x i8>*
store <16 x i8> %112, <16 x i8>* %116
%117 = add nuw i64 %105, 32
%118 = add i64 %106, 1
%119 = icmp eq i64 %118, %48
br i1 %119, label %120, label %104
120: ; preds = %104, %101
%121 = icmp eq i64 %33, %44
br i1 %121, label %152, label %122
122: ; preds = %120
%123 = getelementptr i8, i8* %27, i64 %44
%124 = and i64 %33, 24
%125 = icmp eq i64 %124, 0
br i1 %125, label %141, label %126
126: ; preds = %41, %122
%127 = phi i64 [ %44, %122 ], [ 0, %41 ]
%128 = and i64 %33, -8
%129 = getelementptr i8, i8* %27, i64 %128
br label %130
130: ; preds = %130, %126
%131 = phi i64 [ %127, %126 ], [ %137, %130 ]
%132 = getelementptr i8, i8* %27, i64 %131
%133 = bitcast i8* %132 to <8 x i8>*
%134 = load <8 x i8>, <8 x i8>* %133
%135 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %131
%136 = bitcast i8* %135 to <8 x i8>*
store <8 x i8> %134, <8 x i8>* %136
%137 = add nuw i64 %131, 8
%138 = icmp eq i64 %137, %128
br i1 %138, label %139, label %130
139: ; preds = %130
%140 = icmp eq i64 %33, %128
br i1 %140, label %152, label %141
141: ; preds = %35, %30, %122, %139
%142 = phi i64 [ 0, %30 ], [ 0, %35 ], [ %44, %122 ], [ %128, %139 ]
%143 = phi i8* [ %27, %30 ], [ %27, %35 ], [ %123, %122 ], [ %129, %139 ]
br label %144
144: ; preds = %141, %144
%145 = phi i64 [ %150, %144 ], [ %142, %141 ]
%146 = phi i8* [ %149, %144 ], [ %143, %141 ]
%147 = load i8, i8* %146
%148 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %145
store i8 %147, i8* %148
%149 = getelementptr inbounds i8, i8* %146, i64 1
%150 = add nuw i64 %145, 1
%151 = icmp eq i64 %150, %33
br i1 %151, label %152, label %144
152: ; preds = %144, %139, %120
%153 = and i64 %33, 4294967295
br label %154
154: ; preds = %152, %23
%155 = phi i64 [ 0, %23 ], [ %153, %152 ]
%156 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %155
store i8 0, i8* %156
%157 = getelementptr inbounds [36 x i8], [36 x i8]* %3, i64 0, i64 4
%158 = getelementptr inbounds [36 x i8], [36 x i8]* %3, i64 0, i64 3
%159 = getelementptr inbounds [36 x i8], [36 x i8]* %3, i64 0, i64 1
%160 = getelementptr inbounds [36 x i8], [36 x i8]* %3, i64 0, i64 2
br label %161
161: ; preds = %154, %246
%162 = phi i32 [ 0, %154 ], [ %234, %246 ]
%163 = phi i32 [ 0, %154 ], [ %247, %246 ]
br label %164
164: ; preds = %161, %241
%165 = phi i32 [ 0, %161 ], [ %242, %241 ]
%166 = phi i32 [ %162, %161 ], [ %234, %241 ]
%167 = phi i32 [ %163, %161 ], [ %236, %241 ]
%168 = phi i32 [ -1, %161 ], [ %235, %241 ]
%169 = load i32, i32* @SEEK_SET
%170 = call i32 @fseek(i32* %18, i32 %162, i32 %169)
%171 = add nsw i32 %165, 1
%172 = call i32 @fread(i8* %7, i32 8, i32 1, i32* %18)
%173 = icmp eq i32 %172, 1
br i1 %173, label %174, label %232
174: ; preds = %164, %225
%175 = phi i32 [ %226, %225 ], [ %168, %164 ]
%176 = phi i32* [ %227, %225 ], [ null, %164 ]
%177 = phi i32 [ %185, %225 ], [ %162, %164 ]
%178 = call i64 @memcmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%179 = icmp eq i64 %178, 0
br i1 %179, label %182, label %180
180: ; preds = %174
%181 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i32 %177)
br label %249
182: ; preds = %174
%183 = add nsw i32 %177, 8
%184 = call i32 @get32bit(i8* %157)
%185 = add nsw i32 %183, %184
%186 = load i8, i8* %158
%187 = sext i8 %186 to i32
switch i32 %187, label %223 [
i32 70, label %188
i32 69, label %190
i32 80, label %194
]
188: ; preds = %182
%189 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.13, i64 0, i64 0))
br label %225
190: ; preds = %182
%191 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.12, i64 0, i64 0))
%192 = load i32, i32* @SEEK_SET
%193 = call i32 @fseek(i32* %18, i32 %185, i32 %192)
br label %232
194: ; preds = %182
%195 = call i32 @fread(i8* %7, i32 8, i32 1, i32* %18)
%196 = load i8, i8* %7
%197 = sext i8 %196 to i32
%198 = load i8, i8* %159
%199 = sext i8 %198 to i32
%200 = call i32 @get32bit(i8* %157)
%201 = call i32 @get16bit(i8* %160)
%202 = icmp eq i32 %165, %197
br i1 %202, label %203, label %225
203: ; preds = %194
%204 = icmp eq i32* %176, null
br i1 %204, label %205, label %211
205: ; preds = %203
%206 = call i32 @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* %8, i32 %167, i32 %165)
%207 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%208 = icmp eq i32* %207, null
br i1 %208, label %209, label %211
209: ; preds = %205
%210 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %9)
br label %249
211: ; preds = %205, %203
%212 = phi i32* [ %176, %203 ], [ %207, %205 ]
%213 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i32 %167, i32 %171, i32 %199, i32 %200, i32 %201)
%214 = icmp sgt i32 %201, 0
br i1 %214, label %215, label %225
215: ; preds = %211, %215
%216 = phi i32 [ %221, %215 ], [ 0, %211 ]
%217 = call i32 @fread(i8* %7, i32 1, i32 1, i32* %18)
%218 = load i8, i8* %7
%219 = sext i8 %218 to i32
%220 = call i32 @fputc(i32 %219, i32* %212)
%221 = add nuw nsw i32 %216, 1
%222 = icmp eq i32 %221, %201
br i1 %222, label %225, label %215
223: ; preds = %182
%224 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.11, i64 0, i64 0), i32 %177)
br label %225
225: ; preds = %215, %211, %194, %223, %188
%226 = phi i32 [ %175, %223 ], [ %199, %194 ], [ %175, %188 ], [ %199, %211 ], [ %199, %215 ]
%227 = phi i32* [ %176, %223 ], [ %176, %194 ], [ %176, %188 ], [ %212, %211 ], [ %212, %215 ]
%228 = load i32, i32* @SEEK_SET
%229 = call i32 @fseek(i32* %18, i32 %185, i32 %228)
%230 = call i32 @fread(i8* %7, i32 8, i32 1, i32* %18)
%231 = icmp eq i32 %230, 1
br i1 %231, label %174, label %232
232: ; preds = %225, %164, %190
%233 = phi i32* [ %176, %190 ], [ null, %164 ], [ %227, %225 ]
%234 = phi i32 [ %185, %190 ], [ %166, %164 ], [ %166, %225 ]
%235 = phi i32 [ %175, %190 ], [ 0, %164 ], [ 0, %225 ]
%236 = phi i32 [ %167, %190 ], [ -2, %164 ], [ -2, %225 ]
%237 = phi i32 [ %165, %190 ], [ 0, %164 ], [ 0, %225 ]
%238 = icmp eq i32* %233, null
br i1 %238, label %241, label %239
239: ; preds = %232
%240 = call i32 @fclose(i32* %233)
br label %241
241: ; preds = %232, %239
%242 = add nsw i32 %237, 1
%243 = icmp slt i32 %235, 0
%244 = icmp slt i32 %242, %235
%245 = select i1 %243, i1 true, i1 %244
br i1 %245, label %164, label %246
246: ; preds = %241
%247 = add nsw i32 %236, 1
%248 = icmp sgt i32 %236, -2
br i1 %248, label %161, label %249
249: ; preds = %246, %209, %180, %21, %12
%250 = phi i32 [ 1, %12 ], [ 1, %180 ], [ 1, %209 ], [ 1, %21 ], [ 0, %246 ]
ret i32 %250
}