#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 sc_Zq(double qa, double qb, double qc, double dnn, double d_factor) {
  const double a1 = qa;
  const double a2 = qb;
  const double a3 = qc;
  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):
<sc_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
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1030 <square@plt>
movaps %xmm0,%xmm1
movsd  0xe64(%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  0xe0a(%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  0xd95(%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  0xd4d(%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  0xcfc(%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):
<sc_Zq>:
sub    $0x58,%rsp
movsd  %xmm3,(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x10(%rsp)
mulsd  %xmm3,%xmm4
movapd %xmm4,%xmm0
call   1030 <square@plt>
mulsd  0xe80(%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  0xe37(%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  0xdeb(%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  0xd93(%rip),%xmm1
mulsd  0x20(%rsp),%xmm1
movapd 0x30(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
define double @sc_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
store double %17, double* %11
%18 = load double, double* %7
store double %18, double* %12
%19 = load double, double* %8
store double %19, double* %13
%20 = load double, double* %9
%21 = load double, double* %10
%22 = fmul double %20, %21
%23 = call double @square(double %22)
%24 = fmul double -5.000000e-01, %23
%25 = load double, double* %11
%26 = load double, double* %11
%27 = load double, double* %12
%28 = load double, double* %12
%29 = fmul double %27, %28
%30 = call double @llvm.fmuladd.f64(double %25, double %26, double %29)
%31 = load double, double* %13
%32 = load double, double* %13
%33 = call double @llvm.fmuladd.f64(double %31, double %32, double %30)
%34 = fmul double %24, %33
store double %34, double* %14
%35 = load double, double* %14
%36 = call double @exp(double %35)
store double %36, double* %15
%37 = load double, double* %14
%38 = fmul double 2.000000e+00, %37
%39 = call i32 @expm1(double %38)
%40 = call double @cube(i32 %39)
%41 = fneg double %40
%42 = load double, double* %15
%43 = load double, double* %9
%44 = load double, double* %11
%45 = fmul double %43, %44
%46 = call double @cos(double %45)
%47 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %46, double %42)
%48 = load double, double* %15
%49 = call double @llvm.fmuladd.f64(double %47, double %48, double 1.000000e+00)
%50 = load double, double* %15
%51 = load double, double* %9
%52 = load double, double* %12
%53 = fmul double %51, %52
%54 = call double @cos(double %53)
%55 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %54, double %50)
%56 = load double, double* %15
%57 = call double @llvm.fmuladd.f64(double %55, double %56, double 1.000000e+00)
%58 = fmul double %49, %57
%59 = load double, double* %15
%60 = load double, double* %9
%61 = load double, double* %13
%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 = fdiv double %41, %67
store double %68, double* %16
%69 = load double, double* %16
ret double %69
}

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