#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 acos(double);
double log(double);
double pow(double, double);
double sqrt(double);
double GridGen_compute_Q(double slope, short int which_equation) {
  double x;
  double y, y_b;
  double v, w;
  double pi = acos(-1.0);
  y = slope;
  if ((which_equation == 1) || (which_equation == 4)) {
    if (y < 2.7829681) {
      y_b = y - 1.0;
      x = sqrt(6.0 * y_b) *
          (1.0 - 0.15 * y_b + 0.057321429 * y_b * y_b -
           0.024907295 * pow(y_b, 3.0) + 0.0077424461 * pow(y_b, 4.0) -
           0.0010794123 * pow(y_b, 5.0));
    } else {
      v = log(y);
      w = 1.0 / y - 0.028527431;
      x = v + (1.0 + 1.0 / v) * log(2.0 * v) - 0.02041793 + 0.24902722 * w +
          1.9496443 * w * w - 2.6294547 * pow(w, 3.0) +
          8.56795911 * pow(w, 4.0);
    }
  }
  if ((which_equation == 2) || (which_equation == 5)) {
    if (y < 0.26938972) {
      x = pi * (1.0 - y + y * y - (1.0 + pi * pi / 6.0) * pow(y, 3.0) +
                6.794732 * pow(y, 4.0) - 13.205501 * pow(y, 5.0) +
                11.726095 * pow(y, 6.0));
    } else {
      y_b = 1.0 - y;
      x = sqrt(6.0 * y_b) *
          (1.0 + 0.15 * y_b + 0.057321429 * y_b * y_b +
           0.048774238 * pow(y_b, 3.0) - 0.053337753 * pow(y_b, 4.0) -
           0.075845134 * pow(y_b, 5.0));
    }
  }
  return (x);
}


x86 assembly (clang, -O0):
<GridGen_compute_Q>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %di,%ax
movsd  %xmm0,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movsd  0xea1(%rip),%xmm0
call   1030 <acos@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movswl -0xa(%rbp),%eax
cmp    $0x1,%eax
je     118d <GridGen_compute_Q+0x4d>
movswl -0xa(%rbp),%eax
cmp    $0x4,%eax
jne    13b7 <GridGen_compute_Q+0x277>
movsd  0xe73(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    129e <GridGen_compute_Q+0x15e>
movsd  -0x20(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xed2(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  0xeae(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe6a(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe8e(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe12(%rip),%xmm1
call   1050 <pow@plt>
movsd  -0x60(%rbp),%xmm1
movsd  0xe50(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xdd6(%rip),%xmm1
call   1050 <pow@plt>
movsd  -0x58(%rbp),%xmm1
movsd  0xe1c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xdfa(%rip),%xmm1
call   1050 <pow@plt>
movsd  -0x50(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xdd8(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    13b2 <GridGen_compute_Q+0x272>
movsd  -0x20(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xd9b(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  0xd96(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xd73(%rip),%xmm1
divsd  -0x30(%rbp),%xmm1
movsd  0xd66(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xd4d(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1040 <log@plt>
movsd  -0x80(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xd1e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  0xd05(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xced(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xcc1(%rip),%xmm1
call   1050 <pow@plt>
movsd  -0x70(%rbp),%xmm1
movsd  0xca7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xc85(%rip),%xmm1
call   1050 <pow@plt>
movsd  -0x68(%rbp),%xmm1
movsd  0xc6b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    13b7 <GridGen_compute_Q+0x277>
movswl -0xa(%rbp),%eax
cmp    $0x2,%eax
je     13d1 <GridGen_compute_Q+0x291>
movswl -0xa(%rbp),%eax
cmp    $0x5,%eax
jne    1647 <GridGen_compute_Q+0x507>
movsd  0xcbf(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1535 <GridGen_compute_Q+0x3f5>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xc57(%rip),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x40(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
movsd  0xc66(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xc1a(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xbd9(%rip),%xmm1
call   1050 <pow@plt>
movsd  -0xb0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xa8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xb7d(%rip),%xmm1
call   1050 <pow@plt>
movsd  -0xa0(%rbp),%xmm1
ff
movsd  0xc20(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xb9b(%rip),%xmm1
call   1050 <pow@plt>
movsd  -0x98(%rbp),%xmm1
ff
movsd  0xbe6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xb91(%rip),%xmm1
call   1050 <pow@plt>
movsd  -0x90(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xba1(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1642 <GridGen_compute_Q+0x502>
movsd  0xb13(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xb41(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x28(%rbp),%xmm1
movsd  0xb4a(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xad6(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xafa(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  0xa7b(%rip),%xmm1
call   1050 <pow@plt>
movsd  -0xd0(%rbp),%xmm1
ff
movsd  0xaee(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  0xa39(%rip),%xmm1
call   1050 <pow@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movsd  0xab4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  0xa57(%rip),%xmm1
call   1050 <pow@plt>
movsd  -0xc0(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
movsd  0xa6f(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1647 <GridGen_compute_Q+0x507>
movsd  -0x18(%rbp),%xmm0
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GridGen_compute_Q>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
movapd %xmm0,%xmm1
cmp    $0x4,%bx
movsd  %xmm0,0x10(%rsp)
je     1151 <GridGen_compute_Q+0x21>
cmp    $0x1,%bx
jne    126e <GridGen_compute_Q+0x13e>
movsd  0xea7(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1193 <GridGen_compute_Q+0x63>
movsd  0xee9(%rip),%xmm2
addsd  %xmm1,%xmm2
movsd  0xee5(%rip),%xmm0
movsd  %xmm2,(%rsp)
mulsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     127d <GridGen_compute_Q+0x14d>
sqrtsd %xmm0,%xmm0
jmp    1282 <GridGen_compute_Q+0x152>
movapd %xmm1,%xmm0
call   1030 <log@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
movsd  0xe5a(%rip),%xmm0
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
divsd  0x10(%rsp),%xmm0
addsd  0xe42(%rip),%xmm0
movsd  %xmm0,(%rsp)
addsd  %xmm1,%xmm1
movapd %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0x18(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
addsd  0xe24(%rip),%xmm0
movsd  0xe24(%rip),%xmm1
movsd  (%rsp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe17(%rip),%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xe05(%rip),%xmm1
movapd %xmm2,%xmm0
call   1040 <pow@plt>
mulsd  0xdfc(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xdf0(%rip),%xmm1
movsd  (%rsp),%xmm0
call   1040 <pow@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0xde0(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
cmp    $0x5,%bx
jne    1334 <GridGen_compute_Q+0x204>
jmp    133e <GridGen_compute_Q+0x20e>
call   1050 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xdd0(%rip),%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  0xd67(%rip),%xmm1
movsd  0xdbf(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x18(%rsp)
movsd  0xd6d(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0xda0(%rip),%xmm0
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0xd5c(%rip),%xmm1
movsd  (%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xd82(%rip),%xmm0
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0xd76(%rip),%xmm1
movsd  (%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xd6c(%rip),%xmm0
addsd  0x18(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
cmp    $0x5,%bx
je     133e <GridGen_compute_Q+0x20e>
cmp    $0x2,%bx
jne    14d7 <GridGen_compute_Q+0x3a7>
movsd  0xd4a(%rip),%xmm0
ucomisd %xmm1,%xmm0
movsd  0xcb6(%rip),%xmm2
subsd  %xmm1,%xmm2
jbe    1407 <GridGen_compute_Q+0x2d7>
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
movsd  0xcb7(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0xd32(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xca8(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xd15(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xcc3(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xcf8(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xc76(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xcdb(%rip),%xmm0
addsd  (%rsp),%xmm0
mulsd  0xcd6(%rip),%xmm0
jmp    14d7 <GridGen_compute_Q+0x3a7>
movsd  0xc49(%rip),%xmm0
mulsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm2,(%rsp)
jb     1428 <GridGen_compute_Q+0x2f8>
sqrtsd %xmm0,%xmm0
jmp    1432 <GridGen_compute_Q+0x302>
call   1050 <sqrt@plt>
movsd  (%rsp),%xmm2
movsd  %xmm0,0x10(%rsp)
movsd  0xc58(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xbbc(%rip),%xmm0
movsd  0xc14(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xbc2(%rip),%xmm1
movapd %xmm2,%xmm0
call   1040 <pow@plt>
mulsd  0xc21(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xbad(%rip),%xmm1
movsd  (%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xc03(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xbc7(%rip),%xmm1
movsd  (%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xbe5(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @GridGen_compute_Q(double %0, i16 signext %1) {
%3 = alloca double
%4 = alloca i16
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %3
store i16 %1, i16* %4
%11 = call double @acos(double -1.000000e+00)
store double %11, double* %10
%12 = load double, double* %3
store double %12, double* %6
%13 = load i16, i16* %4
%14 = sext i16 %13 to i32
%15 = icmp eq i32 %14, 1
br i1 %15, label %20, label %16
16: ; preds = %2
%17 = load i16, i16* %4
%18 = sext i16 %17 to i32
%19 = icmp eq i32 %18, 4
br i1 %19, label %20, label %73
20: ; preds = %16, %2
%21 = load double, double* %6
%22 = fcmp olt double %21, 0x40064384C77A7D75
br i1 %22, label %23, label %45
23: ; preds = %20
%24 = load double, double* %6
%25 = fsub double %24, 1.000000e+00
store double %25, double* %7
%26 = load double, double* %7
%27 = fmul double 6.000000e+00, %26
%28 = call double @sqrt(double %27)
%29 = load double, double* %7
%30 = call double @llvm.fmuladd.f64(double -1.500000e-01, double %29, double 1.000000e+00)
%31 = load double, double* %7
%32 = fmul double 0x3FAD593BFDD4790B, %31
%33 = load double, double* %7
%34 = call double @llvm.fmuladd.f64(double %32, double %33, double %30)
%35 = load double, double* %7
%36 = call double @pow(double %35, double 3.000000e+00)
%37 = call double @llvm.fmuladd.f64(double 0xBF99814C45D3C9C1, double %36, double %34)
%38 = load double, double* %7
%39 = call double @pow(double %38, double 4.000000e+00)
%40 = call double @llvm.fmuladd.f64(double 0x3F7FB68B0CA61026, double %39, double %37)
%41 = load double, double* %7
%42 = call double @pow(double %41, double 5.000000e+00)
%43 = call double @llvm.fmuladd.f64(double 0xBF51AF6221C0EC85, double %42, double %40)
%44 = fmul double %28, %43
store double %44, double* %5
br label %72
45: ; preds = %20
%46 = load double, double* %6
%47 = call double @log(double %46)
store double %47, double* %8
%48 = load double, double* %6
%49 = fdiv double 1.000000e+00, %48
%50 = fsub double %49, 0x3F9D364B7CBC4F62
store double %50, double* %9
%51 = load double, double* %8
%52 = load double, double* %8
%53 = fdiv double 1.000000e+00, %52
%54 = fadd double 1.000000e+00, %53
%55 = load double, double* %8
%56 = fmul double 2.000000e+00, %55
%57 = call double @log(double %56)
%58 = call double @llvm.fmuladd.f64(double %54, double %57, double %51)
%59 = fsub double %58, 0x3F94E87016687738
%60 = load double, double* %9
%61 = call double @llvm.fmuladd.f64(double 0x3FCFE01FBADB5DB4, double %60, double %59)
%62 = load double, double* %9
%63 = fmul double 0x3FFF31BE38B55334, %62
%64 = load double, double* %9
%65 = call double @llvm.fmuladd.f64(double %63, double %64, double %61)
%66 = load double, double* %9
%67 = call double @pow(double %66, double 3.000000e+00)
%68 = call double @llvm.fmuladd.f64(double 0xC005091F8BB68208, double %67, double %65)
%69 = load double, double* %9
%70 = call double @pow(double %69, double 4.000000e+00)
%71 = call double @llvm.fmuladd.f64(double 0x402122CB8955D49E, double %70, double %68)
store double %71, double* %5
br label %72
72: ; preds = %45, %23
br label %73
73: ; preds = %72, %16
%74 = load i16, i16* %4
%75 = sext i16 %74 to i32
%76 = icmp eq i32 %75, 2
br i1 %76, label %81, label %77
77: ; preds = %73
%78 = load i16, i16* %4
%79 = sext i16 %78 to i32
%80 = icmp eq i32 %79, 5
br i1 %80, label %81, label %133
81: ; preds = %77, %73
%82 = load double, double* %6
%83 = fcmp olt double %82, 0x3FD13DAE6151D489
br i1 %83, label %84, label %110
84: ; preds = %81
%85 = load double, double* %10
%86 = load double, double* %6
%87 = fsub double 1.000000e+00, %86
%88 = load double, double* %6
%89 = load double, double* %6
%90 = call double @llvm.fmuladd.f64(double %88, double %89, double %87)
%91 = load double, double* %10
%92 = load double, double* %10
%93 = fmul double %91, %92
%94 = fdiv double %93, 6.000000e+00
%95 = fadd double 1.000000e+00, %94
%96 = load double, double* %6
%97 = call double @pow(double %96, double 3.000000e+00)
%98 = fneg double %95
%99 = call double @llvm.fmuladd.f64(double %98, double %97, double %90)
%100 = load double, double* %6
%101 = call double @pow(double %100, double 4.000000e+00)
%102 = call double @llvm.fmuladd.f64(double 0x401B2DCE39B456B4, double %101, double %99)
%103 = load double, double* %6
%104 = call double @pow(double %103, double 5.000000e+00)
%105 = call double @llvm.fmuladd.f64(double 0xC02A69376D549731, double %104, double %102)
%106 = load double, double* %6
%107 = call double @pow(double %106, double 6.000000e+00)
%108 = call double @llvm.fmuladd.f64(double 0x402773C2B94D9408, double %107, double %105)
%109 = fmul double %85, %108
store double %109, double* %5
br label %132
110: ; preds = %81
%111 = load double, double* %6
%112 = fsub double 1.000000e+00, %111
store double %112, double* %7
%113 = load double, double* %7
%114 = fmul double 6.000000e+00, %113
%115 = call double @sqrt(double %114)
%116 = load double, double* %7
%117 = call double @llvm.fmuladd.f64(double 1.500000e-01, double %116, double 1.000000e+00)
%118 = load double, double* %7
%119 = fmul double 0x3FAD593BFDD4790B, %118
%120 = load double, double* %7
%121 = call double @llvm.fmuladd.f64(double %119, double %120, double %117)
%122 = load double, double* %7
%123 = call double @pow(double %122, double 3.000000e+00)
%124 = call double @llvm.fmuladd.f64(double 0x3FA8F8EFDA31D3FC, double %123, double %121)
%125 = load double, double* %7
%126 = call double @pow(double %125, double 4.000000e+00)
%127 = call double @llvm.fmuladd.f64(double 0xBFAB4F16018DE372, double %126, double %124)
%128 = load double, double* %7
%129 = call double @pow(double %128, double 5.000000e+00)
%130 = call double @llvm.fmuladd.f64(double 0xBFB36A9632173A95, double %129, double %127)
%131 = fmul double %115, %130
store double %131, double* %5
br label %132
132: ; preds = %110, %84
br label %133
133: ; preds = %132, %77
%134 = load double, double* %5
ret double %134
}

LLVM IR (-O2):
define double @GridGen_compute_Q(double %0, i16 signext %1) {
switch i16 %1, label %36 [
i16 4, label %3
i16 1, label %3
]
3: ; preds = %2, %2
%4 = fcmp olt double %0, 0x40064384C77A7D75
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = fadd double %0, -1.000000e+00
%7 = fmul double %6, 6.000000e+00
%8 = tail call double @sqrt(double %7)
%9 = tail call double @llvm.fmuladd.f64(double %6, double -1.500000e-01, double 1.000000e+00)
%10 = fmul double %6, 0x3FAD593BFDD4790B
%11 = tail call double @llvm.fmuladd.f64(double %10, double %6, double %9)
%12 = tail call double @pow(double %6, double 3.000000e+00)
%13 = tail call double @llvm.fmuladd.f64(double %12, double 0xBF99814C45D3C9C1, double %11)
%14 = tail call double @pow(double %6, double 4.000000e+00)
%15 = tail call double @llvm.fmuladd.f64(double %14, double 0x3F7FB68B0CA61026, double %13)
%16 = tail call double @pow(double %6, double 5.000000e+00)
%17 = tail call double @llvm.fmuladd.f64(double %16, double 0xBF51AF6221C0EC85, double %15)
%18 = fmul double %8, %17
br label %36
19: ; preds = %3
%20 = tail call double @log(double %0)
%21 = fdiv double 1.000000e+00, %0
%22 = fadd double %21, 0xBF9D364B7CBC4F62
%23 = fdiv double 1.000000e+00, %20
%24 = fadd double %23, 1.000000e+00
%25 = fmul double %20, 2.000000e+00
%26 = tail call double @log(double %25)
%27 = tail call double @llvm.fmuladd.f64(double %24, double %26, double %20)
%28 = fadd double %27, 0xBF94E87016687738
%29 = tail call double @llvm.fmuladd.f64(double %22, double 0x3FCFE01FBADB5DB4, double %28)
%30 = fmul double %22, 0x3FFF31BE38B55334
%31 = tail call double @llvm.fmuladd.f64(double %30, double %22, double %29)
%32 = tail call double @pow(double %22, double 3.000000e+00)
%33 = tail call double @llvm.fmuladd.f64(double %32, double 0xC005091F8BB68208, double %31)
%34 = tail call double @pow(double %22, double 4.000000e+00)
%35 = tail call double @llvm.fmuladd.f64(double %34, double 0x402122CB8955D49E, double %33)
br label %36
36: ; preds = %2, %5, %19
%37 = phi double [ %18, %5 ], [ %35, %19 ], [ undef, %2 ]
switch i16 %1, label %65 [
i16 5, label %38
i16 2, label %38
]
38: ; preds = %36, %36
%39 = fcmp olt double %0, 0x3FD13DAE6151D489
%40 = fsub double 1.000000e+00, %0
br i1 %39, label %41, label %52
41: ; preds = %38
%42 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %40)
%43 = tail call double @pow(double %0, double 3.000000e+00)
%44 = tail call double @llvm.fmuladd.f64(double %43, double 0xC00528D3312983EA, double %42)
%45 = tail call double @pow(double %0, double 4.000000e+00)
%46 = tail call double @llvm.fmuladd.f64(double %45, double 0x401B2DCE39B456B4, double %44)
%47 = tail call double @pow(double %0, double 5.000000e+00)
%48 = tail call double @llvm.fmuladd.f64(double %47, double 0xC02A69376D549731, double %46)
%49 = tail call double @pow(double %0, double 6.000000e+00)
%50 = tail call double @llvm.fmuladd.f64(double %49, double 0x402773C2B94D9408, double %48)
%51 = fmul double %50, 0x400921FB54442D18
br label %65
52: ; preds = %38
%53 = fmul double %40, 6.000000e+00
%54 = tail call double @sqrt(double %53)
%55 = tail call double @llvm.fmuladd.f64(double %40, double 1.500000e-01, double 1.000000e+00)
%56 = fmul double %40, 0x3FAD593BFDD4790B
%57 = tail call double @llvm.fmuladd.f64(double %56, double %40, double %55)
%58 = tail call double @pow(double %40, double 3.000000e+00)
%59 = tail call double @llvm.fmuladd.f64(double %58, double 0x3FA8F8EFDA31D3FC, double %57)
%60 = tail call double @pow(double %40, double 4.000000e+00)
%61 = tail call double @llvm.fmuladd.f64(double %60, double 0xBFAB4F16018DE372, double %59)
%62 = tail call double @pow(double %40, double 5.000000e+00)
%63 = tail call double @llvm.fmuladd.f64(double %62, double 0xBFB36A9632173A95, double %61)
%64 = fmul double %54, %63
br label %65
65: ; preds = %36, %41, %52
%66 = phi double [ %51, %41 ], [ %64, %52 ], [ %37, %36 ]
ret double %66
}