#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 find_nearest(double const *, double *, int, int, double *, double *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
int /*<<< orphan*/ normalize(double *, int);
double pvq_dist_k2(double const *, int);
double sqrt(double);
int /*<<< orphan*/ stderr;
double vq_train(const double *data, int nb_vectors, double *codebook,
                int nb_entries, int n, int nb_iter, int exclude_pvq) {
  int i;
  int iter;
  double rms[(1)];
  double *accum;
  accum = (double *)malloc((4096) * (128) * (1) * sizeof(*accum));
  for (iter = 0; iter < nb_iter; iter++) {
    for (i = 0; i < (1); i++)
      rms[i] = 0;
    memset(accum, 0, nb_entries * n * (1) * sizeof(*accum));
#pragma omp parallel for schedule(dynamic)
    for (i = 0; i < nb_vectors; i++) {
      int tid;
      int id;
      double sign;
      double pvq_err;
      double err;
      tid = (0);
      id = find_nearest(&data[i * n], codebook, nb_entries, n, &sign, &err);
      pvq_err = pvq_dist_k2(&data[i * n], n);
      if (!exclude_pvq || err < pvq_err) {
        int j;
        int offset;
        rms[tid] += err;
        offset = nb_entries * n * tid + id * n;
        for (j = 0; j < n; j++)
          accum[offset + j] += sign * data[i * n + j];
      } else
        rms[tid] += pvq_err;
    }
    for (i = 1; i < (1); i++) {
      int j;
      int offset;
      offset = nb_entries * n * i;
      for (j = 0; j < nb_entries * n; j++)
        accum[j] += accum[offset + j];
    }
    for (i = 1; i < (1); i++)
      rms[0] += rms[i];
    for (i = 0; i < nb_entries; i++)
      normalize(&accum[i * n], n);
    for (i = 0; i < nb_entries * n; i++)
      codebook[i] = accum[i];
    rms[0] = sqrt(rms[0] / nb_vectors);
    fprintf(stderr, "RMS: %f\n", rms[0]);
  }
  free(accum);
  return rms[0];
}


x86 assembly (clang, -O0):
<vq_train>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    $0x400000,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    14b4 <vq_train+0x334>
movl   $0x0,-0x28(%rbp)
cmpl   $0x1,-0x28(%rbp)
jge    11ee <vq_train+0x6e>
movslq -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp,%rax,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11c9 <vq_train+0x49>
mov    -0x40(%rbp),%rdi
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
shl    $0x0,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1040 <memset@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1346 <vq_train+0x1c6>
movl   $0x0,-0x44(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    -0x50(%rbp),%r8
lea    -0x60(%rbp),%r9
call   1070 <find_nearest@plt>
mov    %eax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%esi
call   10a0 <pvq_dist_k2@plt>
movsd  %xmm0,-0x58(%rbp)
cmpl   $0x0,0x10(%rbp)
je     1292 <vq_train+0x112>
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    131e <vq_train+0x19e>
movsd  -0x60(%rbp),%xmm0
movslq -0x44(%rbp),%rax
addsd  -0x38(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x38(%rbp,%rax,8)
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
imul   -0x44(%rbp),%eax
mov    -0x48(%rbp),%ecx
imul   -0x20(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x68(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1319 <vq_train+0x199>
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
imul   -0x20(%rbp),%ecx
add    -0x64(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x40(%rbp),%rax
mov    -0x68(%rbp),%ecx
add    -0x64(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    12c5 <vq_train+0x145>
jmp    1333 <vq_train+0x1b3>
movsd  -0x58(%rbp),%xmm0
movslq -0x44(%rbp),%rax
addsd  -0x38(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x38(%rbp,%rax,8)
jmp    1338 <vq_train+0x1b8>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1212 <vq_train+0x92>
movl   $0x1,-0x28(%rbp)
cmpl   $0x1,-0x28(%rbp)
jge    13c3 <vq_train+0x243>
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
imul   -0x28(%rbp),%eax
mov    %eax,-0x70(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    -0x1c(%rbp),%ecx
imul   -0x20(%rbp),%ecx
cmp    %ecx,%eax
jge    13b0 <vq_train+0x230>
mov    -0x40(%rbp),%rax
mov    -0x70(%rbp),%ecx
add    -0x6c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x6c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    136c <vq_train+0x1ec>
jmp    13b5 <vq_train+0x235>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    134d <vq_train+0x1cd>
movl   $0x1,-0x28(%rbp)
cmpl   $0x1,-0x28(%rbp)
jge    13f6 <vq_train+0x276>
movslq -0x28(%rbp),%rax
movsd  -0x38(%rbp,%rax,8),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13ca <vq_train+0x24a>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1433 <vq_train+0x2b3>
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%esi
call   1050 <normalize@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13fd <vq_train+0x27d>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x1c(%rbp),%ecx
imul   -0x20(%rbp),%ecx
cmp    %ecx,%eax
jge    1474 <vq_train+0x2f4>
mov    -0x40(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    143a <vq_train+0x2ba>
movsd  -0x38(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,-0x38(%rbp)
mov    0x2b4d(%rip),%rax
mov    (%rax),%edi
movsd  -0x38(%rbp),%xmm0
lea    0xb5f(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11b6 <vq_train+0x36>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x38(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vq_train>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %r9d,%ebx
mov    %r8d,%r12d
mov    %ecx,%r14d
mov    %rdx,%rbp
mov    %esi,%r15d
mov    %rdi,0x18(%rsp)
mov    $0x400000,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
mov    %ebx,0x3c(%rsp)
test   %ebx,%ebx
jle    1820 <vq_train+0x6a0>
mov    %r12d,%ebx
imul   %r14d,%ebx
lea    0x0(,%rbx,8),%eax
mov    %eax,0x34(%rsp)
cvtsi2sd %r15d,%xmm0
movsd  %xmm0,0xb8(%rsp)
movslq %r12d,%rdx
mov    %edx,%esi
lea    0x0(,%rbx,8),%r8
add    %rbp,%r8
lea    0x0(,%rbx,8),%rcx
add    %r13,%rcx
mov    %ebx,%edi
and    $0xfffffffc,%edi
mov    %rdi,0x88(%rsp)
add    $0xfffffffffffffffc,%rdi
mov    %rdi,0x80(%rsp)
shr    $0x2,%rdi
add    $0x1,%rdi
mov    %esi,%eax
and    $0xfffffffc,%eax
mov    %rax,0xd8(%rsp)
mov    %rsi,%rax
neg    %rax
mov    %rax,0xf0(%rsp)
cmp    %rbp,%rcx
seta   %cl
cmp    %r8,%r13
setb   %al
and    %cl,%al
mov    %al,0x6(%rsp)
mov    %edi,%eax
and    $0x3,%eax
and    $0xfffffffffffffffc,%rdi
mov    %rdi,0x68(%rsp)
mov    %ebx,%ecx
and    $0x3,%ecx
mov    %rcx,0xb0(%rsp)
lea    0x0(,%rsi,8),%rcx
and    $0xffffffffffffffe0,%rcx
mov    %rcx,0xd0(%rsp)
mov    %rax,0x78(%rsp)
shl    $0x5,%rax
mov    %rax,0xa8(%rsp)
mov    %r15d,%eax
mov    %rax,0xf8(%rsp)
mov    %r14d,%eax
mov    %rax,0xa0(%rsp)
mov    %rsi,0x28(%rsp)
lea    0x0(%r13,%rsi,8),%rax
mov    %rax,0xe8(%rsp)
mov    0x18(%rsp),%rcx
lea    0x10(%rcx),%rax
mov    %rax,0x98(%rsp)
mov    %rdx,0x100(%rsp)
lea    0x0(,%rdx,8),%rax
mov    %rax,0x50(%rsp)
lea    0x10(%r13),%rax
mov    %rax,0x48(%rsp)
lea    0x8(%r13),%rax
mov    %rax,0xe0(%rsp)
lea    0x8(%rcx),%rax
mov    %rax,0x90(%rsp)
lea    0x10(%rbp),%rax
mov    %rax,0x70(%rsp)
xor    %eax,%eax
mov    %r12d,0x44(%rsp)
mov    %r14d,0x40(%rsp)
mov    %rbp,0x58(%rsp)
mov    %r15d,0x38(%rsp)
mov    %r13,0x20(%rsp)
mov    %rbx,0xc0(%rsp)
jmp    1369 <vq_train+0x1e9>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movapd %xmm2,%xmm0
call   1090 <sqrt@plt>
mov    0x2ca0(%rip),%rax
mov    (%rax),%edi
lea    0xcbf(%rip),%rsi
movsd  %xmm0,0x8(%rsp)
call   1060 <fprintf@plt>
mov    0xc8(%rsp),%rax
add    $0x1,%eax
cmp    0x3c(%rsp),%eax
je     1820 <vq_train+0x6a0>
mov    %rax,0xc8(%rsp)
mov    %r13,%rdi
xor    %esi,%esi
mov    0x34(%rsp),%edx
call   1040 <memset@plt>
xorpd  %xmm6,%xmm6
test   %r15d,%r15d
mov    0x18(%rsp),%r9
mov    0x28(%rsp),%rdi
jle    1630 <vq_train+0x4b0>
xorpd  %xmm6,%xmm6
mov    0x90(%rsp),%rbp
mov    0x98(%rsp),%r13
xor    %ebx,%ebx
jmp    13da <vq_train+0x25a>
xchg   %ax,%ax
movapd %xmm1,%xmm0
addsd  %xmm0,%xmm6
add    $0x1,%rbx
mov    0x50(%rsp),%rax
add    %rax,%r13
add    %rax,%rbp
cmp    0xf8(%rsp),%rbx
mov    0x40(%rsp),%r14d
je     1630 <vq_train+0x4b0>
movsd  %xmm6,0x8(%rsp)
cmpl   $0x0,0x150(%rsp)
setne  0x7(%rsp)
mov    %rbx,0x60(%rsp)
mov    0x100(%rsp),%r12
imul   %r12,%rbx
lea    (%r9,%rbx,8),%r15
lea    (%rbx,%rdi,1),%rax
mov    %rax,0x108(%rsp)
mov    %r15,%rdi
mov    0x58(%rsp),%rsi
mov    %r14d,%edx
mov    %r12d,%ecx
lea    0x10(%rsp),%r8
lea    0x110(%rsp),%r9
call   1070 <find_nearest@plt>
mov    %eax,%r14d
mov    %r15,%rdi
mov    %r12d,%esi
call   10a0 <pvq_dist_k2@plt>
movsd  0x110(%rsp),%xmm1
ucomisd %xmm1,%xmm0
setbe  %al
test   %al,0x7(%rsp)
jne    1456 <vq_train+0x2d6>
movapd %xmm1,%xmm0
mov    0x44(%rsp),%r12d
jne    1610 <vq_train+0x490>
mov    %rbx,%r11
test   %r12d,%r12d
mov    0x18(%rsp),%r9
mov    0x28(%rsp),%rdi
movsd  0x8(%rsp),%xmm6
mov    0x60(%rsp),%rbx
jle    13b4 <vq_train+0x234>
imul   %r12d,%r14d
movslq %r14d,%r10
cmp    $0x4,%r12d
jb     1570 <vq_train+0x3f0>
mov    0x108(%rsp),%rax
lea    (%r9,%rax,8),%rcx
mov    0x20(%rsp),%rax
lea    (%rax,%r10,8),%rdx
mov    0xe8(%rsp),%rax
lea    (%rax,%r10,8),%rsi
lea    0x18(%rsp),%rax
cmp    %rax,%rdx
setb   %r8b
lea    0x10(%rsp),%rax
cmp    %rsi,%rax
setb   %al
cmp    %rcx,%rdx
setb   %cl
cmp    %rsi,%r15
setb   %sil
test   %al,%r8b
jne    1570 <vq_train+0x3f0>
mov    $0x0,%edx
and    %sil,%cl
jne    1572 <vq_train+0x3f2>
movsd  0x10(%rsp),%xmm0
unpcklpd %xmm0,%xmm0
mov    0x48(%rsp),%rax
lea    (%rax,%r10,8),%rcx
xor    %edx,%edx
mov    0xd0(%rsp),%rax
nopl   0x0(%rax)
movupd -0x10(%r13,%rdx,1),%xmm2
movupd 0x0(%r13,%rdx,1),%xmm3
movupd -0x10(%rcx,%rdx,1),%xmm4
movupd (%rcx,%rdx,1),%xmm5
mulpd  %xmm0,%xmm2
addpd  %xmm4,%xmm2
mulpd  %xmm0,%xmm3
addpd  %xmm5,%xmm3
movupd %xmm2,-0x10(%rcx,%rdx,1)
movupd %xmm3,(%rcx,%rdx,1)
add    $0x20,%rdx
cmp    %rdx,%rax
jne    1510 <vq_train+0x390>
mov    0xd8(%rsp),%rax
mov    %rax,%rdx
cmp    %rdi,%rax
je     13b0 <vq_train+0x230>
jmp    1572 <vq_train+0x3f2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edx,%edx
mov    %rdx,%rcx
test   $0x1,%dil
je     15a4 <vq_train+0x424>
movsd  0x10(%rsp),%xmm0
add    %rdx,%r11
lea    (%rdx,%r10,1),%rax
mulsd  (%r9,%r11,8),%xmm0
mov    0x20(%rsp),%rcx
addsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
mov    %rdx,%rcx
or     $0x1,%rcx
not    %rdx
cmp    0xf0(%rsp),%rdx
je     13b0 <vq_train+0x230>
mov    0xe0(%rsp),%rax
lea    (%rax,%r10,8),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x10(%rsp),%xmm0
mulsd  -0x8(%rbp,%rcx,8),%xmm0
addsd  -0x8(%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x8(%rax,%rcx,8)
movsd  0x10(%rsp),%xmm0
mulsd  0x0(%rbp,%rcx,8),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rdi
jne    15d0 <vq_train+0x450>
jmp    13b0 <vq_train+0x230>
nopl   0x0(%rax)
mov    0x18(%rsp),%r9
mov    0x28(%rsp),%rdi
movsd  0x8(%rsp),%xmm6
mov    0x60(%rsp),%rbx
jmp    13b4 <vq_train+0x234>
nopw   0x0(%rax,%rax,1)
movsd  %xmm6,0x8(%rsp)
test   %r14d,%r14d
mov    0x20(%rsp),%r13
mov    0x50(%rsp),%r15
jle    1664 <vq_train+0x4e4>
mov    0xa0(%rsp),%rbx
mov    %r13,%rbp
mov    %rbp,%rdi
mov    %r12d,%esi
call   1050 <normalize@plt>
add    %r15,%rbp
add    $0xffffffffffffffff,%rbx
jne    1650 <vq_train+0x4d0>
mov    0xc0(%rsp),%rbx
test   %ebx,%ebx
mov    0x58(%rsp),%rbp
mov    0x38(%rsp),%r15d
mov    0xb0(%rsp),%rsi
mov    0xa8(%rsp),%rdi
movsd  0x8(%rsp),%xmm2
jle    17fd <vq_train+0x67d>
cmp    $0x4,%ebx
setb   %al
or     0x6(%rsp),%al
je     16b0 <vq_train+0x530>
xor    %eax,%eax
jmp    178f <vq_train+0x60f>
nopw   0x0(%rax,%rax,1)
cmpq   $0xc,0x80(%rsp)
jae    16bf <vq_train+0x53f>
xor    %eax,%eax
jmp    1736 <vq_train+0x5b6>
mov    0x68(%rsp),%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movups 0x0(%r13,%rax,8),%xmm0
movups 0x10(%r13,%rax,8),%xmm1
movups %xmm0,0x0(%rbp,%rax,8)
movups %xmm1,0x10(%rbp,%rax,8)
movups 0x20(%r13,%rax,8),%xmm0
movups 0x30(%r13,%rax,8),%xmm1
movups %xmm0,0x20(%rbp,%rax,8)
movups %xmm1,0x30(%rbp,%rax,8)
movups 0x40(%r13,%rax,8),%xmm0
movups 0x50(%r13,%rax,8),%xmm1
movups %xmm0,0x40(%rbp,%rax,8)
movups %xmm1,0x50(%rbp,%rax,8)
movupd 0x60(%r13,%rax,8),%xmm0
movupd 0x70(%r13,%rax,8),%xmm1
movupd %xmm0,0x60(%rbp,%rax,8)
movupd %xmm1,0x70(%rbp,%rax,8)
add    $0x10,%rax
add    $0xfffffffffffffffc,%rcx
jne    16d0 <vq_train+0x550>
cmpq   $0x0,0x78(%rsp)
je     177f <vq_train+0x5ff>
mov    0x70(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
mov    0x48(%rsp),%rdx
lea    (%rdx,%rax,8),%rax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd -0x10(%rax,%rdx,1),%xmm0
movupd (%rax,%rdx,1),%xmm1
movupd %xmm0,-0x10(%rcx,%rdx,1)
movupd %xmm1,(%rcx,%rdx,1)
add    $0x20,%rdx
cmp    %rdx,%rdi
jne    1760 <vq_train+0x5e0>
mov    0x88(%rsp),%rcx
mov    %rcx,%rax
cmp    %rbx,%rcx
je     17fd <vq_train+0x67d>
mov    %rax,%rcx
not    %rcx
add    %rbx,%rcx
test   %rsi,%rsi
je     17b7 <vq_train+0x637>
mov    %rsi,%rdx
movsd  0x0(%r13,%rax,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    17a0 <vq_train+0x620>
cmp    $0x3,%rcx
jb     17fd <vq_train+0x67d>
nopl   (%rax)
movsd  0x0(%r13,%rax,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
movsd  0x8(%r13,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbp,%rax,8)
movsd  0x10(%r13,%rax,8),%xmm0
movsd  %xmm0,0x10(%rbp,%rax,8)
movsd  0x18(%r13,%rax,8),%xmm0
movsd  %xmm0,0x18(%rbp,%rax,8)
add    $0x4,%rax
cmp    %rax,%rbx
jne    17c0 <vq_train+0x640>
divsd  0xb8(%rsp),%xmm2
ucomisd 0x7f2(%rip),%xmm2
jb     1330 <vq_train+0x1b0>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1339 <vq_train+0x1b9>
mov    %r13,%rdi
call   1030 <free@plt>
movsd  0x8(%rsp),%xmm0
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"RMS: %f\0A\00"
define double @vq_train(double* %0, i32 %1, double* %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca double*
%9 = alloca i32
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [1 x double]
%18 = alloca double*
%19 = alloca i32
%20 = alloca i32
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
store double* %0, double** %8
store i32 %1, i32* %9
store double* %2, double** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%28 = call i64 @malloc(i32 4194304)
%29 = inttoptr i64 %28 to double*
store double* %29, double** %18
store i32 0, i32* %16
br label %30
30: ; preds = %239, %7
%31 = load i32, i32* %16
%32 = load i32, i32* %13
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %242
34: ; preds = %30
store i32 0, i32* %15
br label %35
35: ; preds = %42, %34
%36 = load i32, i32* %15
%37 = icmp slt i32 %36, 1
br i1 %37, label %38, label %45
38: ; preds = %35
%39 = load i32, i32* %15
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [1 x double], [1 x double]* %17, i64 0, i64 %40
store double 0.000000e+00, double* %41
br label %42
42: ; preds = %38
%43 = load i32, i32* %15
%44 = add nsw i32 %43, 1
store i32 %44, i32* %15
br label %35
45: ; preds = %35
%46 = load double*, double** %18
%47 = load i32, i32* %11
%48 = load i32, i32* %12
%49 = mul nsw i32 %47, %48
%50 = mul nsw i32 %49, 1
%51 = sext i32 %50 to i64
%52 = mul i64 %51, 8
%53 = trunc i64 %52 to i32
%54 = call i32 @memset(double* %46, i32 0, i32 %53)
store i32 0, i32* %15
br label %55
55: ; preds = %135, %45
%56 = load i32, i32* %15
%57 = load i32, i32* %9
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %138
59: ; preds = %55
store i32 0, i32* %19
%60 = load double*, double** %8
%61 = load i32, i32* %15
%62 = load i32, i32* %12
%63 = mul nsw i32 %61, %62
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %60, i64 %64
%66 = load double*, double** %10
%67 = load i32, i32* %11
%68 = load i32, i32* %12
%69 = call i32 @find_nearest(double* %65, double* %66, i32 %67, i32 %68, double* %21, double* %23)
store i32 %69, i32* %20
%70 = load double*, double** %8
%71 = load i32, i32* %15
%72 = load i32, i32* %12
%73 = mul nsw i32 %71, %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %70, i64 %74
%76 = load i32, i32* %12
%77 = call double @pvq_dist_k2(double* %75, i32 %76)
store double %77, double* %22
%78 = load i32, i32* %14
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %84
80: ; preds = %59
%81 = load double, double* %23
%82 = load double, double* %22
%83 = fcmp olt double %81, %82
br i1 %83, label %84, label %127
84: ; preds = %80, %59
%85 = load double, double* %23
%86 = load i32, i32* %19
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [1 x double], [1 x double]* %17, i64 0, i64 %87
%89 = load double, double* %88
%90 = fadd double %89, %85
store double %90, double* %88
%91 = load i32, i32* %11
%92 = load i32, i32* %12
%93 = mul nsw i32 %91, %92
%94 = load i32, i32* %19
%95 = mul nsw i32 %93, %94
%96 = load i32, i32* %20
%97 = load i32, i32* %12
%98 = mul nsw i32 %96, %97
%99 = add nsw i32 %95, %98
store i32 %99, i32* %25
store i32 0, i32* %24
br label %100
100: ; preds = %123, %84
%101 = load i32, i32* %24
%102 = load i32, i32* %12
%103 = icmp slt i32 %101, %102
br i1 %103, label %104, label %126
104: ; preds = %100
%105 = load double, double* %21
%106 = load double*, double** %8
%107 = load i32, i32* %15
%108 = load i32, i32* %12
%109 = mul nsw i32 %107, %108
%110 = load i32, i32* %24
%111 = add nsw i32 %109, %110
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %106, i64 %112
%114 = load double, double* %113
%115 = load double*, double** %18
%116 = load i32, i32* %25
%117 = load i32, i32* %24
%118 = add nsw i32 %116, %117
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %115, i64 %119
%121 = load double, double* %120
%122 = call double @llvm.fmuladd.f64(double %105, double %114, double %121)
store double %122, double* %120
br label %123
123: ; preds = %104
%124 = load i32, i32* %24
%125 = add nsw i32 %124, 1
store i32 %125, i32* %24
br label %100
126: ; preds = %100
br label %134
127: ; preds = %80
%128 = load double, double* %22
%129 = load i32, i32* %19
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [1 x double], [1 x double]* %17, i64 0, i64 %130
%132 = load double, double* %131
%133 = fadd double %132, %128
store double %133, double* %131
br label %134
134: ; preds = %127, %126
br label %135
135: ; preds = %134
%136 = load i32, i32* %15
%137 = add nsw i32 %136, 1
store i32 %137, i32* %15
br label %55
138: ; preds = %55
store i32 1, i32* %15
br label %139
139: ; preds = %172, %138
%140 = load i32, i32* %15
%141 = icmp slt i32 %140, 1
br i1 %141, label %142, label %175
142: ; preds = %139
%143 = load i32, i32* %11
%144 = load i32, i32* %12
%145 = mul nsw i32 %143, %144
%146 = load i32, i32* %15
%147 = mul nsw i32 %145, %146
store i32 %147, i32* %27
store i32 0, i32* %26
br label %148
148: ; preds = %168, %142
%149 = load i32, i32* %26
%150 = load i32, i32* %11
%151 = load i32, i32* %12
%152 = mul nsw i32 %150, %151
%153 = icmp slt i32 %149, %152
br i1 %153, label %154, label %171
154: ; preds = %148
%155 = load double*, double** %18
%156 = load i32, i32* %27
%157 = load i32, i32* %26
%158 = add nsw i32 %156, %157
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds double, double* %155, i64 %159
%161 = load double, double* %160
%162 = load double*, double** %18
%163 = load i32, i32* %26
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %162, i64 %164
%166 = load double, double* %165
%167 = fadd double %166, %161
store double %167, double* %165
br label %168
168: ; preds = %154
%169 = load i32, i32* %26
%170 = add nsw i32 %169, 1
store i32 %170, i32* %26
br label %148
171: ; preds = %148
br label %172
172: ; preds = %171
%173 = load i32, i32* %15
%174 = add nsw i32 %173, 1
store i32 %174, i32* %15
br label %139
175: ; preds = %139
store i32 1, i32* %15
br label %176
176: ; preds = %187, %175
%177 = load i32, i32* %15
%178 = icmp slt i32 %177, 1
br i1 %178, label %179, label %190
179: ; preds = %176
%180 = load i32, i32* %15
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds [1 x double], [1 x double]* %17, i64 0, i64 %181
%183 = load double, double* %182
%184 = getelementptr inbounds [1 x double], [1 x double]* %17, i64 0, i64 0
%185 = load double, double* %184
%186 = fadd double %185, %183
store double %186, double* %184
br label %187
187: ; preds = %179
%188 = load i32, i32* %15
%189 = add nsw i32 %188, 1
store i32 %189, i32* %15
br label %176
190: ; preds = %176
store i32 0, i32* %15
br label %191
191: ; preds = %204, %190
%192 = load i32, i32* %15
%193 = load i32, i32* %11
%194 = icmp slt i32 %192, %193
br i1 %194, label %195, label %207
195: ; preds = %191
%196 = load double*, double** %18
%197 = load i32, i32* %15
%198 = load i32, i32* %12
%199 = mul nsw i32 %197, %198
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds double, double* %196, i64 %200
%202 = load i32, i32* %12
%203 = call i32 @normalize(double* %201, i32 %202)
br label %204
204: ; preds = %195
%205 = load i32, i32* %15
%206 = add nsw i32 %205, 1
store i32 %206, i32* %15
br label %191
207: ; preds = %191
store i32 0, i32* %15
br label %208
208: ; preds = %224, %207
%209 = load i32, i32* %15
%210 = load i32, i32* %11
%211 = load i32, i32* %12
%212 = mul nsw i32 %210, %211
%213 = icmp slt i32 %209, %212
br i1 %213, label %214, label %227
214: ; preds = %208
%215 = load double*, double** %18
%216 = load i32, i32* %15
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds double, double* %215, i64 %217
%219 = load double, double* %218
%220 = load double*, double** %10
%221 = load i32, i32* %15
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds double, double* %220, i64 %222
store double %219, double* %223
br label %224
224: ; preds = %214
%225 = load i32, i32* %15
%226 = add nsw i32 %225, 1
store i32 %226, i32* %15
br label %208
227: ; preds = %208
%228 = getelementptr inbounds [1 x double], [1 x double]* %17, i64 0, i64 0
%229 = load double, double* %228
%230 = load i32, i32* %9
%231 = sitofp i32 %230 to double
%232 = fdiv double %229, %231
%233 = call double @sqrt(double %232)
%234 = getelementptr inbounds [1 x double], [1 x double]* %17, i64 0, i64 0
store double %233, double* %234
%235 = load i32, i32* @stderr
%236 = getelementptr inbounds [1 x double], [1 x double]* %17, i64 0, i64 0
%237 = load double, double* %236
%238 = call i32 @fprintf(i32 %235, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %237)
br label %239
239: ; preds = %227
%240 = load i32, i32* %16
%241 = add nsw i32 %240, 1
store i32 %241, i32* %16
br label %30
242: ; preds = %30
%243 = load double*, double** %18
%244 = call i32 @free(double* %243)
%245 = getelementptr inbounds [1 x double], [1 x double]* %17, i64 0, i64 0
%246 = load double, double* %245
ret double %246
}

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