#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 short int8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
float atof(char *);
int /*<<< orphan*/ display_help();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(short **, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(short **, int, int, int /*<<< orphan*/ *);
int getopt(int, char **, char *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  FILE *fin, *fout;
  short left[2], right[2], out[2 * 1000], i;
  float oversample, t;
  int8_t out_s8[2 * 1000];
  int lo_i[3], lo_q[3];
  if (argc < 3) {
    display_help();
    exit(1);
  }
  if (strcmp(argv[1], "-") == 0)
    fin = stdin;
  else
    fin = fopen(argv[1], "rb");
  assert(fin != NULL);
  if (strcmp(argv[2], "-") == 0)
    fout = stdout;
  else
    fout = fopen(argv[2], "wb");
  assert(fout != NULL);
  oversample = atof(argv[3]);
  if (oversample <= 1) {
    display_help();
    exit(1);
  }
  int channels = 1;
  int freq_shift = 0;
  lo_i[0] = -1;
  lo_i[1] = 0;
  lo_q[0] = 0;
  lo_q[1] = -1;
  int format = 0;
  int opt;
  while ((opt = getopt(argc, argv, "cdf")) != -1) {
    switch (opt) {
    case 'c':
      channels = 2;
      break;
    case 'd':
      channels = 2;
      format = 1;
      break;
    case 'f':
      freq_shift = 1;
      break;
    default:
      display_help();
      exit(1);
    }
  }
  for (i = 0; i < channels; i++)
    left[i] = 0;
  t = 0.0;
  int j = 0;
  while (fread(&right, sizeof(short) * channels, 1, fin) == 1) {
    while (t < 1.0) {
      for (i = 0; i < channels; i++) {
        out[2 * j + i] = (1.0 - t) * left[i] + t * right[i];
      }
      if (freq_shift) {
        lo_i[2] = -lo_i[0];
        lo_q[2] = -lo_q[0];
        int a = out[2 * j];
        int b = out[2 * j + 1];
        int c = lo_i[2];
        int d = lo_q[2];
        out[2 * j] = a * c - b * d;
        out[2 * j + 1] = b * c + a * d;
        lo_i[0] = lo_i[1];
        lo_i[1] = lo_i[2];
        lo_q[0] = lo_q[1];
        lo_q[1] = lo_q[2];
      }
      j++;
      if (j == 1000) {
        if (format == 0) {
          fwrite(&out, sizeof(short) * channels, 1000, fout);
        } else {
          for (i = 0; i < channels * 1000; i++) {
            out_s8[i] = out[i] >> 8;
          }
          fwrite(&out_s8, sizeof(int8_t) * channels, 1000, fout);
        }
        j = 0;
      }
      t += 1.0 / oversample;
    }
    t -= 1.0;
    for (i = 0; i < channels; i++)
      left[i] = right[i];
  }
  if (format == 0) {
    fwrite(&out, sizeof(short), j, fout);
  } else {
    for (i = 0; i < j; i++) {
      out_s8[i] = out[i] >> 8;
    }
    fwrite(&out_s8, sizeof(int8_t), j, fout);
  }
  fclose(fout);
  fclose(fin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1fc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11d4 <main+0x34>
mov    $0x0,%al
call   1060 <display_help@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2d(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1205 <main+0x65>
mov    0x2def(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    121d <main+0x7d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdfe(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdd2(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1260 <main+0xc0>
mov    0x2d84(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1278 <main+0xd8>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xda6(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atof@plt>
movss  %xmm0,-0xfd8(%rbp)
ff
movss  0xd59(%rip),%xmm0
ucomiss -0xfd8(%rbp),%xmm0
jb     12c5 <main+0x125>
mov    $0x0,%al
call   1060 <display_help@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
movl   $0x1,-0x1f9c(%rbp)
movl   $0x0,-0x1fa0(%rbp)
movl   $0xffffffff,-0x1f8c(%rbp)
ff ff ff
movl   $0x0,-0x1f88(%rbp)
movl   $0x0,-0x1f98(%rbp)
movl   $0xffffffff,-0x1f94(%rbp)
ff ff ff
movl   $0x0,-0x1fa4(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xcff(%rip),%rdx
call   10a0 <getopt@plt>
mov    %eax,-0x1fa8(%rbp)
cmp    $0xffffffff,%eax
je     13bc <main+0x21c>
mov    -0x1fa8(%rbp),%eax
mov    %eax,-0x1fc0(%rbp)
sub    $0x63,%eax
je     136f <main+0x1cf>
jmp    1347 <main+0x1a7>
mov    -0x1fc0(%rbp),%eax
sub    $0x64,%eax
je     137e <main+0x1de>
jmp    135b <main+0x1bb>
mov    -0x1fc0(%rbp),%eax
sub    $0x66,%eax
je     1397 <main+0x1f7>
jmp    13a6 <main+0x206>
movl   $0x2,-0x1f9c(%rbp)
jmp    13b7 <main+0x217>
movl   $0x2,-0x1f9c(%rbp)
movl   $0x1,-0x1fa4(%rbp)
jmp    13b7 <main+0x217>
movl   $0x1,-0x1fa0(%rbp)
jmp    13b7 <main+0x217>
mov    $0x0,%al
call   1060 <display_help@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
jmp    130b <main+0x16b>
movw   $0x0,-0xfd2(%rbp)
movswl -0xfd2(%rbp),%eax
cmp    -0x1f9c(%rbp),%eax
jge    13fe <main+0x25e>
movswq -0xfd2(%rbp),%rax
ff
movw   $0x0,-0x24(%rbp,%rax,2)
mov    -0xfd2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xfd2(%rbp)
jmp    13c5 <main+0x225>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xfdc(%rbp)
ff
movl   $0x0,-0x1fac(%rbp)
lea    -0x28(%rbp),%rdi
movslq -0x1f9c(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    1790 <main+0x5f0>
jmp    1440 <main+0x2a0>
movss  -0xfdc(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
movsd  0xbb4(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    171a <main+0x57a>
movw   $0x0,-0xfd2(%rbp)
movswl -0xfd2(%rbp),%eax
cmp    -0x1f9c(%rbp),%eax
jge    14f6 <main+0x356>
movss  -0xfdc(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm2
movsd  0xb7a(%rip),%xmm0
subsd  %xmm2,%xmm0
movswq -0xfd2(%rbp),%rax
ff
movswl -0x24(%rbp,%rax,2),%ecx
cvtsi2sd %ecx,%xmm2
movswl -0x28(%rbp,%rax,2),%eax
cvtsi2ss %eax,%xmm3
mulss  %xmm3,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%cx
mov    -0x1fac(%rbp),%eax
shl    $0x1,%eax
movswl -0xfd2(%rbp),%edx
add    %edx,%eax
cltq
mov    %cx,-0xfd0(%rbp,%rax,2)
ff
mov    -0xfd2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xfd2(%rbp)
jmp    1467 <main+0x2c7>
cmpl   $0x0,-0x1fa0(%rbp)
je     1603 <main+0x463>
xor    %eax,%eax
sub    -0x1f8c(%rbp),%eax
mov    %eax,-0x1f84(%rbp)
xor    %eax,%eax
sub    -0x1f98(%rbp),%eax
mov    %eax,-0x1f90(%rbp)
mov    -0x1fac(%rbp),%eax
shl    $0x1,%eax
cltq
movswl -0xfd0(%rbp,%rax,2),%eax
ff
mov    %eax,-0x1fb0(%rbp)
mov    -0x1fac(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
movswl -0xfd0(%rbp,%rax,2),%eax
ff
mov    %eax,-0x1fb4(%rbp)
mov    -0x1f84(%rbp),%eax
mov    %eax,-0x1fb8(%rbp)
mov    -0x1f90(%rbp),%eax
mov    %eax,-0x1fbc(%rbp)
mov    -0x1fb0(%rbp),%eax
imul   -0x1fb8(%rbp),%eax
mov    -0x1fb4(%rbp),%ecx
imul   -0x1fbc(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,%cx
mov    -0x1fac(%rbp),%eax
shl    $0x1,%eax
cltq
mov    %cx,-0xfd0(%rbp,%rax,2)
ff
mov    -0x1fb4(%rbp),%eax
imul   -0x1fb8(%rbp),%eax
mov    -0x1fb0(%rbp),%ecx
imul   -0x1fbc(%rbp),%ecx
add    %ecx,%eax
mov    %ax,%cx
mov    -0x1fac(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
mov    %cx,-0xfd0(%rbp,%rax,2)
ff
mov    -0x1f88(%rbp),%eax
mov    %eax,-0x1f8c(%rbp)
mov    -0x1f84(%rbp),%eax
mov    %eax,-0x1f88(%rbp)
mov    -0x1f94(%rbp),%eax
mov    %eax,-0x1f98(%rbp)
mov    -0x1f90(%rbp),%eax
mov    %eax,-0x1f94(%rbp)
mov    -0x1fac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1fac(%rbp)
cmpl   $0x3e8,-0x1fac(%rbp)
jne    16e1 <main+0x541>
cmpl   $0x0,-0x1fa4(%rbp)
jne    1656 <main+0x4b6>
lea    -0xfd0(%rbp),%rdi
movslq -0x1f9c(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%esi
mov    -0x20(%rbp),%rcx
mov    $0x3e8,%edx
call   10c0 <fwrite@plt>
jmp    16d7 <main+0x537>
movw   $0x0,-0xfd2(%rbp)
movswl -0xfd2(%rbp),%eax
imul   $0x3e8,-0x1f9c(%rbp),%ecx
cmp    %ecx,%eax
jge    16b5 <main+0x515>
movswq -0xfd2(%rbp),%rax
ff
movswl -0xfd0(%rbp,%rax,2),%eax
ff
sar    $0x8,%eax
mov    %ax,%cx
movswq -0xfd2(%rbp),%rax
ff
mov    %cx,-0x1f80(%rbp,%rax,2)
ff
mov    -0xfd2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xfd2(%rbp)
jmp    165f <main+0x4bf>
lea    -0x1f80(%rbp),%rdi
movslq -0x1f9c(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%esi
mov    -0x20(%rbp),%rcx
mov    $0x3e8,%edx
call   10c0 <fwrite@plt>
movl   $0x0,-0x1fac(%rbp)
movss  -0xfd8(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  0x913(%rip),%xmm1
divsd  %xmm0,%xmm1
movss  -0xfdc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xfdc(%rbp)
ff
jmp    1440 <main+0x2a0>
movss  -0xfdc(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  0x8da(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xfdc(%rbp)
ff
movw   $0x0,-0xfd2(%rbp)
movswl -0xfd2(%rbp),%eax
cmp    -0x1f9c(%rbp),%eax
jge    178b <main+0x5eb>
movswq -0xfd2(%rbp),%rax
ff
mov    -0x28(%rbp,%rax,2),%cx
movswq -0xfd2(%rbp),%rax
ff
mov    %cx,-0x24(%rbp,%rax,2)
mov    -0xfd2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xfd2(%rbp)
jmp    1747 <main+0x5a7>
jmp    1413 <main+0x273>
cmpl   $0x0,-0x1fa4(%rbp)
jne    17bd <main+0x61d>
lea    -0xfd0(%rbp),%rdi
mov    -0x1fac(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x2,%esi
call   10c0 <fwrite@plt>
jmp    1831 <main+0x691>
movw   $0x0,-0xfd2(%rbp)
movswl -0xfd2(%rbp),%eax
cmp    -0x1fac(%rbp),%eax
jge    1816 <main+0x676>
movswq -0xfd2(%rbp),%rax
ff
movswl -0xfd0(%rbp,%rax,2),%eax
ff
sar    $0x8,%eax
mov    %ax,%cx
movswq -0xfd2(%rbp),%rax
ff
mov    %cx,-0x1f80(%rbp,%rax,2)
ff
mov    -0xfd2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xfd2(%rbp)
jmp    17c6 <main+0x626>
lea    -0x1f80(%rbp),%rdi
mov    -0x1fac(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x2,%esi
call   10c0 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x1fc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1fa8,%rsp
cmp    $0x2,%edi
jle    1819 <main+0x679>
mov    %rsi,%rbx
mov    %edi,%r12d
mov    0x8(%rsi),%rdi
lea    0xe45(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     11ea <main+0x4a>
mov    0x8(%rbx),%rdi
lea    0xe32(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%r13
jmp    11f4 <main+0x54>
mov    0x2df7(%rip),%rax
mov    (%rax),%r13
xor    %edi,%edi
test   %r13,%r13
setne  %dil
call   1080 <assert@plt>
mov    0x10(%rbx),%rdi
lea    0xe03(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1229 <main+0x89>
mov    0x10(%rbx),%rdi
lea    0xdf3(%rip),%rsi
call   1090 <fopen@plt>
jmp    1233 <main+0x93>
mov    0x2da8(%rip),%rax
mov    (%rax),%rax
xor    %edi,%edi
mov    %rax,0x10(%rsp)
test   %rax,%rax
setne  %dil
call   1080 <assert@plt>
mov    0x18(%rbx),%rdi
call   1040 <atof@plt>
movss  0xda9(%rip),%xmm1
movss  %xmm0,0x30(%rsp)
ucomiss %xmm0,%xmm1
jae    1819 <main+0x679>
mov    $0x1,%al
mov    %eax,0x4(%rsp)
xor    %ecx,%ecx
mov    $0x1,%r14d
lea    0xd9d(%rip),%rbp
nopl   0x0(%rax,%rax,1)
mov    %ecx,%r15d
mov    %r12d,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   10a0 <getopt@plt>
mov    $0x1,%ecx
cmp    $0x66,%eax
je     1280 <main+0xe0>
mov    %r15d,0x8(%rsp)
cmp    $0x64,%eax
je     12b6 <main+0x116>
cmp    $0x63,%eax
mov    0x8(%rsp),%ecx
jne    12ca <main+0x12a>
mov    $0x2,%r14d
jmp    1280 <main+0xe0>
mov    $0x2,%r14d
movl   $0x0,0x4(%rsp)
mov    0x8(%rsp),%ecx
jmp    1280 <main+0xe0>
cmp    $0xffffffff,%eax
jne    1819 <main+0x679>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movswq %ax,%rcx
movw   $0x0,0x1c(%rsp,%rcx,2)
add    $0x1,%eax
movswl %ax,%ecx
cmp    %ecx,%r14d
jg     12e0 <main+0x140>
lea    (%r14,%r14,1),%esi
lea    0xc(%rsp),%rdi
mov    $0x1,%ebx
mov    %esi,0x18(%rsp)
mov    $0x1,%edx
mov    %r13,%rcx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    1669 <main+0x4c9>
mov    %r13,0x20(%rsp)
imul   $0x3e8,%r14d,%r12d
movss  0x30(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xccc(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
cmp    $0x2,%r12d
cmovge %r12d,%ebx
lea    -0x1(%rbx),%eax
lea    -0x10(%r12),%edx
mov    %edx,%ecx
shr    $0x4,%ecx
add    $0x1,%ecx
mov    %ecx,0x44(%rsp)
movzwl %ax,%ecx
cmp    $0x7fff,%ecx
setae  %cl
cmp    $0x8000,%eax
setae  %al
or     %cl,%al
mov    %al,0x3(%rsp)
mov    %rbx,0x48(%rsp)
mov    %ebx,%eax
and    $0xff0,%eax
mov    %eax,0x40(%rsp)
mov    %rdx,0x58(%rsp)
shr    $0x4,%rdx
add    $0x1,%edx
and    $0xfffffffe,%edx
shl    $0x4,%rdx
mov    %rdx,0x50(%rsp)
mov    $0xffffffff,%r13d
xor    %edx,%edx
xorps  %xmm4,%xmm4
xor    %r10d,%r10d
xor    %r15d,%r15d
mov    $0xffffffff,%ebx
nopw   0x0(%rax,%rax,1)
movss  0xc38(%rip),%xmm0
ucomiss %xmm4,%xmm0
mov    0x8(%rsp),%r8d
ja     1483 <main+0x2e3>
mov    %ebx,0x28(%rsp)
mov    %r10d,%ebp
mov    %rdx,%rbx
addss  0xc1c(%rip),%xmm4
movss  %xmm4,0x3c(%rsp)
xor    %eax,%eax
movswq %ax,%rcx
movzwl 0xc(%rsp,%rcx,2),%edx
mov    %dx,0x1c(%rsp,%rcx,2)
add    $0x1,%eax
movswl %ax,%ecx
cmp    %ecx,%r14d
jg     13f0 <main+0x250>
lea    0xc(%rsp),%rdi
mov    0x18(%rsp),%esi
mov    $0x1,%edx
mov    0x20(%rsp),%rcx
call   1030 <fread@plt>
cmp    $0x1,%eax
mov    %rbx,%rdx
mov    %ebp,%r10d
mov    0x28(%rsp),%ebx
movss  0x3c(%rsp),%xmm4
je     13c0 <main+0x220>
jmp    167e <main+0x4de>
nopl   0x0(%rax,%rax,1)
mov    0x18(%rsp),%esi
mov    $0x3e8,%edx
mov    0x10(%rsp),%rcx
call   10c0 <fwrite@plt>
xor    %edx,%edx
mov    0x8(%rsp),%r8d
mov    %ebx,%r10d
mov    %ebp,%ebx
movsd  0x28(%rsp),%xmm3
addsd  0x30(%rsp),%xmm3
xorps  %xmm4,%xmm4
cvtsd2ss %xmm3,%xmm4
movss  0xb86(%rip),%xmm0
ucomiss %xmm4,%xmm0
jbe    13d6 <main+0x236>
mov    %r13d,%r9d
xorps  %xmm3,%xmm3
cvtss2sd %xmm4,%xmm3
movsd  0xb73(%rip),%xmm0
subsd  %xmm3,%xmm0
lea    (%rdx,%rdx,1),%ecx
xor    %esi,%esi
xchg   %ax,%ax
movslq %esi,%rbp
movswl 0x1c(%rsp,%rbp,2),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
movswl 0xc(%rsp,%rbp,2),%esi
xorps  %xmm2,%xmm2
cvtsi2ss %esi,%xmm2
mulsd  %xmm0,%xmm1
mulss  %xmm4,%xmm2
cvtss2sd %xmm2,%xmm2
addsd  %xmm1,%xmm2
cvttsd2si %xmm2,%esi
lea    (%rcx,%rbp,1),%edi
movslq %edi,%rdi
mov    %si,0x60(%rsp,%rdi,2)
add    $0x1,%ebp
movswl %bp,%esi
cmp    %esi,%r14d
jg     14a0 <main+0x300>
test   %r8d,%r8d
je     1540 <main+0x3a0>
mov    %ebx,%eax
neg    %eax
mov    %r15d,%r13d
neg    %r13d
movslq %ecx,%rcx
movzwl 0x60(%rsp,%rcx,2),%esi
lea    (%rdx,%rdx,1),%edi
add    $0x1,%edi
movslq %edi,%rdi
movzwl 0x60(%rsp,%rdi,2),%ebx
mov    %esi,%ebp
imul   %eax,%ebp
imul   %ebx,%r15d
add    %ebp,%r15d
mov    %r15w,0x60(%rsp,%rcx,2)
imul   %eax,%ebx
imul   %r13d,%esi
add    %ebx,%esi
mov    %si,0x60(%rsp,%rdi,2)
mov    %r10d,%ebx
mov    %r9d,%r15d
mov    %eax,%r10d
jmp    1543 <main+0x3a3>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r9d,%r13d
add    $0x1,%edx
cmp    $0x3e8,%edx
jne    1465 <main+0x2c5>
movsd  %xmm3,0x28(%rsp)
mov    %ebx,%ebp
mov    %r10d,%ebx
lea    0x60(%rsp),%rdi
testb  $0x1,0x4(%rsp)
jne    1440 <main+0x2a0>
cmpl   $0x10,0x48(%rsp)
setb   %cl
xor    %eax,%eax
or     0x3(%rsp),%cl
jne    1640 <main+0x4a0>
cmpl   $0x10,0x58(%rsp)
jb     15ee <main+0x44e>
xor    %eax,%eax
mov    0x50(%rsp),%rcx
nop
movdqa 0x60(%rsp,%rax,2),%xmm0
movdqu 0x70(%rsp,%rax,2),%xmm1
psraw  $0x8,%xmm0
psraw  $0x8,%xmm1
movdqa %xmm0,0x1000(%rsp,%rax,2)
movdqu %xmm1,0x1010(%rsp,%rax,2)
movdqa 0x80(%rsp,%rax,2),%xmm0
movdqu 0x90(%rsp,%rax,2),%xmm1
psraw  $0x8,%xmm0
psraw  $0x8,%xmm1
movdqa %xmm0,0x1020(%rsp,%rax,2)
movdqu %xmm1,0x1030(%rsp,%rax,2)
add    $0x20,%rax
cmp    %eax,%ecx
jne    1590 <main+0x3f0>
testb  $0x1,0x44(%rsp)
je     1621 <main+0x481>
movswq %ax,%rax
movdqa 0x60(%rsp,%rax,2),%xmm0
movdqu 0x70(%rsp,%rax,2),%xmm1
psraw  $0x8,%xmm0
psraw  $0x8,%xmm1
movdqa %xmm0,0x1000(%rsp,%rax,2)
movdqu %xmm1,0x1010(%rsp,%rax,2)
mov    0x40(%rsp),%ecx
mov    %ecx,%eax
lea    0x1000(%rsp),%rdi
cmp    %ecx,0x48(%rsp)
je     1440 <main+0x2a0>
nopl   0x0(%rax)
movswq %ax,%rcx
movsbl 0x61(%rsp,%rcx,2),%edx
mov    %dx,0x1000(%rsp,%rcx,2)
add    $0x1,%eax
movswl %ax,%ecx
cmp    %ecx,%r12d
jg     1640 <main+0x4a0>
lea    0x1000(%rsp),%rdi
jmp    1440 <main+0x2a0>
xor    %edx,%edx
testb  $0x1,0x4(%rsp)
je     1696 <main+0x4f6>
lea    0x60(%rsp),%rdi
mov    0x10(%rsp),%r14
jmp    16ea <main+0x54a>
testb  $0x1,0x4(%rsp)
je     169d <main+0x4fd>
lea    0x60(%rsp),%rdi
mov    0x20(%rsp),%r13
mov    0x10(%rsp),%r14
jmp    16ea <main+0x54a>
mov    0x10(%rsp),%r14
jmp    16e2 <main+0x542>
test   %edx,%edx
mov    0x10(%rsp),%r14
jle    16dd <main+0x53d>
cmp    $0x10,%edx
mov    0x20(%rsp),%r13
jae    171b <main+0x57b>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movswq %ax,%rcx
movsbl 0x61(%rsp,%rcx,2),%esi
mov    %si,0x1000(%rsp,%rcx,2)
add    $0x1,%eax
movswl %ax,%ecx
cmp    %ecx,%edx
jg     16c0 <main+0x520>
jmp    16e2 <main+0x542>
mov    0x20(%rsp),%r13
lea    0x1000(%rsp),%rdi
mov    $0x2,%esi
mov    %r14,%rcx
call   10c0 <fwrite@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x1fa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    -0x1(%rdx),%ecx
movzwl %cx,%esi
xor    %eax,%eax
cmp    $0x7ffe,%esi
ja     16c0 <main+0x520>
cmp    $0x7fff,%ecx
ja     16c0 <main+0x520>
mov    %edx,%eax
and    $0xfffffff0,%eax
lea    -0x10(%rax),%esi
mov    %esi,%r8d
shr    $0x4,%r8d
add    $0x1,%r8d
xor    %ecx,%ecx
test   %esi,%esi
je     17de <main+0x63e>
mov    %r8d,%esi
and    $0xfffffffe,%esi
movabs $0x10000000000000,%r9
movabs $0x20000000000000,%r10
xor    %edi,%edi
nopl   0x0(%rax)
mov    %rdi,%rbx
sar    $0x2f,%rbx
movdqa 0x60(%rsp,%rbx,1),%xmm0
movdqu 0x70(%rsp,%rbx,1),%xmm1
psraw  $0x8,%xmm0
psraw  $0x8,%xmm1
movdqa %xmm0,0x1000(%rsp,%rbx,1)
movdqu %xmm1,0x1010(%rsp,%rbx,1)
lea    (%rdi,%r9,1),%rbx
sar    $0x2f,%rbx
movdqa 0x60(%rsp,%rbx,1),%xmm0
movdqu 0x70(%rsp,%rbx,1),%xmm1
psraw  $0x8,%xmm0
psraw  $0x8,%xmm1
movdqa %xmm0,0x1000(%rsp,%rbx,1)
movdqu %xmm1,0x1010(%rsp,%rbx,1)
add    $0x20,%ecx
add    %r10,%rdi
add    $0xfffffffe,%esi
jne    1770 <main+0x5d0>
movswq %cx,%rcx
test   $0x1,%r8b
je     180c <main+0x66c>
movdqa 0x60(%rsp,%rcx,2),%xmm0
movdqu 0x70(%rsp,%rcx,2),%xmm1
psraw  $0x8,%xmm0
psraw  $0x8,%xmm1
movdqa %xmm0,0x1000(%rsp,%rcx,2)
movdqu %xmm1,0x1010(%rsp,%rcx,2)
cmp    %eax,%edx
jne    16c0 <main+0x520>
jmp    16e2 <main+0x542>
xor    %eax,%eax
call   1060 <display_help@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@stdin = global i32* null
@.str.1 = [3 x i8] c"rb\00"
@stdout = global i32* null
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [4 x i8] c"cdf\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 [2 x i16]
%9 = alloca [2 x i16]
%10 = alloca [2000 x i16]
%11 = alloca i16
%12 = alloca float
%13 = alloca float
%14 = alloca [2000 x i16]
%15 = alloca [3 x i32]
%16 = alloca [3 x i32]
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%26 = load i32, i32* %4
%27 = icmp slt i32 %26, 3
br i1 %27, label %28, label %31
28: ; preds = %2
%29 = call i32 (...) @display_help()
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %2
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %31
%38 = load i32*, i32** @stdin
store i32* %38, i32** %6
br label %44
39: ; preds = %31
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i32* @fopen(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %43, i32** %6
br label %44
44: ; preds = %39, %37
%45 = load i32*, i32** %6
%46 = icmp ne i32* %45, null
%47 = zext i1 %46 to i32
%48 = call i32 @assert(i32 %47)
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 2
%51 = load i8*, i8** %50
%52 = call i64 @strcmp(i8* %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %44
%55 = load i32*, i32** @stdout
store i32* %55, i32** %7
br label %61
56: ; preds = %44
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 2
%59 = load i8*, i8** %58
%60 = call i32* @fopen(i8* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %60, i32** %7
br label %61
61: ; preds = %56, %54
%62 = load i32*, i32** %7
%63 = icmp ne i32* %62, null
%64 = zext i1 %63 to i32
%65 = call i32 @assert(i32 %64)
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i64 3
%68 = load i8*, i8** %67
%69 = call float @atof(i8* %68)
store float %69, float* %12
%70 = load float, float* %12
%71 = fcmp ole float %70, 1.000000e+00
br i1 %71, label %72, label %75
72: ; preds = %61
%73 = call i32 (...) @display_help()
%74 = call i32 @exit(i32 1)
unreachable
75: ; preds = %61
store i32 1, i32* %17
store i32 0, i32* %18
%76 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 0
store i32 -1, i32* %76
%77 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 1
store i32 0, i32* %77
%78 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0, i64 0
store i32 0, i32* %78
%79 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0, i64 1
store i32 -1, i32* %79
store i32 0, i32* %19
br label %80
80: ; preds = %93, %75
%81 = load i32, i32* %4
%82 = load i8**, i8*** %5
%83 = call i32 @getopt(i32 %81, i8** %82, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
store i32 %83, i32* %20
%84 = icmp ne i32 %83, -1
br i1 %84, label %85, label %94
85: ; preds = %80
%86 = load i32, i32* %20
switch i32 %86, label %90 [
i32 99, label %87
i32 100, label %88
i32 102, label %89
]
87: ; preds = %85
store i32 2, i32* %17
br label %93
88: ; preds = %85
store i32 2, i32* %17
store i32 1, i32* %19
br label %93
89: ; preds = %85
store i32 1, i32* %18
br label %93
90: ; preds = %85
%91 = call i32 (...) @display_help()
%92 = call i32 @exit(i32 1)
unreachable
93: ; preds = %89, %88, %87
br label %80
94: ; preds = %80
store i16 0, i16* %11
br label %95
95: ; preds = %104, %94
%96 = load i16, i16* %11
%97 = sext i16 %96 to i32
%98 = load i32, i32* %17
%99 = icmp slt i32 %97, %98
br i1 %99, label %100, label %107
100: ; preds = %95
%101 = load i16, i16* %11
%102 = sext i16 %101 to i64
%103 = getelementptr inbounds [2 x i16], [2 x i16]* %8, i64 0, i64 %102
store i16 0, i16* %103
br label %104
104: ; preds = %100
%105 = load i16, i16* %11
%106 = add i16 %105, 1
store i16 %106, i16* %11
br label %95
107: ; preds = %95
store float 0.000000e+00, float* %13
store i32 0, i32* %21
br label %108
108: ; preds = %300, %107
%109 = bitcast [2 x i16]* %9 to i16**
%110 = load i32, i32* %17
%111 = sext i32 %110 to i64
%112 = mul i64 2, %111
%113 = trunc i64 %112 to i32
%114 = load i32*, i32** %6
%115 = call i32 @fread(i16** %109, i32 %113, i32 1, i32* %114)
%116 = icmp eq i32 %115, 1
br i1 %116, label %117, label %301
117: ; preds = %108
br label %118
118: ; preds = %271, %117
%119 = load float, float* %13
%120 = fpext float %119 to double
%121 = fcmp olt double %120, 1.000000e+00
br i1 %121, label %122, label %279
122: ; preds = %118
store i16 0, i16* %11
br label %123
123: ; preds = %156, %122
%124 = load i16, i16* %11
%125 = sext i16 %124 to i32
%126 = load i32, i32* %17
%127 = icmp slt i32 %125, %126
br i1 %127, label %128, label %159
128: ; preds = %123
%129 = load float, float* %13
%130 = fpext float %129 to double
%131 = fsub double 1.000000e+00, %130
%132 = load i16, i16* %11
%133 = sext i16 %132 to i64
%134 = getelementptr inbounds [2 x i16], [2 x i16]* %8, i64 0, i64 %133
%135 = load i16, i16* %134
%136 = sext i16 %135 to i32
%137 = sitofp i32 %136 to double
%138 = load float, float* %13
%139 = load i16, i16* %11
%140 = sext i16 %139 to i64
%141 = getelementptr inbounds [2 x i16], [2 x i16]* %9, i64 0, i64 %140
%142 = load i16, i16* %141
%143 = sext i16 %142 to i32
%144 = sitofp i32 %143 to float
%145 = fmul float %138, %144
%146 = fpext float %145 to double
%147 = call double @llvm.fmuladd.f64(double %131, double %137, double %146)
%148 = fptosi double %147 to i16
%149 = load i32, i32* %21
%150 = mul nsw i32 2, %149
%151 = load i16, i16* %11
%152 = sext i16 %151 to i32
%153 = add nsw i32 %150, %152
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds [2000 x i16], [2000 x i16]* %10, i64 0, i64 %154
store i16 %148, i16* %155
br label %156
156: ; preds = %128
%157 = load i16, i16* %11
%158 = add i16 %157, 1
store i16 %158, i16* %11
br label %123
159: ; preds = %123
%160 = load i32, i32* %18
%161 = icmp ne i32 %160, 0
br i1 %161, label %162, label %225
162: ; preds = %159
%163 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 0
%164 = load i32, i32* %163
%165 = sub nsw i32 0, %164
%166 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 2
store i32 %165, i32* %166
%167 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0, i64 0
%168 = load i32, i32* %167
%169 = sub nsw i32 0, %168
%170 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0, i64 2
store i32 %169, i32* %170
%171 = load i32, i32* %21
%172 = mul nsw i32 2, %171
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds [2000 x i16], [2000 x i16]* %10, i64 0, i64 %173
%175 = load i16, i16* %174
%176 = sext i16 %175 to i32
store i32 %176, i32* %22
%177 = load i32, i32* %21
%178 = mul nsw i32 2, %177
%179 = add nsw i32 %178, 1
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [2000 x i16], [2000 x i16]* %10, i64 0, i64 %180
%182 = load i16, i16* %181
%183 = sext i16 %182 to i32
store i32 %183, i32* %23
%184 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 2
%185 = load i32, i32* %184
store i32 %185, i32* %24
%186 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0, i64 2
%187 = load i32, i32* %186
store i32 %187, i32* %25
%188 = load i32, i32* %22
%189 = load i32, i32* %24
%190 = mul nsw i32 %188, %189
%191 = load i32, i32* %23
%192 = load i32, i32* %25
%193 = mul nsw i32 %191, %192
%194 = sub nsw i32 %190, %193
%195 = trunc i32 %194 to i16
%196 = load i32, i32* %21
%197 = mul nsw i32 2, %196
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds [2000 x i16], [2000 x i16]* %10, i64 0, i64 %198
store i16 %195, i16* %199
%200 = load i32, i32* %23
%201 = load i32, i32* %24
%202 = mul nsw i32 %200, %201
%203 = load i32, i32* %22
%204 = load i32, i32* %25
%205 = mul nsw i32 %203, %204
%206 = add nsw i32 %202, %205
%207 = trunc i32 %206 to i16
%208 = load i32, i32* %21
%209 = mul nsw i32 2, %208
%210 = add nsw i32 %209, 1
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds [2000 x i16], [2000 x i16]* %10, i64 0, i64 %211
store i16 %207, i16* %212
%213 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 1
%214 = load i32, i32* %213
%215 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 0
store i32 %214, i32* %215
%216 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 2
%217 = load i32, i32* %216
%218 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 0, i64 1
store i32 %217, i32* %218
%219 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0, i64 1
%220 = load i32, i32* %219
%221 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0, i64 0
store i32 %220, i32* %221
%222 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0, i64 2
%223 = load i32, i32* %222
%224 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0, i64 1
store i32 %223, i32* %224
br label %225
225: ; preds = %162, %159
%226 = load i32, i32* %21
%227 = add nsw i32 %226, 1
store i32 %227, i32* %21
%228 = load i32, i32* %21
%229 = icmp eq i32 %228, 1000
br i1 %229, label %230, label %271
230: ; preds = %225
%231 = load i32, i32* %19
%232 = icmp eq i32 %231, 0
br i1 %232, label %233, label %241
233: ; preds = %230
%234 = bitcast [2000 x i16]* %10 to i16**
%235 = load i32, i32* %17
%236 = sext i32 %235 to i64
%237 = mul i64 2, %236
%238 = trunc i64 %237 to i32
%239 = load i32*, i32** %7
%240 = call i32 @fwrite(i16** %234, i32 %238, i32 1000, i32* %239)
br label %270
241: ; preds = %230
store i16 0, i16* %11
br label %242
242: ; preds = %259, %241
%243 = load i16, i16* %11
%244 = sext i16 %243 to i32
%245 = load i32, i32* %17
%246 = mul nsw i32 %245, 1000
%247 = icmp slt i32 %244, %246
br i1 %247, label %248, label %262
248: ; preds = %242
%249 = load i16, i16* %11
%250 = sext i16 %249 to i64
%251 = getelementptr inbounds [2000 x i16], [2000 x i16]* %10, i64 0, i64 %250
%252 = load i16, i16* %251
%253 = sext i16 %252 to i32
%254 = ashr i32 %253, 8
%255 = trunc i32 %254 to i16
%256 = load i16, i16* %11
%257 = sext i16 %256 to i64
%258 = getelementptr inbounds [2000 x i16], [2000 x i16]* %14, i64 0, i64 %257
store i16 %255, i16* %258
br label %259
259: ; preds = %248
%260 = load i16, i16* %11
%261 = add i16 %260, 1
store i16 %261, i16* %11
br label %242
262: ; preds = %242
%263 = bitcast [2000 x i16]* %14 to i16**
%264 = load i32, i32* %17
%265 = sext i32 %264 to i64
%266 = mul i64 2, %265
%267 = trunc i64 %266 to i32
%268 = load i32*, i32** %7
%269 = call i32 @fwrite(i16** %263, i32 %267, i32 1000, i32* %268)
br label %270
270: ; preds = %262, %233
store i32 0, i32* %21
br label %271
271: ; preds = %270, %225
%272 = load float, float* %12
%273 = fpext float %272 to double
%274 = fdiv double 1.000000e+00, %273
%275 = load float, float* %13
%276 = fpext float %275 to double
%277 = fadd double %276, %274
%278 = fptrunc double %277 to float
store float %278, float* %13
br label %118
279: ; preds = %118
%280 = load float, float* %13
%281 = fpext float %280 to double
%282 = fsub double %281, 1.000000e+00
%283 = fptrunc double %282 to float
store float %283, float* %13
store i16 0, i16* %11
br label %284
284: ; preds = %297, %279
%285 = load i16, i16* %11
%286 = sext i16 %285 to i32
%287 = load i32, i32* %17
%288 = icmp slt i32 %286, %287
br i1 %288, label %289, label %300
289: ; preds = %284
%290 = load i16, i16* %11
%291 = sext i16 %290 to i64
%292 = getelementptr inbounds [2 x i16], [2 x i16]* %9, i64 0, i64 %291
%293 = load i16, i16* %292
%294 = load i16, i16* %11
%295 = sext i16 %294 to i64
%296 = getelementptr inbounds [2 x i16], [2 x i16]* %8, i64 0, i64 %295
store i16 %293, i16* %296
br label %297
297: ; preds = %289
%298 = load i16, i16* %11
%299 = add i16 %298, 1
store i16 %299, i16* %11
br label %284
300: ; preds = %284
br label %108
301: ; preds = %108
%302 = load i32, i32* %19
%303 = icmp eq i32 %302, 0
br i1 %303, label %304, label %309
304: ; preds = %301
%305 = bitcast [2000 x i16]* %10 to i16**
%306 = load i32, i32* %21
%307 = load i32*, i32** %7
%308 = call i32 @fwrite(i16** %305, i32 2, i32 %306, i32* %307)
br label %334
309: ; preds = %301
store i16 0, i16* %11
br label %310
310: ; preds = %326, %309
%311 = load i16, i16* %11
%312 = sext i16 %311 to i32
%313 = load i32, i32* %21
%314 = icmp slt i32 %312, %313
br i1 %314, label %315, label %329
315: ; preds = %310
%316 = load i16, i16* %11
%317 = sext i16 %316 to i64
%318 = getelementptr inbounds [2000 x i16], [2000 x i16]* %10, i64 0, i64 %317
%319 = load i16, i16* %318
%320 = sext i16 %319 to i32
%321 = ashr i32 %320, 8
%322 = trunc i32 %321 to i16
%323 = load i16, i16* %11
%324 = sext i16 %323 to i64
%325 = getelementptr inbounds [2000 x i16], [2000 x i16]* %14, i64 0, i64 %324
store i16 %322, i16* %325
br label %326
326: ; preds = %315
%327 = load i16, i16* %11
%328 = add i16 %327, 1
store i16 %328, i16* %11
br label %310
329: ; preds = %310
%330 = bitcast [2000 x i16]* %14 to i16**
%331 = load i32, i32* %21
%332 = load i32*, i32** %7
%333 = call i32 @fwrite(i16** %330, i32 2, i32 %331, i32* %332)
br label %334
334: ; preds = %329, %304
%335 = load i32*, i32** %7
%336 = call i32 @fclose(i32* %335)
%337 = load i32*, i32** %6
%338 = call i32 @fclose(i32* %337)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@stdin = global i32* null
@.str.1 = [3 x i8] c"rb\00"
@stdout = global i32* null
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [4 x i8] c"cdf\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [2 x i16]
%4 = alloca [2 x i16]
%5 = alloca [2000 x i16]
%6 = alloca [2000 x i16]
%7 = bitcast [2 x i16]* %3 to i8*
%8 = bitcast [2 x i16]* %4 to i8*
%9 = bitcast [2000 x i16]* %5 to i8*
%10 = bitcast [2000 x i16]* %6 to i8*
%11 = icmp slt i32 %0, 3
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = tail call i32 (...) @display_help()
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i32*, i32** @stdin
br label %25
22: ; preds = %15
%23 = load i8*, i8** %16
%24 = tail call i32* @fopen(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %22, %20
%26 = phi i32* [ %21, %20 ], [ %24, %22 ]
%27 = icmp ne i32* %26, null
%28 = zext i1 %27 to i32
%29 = tail call i32 @assert(i32 %28)
%30 = getelementptr inbounds i8*, i8** %1, i64 2
%31 = load i8*, i8** %30
%32 = tail call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %25
%35 = load i32*, i32** @stdout
br label %39
36: ; preds = %25
%37 = load i8*, i8** %30
%38 = tail call i32* @fopen(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %39
39: ; preds = %36, %34
%40 = phi i32* [ %35, %34 ], [ %38, %36 ]
%41 = icmp ne i32* %40, null
%42 = zext i1 %41 to i32
%43 = tail call i32 @assert(i32 %42)
%44 = getelementptr inbounds i8*, i8** %1, i64 3
%45 = load i8*, i8** %44
%46 = tail call float @atof(i8* %45)
%47 = fcmp ugt float %46, 1.000000e+00
br i1 %47, label %54, label %48
48: ; preds = %39
%49 = tail call i32 (...) @display_help()
%50 = tail call i32 @exit(i32 1)
unreachable
51: ; preds = %51, %58
%52 = phi i32 [ %60, %58 ], [ 1, %51 ]
%53 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
switch i32 %53, label %61 [
i32 -1, label %93
i32 99, label %58
i32 100, label %54
i32 102, label %51
]
54: ; preds = %51, %39
%55 = phi i32 [ 1, %39 ], [ 2, %51 ]
%56 = phi i32 [ 0, %39 ], [ %52, %51 ]
%57 = phi i1 [ true, %39 ], [ false, %51 ]
br label %58
58: ; preds = %51, %54
%59 = phi i32 [ %55, %54 ], [ 2, %51 ]
%60 = phi i32 [ %56, %54 ], [ %52, %51 ]
br label %51
61: ; preds = %51
%62 = tail call i32 (...) @display_help()
%63 = tail call i32 @exit(i32 1)
unreachable
64: ; preds = %93
%65 = bitcast [2 x i16]* %4 to i16**
%66 = shl nuw nsw i32 %59, 1
%67 = call i32 @fread(i16** %65, i32 %66, i32 1, i32* %26)
%68 = icmp eq i32 %67, 1
br i1 %68, label %69, label %269
69: ; preds = %64
%70 = icmp eq i32 %52, 0
%71 = mul nuw nsw i32 %59, 1000
%72 = fpext float %46 to double
%73 = fdiv double 1.000000e+00, %72
%74 = call i32 @llvm.smax.i32(i32 %71, i32 1)
%75 = add nsw i32 %74, -1
%76 = call i32 @llvm.smax.i32(i32 %71, i32 1)
%77 = mul nsw i32 %59, 1000
%78 = add nsw i32 %77, -16
%79 = lshr i32 %78, 4
%80 = add nuw nsw i32 %79, 1
%81 = icmp ult i32 %76, 16
%82 = trunc i32 %75 to i16
%83 = icmp ugt i16 %82, 32766
%84 = icmp ugt i32 %75, 32767
%85 = or i1 %83, %84
%86 = and i32 %76, 4080
%87 = trunc i32 %86 to i16
%88 = and i32 %80, 1
%89 = icmp ult i32 %78, 16
%90 = and i32 %80, 536870910
%91 = icmp eq i32 %88, 0
%92 = icmp eq i32 %76, %86
br label %103
93: ; preds = %51, %93
%94 = phi i16 [ %97, %93 ], [ 0, %51 ]
%95 = sext i16 %94 to i64
%96 = getelementptr inbounds [2 x i16], [2 x i16]* %3, i64 0, i64 %95
store i16 0, i16* %96
%97 = add i16 %94, 1
%98 = sext i16 %97 to i32
%99 = icmp sgt i32 %59, %98
br i1 %99, label %93, label %64
100: ; preds = %259
%101 = call i32 @fread(i16** %65, i32 %66, i32 1, i32* %26)
%102 = icmp eq i32 %101, 1
br i1 %102, label %103, label %268
103: ; preds = %69, %100
%104 = phi float [ 0.000000e+00, %69 ], [ %258, %100 ]
%105 = phi i32 [ 0, %69 ], [ %256, %100 ]
%106 = phi i32 [ 0, %69 ], [ %255, %100 ]
%107 = phi i32 [ 0, %69 ], [ %254, %100 ]
%108 = phi i32 [ -1, %69 ], [ %253, %100 ]
%109 = phi i32 [ -1, %69 ], [ %252, %100 ]
%110 = fcmp olt float %104, 1.000000e+00
br i1 %110, label %111, label %251
111: ; preds = %103, %246
%112 = phi float [ %249, %246 ], [ %104, %103 ]
%113 = phi i32 [ %247, %246 ], [ %105, %103 ]
%114 = phi i32 [ %167, %246 ], [ %106, %103 ]
%115 = phi i32 [ %166, %246 ], [ %107, %103 ]
%116 = phi i32 [ %165, %246 ], [ %108, %103 ]
%117 = phi i32 [ %164, %246 ], [ %109, %103 ]
%118 = fpext float %112 to double
%119 = fsub double 1.000000e+00, %118
%120 = shl nsw i32 %113, 1
br label %121
121: ; preds = %111, %121
%122 = phi i32 [ 0, %111 ], [ %139, %121 ]
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [2 x i16], [2 x i16]* %3, i64 0, i64 %123
%125 = load i16, i16* %124
%126 = sitofp i16 %125 to double
%127 = getelementptr inbounds [2 x i16], [2 x i16]* %4, i64 0, i64 %123
%128 = load i16, i16* %127
%129 = sitofp i16 %128 to float
%130 = fmul float %112, %129
%131 = fpext float %130 to double
%132 = tail call double @llvm.fmuladd.f64(double %119, double %126, double %131)
%133 = fptosi double %132 to i16
%134 = add nsw i32 %122, %120
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [2000 x i16], [2000 x i16]* %5, i64 0, i64 %135
store i16 %133, i16* %136
%137 = shl nsw i32 %122, 16
%138 = add i32 %137, 65536
%139 = ashr exact i32 %138, 16
%140 = icmp sgt i32 %59, %139
br i1 %140, label %121, label %141
141: ; preds = %121
br i1 %70, label %163, label %142
142: ; preds = %141
%143 = sub nsw i32 0, %117
%144 = sub nsw i32 0, %115
%145 = shl nsw i32 %113, 1
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [2000 x i16], [2000 x i16]* %5, i64 0, i64 %146
%148 = load i16, i16* %147
%149 = zext i16 %148 to i32
%150 = or i32 %145, 1
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [2000 x i16], [2000 x i16]* %5, i64 0, i64 %151
%153 = load i16, i16* %152
%154 = zext i16 %153 to i32
%155 = mul i32 %149, %143
%156 = mul i32 %115, %154
%157 = add i32 %156, %155
%158 = trunc i32 %157 to i16
store i16 %158, i16* %147
%159 = mul i32 %154, %143
%160 = mul i32 %149, %144
%161 = add i32 %159, %160
%162 = trunc i32 %161 to i16
store i16 %162, i16* %152
br label %163
163: ; preds = %142, %141
%164 = phi i32 [ %114, %142 ], [ %117, %141 ]
%165 = phi i32 [ %144, %142 ], [ %116, %141 ]
%166 = phi i32 [ %116, %142 ], [ %115, %141 ]
%167 = phi i32 [ %143, %142 ], [ %114, %141 ]
%168 = add nsw i32 %113, 1
%169 = icmp eq i32 %168, 1000
br i1 %169, label %170, label %246
170: ; preds = %163
br i1 %57, label %242, label %171
171: ; preds = %170
%172 = select i1 %81, i1 true, i1 %85
br i1 %172, label %230, label %173
173: ; preds = %171
br i1 %89, label %211, label %174
174: ; preds = %173, %174
%175 = phi i32 [ %208, %174 ], [ 0, %173 ]
%176 = phi i32 [ %209, %174 ], [ 0, %173 ]
%177 = zext i32 %175 to i64
%178 = shl i64 %177, 48
%179 = ashr exact i64 %178, 48
%180 = getelementptr inbounds [2000 x i16], [2000 x i16]* %5, i64 0, i64 %179
%181 = bitcast i16* %180 to <8 x i16>*
%182 = load <8 x i16>, <8 x i16>* %181
%183 = getelementptr inbounds i16, i16* %180, i64 8
%184 = bitcast i16* %183 to <8 x i16>*
%185 = load <8 x i16>, <8 x i16>* %184
%186 = ashr <8 x i16> %182, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%187 = ashr <8 x i16> %185, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%188 = getelementptr inbounds [2000 x i16], [2000 x i16]* %6, i64 0, i64 %179
%189 = bitcast i16* %188 to <8 x i16>*
store <8 x i16> %186, <8 x i16>* %189
%190 = getelementptr inbounds i16, i16* %188, i64 8
%191 = bitcast i16* %190 to <8 x i16>*
store <8 x i16> %187, <8 x i16>* %191
%192 = or i32 %175, 16
%193 = zext i32 %192 to i64
%194 = shl i64 %193, 48
%195 = ashr exact i64 %194, 48
%196 = getelementptr inbounds [2000 x i16], [2000 x i16]* %5, i64 0, i64 %195
%197 = bitcast i16* %196 to <8 x i16>*
%198 = load <8 x i16>, <8 x i16>* %197
%199 = getelementptr inbounds i16, i16* %196, i64 8
%200 = bitcast i16* %199 to <8 x i16>*
%201 = load <8 x i16>, <8 x i16>* %200
%202 = ashr <8 x i16> %198, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%203 = ashr <8 x i16> %201, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%204 = getelementptr inbounds [2000 x i16], [2000 x i16]* %6, i64 0, i64 %195
%205 = bitcast i16* %204 to <8 x i16>*
store <8 x i16> %202, <8 x i16>* %205
%206 = getelementptr inbounds i16, i16* %204, i64 8
%207 = bitcast i16* %206 to <8 x i16>*
store <8 x i16> %203, <8 x i16>* %207
%208 = add nuw nsw i32 %175, 32
%209 = add nuw nsw i32 %176, 2
%210 = icmp eq i32 %209, %90
br i1 %210, label %211, label %174
211: ; preds = %174, %173
%212 = phi i32 [ 0, %173 ], [ %208, %174 ]
br i1 %91, label %229, label %213
213: ; preds = %211
%214 = zext i32 %212 to i64
%215 = shl i64 %214, 48
%216 = ashr exact i64 %215, 48
%217 = getelementptr inbounds [2000 x i16], [2000 x i16]* %5, i64 0, i64 %216
%218 = bitcast i16* %217 to <8 x i16>*
%219 = load <8 x i16>, <8 x i16>* %218
%220 = getelementptr inbounds i16, i16* %217, i64 8
%221 = bitcast i16* %220 to <8 x i16>*
%222 = load <8 x i16>, <8 x i16>* %221
%223 = ashr <8 x i16> %219, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%224 = ashr <8 x i16> %222, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%225 = getelementptr inbounds [2000 x i16], [2000 x i16]* %6, i64 0, i64 %216
%226 = bitcast i16* %225 to <8 x i16>*
store <8 x i16> %223, <8 x i16>* %226
%227 = getelementptr inbounds i16, i16* %225, i64 8
%228 = bitcast i16* %227 to <8 x i16>*
store <8 x i16> %224, <8 x i16>* %228
br label %229
229: ; preds = %211, %213
br i1 %92, label %242, label %230
230: ; preds = %171, %229
%231 = phi i16 [ 0, %171 ], [ %87, %229 ]
br label %232
232: ; preds = %230, %232
%233 = phi i16 [ %239, %232 ], [ %231, %230 ]
%234 = sext i16 %233 to i64
%235 = getelementptr inbounds [2000 x i16], [2000 x i16]* %5, i64 0, i64 %234
%236 = load i16, i16* %235
%237 = ashr i16 %236, 8
%238 = getelementptr inbounds [2000 x i16], [2000 x i16]* %6, i64 0, i64 %234
store i16 %237, i16* %238
%239 = add i16 %233, 1
%240 = sext i16 %239 to i32
%241 = icmp sgt i32 %71, %240
br i1 %241, label %232, label %242
242: ; preds = %232, %229, %170
%243 = phi [2000 x i16]* [ %5, %170 ], [ %6, %229 ], [ %6, %232 ]
%244 = bitcast [2000 x i16]* %243 to i16**
%245 = call i32 @fwrite(i16** %244, i32 %66, i32 1000, i32* %40)
br label %246
246: ; preds = %242, %163
%247 = phi i32 [ %168, %163 ], [ 0, %242 ]
%248 = fadd double %73, %118
%249 = fptrunc double %248 to float
%250 = fcmp olt float %249, 1.000000e+00
br i1 %250, label %111, label %251
251: ; preds = %246, %103
%252 = phi i32 [ %109, %103 ], [ %164, %246 ]
%253 = phi i32 [ %108, %103 ], [ %165, %246 ]
%254 = phi i32 [ %107, %103 ], [ %166, %246 ]
%255 = phi i32 [ %106, %103 ], [ %167, %246 ]
%256 = phi i32 [ %105, %103 ], [ %247, %246 ]
%257 = phi float [ %104, %103 ], [ %249, %246 ]
%258 = fadd float %257, -1.000000e+00
br label %259
259: ; preds = %251, %259
%260 = phi i16 [ %265, %259 ], [ 0, %251 ]
%261 = sext i16 %260 to i64
%262 = getelementptr inbounds [2 x i16], [2 x i16]* %4, i64 0, i64 %261
%263 = load i16, i16* %262
%264 = getelementptr inbounds [2 x i16], [2 x i16]* %3, i64 0, i64 %261
store i16 %263, i16* %264
%265 = add i16 %260, 1
%266 = sext i16 %265 to i32
%267 = icmp sgt i32 %59, %266
br i1 %267, label %259, label %100
268: ; preds = %100
br i1 %57, label %363, label %270
269: ; preds = %64
br i1 %57, label %363, label %361
270: ; preds = %268
%271 = icmp sgt i32 %256, 0
br i1 %271, label %272, label %361
272: ; preds = %270
%273 = icmp ult i32 %256, 16
br i1 %273, label %349, label %274
274: ; preds = %272
%275 = add i32 %256, -1
%276 = trunc i32 %275 to i16
%277 = icmp ugt i16 %276, 32766
%278 = icmp ugt i32 %275, 32767
%279 = or i1 %277, %278
br i1 %279, label %349, label %280
280: ; preds = %274
%281 = and i32 %256, -16
%282 = trunc i32 %281 to i16
%283 = add i32 %281, -16
%284 = lshr exact i32 %283, 4
%285 = add nuw nsw i32 %284, 1
%286 = and i32 %285, 1
%287 = icmp eq i32 %283, 0
br i1 %287, label %331, label %288
288: ; preds = %280
%289 = and i32 %285, 536870910
br label %290
290: ; preds = %290, %288
%291 = phi i32 [ 0, %288 ], [ %324, %290 ]
%292 = phi i32 [ 0, %288 ], [ %325, %290 ]
%293 = zext i32 %291 to i64
%294 = shl i64 %293, 48
%295 = ashr exact i64 %294, 48
%296 = getelementptr inbounds [2000 x i16], [2000 x i16]* %5, i64 0, i64 %295
%297 = bitcast i16* %296 to <8 x i16>*
%298 = load <8 x i16>, <8 x i16>* %297
%299 = getelementptr inbounds i16, i16* %296, i64 8
%300 = bitcast i16* %299 to <8 x i16>*
%301 = load <8 x i16>, <8 x i16>* %300
%302 = ashr <8 x i16> %298, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%303 = ashr <8 x i16> %301, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%304 = getelementptr inbounds [2000 x i16], [2000 x i16]* %6, i64 0, i64 %295
%305 = bitcast i16* %304 to <8 x i16>*
store <8 x i16> %302, <8 x i16>* %305
%306 = getelementptr inbounds i16, i16* %304, i64 8
%307 = bitcast i16* %306 to <8 x i16>*
store <8 x i16> %303, <8 x i16>* %307
%308 = or i32 %291, 16
%309 = zext i32 %308 to i64
%310 = shl i64 %309, 48
%311 = ashr exact i64 %310, 48
%312 = getelementptr inbounds [2000 x i16], [2000 x i16]* %5, i64 0, i64 %311
%313 = bitcast i16* %312 to <8 x i16>*
%314 = load <8 x i16>, <8 x i16>* %313
%315 = getelementptr inbounds i16, i16* %312, i64 8
%316 = bitcast i16* %315 to <8 x i16>*
%317 = load <8 x i16>, <8 x i16>* %316
%318 = ashr <8 x i16> %314, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%319 = ashr <8 x i16> %317, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%320 = getelementptr inbounds [2000 x i16], [2000 x i16]* %6, i64 0, i64 %311
%321 = bitcast i16* %320 to <8 x i16>*
store <8 x i16> %318, <8 x i16>* %321
%322 = getelementptr inbounds i16, i16* %320, i64 8
%323 = bitcast i16* %322 to <8 x i16>*
store <8 x i16> %319, <8 x i16>* %323
%324 = add nuw i32 %291, 32
%325 = add i32 %292, 2
%326 = icmp eq i32 %325, %289
br i1 %326, label %327, label %290
327: ; preds = %290
%328 = zext i32 %324 to i64
%329 = shl i64 %328, 48
%330 = ashr exact i64 %329, 48
br label %331
331: ; preds = %327, %280
%332 = phi i64 [ 0, %280 ], [ %330, %327 ]
%333 = icmp eq i32 %286, 0
br i1 %333, label %347, label %334
334: ; preds = %331
%335 = getelementptr inbounds [2000 x i16], [2000 x i16]* %5, i64 0, i64 %332
%336 = bitcast i16* %335 to <8 x i16>*
%337 = load <8 x i16>, <8 x i16>* %336
%338 = getelementptr inbounds i16, i16* %335, i64 8
%339 = bitcast i16* %338 to <8 x i16>*
%340 = load <8 x i16>, <8 x i16>* %339
%341 = ashr <8 x i16> %337, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%342 = ashr <8 x i16> %340, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%343 = getelementptr inbounds [2000 x i16], [2000 x i16]* %6, i64 0, i64 %332
%344 = bitcast i16* %343 to <8 x i16>*
store <8 x i16> %341, <8 x i16>* %344
%345 = getelementptr inbounds i16, i16* %343, i64 8
%346 = bitcast i16* %345 to <8 x i16>*
store <8 x i16> %342, <8 x i16>* %346
br label %347
347: ; preds = %331, %334
%348 = icmp eq i32 %256, %281
br i1 %348, label %361, label %349
349: ; preds = %274, %272, %347
%350 = phi i16 [ 0, %274 ], [ 0, %272 ], [ %282, %347 ]
br label %351
351: ; preds = %349, %351
%352 = phi i16 [ %358, %351 ], [ %350, %349 ]
%353 = sext i16 %352 to i64
%354 = getelementptr inbounds [2000 x i16], [2000 x i16]* %5, i64 0, i64 %353
%355 = load i16, i16* %354
%356 = ashr i16 %355, 8
%357 = getelementptr inbounds [2000 x i16], [2000 x i16]* %6, i64 0, i64 %353
store i16 %356, i16* %357
%358 = add i16 %352, 1
%359 = sext i16 %358 to i32
%360 = icmp sgt i32 %256, %359
br i1 %360, label %351, label %361
361: ; preds = %351, %347, %269, %270
%362 = phi i32 [ %256, %270 ], [ 0, %269 ], [ %256, %347 ], [ %256, %351 ]
br label %363
363: ; preds = %268, %269, %361
%364 = phi [2000 x i16]* [ %6, %361 ], [ %5, %269 ], [ %5, %268 ]
%365 = phi i32 [ %362, %361 ], [ 0, %269 ], [ %256, %268 ]
%366 = bitcast [2000 x i16]* %364 to i16**
%367 = call i32 @fwrite(i16** %366, i32 2, i32 %365, i32* %40)
%368 = tail call i32 @fclose(i32* %40)
%369 = tail call i32 @fclose(i32* %26)
ret i32 0
}