#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 atan(double);
double cos(double);
scalar_t__ factorial(int);
double pow(int, int);
double sin(double);
double Si(double x) {
  int i;
  int nmax = 6;
  double out;
  long double power;
  double pi = 4.0 * atan(1.0);
  if (x >= pi * 6.2 / 4.0) {
    double out_sin = 0.0;
    double out_cos = 0.0;
    out = pi / 2.0;
    for (i = 0; i < nmax - 2; i += 1) {
      out_cos += pow(-1.0, i) * (double)factorial(2 * i) / pow(x, 2 * i + 1);
      out_sin +=
          pow(-1.0, i) * (double)factorial(2 * i + 1) / pow(x, 2 * i + 2);
    }
    out -= cos(x) * out_cos;
    out -= sin(x) * out_sin;
    return out;
  }
  out = 0.0;
  for (i = 0; i < nmax; i += 1) {
    if (i == 0) {
      out += x;
      continue;
    }
    power = pow(x, (2 * i + 1));
    out += (double)pow(-1, i) * power /
           ((2.0 * (double)i + 1.0) * (double)factorial(2 * i + 1));
  }
  return out;
}


x86 assembly (clang, -O0):
<Si>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movsd  %xmm0,-0x10(%rbp)
movl   $0x6,-0x18(%rbp)
movsd  0xea1(%rip),%xmm0
call   1050 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xe81(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe73(%rip),%xmm1
mulsd  -0x38(%rbp),%xmm1
movsd  0xe5e(%rip),%xmm2
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     1336 <Si+0x1e6>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xe4b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    12b7 <Si+0x167>
mov    -0x14(%rbp),%esi
mov    $0xffffffff,%edi
call   1070 <pow@plt>
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x14(%rbp),%edi
shl    $0x1,%edi
call   1030 <factorial@plt>
movsd  -0x88(%rbp),%xmm0
ff
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
cvttsd2si -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
divsd  %xmm1,%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x14(%rbp),%esi
mov    $0xffffffff,%edi
call   1070 <pow@plt>
movsd  %xmm0,-0x78(%rbp)
mov    -0x14(%rbp),%edi
shl    $0x1,%edi
add    $0x1,%edi
call   1030 <factorial@plt>
movsd  -0x78(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
cvttsd2si -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
shl    $0x1,%esi
add    $0x2,%esi
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
divsd  %xmm1,%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11dd <Si+0x8d>
movsd  -0x10(%rbp),%xmm0
call   1060 <cos@plt>
movsd  -0x48(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  -0x40(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1422 <Si+0x2d2>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1418 <Si+0x2c8>
cmpl   $0x0,-0x14(%rbp)
jne    136f <Si+0x21f>
movsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    140a <Si+0x2ba>
cvttsd2si -0x10(%rbp),%edi
mov    -0x14(%rbp),%ecx
mov    %ecx,%eax
lea    0x1(%rax,%rax,1),%esi
call   1070 <pow@plt>
movsd  %xmm0,-0x50(%rbp)
fldl   -0x50(%rbp)
fstpt  -0x30(%rbp)
mov    -0x14(%rbp),%esi
mov    $0xffffffff,%edi
call   1070 <pow@plt>
movsd  %xmm0,-0x58(%rbp)
fldl   -0x58(%rbp)
fldt   -0x30(%rbp)
fmulp  %st,%st(1)
fstpt  -0x94(%rbp)
mov    -0x14(%rbp),%ecx
cvtsi2sd %ecx,%xmm0
addsd  %xmm0,%xmm0
movsd  0xc50(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    %ecx,%eax
lea    0x1(%rax,%rax,1),%edi
call   1030 <factorial@plt>
movsd  -0xa0(%rbp),%xmm0
ff
fldt   -0x94(%rbp)
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
fldl   -0x60(%rbp)
fdivrp %st,%st(1)
fldl   -0x20(%rbp)
faddp  %st,%st(1)
fstpl  -0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1345 <Si+0x1f5>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Si>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x158,%rsp
movsd  %xmm0,0x18(%rsp)
movsd  0xe95(%rip),%xmm0
call   1050 <atan@plt>
movsd  0x18(%rsp),%xmm0
ucomisd 0xe8a(%rip),%xmm0
cvttsd2si %xmm0,%ebp
jae    14a6 <Si+0x356>
xorpd  %xmm0,%xmm0
movsd  0x18(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
mov    %ebp,%edi
mov    $0x3,%esi
call   1070 <pow@plt>
movsd  %xmm0,0x130(%rsp)
fldl   0x130(%rsp)
fstpt  (%rsp)
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1070 <pow@plt>
movsd  %xmm0,0x128(%rsp)
fldt   (%rsp)
fmull  0x128(%rsp)
fstpt  (%rsp)
mov    $0x3,%edi
call   1030 <factorial@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0xe1e(%rip),%xmm0
movsd  %xmm0,0x120(%rsp)
fldt   (%rsp)
fdivl  0x120(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x138(%rsp)
faddl  0x138(%rsp)
fstpl  0x118(%rsp)
movsd  0x118(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %ebp,%edi
mov    $0x5,%esi
call   1070 <pow@plt>
movsd  %xmm0,0x110(%rsp)
fldl   0x110(%rsp)
fstpt  (%rsp)
mov    $0xffffffff,%edi
mov    $0x2,%esi
call   1070 <pow@plt>
movsd  %xmm0,0x100(%rsp)
fldt   (%rsp)
fmull  0x100(%rsp)
fstpt  (%rsp)
mov    $0x5,%edi
call   1030 <factorial@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0xd89(%rip),%xmm0
movsd  %xmm0,0xf8(%rsp)
fldt   (%rsp)
fdivl  0xf8(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x108(%rsp)
faddl  0x108(%rsp)
fstpl  0xf0(%rsp)
movsd  0xf0(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %ebp,%edi
mov    $0x7,%esi
call   1070 <pow@plt>
movsd  %xmm0,0xe8(%rsp)
fldl   0xe8(%rsp)
fstpt  (%rsp)
mov    $0xffffffff,%edi
mov    $0x3,%esi
call   1070 <pow@plt>
movsd  %xmm0,0xd8(%rsp)
fldt   (%rsp)
fmull  0xd8(%rsp)
fstpt  (%rsp)
mov    $0x7,%edi
call   1030 <factorial@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0xcf4(%rip),%xmm0
movsd  %xmm0,0xd0(%rsp)
fldt   (%rsp)
fdivl  0xd0(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0xe0(%rsp)
faddl  0xe0(%rsp)
fstpl  0xc8(%rsp)
movsd  0xc8(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %ebp,%edi
mov    $0x9,%esi
call   1070 <pow@plt>
movsd  %xmm0,0xc0(%rsp)
fldl   0xc0(%rsp)
fstpt  (%rsp)
mov    $0xffffffff,%edi
mov    $0x4,%esi
call   1070 <pow@plt>
movsd  %xmm0,0xb0(%rsp)
fldt   (%rsp)
fmull  0xb0(%rsp)
fstpt  (%rsp)
mov    $0x9,%edi
call   1030 <factorial@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0xc5f(%rip),%xmm0
movsd  %xmm0,0xa8(%rsp)
fldt   (%rsp)
fdivl  0xa8(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0xb8(%rsp)
faddl  0xb8(%rsp)
fstpl  0xa0(%rsp)
movsd  0xa0(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %ebp,%edi
mov    $0xb,%esi
call   1070 <pow@plt>
movsd  %xmm0,0x98(%rsp)
fldl   0x98(%rsp)
fstpt  (%rsp)
mov    $0xffffffff,%edi
mov    $0x5,%esi
call   1070 <pow@plt>
movsd  %xmm0,0x88(%rsp)
fldt   (%rsp)
fmull  0x88(%rsp)
fstpt  (%rsp)
mov    $0xb,%edi
call   1030 <factorial@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0xbca(%rip),%xmm0
movsd  %xmm0,0x80(%rsp)
fldt   (%rsp)
fdivl  0x80(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x90(%rsp)
faddl  0x90(%rsp)
fstpl  0x78(%rsp)
movsd  0x78(%rsp),%xmm0
jmp    17bf <Si+0x66f>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1070 <pow@plt>
movapd %xmm0,(%rsp)
xor    %edi,%edi
call   1030 <factorial@plt>
mov    %rax,%r15
mov    %ebp,%edi
mov    $0x1,%esi
call   1070 <pow@plt>
movapd %xmm0,0x20(%rsp)
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1070 <pow@plt>
movapd %xmm0,0x50(%rsp)
mov    $0x1,%edi
call   1030 <factorial@plt>
mov    %rax,%r14
mov    %ebp,%edi
mov    $0x2,%esi
call   1070 <pow@plt>
movapd %xmm0,0x30(%rsp)
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1070 <pow@plt>
movapd %xmm0,0x40(%rsp)
mov    $0x2,%edi
call   1030 <factorial@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    $0x3,%esi
call   1070 <pow@plt>
cvtsi2sd %r15,%xmm1
cvtsi2sd %rbx,%xmm2
unpcklpd %xmm2,%xmm1
movapd (%rsp),%xmm2
unpcklpd 0x40(%rsp),%xmm2
mulpd  %xmm1,%xmm2
movapd 0x20(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
divpd  %xmm1,%xmm2
movapd %xmm2,(%rsp)
xorpd  %xmm0,%xmm0
movapd %xmm2,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,0x20(%rsp)
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1070 <pow@plt>
movapd %xmm0,0x40(%rsp)
mov    $0x3,%edi
call   1030 <factorial@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r14,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
unpcklpd %xmm1,%xmm0
movapd 0x50(%rsp),%xmm1
unpcklpd 0x40(%rsp),%xmm1
mulpd  %xmm0,%xmm1
movapd %xmm1,0x50(%rsp)
mov    %ebp,%edi
mov    $0x4,%esi
call   1070 <pow@plt>
movapd 0x30(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
movapd 0x50(%rsp),%xmm0
divpd  %xmm1,%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
movapd (%rsp),%xmm1
unpckhpd %xmm1,%xmm1
addsd  0x20(%rsp),%xmm1
movapd %xmm1,(%rsp)
unpckhpd %xmm0,%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,0x50(%rsp)
mov    $0xffffffff,%edi
mov    $0x2,%esi
call   1070 <pow@plt>
movapd %xmm0,0x20(%rsp)
mov    $0x4,%edi
call   1030 <factorial@plt>
mov    %rax,%r15
mov    %ebp,%edi
mov    $0x5,%esi
call   1070 <pow@plt>
movapd %xmm0,0x60(%rsp)
mov    $0xffffffff,%edi
mov    $0x2,%esi
call   1070 <pow@plt>
movapd %xmm0,0x30(%rsp)
mov    $0x5,%edi
call   1030 <factorial@plt>
mov    %rax,%r14
mov    %ebp,%edi
mov    $0x6,%esi
call   1070 <pow@plt>
movapd %xmm0,0x40(%rsp)
mov    $0xffffffff,%edi
mov    $0x3,%esi
call   1070 <pow@plt>
movapd %xmm0,0x140(%rsp)
mov    $0x6,%edi
call   1030 <factorial@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    $0x7,%esi
call   1070 <pow@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %r15,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sd %rbx,%xmm2
unpcklpd %xmm2,%xmm1
movapd 0x20(%rsp),%xmm2
unpcklpd 0x140(%rsp),%xmm2
mulpd  %xmm1,%xmm2
movapd 0x60(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
divpd  %xmm1,%xmm2
movapd %xmm2,0x20(%rsp)
movapd (%rsp),%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,(%rsp)
mov    $0xffffffff,%edi
mov    $0x3,%esi
call   1070 <pow@plt>
movapd %xmm0,0x60(%rsp)
mov    $0x7,%edi
call   1030 <factorial@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r14,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
unpcklpd %xmm1,%xmm0
movapd 0x30(%rsp),%xmm1
unpcklpd 0x60(%rsp),%xmm1
mulpd  %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
mov    %ebp,%edi
mov    $0x8,%esi
call   1070 <pow@plt>
movapd 0x40(%rsp),%xmm2
unpcklpd %xmm0,%xmm2
movapd 0x30(%rsp),%xmm1
divpd  %xmm2,%xmm1
movapd 0x50(%rsp),%xmm0
addsd  %xmm1,%xmm0
movapd 0x20(%rsp),%xmm2
unpckhpd %xmm2,%xmm2
addsd  (%rsp),%xmm2
movapd %xmm2,0x20(%rsp)
unpckhpd %xmm1,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
movsd  0x18(%rsp),%xmm0
call   1060 <cos@plt>
mulsd  0x20(%rsp),%xmm0
movsd  0x878(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x30(%rsp),%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x158,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @Si(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca x86_fp80
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %3
store i32 6, i32* %5
%11 = call double @atan(double 1.000000e+00)
%12 = fmul double 4.000000e+00, %11
store double %12, double* %8
%13 = load double, double* %3
%14 = load double, double* %8
%15 = fmul double %14, 6.200000e+00
%16 = fdiv double %15, 4.000000e+00
%17 = fcmp oge double %13, %16
br i1 %17, label %18, label %77
18: ; preds = %1
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
%19 = load double, double* %8
%20 = fdiv double %19, 2.000000e+00
store double %20, double* %6
store i32 0, i32* %4
br label %21
21: ; preds = %60, %18
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = sub nsw i32 %23, 2
%25 = icmp slt i32 %22, %24
br i1 %25, label %26, label %63
26: ; preds = %21
%27 = load i32, i32* %4
%28 = call double @pow(i32 -1, i32 %27)
%29 = load i32, i32* %4
%30 = mul nsw i32 2, %29
%31 = call i64 @factorial(i32 %30)
%32 = sitofp i64 %31 to double
%33 = fmul double %28, %32
%34 = load double, double* %3
%35 = fptosi double %34 to i32
%36 = load i32, i32* %4
%37 = mul nsw i32 2, %36
%38 = add nsw i32 %37, 1
%39 = call double @pow(i32 %35, i32 %38)
%40 = fdiv double %33, %39
%41 = load double, double* %10
%42 = fadd double %41, %40
store double %42, double* %10
%43 = load i32, i32* %4
%44 = call double @pow(i32 -1, i32 %43)
%45 = load i32, i32* %4
%46 = mul nsw i32 2, %45
%47 = add nsw i32 %46, 1
%48 = call i64 @factorial(i32 %47)
%49 = sitofp i64 %48 to double
%50 = fmul double %44, %49
%51 = load double, double* %3
%52 = fptosi double %51 to i32
%53 = load i32, i32* %4
%54 = mul nsw i32 2, %53
%55 = add nsw i32 %54, 2
%56 = call double @pow(i32 %52, i32 %55)
%57 = fdiv double %50, %56
%58 = load double, double* %9
%59 = fadd double %58, %57
store double %59, double* %9
br label %60
60: ; preds = %26
%61 = load i32, i32* %4
%62 = add nsw i32 %61, 1
store i32 %62, i32* %4
br label %21
63: ; preds = %21
%64 = load double, double* %3
%65 = call double @cos(double %64)
%66 = load double, double* %10
%67 = load double, double* %6
%68 = fneg double %65
%69 = call double @llvm.fmuladd.f64(double %68, double %66, double %67)
store double %69, double* %6
%70 = load double, double* %3
%71 = call double @sin(double %70)
%72 = load double, double* %9
%73 = load double, double* %6
%74 = fneg double %71
%75 = call double @llvm.fmuladd.f64(double %74, double %72, double %73)
store double %75, double* %6
%76 = load double, double* %6
store double %76, double* %2
br label %122
77: ; preds = %1
store double 0.000000e+00, double* %6
store i32 0, i32* %4
br label %78
78: ; preds = %117, %77
%79 = load i32, i32* %4
%80 = load i32, i32* %5
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %120
82: ; preds = %78
%83 = load i32, i32* %4
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %89
85: ; preds = %82
%86 = load double, double* %3
%87 = load double, double* %6
%88 = fadd double %87, %86
store double %88, double* %6
br label %117
89: ; preds = %82
%90 = load double, double* %3
%91 = fptosi double %90 to i32
%92 = load i32, i32* %4
%93 = mul nsw i32 2, %92
%94 = add nsw i32 %93, 1
%95 = call double @pow(i32 %91, i32 %94)
%96 = fpext double %95 to x86_fp80
store x86_fp80 %96, x86_fp80* %7
%97 = load i32, i32* %4
%98 = call double @pow(i32 -1, i32 %97)
%99 = fpext double %98 to x86_fp80
%100 = load x86_fp80, x86_fp80* %7
%101 = fmul x86_fp80 %99, %100
%102 = load i32, i32* %4
%103 = sitofp i32 %102 to double
%104 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %103, double 1.000000e+00)
%105 = load i32, i32* %4
%106 = mul nsw i32 2, %105
%107 = add nsw i32 %106, 1
%108 = call i64 @factorial(i32 %107)
%109 = sitofp i64 %108 to double
%110 = fmul double %104, %109
%111 = fpext double %110 to x86_fp80
%112 = fdiv x86_fp80 %101, %111
%113 = load double, double* %6
%114 = fpext double %113 to x86_fp80
%115 = fadd x86_fp80 %114, %112
%116 = fptrunc x86_fp80 %115 to double
store double %116, double* %6
br label %117
117: ; preds = %89, %85
%118 = load i32, i32* %4
%119 = add nsw i32 %118, 1
store i32 %119, i32* %4
br label %78
120: ; preds = %78
%121 = load double, double* %6
store double %121, double* %2
br label %122
122: ; preds = %120, %63
%123 = load double, double* %2
ret double %123
}

LLVM IR (-O2):
define double @Si(double %0) {
%2 = tail call double @atan(double 1.000000e+00)
%3 = fcmp ult double %0, 0x40137A55FAE80959
%4 = fptosi double %0 to i32
br i1 %3, label %88, label %5
5: ; preds = %1
%6 = tail call double @pow(i32 -1, i32 0)
%7 = tail call i64 @factorial(i32 0)
%8 = tail call double @pow(i32 %4, i32 1)
%9 = tail call double @pow(i32 -1, i32 0)
%10 = tail call i64 @factorial(i32 1)
%11 = tail call double @pow(i32 %4, i32 2)
%12 = tail call double @pow(i32 -1, i32 1)
%13 = tail call i64 @factorial(i32 2)
%14 = tail call double @pow(i32 %4, i32 3)
%15 = insertelement <2 x i64> poison, i64 %7, i64 0
%16 = insertelement <2 x i64> %15, i64 %13, i64 1
%17 = sitofp <2 x i64> %16 to <2 x double>
%18 = insertelement <2 x double> poison, double %6, i64 0
%19 = insertelement <2 x double> %18, double %12, i64 1
%20 = fmul <2 x double> %19, %17
%21 = insertelement <2 x double> poison, double %8, i64 0
%22 = insertelement <2 x double> %21, double %14, i64 1
%23 = fdiv <2 x double> %20, %22
%24 = extractelement <2 x double> %23, i64 0
%25 = fadd double %24, 0.000000e+00
%26 = tail call double @pow(i32 -1, i32 1)
%27 = tail call i64 @factorial(i32 3)
%28 = insertelement <2 x i64> poison, i64 %10, i64 0
%29 = insertelement <2 x i64> %28, i64 %27, i64 1
%30 = sitofp <2 x i64> %29 to <2 x double>
%31 = insertelement <2 x double> poison, double %9, i64 0
%32 = insertelement <2 x double> %31, double %26, i64 1
%33 = fmul <2 x double> %32, %30
%34 = tail call double @pow(i32 %4, i32 4)
%35 = insertelement <2 x double> poison, double %11, i64 0
%36 = insertelement <2 x double> %35, double %34, i64 1
%37 = fdiv <2 x double> %33, %36
%38 = extractelement <2 x double> %37, i64 0
%39 = fadd double %38, 0.000000e+00
%40 = extractelement <2 x double> %23, i64 1
%41 = fadd double %25, %40
%42 = extractelement <2 x double> %37, i64 1
%43 = fadd double %39, %42
%44 = tail call double @pow(i32 -1, i32 2)
%45 = tail call i64 @factorial(i32 4)
%46 = tail call double @pow(i32 %4, i32 5)
%47 = tail call double @pow(i32 -1, i32 2)
%48 = tail call i64 @factorial(i32 5)
%49 = tail call double @pow(i32 %4, i32 6)
%50 = tail call double @pow(i32 -1, i32 3)
%51 = tail call i64 @factorial(i32 6)
%52 = tail call double @pow(i32 %4, i32 7)
%53 = insertelement <2 x i64> poison, i64 %45, i64 0
%54 = insertelement <2 x i64> %53, i64 %51, i64 1
%55 = sitofp <2 x i64> %54 to <2 x double>
%56 = insertelement <2 x double> poison, double %44, i64 0
%57 = insertelement <2 x double> %56, double %50, i64 1
%58 = fmul <2 x double> %57, %55
%59 = insertelement <2 x double> poison, double %46, i64 0
%60 = insertelement <2 x double> %59, double %52, i64 1
%61 = fdiv <2 x double> %58, %60
%62 = extractelement <2 x double> %61, i64 0
%63 = fadd double %41, %62
%64 = tail call double @pow(i32 -1, i32 3)
%65 = tail call i64 @factorial(i32 7)
%66 = insertelement <2 x i64> poison, i64 %48, i64 0
%67 = insertelement <2 x i64> %66, i64 %65, i64 1
%68 = sitofp <2 x i64> %67 to <2 x double>
%69 = insertelement <2 x double> poison, double %47, i64 0
%70 = insertelement <2 x double> %69, double %64, i64 1
%71 = fmul <2 x double> %70, %68
%72 = tail call double @pow(i32 %4, i32 8)
%73 = insertelement <2 x double> poison, double %49, i64 0
%74 = insertelement <2 x double> %73, double %72, i64 1
%75 = fdiv <2 x double> %71, %74
%76 = extractelement <2 x double> %75, i64 0
%77 = fadd double %43, %76
%78 = extractelement <2 x double> %61, i64 1
%79 = fadd double %63, %78
%80 = extractelement <2 x double> %75, i64 1
%81 = fadd double %77, %80
%82 = tail call double @cos(double %0)
%83 = fneg double %82
%84 = tail call double @llvm.fmuladd.f64(double %83, double %79, double 0x3FF921FB54442D18)
%85 = tail call double @sin(double %0)
%86 = fneg double %85
%87 = tail call double @llvm.fmuladd.f64(double %86, double %81, double %84)
br label %155
88: ; preds = %1
%89 = fadd double %0, 0.000000e+00
%90 = tail call double @pow(i32 %4, i32 3)
%91 = fpext double %90 to x86_fp80
%92 = tail call double @pow(i32 -1, i32 1)
%93 = fpext double %92 to x86_fp80
%94 = fmul x86_fp80 %91, %93
%95 = tail call i64 @factorial(i32 3)
%96 = sitofp i64 %95 to double
%97 = fmul double %96, 3.000000e+00
%98 = fpext double %97 to x86_fp80
%99 = fdiv x86_fp80 %94, %98
%100 = fpext double %89 to x86_fp80
%101 = fadd x86_fp80 %99, %100
%102 = fptrunc x86_fp80 %101 to double
%103 = tail call double @pow(i32 %4, i32 5)
%104 = fpext double %103 to x86_fp80
%105 = tail call double @pow(i32 -1, i32 2)
%106 = fpext double %105 to x86_fp80
%107 = fmul x86_fp80 %104, %106
%108 = tail call i64 @factorial(i32 5)
%109 = sitofp i64 %108 to double
%110 = fmul double %109, 5.000000e+00
%111 = fpext double %110 to x86_fp80
%112 = fdiv x86_fp80 %107, %111
%113 = fpext double %102 to x86_fp80
%114 = fadd x86_fp80 %112, %113
%115 = fptrunc x86_fp80 %114 to double
%116 = tail call double @pow(i32 %4, i32 7)
%117 = fpext double %116 to x86_fp80
%118 = tail call double @pow(i32 -1, i32 3)
%119 = fpext double %118 to x86_fp80
%120 = fmul x86_fp80 %117, %119
%121 = tail call i64 @factorial(i32 7)
%122 = sitofp i64 %121 to double
%123 = fmul double %122, 7.000000e+00
%124 = fpext double %123 to x86_fp80
%125 = fdiv x86_fp80 %120, %124
%126 = fpext double %115 to x86_fp80
%127 = fadd x86_fp80 %125, %126
%128 = fptrunc x86_fp80 %127 to double
%129 = tail call double @pow(i32 %4, i32 9)
%130 = fpext double %129 to x86_fp80
%131 = tail call double @pow(i32 -1, i32 4)
%132 = fpext double %131 to x86_fp80
%133 = fmul x86_fp80 %130, %132
%134 = tail call i64 @factorial(i32 9)
%135 = sitofp i64 %134 to double
%136 = fmul double %135, 9.000000e+00
%137 = fpext double %136 to x86_fp80
%138 = fdiv x86_fp80 %133, %137
%139 = fpext double %128 to x86_fp80
%140 = fadd x86_fp80 %138, %139
%141 = fptrunc x86_fp80 %140 to double
%142 = tail call double @pow(i32 %4, i32 11)
%143 = fpext double %142 to x86_fp80
%144 = tail call double @pow(i32 -1, i32 5)
%145 = fpext double %144 to x86_fp80
%146 = fmul x86_fp80 %143, %145
%147 = tail call i64 @factorial(i32 11)
%148 = sitofp i64 %147 to double
%149 = fmul double %148, 1.100000e+01
%150 = fpext double %149 to x86_fp80
%151 = fdiv x86_fp80 %146, %150
%152 = fpext double %141 to x86_fp80
%153 = fadd x86_fp80 %151, %152
%154 = fptrunc x86_fp80 %153 to double
br label %155
155: ; preds = %88, %5
%156 = phi double [ %87, %5 ], [ %154, %88 ]
ret double %156
}