#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 bcc_Zq(double qa, double qb, double qc, double dnn, double d_factor) {
  const double a1 = (-qa + qb + qc) / 2.0;
  const double a2 = (+qa - qb + qc) / 2.0;
  const double a3 = (+qa + 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):
<bcc_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
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe66(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe46(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xe26(%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  0xe0b(%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  0xdb1(%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  0xd3c(%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  0xcf4(%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  0xca3(%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):
<bcc_Zq>:
sub    $0x58,%rsp
movsd  %xmm3,(%rsp)
movapd %xmm1,%xmm6
subsd  %xmm0,%xmm6
addsd  %xmm2,%xmm6
movsd  0xe93(%rip),%xmm5
mulsd  %xmm5,%xmm6
movsd  %xmm6,0x10(%rsp)
movapd %xmm0,%xmm6
subsd  %xmm1,%xmm6
addsd  %xmm2,%xmm6
mulsd  %xmm5,%xmm6
movsd  %xmm6,0x20(%rsp)
addsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
mulsd  %xmm5,%xmm0
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm3,%xmm4
movapd %xmm4,%xmm0
call   1030 <square@plt>
mulsd  0xe54(%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  0xe13(%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  0xdc7(%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  0xd67(%rip),%xmm1
mulsd  0x20(%rsp),%xmm1
movapd 0x30(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x58,%rsp
ret

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

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