#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);
double denorm(int n, double x[]) {
  if (n < 8) {
    double ss = 0.0;
    switch (n) {
    case 8:
      ss += x[7] * x[7];
    case 7:
      ss += x[6] * x[6];
    case 6:
      ss += x[5] * x[5];
    case 5:
      ss += x[4] * x[4];
    case 4:
      ss += x[3] * x[3];
    case 3:
      ss += x[2] * x[2];
    case 2:
      ss += x[1] * x[1];
    case 1:
      ss += x[0] * x[0];
    }
    return sqrt(ss);
  } else {
    static double rdwarf = 3.834e-20;
    static double rgiant = 1.304e19;
    static double xabs, x1max, x3max;
    static int i;
    static double s1, s2, s3, agiant, floatn;
    double ret_val, td;
    s1 = 0.0;
    s2 = 0.0;
    s3 = 0.0;
    x1max = 0.0;
    x3max = 0.0;
    floatn = (double)(n + 1);
    agiant = rgiant / floatn;
    for (i = 0; i < n; i++) {
      xabs = (td = x[i], ((td) >= 0.0 ? (td) : -(td)));
      if (xabs > rdwarf && xabs < agiant) {
        td = xabs;
        s2 += td * td;
      } else if (xabs <= rdwarf) {
        if (xabs <= x3max) {
          if (xabs != 0.0) {
            td = xabs / x3max;
            s3 += td * td;
          }
        } else {
          td = x3max / xabs;
          s3 = 1.0 + s3 * (td * td);
          x3max = xabs;
        }
      } else {
        if (xabs <= x1max) {
          td = xabs / x1max;
          s1 += td * td;
        } else {
          td = x1max / xabs;
          s1 = 1.0 + s1 * (td * td);
          x1max = xabs;
        }
      }
    }
    if (s1 != 0.0) {
      ret_val = x1max * sqrt(s1 + s2 / x1max / x1max);
    } else {
      if (s2 == 0.0) {
        ret_val = x3max * sqrt(s3);
      } else {
        if (s2 >= x3max) {
          ret_val = sqrt(s2 * (1.0 + x3max / s2 * (x3max * s3)));
        } else {
          ret_val = sqrt(x3max * (s2 / x3max + x3max * s3));
        }
      }
    }
    return ret_val;
  }
}


x86 assembly (clang, -O0):
<denorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    128c <denorm+0x17c>
movq   $0x0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0x7,%eax
ja     1278 <denorm+0x168>
mov    -0x38(%rbp),%rax
lea    0xeb7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x38(%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x30(%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x28(%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    16e4 <denorm+0x5d4>
xorps  %xmm0,%xmm0
movsd  %xmm0,0x2dc9(%rip)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x2dc6(%rip)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x2dc3(%rip)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x2d90(%rip)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x2d8d(%rip)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x2dab(%rip)
movsd  0x2d53(%rip),%xmm0
divsd  0x2d9b(%rip),%xmm0
movsd  %xmm0,0x2d8b(%rip)
movl   $0x0,0x2d61(%rip)
mov    0x2d5b(%rip),%eax
cmp    -0xc(%rbp),%eax
jge    157a <denorm+0x46a>
mov    -0x18(%rbp),%rax
movslq 0x2d47(%rip),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     133c <denorm+0x22c>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    135d <denorm+0x24d>
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,0x2cd6(%rip)
movsd  0x2cce(%rip),%xmm0
ucomisd 0x2cae(%rip),%xmm0
jbe    13ce <denorm+0x2be>
movsd  0x2cb8(%rip),%xmm1
movsd  0x2ce8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    13ce <denorm+0x2be>
movsd  0x2c9e(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  0x2caf(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2c9f(%rip)
jmp    1561 <denorm+0x451>
movsd  0x2c6a(%rip),%xmm1
movsd  0x2c4a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     14b2 <denorm+0x3a2>
movsd  0x2c50(%rip),%xmm1
movsd  0x2c58(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     145e <denorm+0x34e>
movsd  0x2c36(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1422 <denorm+0x312>
jp     1422 <denorm+0x312>
jmp    1459 <denorm+0x349>
movsd  0x2c16(%rip),%xmm0
divsd  0x2c1e(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  0x2c27(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2c17(%rip)
jmp    14ad <denorm+0x39d>
movsd  0x2bea(%rip),%xmm0
divsd  0x2bd2(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0x2bf5(%rip),%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb6f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2bd3(%rip)
movsd  0x2b9b(%rip),%xmm0
movsd  %xmm0,0x2ba3(%rip)
jmp    155c <denorm+0x44c>
movsd  0x2b86(%rip),%xmm1
movsd  0x2b86(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1508 <denorm+0x3f8>
movsd  0x2b6c(%rip),%xmm0
divsd  0x2b6c(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  0x2b6d(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2b5d(%rip)
jmp    1557 <denorm+0x447>
movsd  0x2b38(%rip),%xmm0
divsd  0x2b28(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0x2b3b(%rip),%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xac5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2b19(%rip)
movsd  0x2af1(%rip),%xmm0
movsd  %xmm0,0x2af1(%rip)
jmp    155c <denorm+0x44c>
jmp    1561 <denorm+0x451>
jmp    1566 <denorm+0x456>
mov    0x2aec(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ae3(%rip)
jmp    12f7 <denorm+0x1e7>
movsd  0x2ade(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    159a <denorm+0x48a>
jp     159a <denorm+0x48a>
jmp    15e6 <denorm+0x4d6>
movsd  0x2aa6(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0x2ab1(%rip),%xmm0
movsd  0x2ab1(%rip),%xmm1
divsd  0x2a89(%rip),%xmm1
divsd  0x2a81(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    16da <denorm+0x5ca>
movsd  0x2a7a(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1631 <denorm+0x521>
jp     1631 <denorm+0x521>
movsd  0x2a47(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0x2a5a(%rip),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    16d5 <denorm+0x5c5>
movsd  0x2a2f(%rip),%xmm0
ucomisd 0x2a0f(%rip),%xmm0
jb     1692 <denorm+0x582>
movsd  0x2a19(%rip),%xmm0
movsd  0x29f9(%rip),%xmm1
divsd  0x2a09(%rip),%xmm1
movsd  0x29e9(%rip),%xmm2
mulsd  0x2a01(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x985(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
jmp    16d0 <denorm+0x5c0>
movsd  0x29b6(%rip),%xmm0
movsd  0x29c6(%rip),%xmm2
divsd  0x29a6(%rip),%xmm2
movsd  0x299e(%rip),%xmm1
movsd  0x29b6(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
jmp    16d5 <denorm+0x5c5>
jmp    16da <denorm+0x5ca>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<denorm>:
push   %rax
cmp    $0x7,%edi
jg     11ca <denorm+0xba>
xorpd  %xmm1,%xmm1
add    $0xffffffff,%edi
xorpd  %xmm0,%xmm0
cmp    $0x6,%edi
ja     11b4 <denorm+0xa4>
lea    0xefb(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
xorpd  %xmm2,%xmm2
xorpd  %xmm0,%xmm0
xorpd  %xmm3,%xmm3
xorpd  %xmm4,%xmm4
xorpd  %xmm5,%xmm5
xorpd  %xmm6,%xmm6
jmp    *%rcx
movsd  0x30(%rsi),%xmm0
mulsd  %xmm0,%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
movsd  0x28(%rsi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
movsd  0x20(%rsi),%xmm3
mulsd  %xmm3,%xmm3
addsd  %xmm0,%xmm3
movsd  0x18(%rsi),%xmm4
mulsd  %xmm4,%xmm4
addsd  %xmm3,%xmm4
movsd  0x10(%rsi),%xmm5
mulsd  %xmm5,%xmm5
addsd  %xmm4,%xmm5
movsd  0x8(%rsi),%xmm6
mulsd  %xmm6,%xmm6
addsd  %xmm5,%xmm6
movsd  (%rsi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm6,%xmm0
ucomisd %xmm1,%xmm0
jb     139a <denorm+0x28a>
xorps  %xmm6,%xmm6
sqrtsd %xmm0,%xmm6
jmp    136a <denorm+0x25a>
lea    0x1(%rdi),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe26(%rip),%xmm12
divsd  %xmm0,%xmm12
mov    %edi,%eax
xorpd  %xmm8,%xmm8
xor    %ecx,%ecx
movapd 0xe2f(%rip),%xmm10
movsd  0xe0e(%rip),%xmm11
movsd  0xe0d(%rip),%xmm9
xorpd  %xmm3,%xmm3
xorpd  %xmm0,%xmm0
xorpd  %xmm6,%xmm6
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
jmp    1235 <denorm+0x125>
nopl   0x0(%rax)
mulsd  %xmm4,%xmm4
addsd  %xmm4,%xmm2
add    $0x1,%rcx
cmp    %rcx,%rax
je     12df <denorm+0x1cf>
movsd  (%rsi,%rcx,8),%xmm7
movapd %xmm7,%xmm5
xorpd  %xmm10,%xmm5
xorpd  %xmm4,%xmm4
cmplesd %xmm7,%xmm4
andpd  %xmm4,%xmm7
andnpd %xmm5,%xmm4
orpd   %xmm7,%xmm4
ucomisd %xmm11,%xmm4
jbe    1266 <denorm+0x156>
ucomisd %xmm4,%xmm12
ja     1220 <denorm+0x110>
ucomisd %xmm4,%xmm11
jae    1290 <denorm+0x180>
ucomisd %xmm4,%xmm6
jae    12b0 <denorm+0x1a0>
divsd  %xmm4,%xmm6
mulsd  %xmm6,%xmm6
mulsd  %xmm6,%xmm1
addsd  %xmm9,%xmm1
movapd %xmm4,%xmm6
jmp    1228 <denorm+0x118>
nopw   0x0(%rax,%rax,1)
ucomisd %xmm4,%xmm3
jae    12c1 <denorm+0x1b1>
divsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm9,%xmm0
movapd %xmm4,%xmm3
jmp    1228 <denorm+0x118>
divsd  %xmm6,%xmm4
mulsd  %xmm4,%xmm4
addsd  %xmm4,%xmm1
jmp    1228 <denorm+0x118>
ucomisd %xmm8,%xmm4
jne    12ce <denorm+0x1be>
jnp    1228 <denorm+0x118>
divsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm4
addsd  %xmm4,%xmm0
jmp    1228 <denorm+0x118>
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm1
jne    12eb <denorm+0x1db>
jnp    130a <denorm+0x1fa>
divsd  %xmm6,%xmm2
divsd  %xmm6,%xmm2
addsd  %xmm2,%xmm1
ucomisd %xmm4,%xmm1
jb     1322 <denorm+0x212>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
mulsd  %xmm0,%xmm6
jmp    136a <denorm+0x25a>
ucomisd %xmm4,%xmm2
jne    133b <denorm+0x22b>
jp     133b <denorm+0x22b>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1353 <denorm+0x243>
sqrtsd %xmm0,%xmm0
jmp    1362 <denorm+0x252>
movapd %xmm1,%xmm0
movsd  %xmm6,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm6
mulsd  %xmm0,%xmm6
jmp    136a <denorm+0x25a>
ucomisd %xmm3,%xmm2
jae    1370 <denorm+0x260>
divsd  %xmm3,%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm3,%xmm0
jmp    138c <denorm+0x27c>
movsd  %xmm3,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm3
mulsd  %xmm0,%xmm3
movapd %xmm3,%xmm6
movapd %xmm6,%xmm0
pop    %rax
ret
movapd %xmm3,%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xc88(%rip),%xmm0
mulsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    11be <denorm+0xae>
pop    %rax
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @denorm(i32 %0, double* nocapture %1) {
%3 = icmp slt i32 %0, 8
br i1 %3, label %4, label %41
4: ; preds = %2
switch i32 %0, label %38 [
i32 1, label %34
i32 7, label %5
i32 6, label %9
i32 5, label %14
i32 4, label %19
i32 3, label %24
i32 2, label %29
]
5: ; preds = %4
%6 = getelementptr inbounds double, double* %1, i64 6
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double %7, double 0.000000e+00)
br label %9
9: ; preds = %4, %5
%10 = phi double [ 0.000000e+00, %4 ], [ %8, %5 ]
%11 = getelementptr inbounds double, double* %1, i64 5
%12 = load double, double* %11
%13 = tail call double @llvm.fmuladd.f64(double %12, double %12, double %10)
br label %14
14: ; preds = %4, %9
%15 = phi double [ 0.000000e+00, %4 ], [ %13, %9 ]
%16 = getelementptr inbounds double, double* %1, i64 4
%17 = load double, double* %16
%18 = tail call double @llvm.fmuladd.f64(double %17, double %17, double %15)
br label %19
19: ; preds = %4, %14
%20 = phi double [ 0.000000e+00, %4 ], [ %18, %14 ]
%21 = getelementptr inbounds double, double* %1, i64 3
%22 = load double, double* %21
%23 = tail call double @llvm.fmuladd.f64(double %22, double %22, double %20)
br label %24
24: ; preds = %4, %19
%25 = phi double [ 0.000000e+00, %4 ], [ %23, %19 ]
%26 = getelementptr inbounds double, double* %1, i64 2
%27 = load double, double* %26
%28 = tail call double @llvm.fmuladd.f64(double %27, double %27, double %25)
br label %29
29: ; preds = %4, %24
%30 = phi double [ 0.000000e+00, %4 ], [ %28, %24 ]
%31 = getelementptr inbounds double, double* %1, i64 1
%32 = load double, double* %31
%33 = tail call double @llvm.fmuladd.f64(double %32, double %32, double %30)
br label %34
34: ; preds = %4, %29
%35 = phi double [ 0.000000e+00, %4 ], [ %33, %29 ]
%36 = load double, double* %1
%37 = tail call double @llvm.fmuladd.f64(double %36, double %36, double %35)
br label %38
38: ; preds = %34, %4
%39 = phi double [ 0.000000e+00, %4 ], [ %37, %34 ]
%40 = tail call double @sqrt(double %39)
br label %119
41: ; preds = %2
%42 = add nuw nsw i32 %0, 1
%43 = sitofp i32 %42 to double
%44 = fdiv double 1.304000e+19, %43
%45 = zext i32 %0 to i64
br label %46
46: ; preds = %41, %85
%47 = phi i64 [ 0, %41 ], [ %91, %85 ]
%48 = phi double [ 0.000000e+00, %41 ], [ %90, %85 ]
%49 = phi double [ 0.000000e+00, %41 ], [ %89, %85 ]
%50 = phi double [ 0.000000e+00, %41 ], [ %88, %85 ]
%51 = phi double [ 0.000000e+00, %41 ], [ %87, %85 ]
%52 = phi double [ 0.000000e+00, %41 ], [ %86, %85 ]
%53 = getelementptr inbounds double, double* %1, i64 %47
%54 = load double, double* %53
%55 = fcmp oge double %54, 0.000000e+00
%56 = fneg double %54
%57 = select i1 %55, double %54, double %56
%58 = fcmp ogt double %57, 3.834000e-20
%59 = fcmp olt double %57, %44
%60 = select i1 %58, i1 %59, i1 false
br i1 %60, label %61, label %63
61: ; preds = %46
%62 = tail call double @llvm.fmuladd.f64(double %57, double %57, double %52)
br label %85
63: ; preds = %46
%64 = fcmp ugt double %57, 3.834000e-20
br i1 %64, label %76, label %65
65: ; preds = %63
%66 = fcmp ugt double %57, %48
br i1 %66, label %72, label %67
67: ; preds = %65
%68 = fcmp une double %57, 0.000000e+00
br i1 %68, label %69, label %85
69: ; preds = %67
%70 = fdiv double %57, %48
%71 = tail call double @llvm.fmuladd.f64(double %70, double %70, double %49)
br label %85
72: ; preds = %65
%73 = fdiv double %48, %57
%74 = fmul double %73, %73
%75 = tail call double @llvm.fmuladd.f64(double %49, double %74, double 1.000000e+00)
br label %85
76: ; preds = %63
%77 = fcmp ugt double %57, %50
br i1 %77, label %81, label %78
78: ; preds = %76
%79 = fdiv double %57, %50
%80 = tail call double @llvm.fmuladd.f64(double %79, double %79, double %51)
br label %85
81: ; preds = %76
%82 = fdiv double %50, %57
%83 = fmul double %82, %82
%84 = tail call double @llvm.fmuladd.f64(double %51, double %83, double 1.000000e+00)
br label %85
85: ; preds = %61, %78, %81, %72, %69, %67
%86 = phi double [ %62, %61 ], [ %52, %78 ], [ %52, %81 ], [ %52, %72 ], [ %52, %69 ], [ %52, %67 ]
%87 = phi double [ %51, %61 ], [ %80, %78 ], [ %84, %81 ], [ %51, %72 ], [ %51, %69 ], [ %51, %67 ]
%88 = phi double [ %50, %61 ], [ %50, %78 ], [ %57, %81 ], [ %50, %72 ], [ %50, %69 ], [ %50, %67 ]
%89 = phi double [ %49, %61 ], [ %49, %78 ], [ %49, %81 ], [ %75, %72 ], [ %71, %69 ], [ %49, %67 ]
%90 = phi double [ %48, %61 ], [ %48, %78 ], [ %48, %81 ], [ %57, %72 ], [ %48, %69 ], [ %48, %67 ]
%91 = add nuw nsw i64 %47, 1
%92 = icmp eq i64 %91, %45
br i1 %92, label %93, label %46
93: ; preds = %85
%94 = fcmp une double %87, 0.000000e+00
br i1 %94, label %95, label %101
95: ; preds = %93
%96 = fdiv double %86, %88
%97 = fdiv double %96, %88
%98 = fadd double %87, %97
%99 = tail call double @sqrt(double %98)
%100 = fmul double %88, %99
br label %119
101: ; preds = %93
%102 = fcmp oeq double %86, 0.000000e+00
br i1 %102, label %103, label %106
103: ; preds = %101
%104 = tail call double @sqrt(double %89)
%105 = fmul double %90, %104
br label %119
106: ; preds = %101
%107 = fcmp ult double %86, %90
br i1 %107, label %114, label %108
108: ; preds = %106
%109 = fdiv double %90, %86
%110 = fmul double %90, %89
%111 = tail call double @llvm.fmuladd.f64(double %109, double %110, double 1.000000e+00)
%112 = fmul double %86, %111
%113 = tail call double @sqrt(double %112)
br label %119
114: ; preds = %106
%115 = fdiv double %86, %90
%116 = tail call double @llvm.fmuladd.f64(double %90, double %89, double %115)
%117 = fmul double %90, %116
%118 = tail call double @sqrt(double %117)
br label %119
119: ; preds = %95, %108, %114, %103, %38
%120 = phi double [ %40, %38 ], [ %100, %95 ], [ %105, %103 ], [ %113, %108 ], [ %118, %114 ]
ret double %120
}