#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 getStrong(int);
double pow(double, int);
double taylor_double(double x) {
  return x - pow(x, 3) / getStrong(3) + pow(x, 5) / getStrong(5) -
         pow(x, 7) / getStrong(7);
}


x86 assembly (clang, -O0):
<taylor_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x38(%rbp)
mov    $0x3,%edi
call   1040 <getStrong@plt>
movsd  -0x38(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x5,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
mov    $0x5,%edi
call   1040 <getStrong@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x7,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x7,%edi
call   1040 <getStrong@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<taylor_double>:
sub    $0x48,%rsp
movsd  %xmm0,0x10(%rsp)
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x3,%edi
call   1040 <getStrong@plt>
movsd  0x8(%rsp),%xmm2
divsd  %xmm0,%xmm2
movsd  0x10(%rsp),%xmm0
movapd %xmm0,%xmm1
subsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    $0x5,%edi
call   1030 <pow@plt>
movapd %xmm0,0x30(%rsp)
mov    $0x5,%edi
call   1040 <getStrong@plt>
movapd %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x7,%edi
call   1030 <pow@plt>
movapd %xmm0,0x10(%rsp)
mov    $0x7,%edi
call   1040 <getStrong@plt>
movapd 0x30(%rsp),%xmm1
unpcklpd 0x10(%rsp),%xmm1
movapd 0x20(%rsp),%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
unpckhpd %xmm1,%xmm1
subsd  %xmm1,%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @taylor_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @pow(double %4, i32 3)
%6 = call double @getStrong(i32 3)
%7 = fdiv double %5, %6
%8 = fsub double %3, %7
%9 = load double, double* %2
%10 = call double @pow(double %9, i32 5)
%11 = call double @getStrong(i32 5)
%12 = fdiv double %10, %11
%13 = fadd double %8, %12
%14 = load double, double* %2
%15 = call double @pow(double %14, i32 7)
%16 = call double @getStrong(i32 7)
%17 = fdiv double %15, %16
%18 = fsub double %13, %17
ret double %18
}

LLVM IR (-O2):
define double @taylor_double(double %0) {
%2 = tail call double @pow(double %0, i32 3)
%3 = tail call double @getStrong(i32 3)
%4 = fdiv double %2, %3
%5 = fsub double %0, %4
%6 = tail call double @pow(double %0, i32 5)
%7 = tail call double @getStrong(i32 5)
%8 = tail call double @pow(double %0, i32 7)
%9 = tail call double @getStrong(i32 7)
%10 = insertelement <2 x double> poison, double %6, i64 0
%11 = insertelement <2 x double> %10, double %8, i64 1
%12 = insertelement <2 x double> poison, double %7, i64 0
%13 = insertelement <2 x double> %12, double %9, i64 1
%14 = fdiv <2 x double> %11, %13
%15 = extractelement <2 x double> %14, i64 0
%16 = fadd double %5, %15
%17 = extractelement <2 x double> %14, i64 1
%18 = fsub double %16, %17
ret double %18
}