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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ acf(double *, int, int, int, double *);
int /*<<< orphan*/ calc_residue(int *, int, int, int const, int *, int *);
int /*<<< orphan*/ calc_signal(int *, int, int, int const, int *, int *);
int check_wav_file(int /*<<< orphan*/ *, int *, int *, int *);
int compute_ref_coefs(double *, int, double *);
int /*<<< orphan*/ dqtz_ref_cof(int *, int, int const, double *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
size_t fread(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(int *, int, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ levinson(int /*<<< orphan*/ *, int, double *, double **);
scalar_t__ malloc(int);
int /*<<< orphan*/ qtz_ref_cof(double *, int, int *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  FILE *infile = fopen(argv[1], "rb");
  FILE *outfile = fopen(argv[2], "wb");
  if (infile == NULL || outfile == NULL) {
    fprintf(stderr, "Error open input or output file.Exiting.......\n");
    return -1;
  }
  int32_t sample_rate;
  int16_t channels, bps;
  int32_t corr = 1 << 20;
  const int8_t Q = 20;
  check_wav_file(infile, &sample_rate, &channels, &bps);
  int32_t is_wav = check_wav_file(infile, &sample_rate, &channels, &bps);
  switch (is_wav) {
  case 1:
    fprintf(stderr, "WAV file detected.\n");
    break;
  case -1:
    fprintf(stderr, "RIFF header not found. Exiting......\n");
    return -1;
  case -2:
    fprintf(stderr, "WAVE header not found. Exiting......\n");
    return -1;
  case -3:
    fprintf(stderr, "Not a 16 bit/sample wav file. Exiting......\n");
    return -1;
  default:
    fprintf(stderr, "Some error occured. Exiting.......\n");
  }
  fprintf(stderr, "Sampling Rate : %d Hz\n", sample_rate);
  fprintf(stderr, "Bits per sample : %d\n", bps);
  fprintf(stderr, "Channels : %d\n", channels);
  fseek(infile, 0, SEEK_SET);
  int8_t header[44];
  fread(header, sizeof(int8_t), 44, infile);
  fwrite(header, sizeof(int8_t), 44, outfile);
  int32_t read_size = 2048 * channels;
  int16_t *buffer = (int16_t *)malloc(sizeof(int16_t) * read_size);
  int16_t *rcv_buffer = (int16_t *)malloc(sizeof(int16_t) * read_size);
  while (feof(infile) == 0) {
    size_t read = fread(buffer, sizeof(int16_t), read_size, infile);
    int32_t samples_per_channel = read / channels;
    for (int32_t i = 0; i < channels; i++) {
      int16_t samples[2048];
      for (int32_t j = 0; j < samples_per_channel; j++)
        samples[j] = buffer[channels * j + i];
      int32_t int_samples[2048];
      for (int32_t j = 0; j < samples_per_channel; j++)
        int_samples[j] = samples[j];
      double qtz_samples[2048];
      for (int32_t j = 0; j < samples_per_channel; j++)
        qtz_samples[j] = ((double)samples[j]) / 32767;
      double autocorr[60 + 1];
      acf(qtz_samples, samples_per_channel, 60, 1, autocorr);
      double ref[60];
      uint8_t opt_lpc_order = compute_ref_coefs(autocorr, 60, ref);
      int32_t q_ref_coeffs[60];
      qtz_ref_cof(ref, opt_lpc_order, q_ref_coeffs);
      dqtz_ref_cof(q_ref_coeffs, opt_lpc_order, Q, ref);
      double lpc[60 + 1];
      double lpc_mat[60][60];
      levinson(NULL, opt_lpc_order, ref, lpc_mat);
      for (int32_t j = 0; j < opt_lpc_order; j++)
        lpc[j + 1] = lpc_mat[opt_lpc_order - 1][j];
      lpc[0] = 0;
      int32_t int_lpc[60 + 1];
      for (int32_t j = 0; j <= opt_lpc_order; j++)
        int_lpc[j] = corr * lpc[j];
      int32_t residues[2048];
      int32_t rcv_samples[2048];
      calc_residue(int_samples, samples_per_channel, opt_lpc_order, Q, int_lpc,
                   residues);
      calc_signal(residues, samples_per_channel, opt_lpc_order, Q, int_lpc,
                  rcv_samples);
      for (int32_t j = 0; j < samples_per_channel; j++)
        rcv_buffer[channels * j + i] = (int16_t)rcv_samples[j];
    }
    fwrite(rcv_buffer, sizeof(int16_t), read, outfile);
  }
  free(buffer);
  fclose(infile);
  fclose(outfile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x139c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde4(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdcf(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     126f <main+0x5f>
cmpq   $0x0,-0x20(%rbp)
jne    1292 <main+0x82>
mov    0x2d6a(%rip),%rax
mov    (%rax),%edi
lea    0xda3(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x655>
movl   $0x100000,-0x30(%rbp)
movl   $0x14,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x24(%rbp),%rsi
mov    %rsi,-0x139b8(%rbp)
lea    -0x28(%rbp),%rdx
mov    %rdx,-0x139b0(%rbp)
lea    -0x2c(%rbp),%rcx
mov    %rcx,-0x139a8(%rbp)
call   1110 <check_wav_file@plt>
mov    -0x139b8(%rbp),%rsi
mov    -0x139b0(%rbp),%rdx
mov    -0x139a8(%rbp),%rcx
mov    -0x18(%rbp),%rdi
call   1110 <check_wav_file@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
add    $0x3,%eax
mov    %eax,%ecx
mov    %rcx,-0x139a0(%rbp)
sub    $0x4,%eax
ja     139f <main+0x18f>
mov    -0x139a0(%rbp),%rax
lea    0xcf7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2cbf(%rip),%rax
mov    (%rax),%edi
lea    0xd28(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    13b6 <main+0x1a6>
mov    0x2ca3(%rip),%rax
mov    (%rax),%edi
lea    0xd20(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x655>
mov    0x2c80(%rip),%rax
mov    (%rax),%edi
lea    0xd23(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x655>
mov    0x2c5d(%rip),%rax
mov    (%rax),%edi
lea    0xd26(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1865 <main+0x655>
mov    0x2c3a(%rip),%rax
mov    (%rax),%edi
lea    0xd30(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2c23(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
lea    0xd3a(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2c09(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%edx
lea    0xd37(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2bef(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%edx
lea    0xd33(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    0x2bc9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10d0 <fseek@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
mov    $0x2c,%edx
call   1060 <fread@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x4,%esi
mov    $0x2c,%edx
call   1120 <fwrite@plt>
mov    -0x28(%rbp),%eax
shl    $0xb,%eax
mov    %eax,-0xf4(%rbp)
movslq -0xf4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x100(%rbp)
movslq -0xf4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x108(%rbp)
mov    -0x18(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%rax
jne    1840 <main+0x630>
mov    -0x100(%rbp),%rdi
mov    -0xf4(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
call   1060 <fread@plt>
mov    %rax,-0x110(%rbp)
mov    -0x110(%rbp),%rax
movslq -0x28(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x114(%rbp)
movl   $0x0,-0x118(%rbp)
mov    -0x118(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    181f <main+0x60f>
movl   $0x0,-0x2124(%rbp)
mov    -0x2124(%rbp),%eax
cmp    -0x114(%rbp),%eax
jge    1549 <main+0x339>
mov    -0x100(%rbp),%rax
mov    -0x28(%rbp),%ecx
imul   -0x2124(%rbp),%ecx
add    -0x118(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x2124(%rbp),%rax
mov    %ecx,-0x2120(%rbp,%rax,4)
mov    -0x2124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2124(%rbp)
jmp    14f8 <main+0x2e8>
movl   $0x0,-0x4134(%rbp)
mov    -0x4134(%rbp),%eax
cmp    -0x114(%rbp),%eax
jge    1595 <main+0x385>
movslq -0x4134(%rbp),%rax
mov    -0x2120(%rbp,%rax,4),%ecx
movslq -0x4134(%rbp),%rax
mov    %ecx,-0x4130(%rbp,%rax,4)
mov    -0x4134(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4134(%rbp)
jmp    1553 <main+0x343>
movl   $0x0,-0x8144(%rbp)
mov    -0x8144(%rbp),%eax
cmp    -0x114(%rbp),%eax
jge    15f1 <main+0x3e1>
movslq -0x8144(%rbp),%rax
cvtsi2sdl -0x2120(%rbp,%rax,4),%xmm0
ff ff
movsd  0xa37(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x8144(%rbp),%rax
movsd  %xmm0,-0x8140(%rbp,%rax,8)
ff ff
mov    -0x8144(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8144(%rbp)
jmp    159f <main+0x38f>
lea    -0x8140(%rbp),%rdi
mov    -0x114(%rbp),%esi
lea    -0x8330(%rbp),%r8
mov    $0x3c,%edx
mov    $0x1,%ecx
call   10e0 <acf@plt>
lea    -0x8330(%rbp),%rdi
lea    -0x8510(%rbp),%rdx
mov    $0x3c,%esi
call   1030 <compute_ref_coefs@plt>
mov    %eax,-0x8514(%rbp)
lea    -0x8510(%rbp),%rdi
mov    -0x8514(%rbp),%esi
lea    -0x8610(%rbp),%rdx
call   1040 <qtz_ref_cof@plt>
lea    -0x8610(%rbp),%rdi
mov    -0x8514(%rbp),%esi
lea    -0x8510(%rbp),%rcx
mov    $0x14,%edx
call   1100 <dqtz_ref_cof@plt>
mov    -0x8514(%rbp),%esi
lea    -0x8510(%rbp),%rdx
lea    -0xf880(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
call   1130 <levinson@plt>
movl   $0x0,-0xf884(%rbp)
mov    -0xf884(%rbp),%eax
cmp    -0x8514(%rbp),%eax
jge    16f3 <main+0x4e3>
mov    -0x8514(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0xf880(%rbp),%rax
imul   $0x1e0,%rcx,%rcx
add    %rcx,%rax
movslq -0xf884(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xf884(%rbp),%eax
add    $0x1,%eax
cltq
movsd  %xmm0,-0x8800(%rbp,%rax,8)
ff ff
mov    -0xf884(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf884(%rbp)
jmp    1690 <main+0x480>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8800(%rbp)
ff
movl   $0x0,-0xf984(%rbp)
mov    -0xf984(%rbp),%eax
cmp    -0x8514(%rbp),%eax
jg     1755 <main+0x545>
cvtsi2sdl -0x30(%rbp),%xmm0
movslq -0xf984(%rbp),%rax
mulsd  -0x8800(%rbp,%rax,8),%xmm0
ff ff
cvttsd2si %xmm0,%ecx
movslq -0xf984(%rbp),%rax
mov    %ecx,-0xf980(%rbp,%rax,4)
mov    -0xf984(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf984(%rbp)
jmp    1708 <main+0x4f8>
lea    -0x4130(%rbp),%rdi
mov    -0x114(%rbp),%esi
mov    -0x8514(%rbp),%edx
lea    -0xf980(%rbp),%r8
lea    -0x11990(%rbp),%r9
mov    $0x14,%ecx
call   10b0 <calc_residue@plt>
lea    -0x11990(%rbp),%rdi
mov    -0x114(%rbp),%esi
mov    -0x8514(%rbp),%edx
lea    -0xf980(%rbp),%r8
lea    -0x13990(%rbp),%r9
mov    $0x14,%ecx
call   1080 <calc_signal@plt>
movl   $0x0,-0x13994(%rbp)
mov    -0x13994(%rbp),%eax
cmp    -0x114(%rbp),%eax
jge    1806 <main+0x5f6>
movslq -0x13994(%rbp),%rax
mov    -0x13990(%rbp,%rax,4),%edx
mov    -0x108(%rbp),%rax
mov    -0x28(%rbp),%ecx
imul   -0x13994(%rbp),%ecx
add    -0x118(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x13994(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13994(%rbp)
jmp    17b5 <main+0x5a5>
jmp    180b <main+0x5fb>
mov    -0x118(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x118(%rbp)
jmp    14df <main+0x2cf>
mov    -0x108(%rbp),%rdi
mov    -0x110(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x4,%esi
call   1120 <fwrite@plt>
jmp    148a <main+0x27a>
mov    -0x100(%rbp),%rdi
call   1050 <free@plt>
mov    -0x18(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1070 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x139c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x13978,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe05(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,%rbp
mov    0x10(%rbx),%rdi
lea    0xdf5(%rip),%rsi
call   1100 <fopen@plt>
test   %rbp,%rbp
je     12c6 <main+0xa6>
mov    %rax,%rbx
test   %rax,%rax
je     12c6 <main+0xa6>
lea    0x1c(%rsp),%r12
lea    0x4(%rsp),%r15
lea    0x18(%rsp),%r14
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1120 <check_wav_file@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1120 <check_wav_file@plt>
add    $0x3,%eax
cmp    $0x4,%eax
ja     1318 <main+0xf8>
lea    0xdd6(%rip),%rsi
lea    0xd85(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d25(%rip),%rax
mov    (%rax),%edi
lea    0xe16(%rip),%rsi
jmp    12d6 <main+0xb6>
mov    0x2d13(%rip),%rax
mov    (%rax),%edi
lea    0xd74(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x13978,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2ce5(%rip),%rax
mov    (%rax),%edi
lea    0xdb0(%rip),%rsi
jmp    12d6 <main+0xb6>
mov    0x2cd3(%rip),%rax
mov    (%rax),%edi
lea    0xd78(%rip),%rsi
jmp    12d6 <main+0xb6>
lea    0xde8(%rip),%rsi
mov    0x2cba(%rip),%r14
mov    (%r14),%edi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    (%r14),%edi
mov    0x1c(%rsp),%edx
lea    0xded(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    (%r14),%edi
mov    0x18(%rsp),%edx
lea    0xdef(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    (%r14),%edi
mov    0x4(%rsp),%edx
lea    0xdf0(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x2c62(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   10e0 <fseek@plt>
lea    0x380(%rsp),%r14
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x2c,%edx
mov    %rbp,%rcx
call   1060 <fread@plt>
mov    $0x2c,%edx
mov    %r14,%rdi
mov    $0x4,%esi
mov    %rbx,%rcx
call   1130 <fwrite@plt>
mov    0x4(%rsp),%r14d
mov    %r14d,0x14(%rsp)
shl    $0xd,%r14d
mov    %r14d,%edi
call   10d0 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %r14d,%edi
call   10d0 <malloc@plt>
mov    %rax,%r15
mov    %rbp,%rdi
call   10a0 <feof@plt>
test   %rax,%rax
je     1408 <main+0x1e8>
mov    0x8(%rsp),%rdi
call   1050 <free@plt>
mov    %rbp,%rdi
call   1070 <fclose@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
xor    %eax,%eax
jmp    12e2 <main+0xc2>
shll   $0xb,0x14(%rsp)
mov    0x8(%rsp),%rax
add    $0x10,%rax
mov    %rax,0x38(%rsp)
mov    %rbp,0x48(%rsp)
mov    %rbx,0x40(%rsp)
jmp    145c <main+0x23c>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x4,%esi
mov    0x50(%rsp),%rdx
mov    0x40(%rsp),%rbx
mov    %rbx,%rcx
call   1130 <fwrite@plt>
mov    0x48(%rsp),%rbp
mov    %rbp,%rdi
call   10a0 <feof@plt>
test   %rax,%rax
jne    13e7 <main+0x1c7>
mov    0x8(%rsp),%rdi
mov    $0x4,%esi
mov    0x14(%rsp),%edx
mov    %rbp,%rcx
call   1060 <fread@plt>
mov    0x4(%rsp),%esi
movslq %esi,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
mov    %rax,0x50(%rsp)
je     14a0 <main+0x280>
xor    %edx,%edx
div    %rcx
mov    %rax,%r12
test   %esi,%esi
jg     14ab <main+0x28b>
jmp    1430 <main+0x210>
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
div    %esi
mov    %eax,%r12d
test   %esi,%esi
jle    1430 <main+0x210>
mov    %r12d,%r14d
lea    0x0(,%r14,4),%rax
mov    %rax,0x68(%rsp)
lea    -0x1(%r14),%rax
mov    %rax,0x28(%rsp)
mov    %r12d,%eax
and    $0x7,%eax
mov    %r14,%rcx
mov    %rax,0x60(%rsp)
sub    %rax,%rcx
mov    %rcx,0x58(%rsp)
mov    %r12d,%eax
and    $0x1,%eax
mov    %r14,%rcx
mov    %rax,0x20(%rsp)
sub    %rax,%rcx
mov    %rcx,0x30(%rsp)
xor    %r10d,%r10d
mov    0x38(%rsp),%r11
xor    %r13d,%r13d
mov    %r12,0x78(%rsp)
mov    %r14,0x70(%rsp)
jmp    152a <main+0x30a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r13
movslq 0x4(%rsp),%rsi
add    $0x4,%r11
add    $0x4,%r10
cmp    %rsi,%r13
jge    1430 <main+0x210>
test   %r12d,%r12d
mov    %r10,0x88(%rsp)
mov    %r11,0x80(%rsp)
jle    1732 <main+0x512>
movslq %esi,%r8
cmp    $0x8,%r14d
jb     15a7 <main+0x387>
mov    $0x0,%ecx
cmp    $0x1,%esi
jne    15a9 <main+0x389>
mov    %r8,%rax
shl    $0x5,%rax
mov    %r11,%rcx
xor    %edx,%edx
mov    0x58(%rsp),%rsi
nopw   0x0(%rax,%rax,1)
movupd -0x10(%rcx),%xmm0
movupd (%rcx),%xmm1
movapd %xmm0,0x8f0(%rsp,%rdx,4)
movapd %xmm1,0x900(%rsp,%rdx,4)
add    $0x8,%rdx
add    %rax,%rcx
cmp    %rsi,%rdx
jne    1570 <main+0x350>
mov    %rsi,%rcx
cmpq   $0x0,0x60(%rsp)
jne    15a9 <main+0x389>
jmp    1686 <main+0x466>
xor    %ecx,%ecx
mov    %r12d,%esi
sub    %ecx,%esi
mov    0x28(%rsp),%r9
sub    %rcx,%r9
and    $0x3,%rsi
je     1604 <main+0x3e4>
lea    (%rsp,%rcx,4),%rax
add    $0x8f0,%rax
mov    %rcx,%rdi
imul   %r8,%rdi
add    %r13,%rdi
mov    0x8(%rsp),%rdx
lea    (%rdx,%rdi,4),%rdi
lea    0x0(,%r8,4),%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rdi),%edx
mov    %edx,(%rax,%rbx,4)
add    $0x1,%rbx
add    %rbp,%rdi
cmp    %rsi,%rbx
jne    15f0 <main+0x3d0>
add    %rbx,%rcx
cmp    $0x3,%r9
jb     1686 <main+0x466>
lea    0x3(%rcx),%rax
imul   %r8,%rax
mov    0x8(%rsp),%rdx
lea    (%rdx,%rax,4),%r9
mov    %r8,%rsi
shl    $0x4,%rsi
lea    0x2(%rcx),%rax
imul   %r8,%rax
lea    (%rdx,%rax,4),%rdi
mov    %rcx,%rax
imul   %r8,%rax
lea    (%rdx,%rax,4),%rax
lea    0x1(%rcx),%rbp
imul   %r8,%rbp
lea    (%rdx,%rbp,4),%rbp
mov    %r10,%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rax,%rbx,1),%edx
mov    %edx,0x8f0(%rsp,%rcx,4)
mov    0x0(%rbp,%rbx,1),%edx
mov    %edx,0x8f4(%rsp,%rcx,4)
mov    (%rdi,%rbx,1),%edx
mov    %edx,0x8f8(%rsp,%rcx,4)
mov    (%r9,%rbx,1),%edx
mov    %edx,0x8fc(%rsp,%rcx,4)
add    $0x4,%rcx
add    %rsi,%rbx
cmp    %r14,%rcx
jne    1650 <main+0x430>
test   %r12d,%r12d
jle    1732 <main+0x512>
lea    0x48f0(%rsp),%rdi
lea    0x8f0(%rsp),%rsi
mov    0x68(%rsp),%rdx
call   10c0 <memcpy@plt>
xor    %eax,%eax
cmp    $0x2,%r14d
jae    16bb <main+0x49b>
movsd  0x967(%rip),%xmm1
jmp    1710 <main+0x4f0>
movapd 0x93d(%rip),%xmm1
mov    0x30(%rsp),%rcx
nopl   0x0(%rax,%rax,1)
cvtdq2pd 0x8f0(%rsp,%rax,4),%xmm0
divpd  %xmm1,%xmm0
movapd %xmm0,0x68f0(%rsp,%rax,8)
add    $0x2,%rax
cmp    %rcx,%rax
jne    16d0 <main+0x4b0>
mov    %rcx,%rax
cmpq   $0x0,0x20(%rsp)
movsd  0x920(%rip),%xmm1
je     1732 <main+0x512>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2sdl 0x8f0(%rsp,%rax,4),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x68f0(%rsp,%rax,8)
add    $0x1,%rax
cmp    %r14,%rax
jne    1710 <main+0x4f0>
lea    0x68f0(%rsp),%rdi
mov    %r12d,%esi
mov    $0x3c,%edx
mov    $0x1,%ecx
lea    0x700(%rsp),%rbp
mov    %rbp,%r8
call   10f0 <acf@plt>
mov    %rbp,%rdi
mov    $0x3c,%esi
lea    0x520(%rsp),%rbp
mov    %rbp,%rdx
call   1030 <compute_ref_coefs@plt>
mov    %eax,%r14d
mov    %rbp,%rdi
mov    %eax,%esi
lea    0x430(%rsp),%rbx
mov    %rbx,%rdx
call   1040 <qtz_ref_cof@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    $0x14,%edx
mov    %rbp,%rcx
call   1110 <dqtz_ref_cof@plt>
xor    %edi,%edi
mov    %r14d,%esi
mov    %rbp,%rdx
lea    0xc8f0(%rsp),%rcx
call   1140 <levinson@plt>
test   %r14d,%r14d
jle    1800 <main+0x5e0>
lea    -0x1(%r14),%eax
imul   $0x1e0,%rax,%rax
lea    (%rsp,%rax,1),%rsi
add    $0xc8f0,%rsi
mov    %r14d,%edx
shl    $0x3,%rdx
lea    0x198(%rsp),%rdi
call   10c0 <memcpy@plt>
movq   $0x0,0x190(%rsp)
movsd  0x836(%rip),%xmm4
jmp    181a <main+0x5fa>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movq   $0x0,0x190(%rsp)
movsd  0x814(%rip),%xmm4
js     1951 <main+0x731>
movl   $0x0,0x90(%rsp)
test   %r14d,%r14d
je     1951 <main+0x731>
lea    0x1(%r14),%eax
lea    -0x1(%rax),%r8
mov    $0x1,%ecx
cmp    $0x4,%r8
jb     1930 <main+0x710>
mov    %r8,%rcx
and    $0xfffffffffffffffc,%rcx
lea    -0x4(%rcx),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     1a4c <main+0x82c>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
movapd 0x79b(%rip),%xmm5
cs nopw 0x0(%rax,%rax,1)
nop
movupd 0x198(%rsp,%rsi,8),%xmm0
movupd 0x1a8(%rsp,%rsi,8),%xmm1
movupd 0x1b8(%rsp,%rsi,8),%xmm2
movupd 0x1c8(%rsp,%rsi,8),%xmm3
mulpd  %xmm5,%xmm0
mulpd  %xmm5,%xmm1
cvttpd2dq %xmm0,%xmm0
cvttpd2dq %xmm1,%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,0x94(%rsp,%rsi,4)
mulpd  %xmm5,%xmm2
mulpd  %xmm5,%xmm3
cvttpd2dq %xmm2,%xmm0
cvttpd2dq %xmm3,%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,0xa4(%rsp,%rsi,4)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1880 <main+0x660>
test   $0x1,%dl
je     1920 <main+0x700>
or     $0x1,%rsi
movupd 0x190(%rsp,%rsi,8),%xmm0
movupd 0x1a0(%rsp,%rsi,8),%xmm1
mulpd  %xmm5,%xmm0
mulpd  %xmm5,%xmm1
cvttpd2dq %xmm0,%xmm0
cvttpd2dq %xmm1,%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,0x90(%rsp,%rsi,4)
cmp    %rcx,%r8
je     1951 <main+0x731>
or     $0x1,%rcx
nopl   0x0(%rax)
movsd  0x190(%rsp,%rcx,8),%xmm0
mulsd  %xmm4,%xmm0
cvttsd2si %xmm0,%edx
mov    %edx,0x90(%rsp,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1930 <main+0x710>
lea    0x48f0(%rsp),%rdi
mov    0x78(%rsp),%r12
mov    %r12d,%esi
mov    %r14d,%edx
mov    $0x14,%ecx
lea    0x90(%rsp),%rbx
mov    %rbx,%r8
lea    0xa8f0(%rsp),%rbp
mov    %rbp,%r9
call   10b0 <calc_residue@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    $0x14,%ecx
mov    %rbx,%r8
lea    0x28f0(%rsp),%r9
call   1080 <calc_signal@plt>
test   %r12d,%r12d
mov    0x70(%rsp),%r14
mov    0x30(%rsp),%rdi
mov    0x88(%rsp),%r10
mov    0x80(%rsp),%r11
jle    1510 <main+0x2f0>
cmpq   $0x0,0x28(%rsp)
je     1a20 <main+0x800>
xor    %eax,%eax
nop
mov    0x28f0(%rsp,%rax,4),%ecx
movslq 0x4(%rsp),%rdx
movslq %eax,%rsi
imul   %rsi,%rdx
add    %r13,%rdx
mov    %ecx,(%r15,%rdx,4)
mov    0x28f4(%rsp,%rax,4),%ecx
movslq 0x4(%rsp),%rdx
add    $0x1,%esi
movslq %esi,%rsi
imul   %rdx,%rsi
add    %r13,%rsi
mov    %ecx,(%r15,%rsi,4)
add    $0x2,%rax
cmp    %rdi,%rax
jne    19d0 <main+0x7b0>
cmpq   $0x0,0x20(%rsp)
je     1510 <main+0x2f0>
jmp    1a2e <main+0x80e>
xchg   %ax,%ax
xor    %eax,%eax
cmpq   $0x0,0x20(%rsp)
je     1510 <main+0x2f0>
mov    0x28f0(%rsp,%rax,4),%ecx
movslq 0x4(%rsp),%rdx
cltq
imul   %rdx,%rax
add    %r13,%rax
mov    %ecx,(%r15,%rax,4)
jmp    1510 <main+0x2f0>
xor    %esi,%esi
movapd 0x5ba(%rip),%xmm5
test   $0x1,%dl
jne    18ed <main+0x6cd>
jmp    1920 <main+0x700>

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [3 x i8] c"wb\00"
@stderr = global i32 0
@.str.2 = [48 x i8] c"Error open input or output file.Exiting.......\0A\00"
@.str.3 = [20 x i8] c"WAV file detected.\0A\00"
@.str.4 = [38 x i8] c"RIFF header not found. Exiting......\0A\00"
@.str.5 = [38 x i8] c"WAVE header not found. Exiting......\0A\00"
@.str.6 = [45 x i8] c"Not a 16 bit/sample wav file. Exiting......\0A\00"
@.str.7 = [36 x i8] c"Some error occured. Exiting.......\0A\00"
@.str.8 = [23 x i8] c"Sampling Rate : %d Hz\0A\00"
@.str.9 = [22 x i8] c"Bits per sample : %d\0A\00"
@.str.10 = [15 x i8] c"Channels : %d\0A\00"
@SEEK_SET = global i32 0
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 [44 x i32]
%15 = alloca i32
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i64
%19 = alloca i32
%20 = alloca i32
%21 = alloca [2048 x i32]
%22 = alloca i32
%23 = alloca [2048 x i32]
%24 = alloca i32
%25 = alloca [2048 x double]
%26 = alloca i32
%27 = alloca [61 x double]
%28 = alloca [60 x double]
%29 = alloca i32
%30 = alloca [60 x i32]
%31 = alloca [61 x double]
%32 = alloca [60 x [60 x double]]
%33 = alloca i32
%34 = alloca [61 x i32]
%35 = alloca i32
%36 = alloca [2048 x i32]
%37 = alloca [2048 x i32]
%38 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i32* @fopen(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %42, i32** %6
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 2
%45 = load i8*, i8** %44
%46 = call i32* @fopen(i8* %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %46, i32** %7
%47 = load i32*, i32** %6
%48 = icmp eq i32* %47, null
br i1 %48, label %52, label %49
49: ; preds = %2
%50 = load i32*, i32** %7
%51 = icmp eq i32* %50, null
br i1 %51, label %52, label %55
52: ; preds = %49, %2
%53 = load i32, i32* @stderr
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %293
55: ; preds = %49
store i32 1048576, i32* %11
store i32 20, i32* %12
%56 = load i32*, i32** %6
%57 = call i32 @check_wav_file(i32* %56, i32* %8, i32* %9, i32* %10)
%58 = load i32*, i32** %6
%59 = call i32 @check_wav_file(i32* %58, i32* %8, i32* %9, i32* %10)
store i32 %59, i32* %13
%60 = load i32, i32* %13
switch i32 %60, label %73 [
i32 1, label %61
i32 -1, label %64
i32 -2, label %67
i32 -3, label %70
]
61: ; preds = %55
%62 = load i32, i32* @stderr
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %76
64: ; preds = %55
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %293
67: ; preds = %55
%68 = load i32, i32* @stderr
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
store i32 -1, i32* %3
br label %293
70: ; preds = %55
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %3
br label %293
73: ; preds = %55
%74 = load i32, i32* @stderr
%75 = call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0))
br label %76
76: ; preds = %73, %61
%77 = load i32, i32* @stderr
%78 = load i32, i32* %8
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %78)
%80 = load i32, i32* @stderr
%81 = load i32, i32* %10
%82 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 %81)
%83 = load i32, i32* @stderr
%84 = load i32, i32* %9
%85 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 %84)
%86 = load i32*, i32** %6
%87 = load i32, i32* @SEEK_SET
%88 = call i32 @fseek(i32* %86, i32 0, i32 %87)
%89 = getelementptr inbounds [44 x i32], [44 x i32]* %14, i64 0, i64 0
%90 = load i32*, i32** %6
%91 = call i64 @fread(i32* %89, i32 4, i32 44, i32* %90)
%92 = getelementptr inbounds [44 x i32], [44 x i32]* %14, i64 0, i64 0
%93 = load i32*, i32** %7
%94 = call i32 @fwrite(i32* %92, i32 4, i64 44, i32* %93)
%95 = load i32, i32* %9
%96 = mul nsw i32 2048, %95
store i32 %96, i32* %15
%97 = load i32, i32* %15
%98 = sext i32 %97 to i64
%99 = mul i64 4, %98
%100 = trunc i64 %99 to i32
%101 = call i64 @malloc(i32 %100)
%102 = inttoptr i64 %101 to i32*
store i32* %102, i32** %16
%103 = load i32, i32* %15
%104 = sext i32 %103 to i64
%105 = mul i64 4, %104
%106 = trunc i64 %105 to i32
%107 = call i64 @malloc(i32 %106)
%108 = inttoptr i64 %107 to i32*
store i32* %108, i32** %17
br label %109
109: ; preds = %281, %76
%110 = load i32*, i32** %6
%111 = call i64 @feof(i32* %110)
%112 = icmp eq i64 %111, 0
br i1 %112, label %113, label %286
113: ; preds = %109
%114 = load i32*, i32** %16
%115 = load i32, i32* %15
%116 = load i32*, i32** %6
%117 = call i64 @fread(i32* %114, i32 4, i32 %115, i32* %116)
store i64 %117, i64* %18
%118 = load i64, i64* %18
%119 = load i32, i32* %9
%120 = sext i32 %119 to i64
%121 = udiv i64 %118, %120
%122 = trunc i64 %121 to i32
store i32 %122, i32* %19
store i32 0, i32* %20
br label %123
123: ; preds = %278, %113
%124 = load i32, i32* %20
%125 = load i32, i32* %9
%126 = icmp slt i32 %124, %125
br i1 %126, label %127, label %281
127: ; preds = %123
store i32 0, i32* %22
br label %128
128: ; preds = %145, %127
%129 = load i32, i32* %22
%130 = load i32, i32* %19
%131 = icmp slt i32 %129, %130
br i1 %131, label %132, label %148
132: ; preds = %128
%133 = load i32*, i32** %16
%134 = load i32, i32* %9
%135 = load i32, i32* %22
%136 = mul nsw i32 %134, %135
%137 = load i32, i32* %20
%138 = add nsw i32 %136, %137
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i32, i32* %133, i64 %139
%141 = load i32, i32* %140
%142 = load i32, i32* %22
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %143
store i32 %141, i32* %144
br label %145
145: ; preds = %132
%146 = load i32, i32* %22
%147 = add nsw i32 %146, 1
store i32 %147, i32* %22
br label %128
148: ; preds = %128
store i32 0, i32* %24
br label %149
149: ; preds = %161, %148
%150 = load i32, i32* %24
%151 = load i32, i32* %19
%152 = icmp slt i32 %150, %151
br i1 %152, label %153, label %164
153: ; preds = %149
%154 = load i32, i32* %24
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %155
%157 = load i32, i32* %156
%158 = load i32, i32* %24
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds [2048 x i32], [2048 x i32]* %23, i64 0, i64 %159
store i32 %157, i32* %160
br label %161
161: ; preds = %153
%162 = load i32, i32* %24
%163 = add nsw i32 %162, 1
store i32 %163, i32* %24
br label %149
164: ; preds = %149
store i32 0, i32* %26
br label %165
165: ; preds = %179, %164
%166 = load i32, i32* %26
%167 = load i32, i32* %19
%168 = icmp slt i32 %166, %167
br i1 %168, label %169, label %182
169: ; preds = %165
%170 = load i32, i32* %26
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [2048 x i32], [2048 x i32]* %21, i64 0, i64 %171
%173 = load i32, i32* %172
%174 = sitofp i32 %173 to double
%175 = fdiv double %174, 3.276700e+04
%176 = load i32, i32* %26
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds [2048 x double], [2048 x double]* %25, i64 0, i64 %177
store double %175, double* %178
br label %179
179: ; preds = %169
%180 = load i32, i32* %26
%181 = add nsw i32 %180, 1
store i32 %181, i32* %26
br label %165
182: ; preds = %165
%183 = getelementptr inbounds [2048 x double], [2048 x double]* %25, i64 0, i64 0
%184 = load i32, i32* %19
%185 = getelementptr inbounds [61 x double], [61 x double]* %27, i64 0, i64 0
%186 = call i32 @acf(double* %183, i32 %184, i32 60, i32 1, double* %185)
%187 = getelementptr inbounds [61 x double], [61 x double]* %27, i64 0, i64 0
%188 = getelementptr inbounds [60 x double], [60 x double]* %28, i64 0, i64 0
%189 = call i32 @compute_ref_coefs(double* %187, i32 60, double* %188)
store i32 %189, i32* %29
%190 = getelementptr inbounds [60 x double], [60 x double]* %28, i64 0, i64 0
%191 = load i32, i32* %29
%192 = getelementptr inbounds [60 x i32], [60 x i32]* %30, i64 0, i64 0
%193 = call i32 @qtz_ref_cof(double* %190, i32 %191, i32* %192)
%194 = getelementptr inbounds [60 x i32], [60 x i32]* %30, i64 0, i64 0
%195 = load i32, i32* %29
%196 = getelementptr inbounds [60 x double], [60 x double]* %28, i64 0, i64 0
%197 = call i32 @dqtz_ref_cof(i32* %194, i32 %195, i32 20, double* %196)
%198 = load i32, i32* %29
%199 = getelementptr inbounds [60 x double], [60 x double]* %28, i64 0, i64 0
%200 = getelementptr inbounds [60 x [60 x double]], [60 x [60 x double]]* %32, i64 0, i64 0
%201 = bitcast [60 x double]* %200 to double**
%202 = call i32 @levinson(i32* null, i32 %198, double* %199, double** %201)
store i32 0, i32* %33
br label %203
203: ; preds = %220, %182
%204 = load i32, i32* %33
%205 = load i32, i32* %29
%206 = icmp slt i32 %204, %205
br i1 %206, label %207, label %223
207: ; preds = %203
%208 = load i32, i32* %29
%209 = sub nsw i32 %208, 1
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds [60 x [60 x double]], [60 x [60 x double]]* %32, i64 0, i64 %210
%212 = load i32, i32* %33
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds [60 x double], [60 x double]* %211, i64 0, i64 %213
%215 = load double, double* %214
%216 = load i32, i32* %33
%217 = add nsw i32 %216, 1
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds [61 x double], [61 x double]* %31, i64 0, i64 %218
store double %215, double* %219
br label %220
220: ; preds = %207
%221 = load i32, i32* %33
%222 = add nsw i32 %221, 1
store i32 %222, i32* %33
br label %203
223: ; preds = %203
%224 = getelementptr inbounds [61 x double], [61 x double]* %31, i64 0, i64 0
store double 0.000000e+00, double* %224
store i32 0, i32* %35
br label %225
225: ; preds = %241, %223
%226 = load i32, i32* %35
%227 = load i32, i32* %29
%228 = icmp sle i32 %226, %227
br i1 %228, label %229, label %244
229: ; preds = %225
%230 = load i32, i32* %11
%231 = sitofp i32 %230 to double
%232 = load i32, i32* %35
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds [61 x double], [61 x double]* %31, i64 0, i64 %233
%235 = load double, double* %234
%236 = fmul double %231, %235
%237 = fptosi double %236 to i32
%238 = load i32, i32* %35
%239 = sext i32 %238 to i64
%240 = getelementptr inbounds [61 x i32], [61 x i32]* %34, i64 0, i64 %239
store i32 %237, i32* %240
br label %241
241: ; preds = %229
%242 = load i32, i32* %35
%243 = add nsw i32 %242, 1
store i32 %243, i32* %35
br label %225
244: ; preds = %225
%245 = getelementptr inbounds [2048 x i32], [2048 x i32]* %23, i64 0, i64 0
%246 = load i32, i32* %19
%247 = load i32, i32* %29
%248 = getelementptr inbounds [61 x i32], [61 x i32]* %34, i64 0, i64 0
%249 = getelementptr inbounds [2048 x i32], [2048 x i32]* %36, i64 0, i64 0
%250 = call i32 @calc_residue(i32* %245, i32 %246, i32 %247, i32 20, i32* %248, i32* %249)
%251 = getelementptr inbounds [2048 x i32], [2048 x i32]* %36, i64 0, i64 0
%252 = load i32, i32* %19
%253 = load i32, i32* %29
%254 = getelementptr inbounds [61 x i32], [61 x i32]* %34, i64 0, i64 0
%255 = getelementptr inbounds [2048 x i32], [2048 x i32]* %37, i64 0, i64 0
%256 = call i32 @calc_signal(i32* %251, i32 %252, i32 %253, i32 20, i32* %254, i32* %255)
store i32 0, i32* %38
br label %257
257: ; preds = %274, %244
%258 = load i32, i32* %38
%259 = load i32, i32* %19
%260 = icmp slt i32 %258, %259
br i1 %260, label %261, label %277
261: ; preds = %257
%262 = load i32, i32* %38
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds [2048 x i32], [2048 x i32]* %37, i64 0, i64 %263
%265 = load i32, i32* %264
%266 = load i32*, i32** %17
%267 = load i32, i32* %9
%268 = load i32, i32* %38
%269 = mul nsw i32 %267, %268
%270 = load i32, i32* %20
%271 = add nsw i32 %269, %270
%272 = sext i32 %271 to i64
%273 = getelementptr inbounds i32, i32* %266, i64 %272
store i32 %265, i32* %273
br label %274
274: ; preds = %261
%275 = load i32, i32* %38
%276 = add nsw i32 %275, 1
store i32 %276, i32* %38
br label %257
277: ; preds = %257
br label %278
278: ; preds = %277
%279 = load i32, i32* %20
%280 = add nsw i32 %279, 1
store i32 %280, i32* %20
br label %123
281: ; preds = %123
%282 = load i32*, i32** %17
%283 = load i64, i64* %18
%284 = load i32*, i32** %7
%285 = call i32 @fwrite(i32* %282, i32 4, i64 %283, i32* %284)
br label %109
286: ; preds = %109
%287 = load i32*, i32** %16
%288 = call i32 @free(i32* %287)
%289 = load i32*, i32** %6
%290 = call i32 @fclose(i32* %289)
%291 = load i32*, i32** %7
%292 = call i32 @fclose(i32* %291)
store i32 0, i32* %3
br label %293
293: ; preds = %286, %70, %67, %64, %52
%294 = load i32, i32* %3
ret i32 %294
}

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