#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 */

/* Variables and functions */
int /*<<< orphan*/ getamplitude(double *, double *, double *, double *, int,
                                int, double *, double *);
double sqrt(double);
void doclean(double *R_r, double *R_i, double *W_r, double *W_i, int Nf,
             double *C_r, double *C_i, double gainval, double SNlimit,
             double df) {
  int i, j, Nftot;
  int peaki, iter;
  double peakval, rmsval, ave1, ave2, val, a_r, a_i, lastsum, thissum;
  Nftot = 2 * Nf + 1;
  for (i = 0; i < Nftot; i++) {
    C_r[i] = 0.;
    C_i[i] = 0.;
  }
  lastsum = 0.;
  iter = 0;
  while (1) {
    iter++;
    for (i = Nf, peaki = -1, peakval = -1., ave1 = 0., ave2 = 0.; i < Nftot;
         i++) {
      val = R_r[i] * R_r[i] + R_i[i] * R_i[i];
      if (val > peakval) {
        peakval = val;
        peaki = i;
      }
      ave1 += val;
      ave2 += val * val;
    }
    ave1 = ave1 / (double)(Nf - 1);
    ave2 = ave2 / (double)(Nf - 1);
    rmsval = sqrt(ave2 - (ave1 * ave1));
    if (peakval - ave1 < SNlimit * rmsval)
      break;
    getamplitude(R_r, R_i, W_r, W_i, Nf, peaki, &a_r, &a_i);
    peaki -= Nf;
    for (j = 0; j < Nftot; j++) {
      R_r[j] -=
          gainval * (a_r * W_r[Nf + j - peaki] - a_i * W_i[Nf + j - peaki] +
                     a_r * W_r[Nf + j + peaki] + a_i * W_i[Nf + j + peaki]);
      R_i[j] -=
          gainval * (a_i * W_r[Nf + j - peaki] + a_r * W_i[Nf + j - peaki] -
                     a_i * W_r[Nf + j + peaki] + a_r * W_i[Nf + j + peaki]);
    }
    thissum = lastsum;
    thissum -=
        (C_r[Nf + peaki] * C_r[Nf + peaki] + C_i[Nf + peaki] * C_i[Nf + peaki]);
    C_r[Nf + peaki] += gainval * a_r;
    C_i[Nf + peaki] += gainval * a_i;
    C_r[Nf - peaki] += gainval * a_r;
    C_i[Nf - peaki] -= gainval * a_i;
    thissum +=
        (C_r[Nf + peaki] * C_r[Nf + peaki] + C_i[Nf + peaki] * C_i[Nf + peaki]);
    if (thissum < 1.0e-12 && lastsum < 1.0e-12)
      break;
    if (thissum - lastsum < 1.0e-12)
      break;
    if (lastsum > 0 ? (thissum < 1.0e-12 * lastsum) : 0)
      break;
    lastsum = thissum;
  }
}


x86 assembly (clang, -O0):
<doclean>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm1,-0x40(%rbp)
movsd  %xmm2,-0x48(%rbp)
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    11a3 <doclean+0x83>
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1169 <doclean+0x49>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movl   $0xffffffff,-0x58(%rbp)
movsd  0xe2d(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    12a0 <doclean+0x180>
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
ucomisd -0x68(%rbp),%xmm0
jbe    125e <doclean+0x13e>
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x68(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x58(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11e8 <doclean+0xc8>
movsd  -0x78(%rbp),%xmm0
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x80(%rbp),%xmm0
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm1
subsd  -0x78(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    132b <doclean+0x20b>
jmp    1795 <doclean+0x675>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x58(%rbp),%r9d
lea    -0x90(%rbp),%r10
lea    -0x98(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <getamplitude@plt>
mov    -0x24(%rbp),%ecx
mov    -0x58(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x58(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    153d <doclean+0x41d>
movsd  -0x38(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x50(%rbp),%ecx
sub    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0x98(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x50(%rbp),%ecx
sub    -0x58(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x90(%rbp),%xmm1
ff
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x50(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x98(%rbp),%xmm2
ff
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x50(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    -0x8(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x50(%rbp),%ecx
sub    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0x90(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x50(%rbp),%ecx
sub    -0x58(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x98(%rbp),%xmm1
ff
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x50(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x90(%rbp),%xmm2
ff
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x50(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    -0x10(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1371 <doclean+0x251>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0x928(%rip),%xmm0
ucomisd -0xa8(%rbp),%xmm0
ff
jbe    1709 <doclean+0x5e9>
movsd  0x912(%rip),%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    1709 <doclean+0x5e9>
jmp    1795 <doclean+0x675>
movsd  -0xa8(%rbp),%xmm1
ff
subsd  -0xa0(%rbp),%xmm1
ff
movsd  0x8e7(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1730 <doclean+0x610>
jmp    1795 <doclean+0x675>
movsd  -0xa0(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    176c <doclean+0x64c>
movsd  -0xa8(%rbp),%xmm1
ff
movsd  0x8b3(%rip),%xmm0
mulsd  -0xa0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
ja     177b <doclean+0x65b>
jmp    1780 <doclean+0x660>
xor    %eax,%eax
test   $0x1,%al
jne    177b <doclean+0x65b>
jmp    1780 <doclean+0x660>
jmp    1795 <doclean+0x675>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    11b5 <doclean+0x95>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doclean>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
movsd  %xmm1,0x60(%rsp)
movaps %xmm0,0x80(%rsp)
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %rsi,%r13
mov    %rdi,%rbp
mov    0xd0(%rsp),%r10
lea    (%r8,%r8,1),%eax
mov    %eax,0x8(%rsp)
lea    (%r8,%r8,1),%eax
add    $0x1,%eax
mov    %eax,%r15d
mov    %eax,0xc(%rsp)
test   %eax,%eax
jle    1231 <doclean+0x111>
cmpl   $0x4,0xc(%rsp)
jb     1192 <doclean+0x72>
lea    (%r10,%r15,8),%rax
cmp    %r9,%rax
jbe    1649 <doclean+0x529>
lea    (%r9,%r15,8),%rax
cmp    %r10,%rax
jbe    1649 <doclean+0x529>
xor    %eax,%eax
mov    %rax,%rcx
not    %rcx
add    %r15,%rcx
mov    %r15d,%edx
and    $0x3,%edx
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movq   $0x0,0x8(%r9,%rax,8)
movq   $0x0,0x8(%r10,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    11b0 <doclean+0x90>
cmp    $0x3,%rcx
jb     1231 <doclean+0x111>
lea    -0x1(%r15),%rcx
cs nopw 0x0(%rax,%rax,1)
movq   $0x0,0x8(%r9,%rax,8)
movq   $0x0,0x8(%r10,%rax,8)
movq   $0x0,0x10(%r9,%rax,8)
movq   $0x0,0x10(%r10,%rax,8)
movq   $0x0,0x18(%r9,%rax,8)
movq   $0x0,0x18(%r10,%rax,8)
movq   $0x0,0x20(%r9,%rax,8)
movq   $0x0,0x20(%r10,%rax,8)
add    $0x4,%rax
cmp    %rax,%rcx
jne    11e0 <doclean+0xc0>
mov    %r9,0x50(%rsp)
lea    -0x1(%r8),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x58(%rsp)
movapd 0xdb1(%rip),%xmm0
xorpd  0x80(%rsp),%xmm0
movapd %xmm0,0x70(%rsp)
movslq %r8d,%rcx
mov    0x8(%rsp),%eax
or     $0x1,%eax
movslq %eax,%rdx
mov    %rcx,0x10(%rsp)
sub    %rcx,%rdx
mov    %rdx,%rax
mov    %rdx,0x38(%rsp)
and    $0xfffffffffffffffe,%rdx
mov    %rdx,0x30(%rsp)
xorpd  %xmm5,%xmm5
mov    %r8,0x18(%rsp)
nopl   (%rax)
mov    $0xffffffff,%r14d
movsd  0xd72(%rip),%xmm7
xorpd  %xmm6,%xmm6
xorpd  %xmm0,%xmm0
cmp    %r8d,0xc(%rsp)
jle    13bb <doclean+0x29b>
cmp    %r8d,0x8(%rsp)
jne    12e0 <doclean+0x1c0>
mov    $0xffffffff,%r14d
xorpd  %xmm0,%xmm0
mov    0x10(%rsp),%rax
xorpd  %xmm6,%xmm6
movsd  0xd3d(%rip),%xmm7
jmp    137b <doclean+0x25b>
nopl   0x0(%rax,%rax,1)
mov    $0xffffffff,%r14d
xorpd  %xmm1,%xmm1
mov    0x30(%rsp),%rcx
mov    0x10(%rsp),%rax
xorpd  %xmm6,%xmm6
movsd  0xd10(%rip),%xmm7
movsd  0x0(%r13,%rax,8),%xmm0
mulsd  %xmm0,%xmm0
movsd  0x0(%rbp,%rax,8),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
ucomisd %xmm7,%xmm2
movsd  0x8(%r13,%rax,8),%xmm3
cmova  %eax,%r14d
movsd  0x8(%rbp,%rax,8),%xmm0
movapd %xmm2,%xmm4
maxsd  %xmm7,%xmm4
addsd  %xmm2,%xmm6
mulsd  %xmm3,%xmm3
mulsd  %xmm0,%xmm0
addsd  %xmm3,%xmm0
ucomisd %xmm4,%xmm0
lea    0x1(%rax),%edx
cmova  %edx,%r14d
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm0,%xmm7
maxsd  %xmm4,%xmm7
addsd  %xmm0,%xmm6
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
add    $0x2,%rax
movapd %xmm0,%xmm1
add    $0xfffffffffffffffe,%rcx
jne    1300 <doclean+0x1e0>
testb  $0x1,0x38(%rsp)
je     13bb <doclean+0x29b>
movsd  0x0(%rbp,%rax,8),%xmm1
movsd  0x0(%r13,%rax,8),%xmm2
mulsd  %xmm2,%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
ucomisd %xmm7,%xmm1
cmova  %eax,%r14d
movapd %xmm1,%xmm2
maxsd  %xmm7,%xmm2
addsd  %xmm1,%xmm6
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
movapd %xmm2,%xmm7
movsd  0x58(%rsp),%xmm1
divsd  %xmm1,%xmm6
divsd  %xmm1,%xmm0
movapd %xmm6,%xmm1
mulsd  %xmm6,%xmm1
subsd  %xmm1,%xmm0
ucomisd 0xc43(%rip),%xmm0
movsd  %xmm5,0x20(%rsp)
jb     13f0 <doclean+0x2d0>
sqrtsd %xmm0,%xmm0
jmp    1412 <doclean+0x2f2>
nopl   0x0(%rax,%rax,1)
movsd  %xmm6,0x48(%rsp)
movsd  %xmm7,0x40(%rsp)
call   1030 <sqrt@plt>
movsd  0x40(%rsp),%xmm7
movsd  0x48(%rsp),%xmm6
mov    0x18(%rsp),%r8
subsd  %xmm6,%xmm7
mulsd  0x60(%rsp),%xmm0
ucomisd %xmm7,%xmm0
ja     1637 <doclean+0x517>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %r14d,%r9d
lea    0x28(%rsp),%rax
push   %rax
lea    0x70(%rsp),%rax
push   %rax
call   1040 <getamplitude@plt>
mov    0x28(%rsp),%r8
add    $0x10,%rsp
mov    %r14d,%ecx
sub    %r8d,%ecx
movsd  0x68(%rsp),%xmm0
cmpl   $0x0,0xc(%rsp)
jle    1540 <doclean+0x420>
mov    %r8d,%r9d
sub    %ecx,%r9d
movsd  0x28(%rsp),%xmm1
movapd %xmm1,%xmm2
xorpd  0xb82(%rip),%xmm2
mov    %r14d,%ecx
mov    0x8(%rsp),%eax
mov    %eax,%edx
sub    %r14d,%edx
xor    %esi,%esi
movapd 0x70(%rsp),%xmm5
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rdx,%rsi,1),%edi
movslq %edi,%rdi
movsd  (%r12,%rdi,8),%xmm3
mulsd  %xmm2,%xmm3
movsd  (%rbx,%rdi,8),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
lea    (%rcx,%rsi,1),%eax
cltq
movsd  (%rbx,%rax,8),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm4,%xmm3
movsd  (%r12,%rax,8),%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm3,%xmm4
mulsd  %xmm5,%xmm4
addsd  0x0(%rbp,%rsi,8),%xmm4
movsd  %xmm4,0x0(%rbp,%rsi,8)
movsd  (%r12,%rdi,8),%xmm3
mulsd  %xmm0,%xmm3
movsd  (%rbx,%rdi,8),%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm3,%xmm4
movsd  (%rbx,%rax,8),%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm4,%xmm3
movsd  (%r12,%rax,8),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
mulsd  %xmm5,%xmm4
addsd  0x0(%r13,%rsi,8),%xmm4
movsd  %xmm4,0x0(%r13,%rsi,8)
add    $0x1,%rsi
cmp    %rsi,%r15
jne    14a0 <doclean+0x380>
jmp    1552 <doclean+0x432>
movsd  0x28(%rsp),%xmm1
mov    %r8d,%r9d
sub    %ecx,%r9d
movapd 0x70(%rsp),%xmm5
movsd  0xabe(%rip),%xmm6
movsd  0x20(%rsp),%xmm7
movslq %r14d,%rcx
mov    0x50(%rsp),%rdx
movsd  (%rdx,%rcx,8),%xmm2
mov    0xd0(%rsp),%rsi
movsd  (%rsi,%rcx,8),%xmm3
mulsd  %xmm3,%xmm3
movapd %xmm2,%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm3,%xmm4
movapd %xmm7,%xmm3
subsd  %xmm4,%xmm3
movapd 0x80(%rsp),%xmm4
mulsd  %xmm4,%xmm0
addsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx,%rcx,8)
movapd %xmm4,%xmm2
mulsd  %xmm1,%xmm2
addsd  (%rsi,%rcx,8),%xmm2
movsd  %xmm2,(%rsi,%rcx,8)
movslq %r9d,%rax
addsd  (%rdx,%rax,8),%xmm0
movsd  %xmm0,(%rdx,%rax,8)
mulsd  %xmm5,%xmm1
addsd  (%rsi,%rax,8),%xmm1
movsd  %xmm1,(%rsi,%rax,8)
movsd  (%rdx,%rcx,8),%xmm0
movsd  (%rsi,%rcx,8),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
ucomisd %xmm0,%xmm6
seta   %al
ucomisd %xmm7,%xmm6
seta   %cl
test   %al,%cl
jne    1637 <doclean+0x517>
movapd %xmm0,%xmm1
subsd  %xmm7,%xmm1
ucomisd %xmm1,%xmm6
ja     1637 <doclean+0x517>
ucomisd 0xa09(%rip),%xmm7
movapd %xmm7,%xmm1
mulsd  %xmm6,%xmm1
movapd %xmm0,%xmm5
jbe    1290 <doclean+0x170>
ucomisd %xmm0,%xmm1
movapd %xmm0,%xmm5
jbe    1290 <doclean+0x170>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r15d,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
mov    %edx,%ecx
and    $0x3,%ecx
cmp    $0xc,%rsi
jae    166d <doclean+0x54d>
xor    %esi,%esi
jmp    16e8 <doclean+0x5c8>
and    $0xfffffffffffffffc,%rdx
xor    %esi,%esi
xorps  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
movups %xmm0,(%r9,%rsi,8)
movups %xmm0,0x10(%r9,%rsi,8)
movups %xmm0,(%r10,%rsi,8)
movups %xmm0,0x10(%r10,%rsi,8)
movups %xmm0,0x20(%r9,%rsi,8)
movups %xmm0,0x30(%r9,%rsi,8)
movups %xmm0,0x20(%r10,%rsi,8)
movups %xmm0,0x30(%r10,%rsi,8)
movups %xmm0,0x40(%r9,%rsi,8)
movups %xmm0,0x50(%r9,%rsi,8)
movups %xmm0,0x40(%r10,%rsi,8)
movups %xmm0,0x50(%r10,%rsi,8)
movups %xmm0,0x60(%r9,%rsi,8)
movups %xmm0,0x70(%r9,%rsi,8)
movups %xmm0,0x60(%r10,%rsi,8)
movups %xmm0,0x70(%r10,%rsi,8)
add    $0x10,%rsi
add    $0xfffffffffffffffc,%rdx
jne    1680 <doclean+0x560>
test   %rcx,%rcx
je     1194 <doclean+0x74>
lea    (%r10,%rsi,8),%rdx
add    $0x10,%rdx
lea    (%r9,%rsi,8),%rsi
add    $0x10,%rsi
shl    $0x5,%rcx
xor    %edi,%edi
xorps  %xmm0,%xmm0
nopw   0x0(%rax,%rax,1)
movups %xmm0,-0x10(%rsi,%rdi,1)
movups %xmm0,(%rsi,%rdi,1)
movups %xmm0,-0x10(%rdx,%rdi,1)
movups %xmm0,(%rdx,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%rcx
jne    1710 <doclean+0x5f0>
jmp    1194 <doclean+0x74>

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

LLVM IR (-O2):
define void @doclean(double* %0, double* %1, double* %2, double* %3, i32 %4, double* nocapture %5, double* nocapture %6, double %7, double %8, double %9) {
%11 = alloca double
%12 = alloca double
%13 = bitcast double* %11 to i8*
%14 = bitcast double* %12 to i8*
%15 = shl nsw i32 %4, 1
%16 = or i32 %15, 1
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %109
18: ; preds = %10
%19 = zext i32 %16 to i64
%20 = icmp ult i32 %16, 4
br i1 %20, label %38, label %53
21: ; preds = %68, %59
%22 = phi i64 [ 0, %59 ], [ %106, %68 ]
%23 = icmp eq i64 %64, 0
br i1 %23, label %38, label %24
24: ; preds = %21, %24
%25 = phi i64 [ %35, %24 ], [ %22, %21 ]
%26 = phi i64 [ %36, %24 ], [ 0, %21 ]
%27 = getelementptr inbounds double, double* %5, i64 %25
%28 = bitcast double* %27 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %28
%29 = getelementptr inbounds double, double* %27, i64 2
%30 = bitcast double* %29 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %30
%31 = getelementptr inbounds double, double* %6, i64 %25
%32 = bitcast double* %31 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %32
%33 = getelementptr inbounds double, double* %31, i64 2
%34 = bitcast double* %33 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %34
%35 = add nuw i64 %25, 4
%36 = add i64 %26, 1
%37 = icmp eq i64 %36, %64
br i1 %37, label %38, label %24
38: ; preds = %21, %24, %53, %18
%39 = phi i64 [ 0, %53 ], [ 0, %18 ], [ %60, %24 ], [ %60, %21 ]
%40 = xor i64 %39, -1
%41 = add nsw i64 %40, %19
%42 = and i64 %19, 3
br label %43
43: ; preds = %43, %38
%44 = phi i64 [ %48, %43 ], [ %39, %38 ]
%45 = phi i64 [ %49, %43 ], [ 0, %38 ]
%46 = getelementptr inbounds double, double* %5, i64 %44
store double 0.000000e+00, double* %46
%47 = getelementptr inbounds double, double* %6, i64 %44
store double 0.000000e+00, double* %47
%48 = add nuw nsw i64 %44, 1
%49 = add i64 %45, 1
%50 = icmp eq i64 %49, %42
br i1 %50, label %51, label %43
51: ; preds = %43
%52 = icmp ult i64 %41, 3
br i1 %52, label %109, label %123
53: ; preds = %18
%54 = getelementptr double, double* %5, i64 %19
%55 = getelementptr double, double* %6, i64 %19
%56 = icmp ugt double* %55, %5
%57 = icmp ugt double* %54, %6
%58 = and i1 %56, %57
br i1 %58, label %38, label %59
59: ; preds = %53
%60 = and i64 %19, 4294967292
%61 = add nsw i64 %60, -4
%62 = lshr exact i64 %61, 2
%63 = add nuw nsw i64 %62, 1
%64 = and i64 %63, 3
%65 = icmp ult i64 %61, 12
br i1 %65, label %21, label %66
66: ; preds = %59
%67 = and i64 %63, 9223372036854775804
br label %68
68: ; preds = %68, %66
%69 = phi i64 [ 0, %66 ], [ %106, %68 ]
%70 = phi i64 [ 0, %66 ], [ %107, %68 ]
%71 = getelementptr inbounds double, double* %5, i64 %69
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %72
%73 = getelementptr inbounds double, double* %71, i64 2
%74 = bitcast double* %73 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %74
%75 = getelementptr inbounds double, double* %6, i64 %69
%76 = bitcast double* %75 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %76
%77 = getelementptr inbounds double, double* %75, i64 2
%78 = bitcast double* %77 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %78
%79 = or i64 %69, 4
%80 = getelementptr inbounds double, double* %5, i64 %79
%81 = bitcast double* %80 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %81
%82 = getelementptr inbounds double, double* %80, i64 2
%83 = bitcast double* %82 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %83
%84 = getelementptr inbounds double, double* %6, i64 %79
%85 = bitcast double* %84 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %85
%86 = getelementptr inbounds double, double* %84, i64 2
%87 = bitcast double* %86 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %87
%88 = or i64 %69, 8
%89 = getelementptr inbounds double, double* %5, i64 %88
%90 = bitcast double* %89 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %90
%91 = getelementptr inbounds double, double* %89, i64 2
%92 = bitcast double* %91 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %92
%93 = getelementptr inbounds double, double* %6, i64 %88
%94 = bitcast double* %93 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %94
%95 = getelementptr inbounds double, double* %93, i64 2
%96 = bitcast double* %95 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %96
%97 = or i64 %69, 12
%98 = getelementptr inbounds double, double* %5, i64 %97
%99 = bitcast double* %98 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %99
%100 = getelementptr inbounds double, double* %98, i64 2
%101 = bitcast double* %100 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %101
%102 = getelementptr inbounds double, double* %6, i64 %97
%103 = bitcast double* %102 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %103
%104 = getelementptr inbounds double, double* %102, i64 2
%105 = bitcast double* %104 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %105
%106 = add nuw i64 %69, 16
%107 = add nuw i64 %70, 4
%108 = icmp eq i64 %107, %67
br i1 %108, label %21, label %68
109: ; preds = %51, %123, %10
%110 = add nsw i32 %4, -1
%111 = sitofp i32 %110 to double
%112 = icmp sgt i32 %16, %4
%113 = fneg double %7
%114 = sext i32 %4 to i64
%115 = zext i32 %16 to i64
%116 = or i32 %15, 1
%117 = sext i32 %116 to i64
%118 = sub nsw i64 %117, %114
%119 = and i64 %118, 1
%120 = icmp eq i32 %15, %4
%121 = and i64 %118, -2
%122 = icmp eq i64 %119, 0
br label %138
123: ; preds = %51, %123
%124 = phi i64 [ %136, %123 ], [ %48, %51 ]
%125 = getelementptr inbounds double, double* %5, i64 %124
store double 0.000000e+00, double* %125
%126 = getelementptr inbounds double, double* %6, i64 %124
store double 0.000000e+00, double* %126
%127 = add nuw nsw i64 %124, 1
%128 = getelementptr inbounds double, double* %5, i64 %127
store double 0.000000e+00, double* %128
%129 = getelementptr inbounds double, double* %6, i64 %127
store double 0.000000e+00, double* %129
%130 = add nuw nsw i64 %124, 2
%131 = getelementptr inbounds double, double* %5, i64 %130
store double 0.000000e+00, double* %131
%132 = getelementptr inbounds double, double* %6, i64 %130
store double 0.000000e+00, double* %132
%133 = add nuw nsw i64 %124, 3
%134 = getelementptr inbounds double, double* %5, i64 %133
store double 0.000000e+00, double* %134
%135 = getelementptr inbounds double, double* %6, i64 %133
store double 0.000000e+00, double* %135
%136 = add nuw nsw i64 %124, 4
%137 = icmp eq i64 %136, %19
br i1 %137, label %109, label %123
138: ; preds = %109, %290
%139 = phi double [ %283, %290 ], [ 0.000000e+00, %109 ]
br i1 %112, label %140, label %199
140: ; preds = %138
br i1 %120, label %176, label %141
141: ; preds = %140, %141
%142 = phi i64 [ %173, %141 ], [ %114, %140 ]
%143 = phi double [ %172, %141 ], [ 0.000000e+00, %140 ]
%144 = phi double [ %171, %141 ], [ 0.000000e+00, %140 ]
%145 = phi double [ %170, %141 ], [ -1.000000e+00, %140 ]
%146 = phi i32 [ %169, %141 ], [ -1, %140 ]
%147 = phi i64 [ %174, %141 ], [ 0, %140 ]
%148 = getelementptr inbounds double, double* %0, i64 %142
%149 = load double, double* %148
%150 = getelementptr inbounds double, double* %1, i64 %142
%151 = load double, double* %150
%152 = fmul double %151, %151
%153 = call double @llvm.fmuladd.f64(double %149, double %149, double %152)
%154 = fcmp ogt double %153, %145
%155 = trunc i64 %142 to i32
%156 = select i1 %154, i32 %155, i32 %146
%157 = select i1 %154, double %153, double %145
%158 = fadd double %144, %153
%159 = call double @llvm.fmuladd.f64(double %153, double %153, double %143)
%160 = add nsw i64 %142, 1
%161 = getelementptr inbounds double, double* %0, i64 %160
%162 = load double, double* %161
%163 = getelementptr inbounds double, double* %1, i64 %160
%164 = load double, double* %163
%165 = fmul double %164, %164
%166 = call double @llvm.fmuladd.f64(double %162, double %162, double %165)
%167 = fcmp ogt double %166, %157
%168 = trunc i64 %160 to i32
%169 = select i1 %167, i32 %168, i32 %156
%170 = select i1 %167, double %166, double %157
%171 = fadd double %158, %166
%172 = call double @llvm.fmuladd.f64(double %166, double %166, double %159)
%173 = add nsw i64 %142, 2
%174 = add i64 %147, 2
%175 = icmp eq i64 %174, %121
br i1 %175, label %176, label %141
176: ; preds = %141, %140
%177 = phi i32 [ undef, %140 ], [ %169, %141 ]
%178 = phi double [ undef, %140 ], [ %170, %141 ]
%179 = phi double [ undef, %140 ], [ %171, %141 ]
%180 = phi double [ undef, %140 ], [ %172, %141 ]
%181 = phi i64 [ %114, %140 ], [ %173, %141 ]
%182 = phi double [ 0.000000e+00, %140 ], [ %172, %141 ]
%183 = phi double [ 0.000000e+00, %140 ], [ %171, %141 ]
%184 = phi double [ -1.000000e+00, %140 ], [ %170, %141 ]
%185 = phi i32 [ -1, %140 ], [ %169, %141 ]
br i1 %122, label %199, label %186
186: ; preds = %176
%187 = getelementptr inbounds double, double* %0, i64 %181
%188 = load double, double* %187
%189 = getelementptr inbounds double, double* %1, i64 %181
%190 = load double, double* %189
%191 = fmul double %190, %190
%192 = call double @llvm.fmuladd.f64(double %188, double %188, double %191)
%193 = fcmp ogt double %192, %184
%194 = trunc i64 %181 to i32
%195 = select i1 %193, i32 %194, i32 %185
%196 = select i1 %193, double %192, double %184
%197 = fadd double %183, %192
%198 = call double @llvm.fmuladd.f64(double %192, double %192, double %182)
br label %199
199: ; preds = %186, %176, %138
%200 = phi i32 [ -1, %138 ], [ %177, %176 ], [ %195, %186 ]
%201 = phi double [ -1.000000e+00, %138 ], [ %178, %176 ], [ %196, %186 ]
%202 = phi double [ 0.000000e+00, %138 ], [ %179, %176 ], [ %197, %186 ]
%203 = phi double [ 0.000000e+00, %138 ], [ %180, %176 ], [ %198, %186 ]
%204 = fdiv double %202, %111
%205 = fdiv double %203, %111
%206 = fneg double %204
%207 = call double @llvm.fmuladd.f64(double %206, double %204, double %205)
%208 = call double @sqrt(double %207)
%209 = fsub double %201, %204
%210 = fmul double %208, %8
%211 = fcmp olt double %209, %210
br i1 %211, label %295, label %212
212: ; preds = %199
%213 = call i32 @getamplitude(double* %0, double* %1, double* %2, double* %3, i32 %4, i32 %200, double* %11, double* %12)
%214 = sub nsw i32 %200, %4
%215 = load double, double* %11
br i1 %17, label %219, label %216
216: ; preds = %212
%217 = load double, double* %12
%218 = sub nsw i32 %4, %214
br label %258
219: ; preds = %212
%220 = sub i32 %4, %214
%221 = load double, double* %12
%222 = fneg double %221
br label %223
223: ; preds = %219, %223
%224 = phi i64 [ 0, %219 ], [ %256, %223 ]
%225 = trunc i64 %224 to i32
%226 = add i32 %220, %225
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds double, double* %2, i64 %227
%229 = load double, double* %228
%230 = getelementptr inbounds double, double* %3, i64 %227
%231 = load double, double* %230
%232 = fmul double %231, %222
%233 = call double @llvm.fmuladd.f64(double %215, double %229, double %232)
%234 = add i32 %200, %225
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds double, double* %2, i64 %235
%237 = load double, double* %236
%238 = call double @llvm.fmuladd.f64(double %215, double %237, double %233)
%239 = getelementptr inbounds double, double* %3, i64 %235
%240 = load double, double* %239
%241 = call double @llvm.fmuladd.f64(double %221, double %240, double %238)
%242 = getelementptr inbounds double, double* %0, i64 %224
%243 = load double, double* %242
%244 = call double @llvm.fmuladd.f64(double %113, double %241, double %243)
store double %244, double* %242
%245 = load double, double* %228
%246 = load double, double* %230
%247 = fmul double %215, %246
%248 = call double @llvm.fmuladd.f64(double %221, double %245, double %247)
%249 = load double, double* %236
%250 = call double @llvm.fmuladd.f64(double %222, double %249, double %248)
%251 = load double, double* %239
%252 = call double @llvm.fmuladd.f64(double %215, double %251, double %250)
%253 = getelementptr inbounds double, double* %1, i64 %224
%254 = load double, double* %253
%255 = call double @llvm.fmuladd.f64(double %113, double %252, double %254)
store double %255, double* %253
%256 = add nuw nsw i64 %224, 1
%257 = icmp eq i64 %256, %115
br i1 %257, label %258, label %223
258: ; preds = %223, %216
%259 = phi i32 [ %218, %216 ], [ %220, %223 ]
%260 = phi double [ %217, %216 ], [ %221, %223 ]
%261 = sext i32 %200 to i64
%262 = getelementptr inbounds double, double* %5, i64 %261
%263 = load double, double* %262
%264 = getelementptr inbounds double, double* %6, i64 %261
%265 = load double, double* %264
%266 = fmul double %265, %265
%267 = call double @llvm.fmuladd.f64(double %263, double %263, double %266)
%268 = fsub double %139, %267
%269 = call double @llvm.fmuladd.f64(double %7, double %215, double %263)
store double %269, double* %262
%270 = load double, double* %264
%271 = call double @llvm.fmuladd.f64(double %7, double %260, double %270)
store double %271, double* %264
%272 = sext i32 %259 to i64
%273 = getelementptr inbounds double, double* %5, i64 %272
%274 = load double, double* %273
%275 = call double @llvm.fmuladd.f64(double %7, double %215, double %274)
store double %275, double* %273
%276 = getelementptr inbounds double, double* %6, i64 %272
%277 = load double, double* %276
%278 = call double @llvm.fmuladd.f64(double %113, double %260, double %277)
store double %278, double* %276
%279 = load double, double* %262
%280 = load double, double* %264
%281 = fmul double %280, %280
%282 = call double @llvm.fmuladd.f64(double %279, double %279, double %281)
%283 = fadd double %268, %282
%284 = fcmp olt double %283, 0x3D719799812DEA11
%285 = fcmp olt double %139, 0x3D719799812DEA11
%286 = and i1 %285, %284
%287 = fsub double %283, %139
%288 = fcmp olt double %287, 0x3D719799812DEA11
%289 = or i1 %286, %288
br i1 %289, label %295, label %290
290: ; preds = %258
%291 = fcmp ogt double %139, 0.000000e+00
%292 = fmul double %139, 0x3D719799812DEA11
%293 = fcmp olt double %283, %292
%294 = select i1 %291, i1 %293, i1 false
br i1 %294, label %295, label %138
295: ; preds = %290, %258, %199
ret void
}