#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 */
double sqrt(double);
void normalize(double *X, int *rn, int *rd, double *X_means, double *result) {
  int i, j, flag, n = *rn, d = *rd;
  double sum;
  for (j = 0; j < d; j++) {
    flag = 0;
    sum = X[j * n];
    for (i = 1; i < n; i++) {
      if (sum != X[i + j * n]) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      for (i = 0; i < n; i++)
        result[i + j * n] = X[i + j * n];
    } else if (flag == 1) {
      sum = 0;
      for (i = 0; i < n; i++)
        sum += (X[i + j * n] - X_means[j]) * (X[i + j * n] - X_means[j]);
      sum = sqrt(sum / (n - 1));
      for (i = 0; i < n; i++)
        result[i + j * n] = X[i + j * n] / sum;
    }
  }
}


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    134f <normalize+0x23f>
movl   $0x0,-0x34(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    11d0 <normalize+0xc0>
movsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x38(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
ucomisd (%rax,%rcx,8),%xmm0
jne    11b1 <normalize+0xa1>
jp     11b1 <normalize+0xa1>
jmp    11bd <normalize+0xad>
movl   $0x1,-0x34(%rbp)
jmp    11d0 <normalize+0xc0>
jmp    11c2 <normalize+0xb2>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1177 <normalize+0x67>
cmpl   $0x0,-0x34(%rbp)
jne    1230 <normalize+0x120>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    122b <normalize+0x11b>
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x38(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x38(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11e1 <normalize+0xd1>
jmp    133c <normalize+0x22c>
cmpl   $0x1,-0x34(%rbp)
jne    1337 <normalize+0x227>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    12bf <normalize+0x1af>
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x38(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x38(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1249 <normalize+0x139>
movsd  -0x48(%rbp),%xmm0
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1332 <normalize+0x222>
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x38(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x38(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12e3 <normalize+0x1d3>
jmp    1337 <normalize+0x227>
jmp    133c <normalize+0x22c>
jmp    1341 <normalize+0x231>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1145 <normalize+0x35>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %r8,0x18(%rsp)
mov    %rcx,0xb8(%rsp)
mov    %rdi,0x8(%rsp)
mov    (%rdx),%eax
mov    %rax,0xc8(%rsp)
test   %eax,%eax
jle    16bf <normalize+0x5af>
movslq (%rsi),%r11
mov    %r11d,%ebp
lea    -0x1(%rbp),%eax
cvtsi2sd %eax,%xmm0
xorpd  %xmm4,%xmm4
xorpd  %xmm1,%xmm1
movsd  %xmm0,0xb0(%rsp)
divsd  %xmm0,%xmm1
movsd  %xmm1,0x38(%rsp)
mov    %ebp,%edi
and    $0xfffffffc,%edi
lea    -0x4(%rdi),%rax
mov    %rax,0x90(%rsp)
shr    $0x2,%rax
add    $0x1,%rax
lea    -0x1(%rbp),%rcx
mov    %rcx,0x40(%rsp)
mov    %ebp,%ecx
and    $0xfffffffe,%ecx
mov    %rcx,0x70(%rsp)
add    $0xfffffffffffffffe,%rcx
mov    %rcx,0x68(%rsp)
shr    %rcx
add    $0x1,%rcx
mov    %eax,%edx
and    $0x3,%edx
and    $0xfffffffffffffffc,%rax
mov    %rax,0x78(%rsp)
mov    %ebp,%r10d
and    $0x3,%r10d
mov    %rcx,%rax
mov    %rcx,0x60(%rsp)
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x58(%rsp)
mov    %rbp,%rax
neg    %rax
mov    %rax,0x80(%rsp)
lea    0x0(,%r11,8),%rax
mov    %rax,0xc0(%rsp)
mov    %rdx,0x88(%rsp)
mov    %rdx,%rax
shl    $0x5,%rax
mov    %rax,0x20(%rsp)
mov    0x18(%rsp),%r15
lea    0x70(%r15),%r13
lea    0x10(%r15),%r14
mov    0x8(%rsp),%rbx
lea    0x10(%rbx),%r8
xor    %ecx,%ecx
mov    %r11,0x30(%rsp)
mov    %rdi,0x28(%rsp)
mov    %r10,0x10(%rsp)
jmp    1261 <normalize+0x151>
nopw   0x0(%rax,%rax,1)
mov    0xd0(%rsp),%rcx
add    $0x1,%rcx
mov    0xc0(%rsp),%rax
add    %rax,%rbx
add    %rax,%r13
add    %rax,%r14
add    %rax,%r8
add    %rax,%r15
cmp    0xc8(%rsp),%rcx
je     16bf <normalize+0x5af>
mov    %rcx,%r12
imul   %r11,%r12
lea    (%r12,%rbp,1),%rax
mov    0x18(%rsp),%rsi
lea    (%rsi,%r12,8),%rdx
mov    %rdx,0x50(%rsp)
lea    (%rsi,%rax,8),%r9
mov    %r9,0x48(%rsp)
mov    0x8(%rsp),%rdx
lea    (%rdx,%r12,8),%r9
lea    (%rdx,%rax,8),%rdx
cmp    $0x2,%r11d
mov    %rcx,0xd0(%rsp)
jl     12ca <normalize+0x1ba>
mov    0x8(%rsp),%rax
movsd  (%rax,%r12,8),%xmm0
mov    $0x1,%eax
xchg   %ax,%ax
ucomisd (%rbx,%rax,8),%xmm0
jne    1370 <normalize+0x260>
jp     1370 <normalize+0x260>
add    $0x1,%rax
cmp    %rax,%rbp
jne    12b0 <normalize+0x1a0>
test   %r11d,%r11d
jle    1230 <normalize+0x120>
cmp    $0x4,%r11d
jb     12ef <normalize+0x1df>
cmp    %rdx,0x50(%rsp)
jae    1394 <normalize+0x284>
cmp    0x48(%rsp),%r9
jae    1394 <normalize+0x284>
xor    %eax,%eax
mov    0x40(%rsp),%rcx
sub    %rax,%rcx
test   $0x3,%bpl
je     1315 <normalize+0x205>
nop
movsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%r15,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%r10
jne    1300 <normalize+0x1f0>
cmp    $0x3,%rcx
mov    0x10(%rsp),%r10
jb     1230 <normalize+0x120>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,-0x10(%r14,%rax,8)
movsd  0x8(%rbx,%rax,8),%xmm0
movsd  %xmm0,-0x8(%r14,%rax,8)
movsd  0x10(%rbx,%rax,8),%xmm0
movsd  %xmm0,(%r14,%rax,8)
movsd  0x18(%rbx,%rax,8),%xmm0
movsd  %xmm0,0x8(%r14,%rax,8)
add    $0x4,%rax
cmp    %rax,%rbp
jne    1330 <normalize+0x220>
jmp    1230 <normalize+0x120>
test   %ebp,%ebp
jle    13af <normalize+0x29f>
mov    0xb8(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm1
cmpq   $0x3,0x40(%rsp)
jae    13e8 <normalize+0x2d8>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
jmp    1440 <normalize+0x330>
cmpq   $0xc,0x90(%rsp)
jae    156e <normalize+0x45e>
xor    %eax,%eax
mov    0x20(%rsp),%rsi
jmp    15e5 <normalize+0x4d5>
movsd  0x38(%rsp),%xmm0
ucomisd %xmm4,%xmm0
jae    1230 <normalize+0x120>
movsd  0x38(%rsp),%xmm0
mov    %r8,%r12
call   1030 <sqrt@plt>
mov    %r12,%r8
mov    0x10(%rsp),%r10
mov    0x28(%rsp),%rdi
xorpd  %xmm4,%xmm4
mov    0x30(%rsp),%r11
jmp    1230 <normalize+0x120>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
xchg   %ax,%ax
movsd  (%rbx,%rax,8),%xmm2
movsd  0x8(%rbx,%rax,8),%xmm3
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
subsd  %xmm1,%xmm3
mulsd  %xmm3,%xmm3
addsd  %xmm2,%xmm3
movsd  0x10(%rbx,%rax,8),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movsd  0x18(%rbx,%rax,8),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
add    $0x4,%rax
cmp    %rax,%rdi
jne    13f0 <normalize+0x2e0>
test   %r10,%r10
je     146a <normalize+0x35a>
lea    (%rbx,%rax,8),%rax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movsd  (%rax,%rcx,8),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm0
add    $0x1,%rcx
cmp    %rcx,%r10
jne    1450 <normalize+0x340>
divsd  0xb0(%rsp),%xmm0
ucomisd %xmm4,%xmm0
jb     1486 <normalize+0x376>
sqrtsd %xmm0,%xmm0
test   %ebp,%ebp
jg     14d6 <normalize+0x3c6>
jmp    1230 <normalize+0x120>
mov    %r8,0xa8(%rsp)
mov    %r9,0xa0(%rsp)
mov    %rdx,0x98(%rsp)
call   1030 <sqrt@plt>
mov    0x98(%rsp),%rdx
mov    0xa0(%rsp),%r9
mov    0xa8(%rsp),%r8
mov    0x10(%rsp),%r10
mov    0x28(%rsp),%rdi
xorpd  %xmm4,%xmm4
mov    0x30(%rsp),%r11
test   %ebp,%ebp
jle    1230 <normalize+0x120>
cmp    $0x1,%ebp
je     14f1 <normalize+0x3e1>
cmp    %rdx,0x50(%rsp)
jae    1635 <normalize+0x525>
cmp    0x48(%rsp),%r9
jae    1635 <normalize+0x525>
xor    %ecx,%ecx
mov    %rcx,%rax
test   $0x1,%bpl
je     1520 <normalize+0x410>
add    %rcx,%r12
mov    0x8(%rsp),%rax
movsd  (%rax,%r12,8),%xmm1
divsd  %xmm0,%xmm1
mov    0x18(%rsp),%rax
movsd  %xmm1,(%rax,%r12,8)
mov    %rcx,%rax
or     $0x1,%rax
not    %rcx
cmp    0x80(%rsp),%rcx
je     1230 <normalize+0x120>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rax,8),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rax,8)
movsd  0x8(%rbx,%rax,8),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r15,%rax,8)
add    $0x2,%rax
cmp    %rax,%rbp
jne    1540 <normalize+0x430>
jmp    1230 <normalize+0x120>
mov    0x78(%rsp),%rcx
xor    %eax,%eax
mov    0x20(%rsp),%rsi
nopw   0x0(%rax,%rax,1)
movups (%rbx,%rax,8),%xmm0
movups 0x10(%rbx,%rax,8),%xmm1
movups %xmm0,-0x70(%r13,%rax,8)
movups %xmm1,-0x60(%r13,%rax,8)
movups 0x20(%rbx,%rax,8),%xmm0
movups 0x30(%rbx,%rax,8),%xmm1
movups %xmm0,-0x50(%r13,%rax,8)
movups %xmm1,-0x40(%r13,%rax,8)
movups 0x40(%rbx,%rax,8),%xmm0
movups 0x50(%rbx,%rax,8),%xmm1
movups %xmm0,-0x30(%r13,%rax,8)
movups %xmm1,-0x20(%r13,%rax,8)
movupd 0x60(%rbx,%rax,8),%xmm0
movupd 0x70(%rbx,%rax,8),%xmm1
movupd %xmm0,-0x10(%r13,%rax,8)
movupd %xmm1,0x0(%r13,%rax,8)
add    $0x10,%rax
add    $0xfffffffffffffffc,%rcx
jne    1580 <normalize+0x470>
cmpq   $0x0,0x88(%rsp)
je     161f <normalize+0x50f>
lea    (%r14,%rax,8),%rcx
lea    (%r8,%rax,8),%rax
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
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,%rsi
jne    1600 <normalize+0x4f0>
mov    %rdi,%rax
cmp    %rbp,%rdi
mov    0x10(%rsp),%r10
je     1230 <normalize+0x120>
jmp    12f1 <normalize+0x1e1>
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
cmpq   $0x0,0x68(%rsp)
je     16b4 <normalize+0x5a4>
mov    0x58(%rsp),%rcx
xor    %eax,%eax
nopl   0x0(%rax)
movupd -0x10(%r8,%rax,8),%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,-0x10(%r14,%rax,8)
movupd (%r8,%rax,8),%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%r14,%rax,8)
add    $0x4,%rax
add    $0xfffffffffffffffe,%rcx
jne    1650 <normalize+0x540>
testb  $0x1,0x60(%rsp)
je     169e <normalize+0x58e>
add    %r12,%rax
mov    0x8(%rsp),%rcx
movupd (%rcx,%rax,8),%xmm2
divpd  %xmm1,%xmm2
mov    0x18(%rsp),%rcx
movupd %xmm2,(%rcx,%rax,8)
mov    0x70(%rsp),%rax
mov    %rax,%rcx
cmp    %rbp,%rax
je     1230 <normalize+0x120>
jmp    14f3 <normalize+0x3e3>
xor    %eax,%eax
testb  $0x1,0x60(%rsp)
jne    1683 <normalize+0x573>
jmp    169e <normalize+0x58e>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @normalize(double* %0, i32* %1, i32* %2, double* %3, double* %4) {
%6 = alloca double*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
store double* %0, double** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store double* %3, double** %9
store double* %4, double** %10
%17 = load i32*, i32** %7
%18 = load i32, i32* %17
store i32 %18, i32* %14
%19 = load i32*, i32** %8
%20 = load i32, i32* %19
store i32 %20, i32* %15
store i32 0, i32* %12
br label %21
21: ; preds = %165, %5
%22 = load i32, i32* %12
%23 = load i32, i32* %15
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %168
25: ; preds = %21
store i32 0, i32* %13
%26 = load double*, double** %6
%27 = load i32, i32* %12
%28 = load i32, i32* %14
%29 = mul nsw i32 %27, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %26, i64 %30
%32 = load double, double* %31
store double %32, double* %16
store i32 1, i32* %11
br label %33
33: ; preds = %51, %25
%34 = load i32, i32* %11
%35 = load i32, i32* %14
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %54
37: ; preds = %33
%38 = load double, double* %16
%39 = load double*, double** %6
%40 = load i32, i32* %11
%41 = load i32, i32* %12
%42 = load i32, i32* %14
%43 = mul nsw i32 %41, %42
%44 = add nsw i32 %40, %43
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %39, i64 %45
%47 = load double, double* %46
%48 = fcmp une double %38, %47
br i1 %48, label %49, label %50
49: ; preds = %37
store i32 1, i32* %13
br label %54
50: ; preds = %37
br label %51
51: ; preds = %50
%52 = load i32, i32* %11
%53 = add nsw i32 %52, 1
store i32 %53, i32* %11
br label %33
54: ; preds = %49, %33
%55 = load i32, i32* %13
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %84
57: ; preds = %54
store i32 0, i32* %11
br label %58
58: ; preds = %80, %57
%59 = load i32, i32* %11
%60 = load i32, i32* %14
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %83
62: ; preds = %58
%63 = load double*, double** %6
%64 = load i32, i32* %11
%65 = load i32, i32* %12
%66 = load i32, i32* %14
%67 = mul nsw i32 %65, %66
%68 = add nsw i32 %64, %67
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %63, i64 %69
%71 = load double, double* %70
%72 = load double*, double** %10
%73 = load i32, i32* %11
%74 = load i32, i32* %12
%75 = load i32, i32* %14
%76 = mul nsw i32 %74, %75
%77 = add nsw i32 %73, %76
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %72, i64 %78
store double %71, double* %79
br label %80
80: ; preds = %62
%81 = load i32, i32* %11
%82 = add nsw i32 %81, 1
store i32 %82, i32* %11
br label %58
83: ; preds = %58
br label %164
84: ; preds = %54
%85 = load i32, i32* %13
%86 = icmp eq i32 %85, 1
br i1 %86, label %87, label %163
87: ; preds = %84
store double 0.000000e+00, double* %16
store i32 0, i32* %11
br label %88
88: ; preds = %125, %87
%89 = load i32, i32* %11
%90 = load i32, i32* %14
%91 = icmp slt i32 %89, %90
br i1 %91, label %92, label %128
92: ; preds = %88
%93 = load double*, double** %6
%94 = load i32, i32* %11
%95 = load i32, i32* %12
%96 = load i32, i32* %14
%97 = mul nsw i32 %95, %96
%98 = add nsw i32 %94, %97
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %93, i64 %99
%101 = load double, double* %100
%102 = load double*, double** %9
%103 = load i32, i32* %12
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %102, i64 %104
%106 = load double, double* %105
%107 = fsub double %101, %106
%108 = load double*, double** %6
%109 = load i32, i32* %11
%110 = load i32, i32* %12
%111 = load i32, i32* %14
%112 = mul nsw i32 %110, %111
%113 = add nsw i32 %109, %112
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %108, i64 %114
%116 = load double, double* %115
%117 = load double*, double** %9
%118 = load i32, i32* %12
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %117, i64 %119
%121 = load double, double* %120
%122 = fsub double %116, %121
%123 = load double, double* %16
%124 = call double @llvm.fmuladd.f64(double %107, double %122, double %123)
store double %124, double* %16
br label %125
125: ; preds = %92
%126 = load i32, i32* %11
%127 = add nsw i32 %126, 1
store i32 %127, i32* %11
br label %88
128: ; preds = %88
%129 = load double, double* %16
%130 = load i32, i32* %14
%131 = sub nsw i32 %130, 1
%132 = sitofp i32 %131 to double
%133 = fdiv double %129, %132
%134 = call double @sqrt(double %133)
store double %134, double* %16
store i32 0, i32* %11
br label %135
135: ; preds = %159, %128
%136 = load i32, i32* %11
%137 = load i32, i32* %14
%138 = icmp slt i32 %136, %137
br i1 %138, label %139, label %162
139: ; preds = %135
%140 = load double*, double** %6
%141 = load i32, i32* %11
%142 = load i32, i32* %12
%143 = load i32, i32* %14
%144 = mul nsw i32 %142, %143
%145 = add nsw i32 %141, %144
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %140, i64 %146
%148 = load double, double* %147
%149 = load double, double* %16
%150 = fdiv double %148, %149
%151 = load double*, double** %10
%152 = load i32, i32* %11
%153 = load i32, i32* %12
%154 = load i32, i32* %14
%155 = mul nsw i32 %153, %154
%156 = add nsw i32 %152, %155
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %151, i64 %157
store double %150, double* %158
br label %159
159: ; preds = %139
%160 = load i32, i32* %11
%161 = add nsw i32 %160, 1
store i32 %161, i32* %11
br label %135
162: ; preds = %135
br label %163
163: ; preds = %162, %84
br label %164
164: ; preds = %163, %83
br label %165
165: ; preds = %164
%166 = load i32, i32* %12
%167 = add nsw i32 %166, 1
store i32 %167, i32* %12
br label %21
168: ; preds = %21
ret void
}

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