#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 */
int pow(double, double);
double w(double x) {
  double val;
  val = -1.0 / (12 * pow(x, 2.0)) + 1.0 / (120 * pow(x, 4.0)) -
        1.0 / (252 * pow(x, 6.0)) + 1.0 / (240 * pow(x, 8.0));
  return (val);
}


x86 assembly (clang, -O0):
<w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefe(%rip),%xmm1
call   1030 <pow@plt>
imul   $0xc,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
call   1030 <pow@plt>
movsd  -0x28(%rbp),%xmm0
imul   $0x78,%eax,%eax
cvtsi2sd %eax,%xmm2
movsd  0xe93(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe89(%rip),%xmm1
call   1030 <pow@plt>
movsd  -0x20(%rbp),%xmm0
imul   $0xfc,%eax,%eax
cvtsi2sd %eax,%xmm2
movsd  0xe5d(%rip),%xmm1
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe4b(%rip),%xmm1
call   1030 <pow@plt>
movsd  -0x18(%rbp),%xmm0
imul   $0xf0,%eax,%eax
cvtsi2sd %eax,%xmm2
movsd  0xe27(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xedd(%rip),%xmm1
call   1030 <pow@plt>
mov    %eax,%ebx
movsd  0xed6(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <pow@plt>
movd   %ebx,%xmm0
pmuludq 0xed7(%rip),%xmm0
movd   %eax,%xmm1
pmuludq 0xedb(%rip),%xmm1
punpckldq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm0
movapd 0xedb(%rip),%xmm1
divpd  %xmm0,%xmm1
movapd %xmm1,0x10(%rsp)
movsd  0xe99(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <pow@plt>
mov    %eax,%ebx
movsd  0xe8c(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <pow@plt>
movd   %ebx,%xmm0
pmuludq 0xead(%rip),%xmm0
movd   %eax,%xmm1
pmuludq 0xeb1(%rip),%xmm1
punpckldq %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm1
movapd 0xe81(%rip),%xmm0
divpd  %xmm1,%xmm0
movapd 0x10(%rsp),%xmm2
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
subsd  %xmm1,%xmm2
subsd  %xmm0,%xmm2
unpckhpd %xmm0,%xmm0
addsd  %xmm2,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @w(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @pow(double %4, double 2.000000e+00)
%6 = mul nsw i32 12, %5
%7 = sitofp i32 %6 to double
%8 = fdiv double -1.000000e+00, %7
%9 = load double, double* %2
%10 = call i32 @pow(double %9, double 4.000000e+00)
%11 = mul nsw i32 120, %10
%12 = sitofp i32 %11 to double
%13 = fdiv double 1.000000e+00, %12
%14 = fadd double %8, %13
%15 = load double, double* %2
%16 = call i32 @pow(double %15, double 6.000000e+00)
%17 = mul nsw i32 252, %16
%18 = sitofp i32 %17 to double
%19 = fdiv double 1.000000e+00, %18
%20 = fsub double %14, %19
%21 = load double, double* %2
%22 = call i32 @pow(double %21, double 8.000000e+00)
%23 = mul nsw i32 240, %22
%24 = sitofp i32 %23 to double
%25 = fdiv double 1.000000e+00, %24
%26 = fadd double %20, %25
store double %26, double* %3
%27 = load double, double* %3
ret double %27
}

LLVM IR (-O2):
define double @w(double %0) {
%2 = tail call i32 @pow(double %0, double 2.000000e+00)
%3 = tail call i32 @pow(double %0, double 4.000000e+00)
%4 = insertelement <2 x i32> poison, i32 %3, i64 0
%5 = insertelement <2 x i32> %4, i32 %2, i64 1
%6 = mul nsw <2 x i32> %5, <i32 120, i32 12>
%7 = sitofp <2 x i32> %6 to <2 x double>
%8 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %7
%9 = shufflevector <2 x double> %8, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%10 = fsub <2 x double> %8, %9
%11 = tail call i32 @pow(double %0, double 6.000000e+00)
%12 = tail call i32 @pow(double %0, double 8.000000e+00)
%13 = insertelement <2 x i32> poison, i32 %11, i64 0
%14 = insertelement <2 x i32> %13, i32 %12, i64 1
%15 = mul nsw <2 x i32> %14, <i32 252, i32 240>
%16 = sitofp <2 x i32> %15 to <2 x double>
%17 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %16
%18 = fsub <2 x double> %10, %17
%19 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%20 = fadd <2 x double> %18, %19
%21 = extractelement <2 x double> %20, i64 0
ret double %21
}