#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 cos(double);
double const cube(int /*<<< orphan*/);
double exp(double const);
int /*<<< orphan*/ expm1(double);
double square(double);
double fcc_Zq(double qa, double qb, double qc, double dnn, double d_factor) {
  const double a1 = (qa + qb) / 2.0;
  const double a2 = (qa + qc) / 2.0;
  const double a3 = (qb + qc) / 2.0;
  const double arg =
      -0.5 * square(dnn * d_factor) * (a1 * a1 + a2 * a2 + a3 * a3);
  const double exp_arg = exp(arg);
  const double Zq = -cube(expm1(2.0 * arg)) /
                    (((exp_arg - 2.0 * cos(dnn * a1)) * exp_arg + 1.0) *
                     ((exp_arg - 2.0 * cos(dnn * a2)) * exp_arg + 1.0) *
                     ((exp_arg - 2.0 * cos(dnn * a3)) * exp_arg + 1.0));
  return Zq;
}


x86 assembly (clang, -O0):
<fcc_Zq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xe82(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe67(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe4c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1030 <square@plt>
movaps %xmm0,%xmm1
movsd  0xe31(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x40(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  0xdd7(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1060 <expm1@plt>
mov    %eax,%edi
call   1070 <cube@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd62(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
call   1050 <cos@plt>
movsd  -0x80(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x78(%rbp),%xmm0
addsd  %xmm2,%xmm2
subsd  %xmm2,%xmm1
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd1a(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
call   1050 <cos@plt>
movsd  -0x70(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x60(%rbp),%xmm0
addsd  %xmm3,%xmm3
subsd  %xmm3,%xmm2
movsd  -0x50(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xcc9(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcc_Zq>:
sub    $0x58,%rsp
movsd  %xmm3,(%rsp)
movapd %xmm0,%xmm6
addsd  %xmm1,%xmm6
movsd  0xe97(%rip),%xmm5
mulsd  %xmm5,%xmm6
movsd  %xmm6,0x10(%rsp)
addsd  %xmm2,%xmm0
mulsd  %xmm5,%xmm0
movsd  %xmm0,0x20(%rsp)
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm5
movsd  %xmm5,0x8(%rsp)
mulsd  %xmm3,%xmm4
movapd %xmm4,%xmm0
call   1030 <square@plt>
mulsd  0xe64(%rip),%xmm0
movsd  0x20(%rsp),%xmm2
mulsd  %xmm2,%xmm2
movsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x30(%rsp)
call   1040 <exp@plt>
movapd %xmm0,0x40(%rsp)
movsd  0x30(%rsp),%xmm0
addsd  %xmm0,%xmm0
call   1060 <expm1@plt>
mov    %eax,%edi
call   1070 <cube@plt>
xorpd  0xe23(%rip),%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  (%rsp),%xmm0
call   1050 <cos@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  (%rsp),%xmm0
call   1050 <cos@plt>
movapd 0x10(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movapd 0x40(%rsp),%xmm0
unpcklpd %xmm0,%xmm0
addpd  %xmm1,%xmm1
movapd %xmm1,%xmm2
movapd %xmm0,%xmm1
subpd  %xmm2,%xmm1
mulpd  %xmm0,%xmm1
addpd  0xdd7(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
call   1050 <cos@plt>
addsd  %xmm0,%xmm0
movapd 0x40(%rsp),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  0xd77(%rip),%xmm1
mulsd  0x20(%rsp),%xmm1
movapd 0x30(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
define double @fcc_Zq(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fadd double %17, %18
%20 = fdiv double %19, 2.000000e+00
store double %20, double* %11
%21 = load double, double* %6
%22 = load double, double* %8
%23 = fadd double %21, %22
%24 = fdiv double %23, 2.000000e+00
store double %24, double* %12
%25 = load double, double* %7
%26 = load double, double* %8
%27 = fadd double %25, %26
%28 = fdiv double %27, 2.000000e+00
store double %28, double* %13
%29 = load double, double* %9
%30 = load double, double* %10
%31 = fmul double %29, %30
%32 = call double @square(double %31)
%33 = fmul double -5.000000e-01, %32
%34 = load double, double* %11
%35 = load double, double* %11
%36 = load double, double* %12
%37 = load double, double* %12
%38 = fmul double %36, %37
%39 = call double @llvm.fmuladd.f64(double %34, double %35, double %38)
%40 = load double, double* %13
%41 = load double, double* %13
%42 = call double @llvm.fmuladd.f64(double %40, double %41, double %39)
%43 = fmul double %33, %42
store double %43, double* %14
%44 = load double, double* %14
%45 = call double @exp(double %44)
store double %45, double* %15
%46 = load double, double* %14
%47 = fmul double 2.000000e+00, %46
%48 = call i32 @expm1(double %47)
%49 = call double @cube(i32 %48)
%50 = fneg double %49
%51 = load double, double* %15
%52 = load double, double* %9
%53 = load double, double* %11
%54 = fmul double %52, %53
%55 = call double @cos(double %54)
%56 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %55, double %51)
%57 = load double, double* %15
%58 = call double @llvm.fmuladd.f64(double %56, double %57, double 1.000000e+00)
%59 = load double, double* %15
%60 = load double, double* %9
%61 = load double, double* %12
%62 = fmul double %60, %61
%63 = call double @cos(double %62)
%64 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %63, double %59)
%65 = load double, double* %15
%66 = call double @llvm.fmuladd.f64(double %64, double %65, double 1.000000e+00)
%67 = fmul double %58, %66
%68 = load double, double* %15
%69 = load double, double* %9
%70 = load double, double* %13
%71 = fmul double %69, %70
%72 = call double @cos(double %71)
%73 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %72, double %68)
%74 = load double, double* %15
%75 = call double @llvm.fmuladd.f64(double %73, double %74, double 1.000000e+00)
%76 = fmul double %67, %75
%77 = fdiv double %50, %76
store double %77, double* %16
%78 = load double, double* %16
ret double %78
}

LLVM IR (-O2):
define double @fcc_Zq(double %0, double %1, double %2, double %3, double %4) {
%6 = fadd double %0, %1
%7 = fmul double %6, 5.000000e-01
%8 = fadd double %0, %2
%9 = fmul double %8, 5.000000e-01
%10 = fadd double %1, %2
%11 = fmul double %10, 5.000000e-01
%12 = fmul double %3, %4
%13 = tail call double @square(double %12)
%14 = fmul double %13, -5.000000e-01
%15 = fmul double %9, %9
%16 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %15)
%17 = tail call double @llvm.fmuladd.f64(double %11, double %11, double %16)
%18 = fmul double %17, %14
%19 = tail call double @exp(double %18)
%20 = fmul double %18, 2.000000e+00
%21 = tail call i32 @expm1(double %20)
%22 = tail call double @cube(i32 %21)
%23 = fneg double %22
%24 = fmul double %7, %3
%25 = tail call double @cos(double %24)
%26 = fmul double %9, %3
%27 = tail call double @cos(double %26)
%28 = insertelement <2 x double> poison, double %25, i64 0
%29 = insertelement <2 x double> %28, double %27, i64 1
%30 = insertelement <2 x double> poison, double %19, i64 0
%31 = shufflevector <2 x double> %30, <2 x double> poison, <2 x i32> zeroinitializer
%32 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %29, <2 x double> <double -2.000000e+00, double -2.000000e+00>, <2 x double> %31)
%33 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %32, <2 x double> %31, <2 x double> <double 1.000000e+00, double 1.000000e+00>)
%34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%35 = fmul <2 x double> %33, %34
%36 = extractelement <2 x double> %35, i64 0
%37 = fmul double %11, %3
%38 = tail call double @cos(double %37)
%39 = tail call double @llvm.fmuladd.f64(double %38, double -2.000000e+00, double %19)
%40 = tail call double @llvm.fmuladd.f64(double %39, double %19, double 1.000000e+00)
%41 = fmul double %36, %40
%42 = fdiv double %23, %41
ret double %42
}