#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 exp(double);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
double pow(double, double);
void cf_cal(double *x, double *f, int nx, double *Os, double *delta,
            double *bias, double *fit, int cf_num) {
  int i, j;
  double *w;
  double w_max = 0, w_sum = 0;
  w = (double *)malloc(cf_num * sizeof(double));
  for (i = 0; i < cf_num; i++) {
    fit[i] += bias[i];
    w[i] = 0;
    for (j = 0; j < nx; j++) {
      w[i] += pow(x[j] - Os[i * nx + j], 2.0);
    }
    if (w[i] != 0)
      w[i] = pow(1.0 / w[i], 0.5) * exp(-w[i] / 2.0 / nx / pow(delta[i], 2.0));
    else
      w[i] = 1.0e99;
    if (w[i] > w_max)
      w_max = w[i];
  }
  for (i = 0; i < cf_num; i++) {
    w_sum = w_sum + w[i];
  }
  if (w_max == 0) {
    for (i = 0; i < cf_num; i++)
      w[i] = 1;
    w_sum = cf_num;
  }
  f[0] = 0.0;
  for (i = 0; i < cf_num; i++) {
    f[0] = f[0] + w[i] / w_sum * fit[i];
  }
  free(w);
}


x86 assembly (clang, -O0):
<cf_cal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movslq 0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    1353 <cf_cal+0x213>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    122e <cf_cal+0xee>
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xe07(%rip),%xmm1
call   1060 <pow@plt>
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11d2 <cf_cal+0x92>
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1253 <cf_cal+0x113>
jp     1253 <cf_cal+0x113>
jmp    1301 <cf_cal+0x1c1>
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  0xd9d(%rip),%xmm0
divsd  (%rax,%rcx,8),%xmm0
movsd  0xda8(%rip),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd6a(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xd43(%rip),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1316 <cf_cal+0x1d6>
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  0xcf7(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    1340 <cf_cal+0x200>
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1345 <cf_cal+0x205>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1190 <cf_cal+0x50>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    138b <cf_cal+0x24b>
movsd  -0x50(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    135a <cf_cal+0x21a>
movsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13e3 <cf_cal+0x2a3>
jp     13e3 <cf_cal+0x2a3>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    13d9 <cf_cal+0x299>
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  0xc3a(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    13aa <cf_cal+0x26a>
cvtsi2sdl 0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    1446 <cf_cal+0x306>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0x50(%rbp),%xmm0
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    13f5 <cf_cal+0x2b5>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cf_cal>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,0x10(%rsp)
mov    %r8,0x48(%rsp)
mov    %rcx,%r15
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%r13
mov    0xa8(%rsp),%r12d
mov    0xa0(%rsp),%rbx
lea    0x0(,%r12,8),%edi
call   1040 <malloc@plt>
mov    %rbx,%r9
mov    %rax,%rbx
mov    %r12d,%r8d
test   %r12d,%r12d
jle    153d <cf_cal+0x3fd>
mov    %r12,0x18(%rsp)
mov    %r14,(%rsp)
cvtsi2sd %ebp,%xmm0
movsd  %xmm0,0x30(%rsp)
movslq %ebp,%rax
mov    %ebp,%esi
mov    %eax,%r12d
mov    %r12,0x50(%rsp)
and    $0xfffffffe,%r12d
mov    %r15,0x28(%rsp)
add    $0x8,%r15
mov    %rax,0x20(%rsp)
lea    0x0(,%rax,8),%rbp
xor    %r14d,%r14d
movsd  0xe29(%rip),%xmm2
xorpd  %xmm0,%xmm0
mov    0x10(%rsp),%rdx
mov    %r9,0x40(%rsp)
mov    %r8,0x38(%rsp)
mov    %esi,0xc(%rsp)
jmp    120a <cf_cal+0xca>
movsd  %xmm0,(%rbx,%r14,8)
maxsd  %xmm3,%xmm0
add    $0x1,%r14
add    %rbp,%r15
cmp    %r8,%r14
je     1343 <cf_cal+0x203>
movsd  (%rdx,%r14,8),%xmm1
addsd  (%r9,%r14,8),%xmm1
movapd %xmm0,%xmm3
movsd  %xmm1,(%r9,%r14,8)
movq   $0x0,(%rbx,%r14,8)
movapd %xmm2,%xmm0
test   %esi,%esi
jle    11f0 <cf_cal+0xb0>
xorpd  %xmm1,%xmm1
xor    %eax,%eax
cmp    $0x1,%esi
je     1280 <cf_cal+0x140>
nopl   0x0(%rax,%rax,1)
movsd  0x0(%r13,%rax,8),%xmm0
subsd  -0x8(%r15,%rax,8),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%r14,8)
movsd  0x8(%r13,%rax,8),%xmm1
subsd  (%r15,%rax,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%r14,8)
add    $0x2,%rax
cmp    %rax,%r12
jne    1240 <cf_cal+0x100>
testb  $0x1,0x50(%rsp)
je     12b2 <cf_cal+0x172>
mov    %r14,%rcx
imul   0x20(%rsp),%rcx
movsd  0x0(%r13,%rax,8),%xmm0
add    %rax,%rcx
mov    0x28(%rsp),%rax
subsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%r14,8)
ucomisd 0xd66(%rip),%xmm1
movapd %xmm2,%xmm0
jne    12c6 <cf_cal+0x186>
jnp    11f0 <cf_cal+0xb0>
movsd  0xd3a(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xd36(%rip),%xmm1
movsd  %xmm3,0x60(%rsp)
call   1060 <pow@plt>
movsd  %xmm0,0x58(%rsp)
movsd  (%rbx,%r14,8),%xmm0
mulsd  0xd1f(%rip),%xmm0
divsd  0x30(%rsp),%xmm0
mov    0x48(%rsp),%rax
movsd  (%rax,%r14,8),%xmm1
mulsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
call   1050 <exp@plt>
movsd  0x60(%rsp),%xmm3
movsd  0xcdb(%rip),%xmm2
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%rdx
mov    0x38(%rsp),%r8
mov    0x40(%rsp),%r9
mulsd  0x58(%rsp),%xmm0
jmp    11f0 <cf_cal+0xb0>
mov    0x18(%rsp),%r12
test   %r12d,%r12d
jle    1369 <cf_cal+0x229>
lea    -0x1(%r8),%rcx
mov    %r8d,%eax
and    $0x7,%eax
cmp    $0x7,%rcx
jae    1389 <cf_cal+0x249>
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
mov    (%rsp),%r14
jmp    13d8 <cf_cal+0x298>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    (%rsp),%r14
jne    137d <cf_cal+0x23d>
jnp    153d <cf_cal+0x3fd>
movq   $0x0,(%r14)
jmp    15c9 <cf_cal+0x489>
mov    %r8d,%edx
and    $0xfffffff8,%edx
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
mov    (%rsp),%r14
nopl   0x0(%rax)
addsd  (%rbx,%rcx,8),%xmm1
addsd  0x8(%rbx,%rcx,8),%xmm1
addsd  0x10(%rbx,%rcx,8),%xmm1
addsd  0x18(%rbx,%rcx,8),%xmm1
addsd  0x20(%rbx,%rcx,8),%xmm1
addsd  0x28(%rbx,%rcx,8),%xmm1
addsd  0x30(%rbx,%rcx,8),%xmm1
addsd  0x38(%rbx,%rcx,8),%xmm1
add    $0x8,%rcx
cmp    %rcx,%rdx
jne    13a0 <cf_cal+0x260>
test   %rax,%rax
je     13fe <cf_cal+0x2be>
lea    (%rbx,%rcx,8),%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addsd  (%rcx,%rdx,8),%xmm1
add    $0x1,%rdx
cmp    %rdx,%rax
jne    13f0 <cf_cal+0x2b0>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    1545 <cf_cal+0x405>
jp     1545 <cf_cal+0x405>
test   %r12d,%r12d
jle    153d <cf_cal+0x3fd>
cmp    $0x4,%r12d
jae    1428 <cf_cal+0x2e8>
xor    %eax,%eax
jmp    1519 <cf_cal+0x3d9>
mov    %r8d,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
mov    %edx,%ecx
and    $0x7,%ecx
cmp    $0x1c,%rsi
jae    144f <cf_cal+0x30f>
xor    %esi,%esi
jmp    14e5 <cf_cal+0x3a5>
and    $0xfffffffffffffff8,%rdx
xor    %esi,%esi
movapd 0xbd3(%rip),%xmm0
nopl   (%rax)
movupd %xmm0,(%rbx,%rsi,8)
movupd %xmm0,0x10(%rbx,%rsi,8)
movupd %xmm0,0x20(%rbx,%rsi,8)
movupd %xmm0,0x30(%rbx,%rsi,8)
movupd %xmm0,0x40(%rbx,%rsi,8)
movupd %xmm0,0x50(%rbx,%rsi,8)
movupd %xmm0,0x60(%rbx,%rsi,8)
movupd %xmm0,0x70(%rbx,%rsi,8)
movupd %xmm0,0x80(%rbx,%rsi,8)
movupd %xmm0,0x90(%rbx,%rsi,8)
movupd %xmm0,0xa0(%rbx,%rsi,8)
movupd %xmm0,0xb0(%rbx,%rsi,8)
movupd %xmm0,0xc0(%rbx,%rsi,8)
movupd %xmm0,0xd0(%rbx,%rsi,8)
movupd %xmm0,0xe0(%rbx,%rsi,8)
movupd %xmm0,0xf0(%rbx,%rsi,8)
add    $0x20,%rsi
add    $0xfffffffffffffff8,%rdx
jne    1460 <cf_cal+0x320>
test   %rcx,%rcx
je     1514 <cf_cal+0x3d4>
lea    (%rbx,%rsi,8),%rdx
add    $0x10,%rdx
shl    $0x5,%rcx
xor    %esi,%esi
movapd 0xb30(%rip),%xmm0
movupd %xmm0,-0x10(%rdx,%rsi,1)
movupd %xmm0,(%rdx,%rsi,1)
add    $0x20,%rsi
cmp    %rsi,%rcx
jne    1500 <cf_cal+0x3c0>
cmp    %r8,%rax
je     153d <cf_cal+0x3fd>
movabs $0x3ff0000000000000,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rcx,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r8
jne    1530 <cf_cal+0x3f0>
xorps  %xmm1,%xmm1
cvtsi2sd %r12d,%xmm1
movq   $0x0,(%r14)
test   %r12d,%r12d
jle    15c9 <cf_cal+0x489>
cmp    $0x1,%r12d
jne    155f <cf_cal+0x41f>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
jmp    15ab <cf_cal+0x46b>
mov    %r8d,%ecx
and    $0xfffffffe,%ecx
xorpd  %xmm0,%xmm0
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rax,8),%xmm2
divsd  %xmm1,%xmm2
mulsd  (%r9,%rax,8),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%r14)
movsd  0x8(%rbx,%rax,8),%xmm0
divsd  %xmm1,%xmm0
mulsd  0x8(%r9,%rax,8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%r14)
add    $0x2,%rax
cmp    %rax,%rcx
jne    1570 <cf_cal+0x430>
test   $0x1,%r8b
je     15c9 <cf_cal+0x489>
movsd  (%rbx,%rax,8),%xmm2
divsd  %xmm1,%xmm2
mulsd  (%r9,%rax,8),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%r14)
mov    %rbx,%rdi
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @cf_cal(double* %0, double* %1, i32 %2, double* %3, double* %4, double* %5, double* %6, i32 %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca double*
%20 = alloca double
%21 = alloca double
store double* %0, double** %9
store double* %1, double** %10
store i32 %2, i32* %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store double* %6, double** %15
store i32 %7, i32* %16
store double 0.000000e+00, double* %20
store double 0.000000e+00, double* %21
%22 = load i32, i32* %16
%23 = sext i32 %22 to i64
%24 = mul i64 %23, 8
%25 = trunc i64 %24 to i32
%26 = call i64 @malloc(i32 %25)
%27 = inttoptr i64 %26 to double*
store double* %27, double** %19
store i32 0, i32* %17
br label %28
28: ; preds = %136, %8
%29 = load i32, i32* %17
%30 = load i32, i32* %16
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %139
32: ; preds = %28
%33 = load double*, double** %14
%34 = load i32, i32* %17
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %33, i64 %35
%37 = load double, double* %36
%38 = load double*, double** %15
%39 = load i32, i32* %17
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
%42 = load double, double* %41
%43 = fadd double %42, %37
store double %43, double* %41
%44 = load double*, double** %19
%45 = load i32, i32* %17
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
store double 0.000000e+00, double* %47
store i32 0, i32* %18
br label %48
48: ; preds = %75, %32
%49 = load i32, i32* %18
%50 = load i32, i32* %11
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %78
52: ; preds = %48
%53 = load double*, double** %9
%54 = load i32, i32* %18
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds double, double* %53, i64 %55
%57 = load double, double* %56
%58 = load double*, double** %12
%59 = load i32, i32* %17
%60 = load i32, i32* %11
%61 = mul nsw i32 %59, %60
%62 = load i32, i32* %18
%63 = add nsw i32 %61, %62
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %58, i64 %64
%66 = load double, double* %65
%67 = fsub double %57, %66
%68 = call double @pow(double %67, double 2.000000e+00)
%69 = load double*, double** %19
%70 = load i32, i32* %17
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
%73 = load double, double* %72
%74 = fadd double %73, %68
store double %74, double* %72
br label %75
75: ; preds = %52
%76 = load i32, i32* %18
%77 = add nsw i32 %76, 1
store i32 %77, i32* %18
br label %48
78: ; preds = %48
%79 = load double*, double** %19
%80 = load i32, i32* %17
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %79, i64 %81
%83 = load double, double* %82
%84 = fcmp une double %83, 0.000000e+00
br i1 %84, label %85, label %116
85: ; preds = %78
%86 = load double*, double** %19
%87 = load i32, i32* %17
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds double, double* %86, i64 %88
%90 = load double, double* %89
%91 = fdiv double 1.000000e+00, %90
%92 = call double @pow(double %91, double 5.000000e-01)
%93 = load double*, double** %19
%94 = load i32, i32* %17
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %93, i64 %95
%97 = load double, double* %96
%98 = fneg double %97
%99 = fdiv double %98, 2.000000e+00
%100 = load i32, i32* %11
%101 = sitofp i32 %100 to double
%102 = fdiv double %99, %101
%103 = load double*, double** %13
%104 = load i32, i32* %17
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %103, i64 %105
%107 = load double, double* %106
%108 = call double @pow(double %107, double 2.000000e+00)
%109 = fdiv double %102, %108
%110 = call double @exp(double %109)
%111 = fmul double %92, %110
%112 = load double*, double** %19
%113 = load i32, i32* %17
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %112, i64 %114
store double %111, double* %115
br label %121
116: ; preds = %78
%117 = load double*, double** %19
%118 = load i32, i32* %17
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %117, i64 %119
store double 0x547D42AEA2879F2E, double* %120
br label %121
121: ; preds = %116, %85
%122 = load double*, double** %19
%123 = load i32, i32* %17
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds double, double* %122, i64 %124
%126 = load double, double* %125
%127 = load double, double* %20
%128 = fcmp ogt double %126, %127
br i1 %128, label %129, label %135
129: ; preds = %121
%130 = load double*, double** %19
%131 = load i32, i32* %17
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds double, double* %130, i64 %132
%134 = load double, double* %133
store double %134, double* %20
br label %135
135: ; preds = %129, %121
br label %136
136: ; preds = %135
%137 = load i32, i32* %17
%138 = add nsw i32 %137, 1
store i32 %138, i32* %17
br label %28
139: ; preds = %28
store i32 0, i32* %17
br label %140
140: ; preds = %152, %139
%141 = load i32, i32* %17
%142 = load i32, i32* %16
%143 = icmp slt i32 %141, %142
br i1 %143, label %144, label %155
144: ; preds = %140
%145 = load double, double* %21
%146 = load double*, double** %19
%147 = load i32, i32* %17
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds double, double* %146, i64 %148
%150 = load double, double* %149
%151 = fadd double %145, %150
store double %151, double* %21
br label %152
152: ; preds = %144
%153 = load i32, i32* %17
%154 = add nsw i32 %153, 1
store i32 %154, i32* %17
br label %140
155: ; preds = %140
%156 = load double, double* %20
%157 = fcmp oeq double %156, 0.000000e+00
br i1 %157, label %158, label %174
158: ; preds = %155
store i32 0, i32* %17
br label %159
159: ; preds = %168, %158
%160 = load i32, i32* %17
%161 = load i32, i32* %16
%162 = icmp slt i32 %160, %161
br i1 %162, label %163, label %171
163: ; preds = %159
%164 = load double*, double** %19
%165 = load i32, i32* %17
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds double, double* %164, i64 %166
store double 1.000000e+00, double* %167
br label %168
168: ; preds = %163
%169 = load i32, i32* %17
%170 = add nsw i32 %169, 1
store i32 %170, i32* %17
br label %159
171: ; preds = %159
%172 = load i32, i32* %16
%173 = sitofp i32 %172 to double
store double %173, double* %21
br label %174
174: ; preds = %171, %155
%175 = load double*, double** %10
%176 = getelementptr inbounds double, double* %175, i64 0
store double 0.000000e+00, double* %176
store i32 0, i32* %17
br label %177
177: ; preds = %200, %174
%178 = load i32, i32* %17
%179 = load i32, i32* %16
%180 = icmp slt i32 %178, %179
br i1 %180, label %181, label %203
181: ; preds = %177
%182 = load double*, double** %10
%183 = getelementptr inbounds double, double* %182, i64 0
%184 = load double, double* %183
%185 = load double*, double** %19
%186 = load i32, i32* %17
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds double, double* %185, i64 %187
%189 = load double, double* %188
%190 = load double, double* %21
%191 = fdiv double %189, %190
%192 = load double*, double** %15
%193 = load i32, i32* %17
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds double, double* %192, i64 %194
%196 = load double, double* %195
%197 = call double @llvm.fmuladd.f64(double %191, double %196, double %184)
%198 = load double*, double** %10
%199 = getelementptr inbounds double, double* %198, i64 0
store double %197, double* %199
br label %200
200: ; preds = %181
%201 = load i32, i32* %17
%202 = add nsw i32 %201, 1
store i32 %202, i32* %17
br label %177
203: ; preds = %177
%204 = load double*, double** %19
%205 = call i32 @free(double* %204)
ret void
}

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