#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 func_q(double *vertex, int k2, int k1, int k) {
  double L, S;
  S = (vertex[2 * k2 + 0] * vertex[2 * k1 + 1] -
       vertex[2 * k1 + 0] * vertex[2 * k2 + 1] +
       vertex[2 * k + 0] * (vertex[2 * k2 + 1] - vertex[2 * k1 + 1]) +
       vertex[2 * k + 1] * (vertex[2 * k1 + 0] - vertex[2 * k2 + 0])) /
      2.0;
  L = 2.0 * vertex[2 * k + 0] * vertex[2 * k + 0] +
      2.0 * vertex[2 * k1 + 0] * vertex[2 * k1 + 0] +
      2.0 * vertex[2 * k2 + 0] * vertex[2 * k2 + 0] -
      2.0 * vertex[2 * k + 0] * vertex[2 * k1 + 0] -
      2.0 * vertex[2 * k + 0] * vertex[2 * k2 + 0] -
      2.0 * vertex[2 * k1 + 0] * vertex[2 * k2 + 0] +
      2.0 * vertex[2 * k + 1] * vertex[2 * k + 1] +
      2.0 * vertex[2 * k1 + 1] * vertex[2 * k1 + 1] +
      2.0 * vertex[2 * k2 + 1] * vertex[2 * k2 + 1] -
      2.0 * vertex[2 * k + 1] * vertex[2 * k1 + 1] -
      2.0 * vertex[2 * k + 1] * vertex[2 * k2 + 1] -
      2.0 * vertex[2 * k1 + 1] * vertex[2 * k2 + 1];
  return 4.0 * sqrt(3.0) * S / L;
}


x86 assembly (clang, -O0):
<func_q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xde2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xdc1(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xd8f(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xd55(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xd1b(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xcca(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xc79(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xc28(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xbee(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xbb4(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xb7a(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xb29(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xad8(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xa8a(%rip),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xa72(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x28(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_q>:
lea    (%rsi,%rsi,1),%eax
cltq
movsd  (%rdi,%rax,8),%xmm8
lea    (%rdx,%rdx,1),%eax
add    $0x1,%eax
add    %edx,%edx
cltq
movsd  (%rdi,%rax,8),%xmm10
movslq %edx,%rax
movsd  (%rdi,%rax,8),%xmm12
lea    0x1(%rsi,%rsi,1),%eax
cltq
movsd  (%rdi,%rax,8),%xmm11
movapd %xmm8,%xmm9
mulsd  %xmm10,%xmm9
movapd %xmm11,%xmm7
subsd  %xmm10,%xmm7
lea    0x1(%rcx,%rcx,1),%eax
cltq
movsd  (%rdi,%rax,8),%xmm13
movapd %xmm12,%xmm0
subsd  %xmm8,%xmm0
mulsd  %xmm13,%xmm0
movapd %xmm13,%xmm6
addsd  %xmm13,%xmm6
mulsd  %xmm6,%xmm13
movapd %xmm10,%xmm15
addsd  %xmm10,%xmm15
movapd %xmm15,%xmm14
mulsd  %xmm10,%xmm14
movapd %xmm11,%xmm5
addsd  %xmm11,%xmm5
mulsd  %xmm11,%xmm5
mulsd  %xmm6,%xmm10
mulsd  %xmm11,%xmm6
mulsd  %xmm11,%xmm15
mulsd  %xmm12,%xmm11
subsd  %xmm11,%xmm9
lea    (%rcx,%rcx,1),%eax
cltq
movsd  (%rdi,%rax,8),%xmm3
mulsd  %xmm3,%xmm7
addsd  %xmm9,%xmm7
addsd  %xmm7,%xmm0
movapd %xmm3,%xmm7
addsd  %xmm3,%xmm7
movapd %xmm12,%xmm1
addsd  %xmm12,%xmm1
movapd %xmm7,%xmm4
mulsd  %xmm12,%xmm4
mulsd  %xmm1,%xmm12
mulsd  %xmm7,%xmm3
addsd  %xmm12,%xmm3
movapd %xmm8,%xmm2
addsd  %xmm8,%xmm2
mulsd  %xmm8,%xmm2
addsd  %xmm3,%xmm2
subsd  %xmm4,%xmm2
mulsd  0xdf7(%rip),%xmm0
mulsd  %xmm8,%xmm7
subsd  %xmm7,%xmm2
mulsd  %xmm8,%xmm1
subsd  %xmm1,%xmm2
addsd  %xmm2,%xmm13
addsd  %xmm13,%xmm14
addsd  %xmm14,%xmm5
subsd  %xmm10,%xmm5
subsd  %xmm6,%xmm5
subsd  %xmm15,%xmm5
mulsd  0xdc8(%rip),%xmm0
divsd  %xmm5,%xmm0
ret

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

LLVM IR (-O2):
define double @func_q(double* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 %1, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds double, double* %0, i64 %6
%8 = load double, double* %7
%9 = shl nsw i32 %2, 1
%10 = or i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds double, double* %0, i64 %11
%13 = load double, double* %12
%14 = sext i32 %9 to i64
%15 = getelementptr inbounds double, double* %0, i64 %14
%16 = load double, double* %15
%17 = or i32 %5, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %0, i64 %18
%20 = load double, double* %19
%21 = fneg double %16
%22 = fmul double %20, %21
%23 = tail call double @llvm.fmuladd.f64(double %8, double %13, double %22)
%24 = shl nsw i32 %3, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %0, i64 %25
%27 = load double, double* %26
%28 = fsub double %20, %13
%29 = tail call double @llvm.fmuladd.f64(double %27, double %28, double %23)
%30 = or i32 %24, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %0, i64 %31
%33 = load double, double* %32
%34 = fsub double %16, %8
%35 = tail call double @llvm.fmuladd.f64(double %33, double %34, double %29)
%36 = fmul double %35, 5.000000e-01
%37 = fmul double %27, 2.000000e+00
%38 = fmul double %16, 2.000000e+00
%39 = fmul double %16, %38
%40 = tail call double @llvm.fmuladd.f64(double %37, double %27, double %39)
%41 = fmul double %8, 2.000000e+00
%42 = tail call double @llvm.fmuladd.f64(double %41, double %8, double %40)
%43 = fneg double %37
%44 = tail call double @llvm.fmuladd.f64(double %43, double %16, double %42)
%45 = tail call double @llvm.fmuladd.f64(double %43, double %8, double %44)
%46 = fneg double %38
%47 = tail call double @llvm.fmuladd.f64(double %46, double %8, double %45)
%48 = fmul double %33, 2.000000e+00
%49 = tail call double @llvm.fmuladd.f64(double %48, double %33, double %47)
%50 = fmul double %13, 2.000000e+00
%51 = tail call double @llvm.fmuladd.f64(double %50, double %13, double %49)
%52 = fmul double %20, 2.000000e+00
%53 = tail call double @llvm.fmuladd.f64(double %52, double %20, double %51)
%54 = fneg double %48
%55 = tail call double @llvm.fmuladd.f64(double %54, double %13, double %53)
%56 = tail call double @llvm.fmuladd.f64(double %54, double %20, double %55)
%57 = fneg double %50
%58 = tail call double @llvm.fmuladd.f64(double %57, double %20, double %56)
%59 = fmul double %36, 0x401BB67AE8584CAA
%60 = fdiv double %59, %58
ret double %60
}