#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 fmoonb(double time) {
  double A[] = {51281.0E-4, 2806.0E-4, 2777.0E-4, 1733.0E-4, 554.0E-4, 463.0E-4,
                326.0E-4,   172.0E-4,  93.0E-4,   88.0E-4,   82.0E-4,  43.0E-4,
                42.0E-4,    34.0E-4,   25.0E-4,   22.0E-4,   22.0E-4,  21.0E-4,
                19.0E-4,    18.0E-4,   18.0E-4,   18.0E-4,   15.0E-4,  15.0E-4,
                15.0E-4,    14.0E-4,   13.0E-4,   13.0E-4,   11.0E-4,  10.0E-4,
                9.0E-4,     8.0E-4,    7.0E-4,    6.0E-4,    6.0E-4,   5.0E-4,
                5.0E-4,     5.0E-4,    4.0E-4,    4.0E-4,    3.0E-4,   3.0E-4,
                3.0E-4,     3.0E-4,    3.0E-4};
  double B[] = {
      483202.019E0, 960400.89E0, 6003.15E0,   407332.20E0, 896537.4E0,
      69866.7E0,    1373736.2E0, 1437599.8E0, 884531.0E0,  471196.0E0,
      371333.0E0,   547066.0E0,  1850935.0E0, 443331.0E0,  860538.0E0,
      481268.0E0,   1337737.0E0, 105866.0E0,  924402.0E0,  820668.0E0,
      519201.0E0,   1449606.0E0, 42002.0E0,   928469.0E0,  996400.0E0,
      29996.0E0,    447203.0E0,  37935.0E0,   1914799.0E0, 1297866.0E0,
      1787072.0E0,  972407.0E0,  1309873.0E0, 559072.0E0,  1361730.0E0,
      848532.0E0,   419339.0E0,  948395.0E0,  2328134.0E0, 1024264.0E0,
      932536.0E0,   1409735.0E0, 2264270.0E0, 1814936.0E0, 335334.0E0};
  double C[] = {3.273E0, 138.24E0, 48.31E0, 52.43E0, 104.0E0, 82.5E0,  239.0E0,
                273.2E0, 187.0E0,  87.0E0,  55.0E0,  217.0E0, 14.0E0,  230.0E0,
                106.0E0, 308.0E0,  241.0E0, 80.0E0,  141.0E0, 153.0E0, 181.0E0,
                10.0E0,  46.0E0,   121.0E0, 316.0E0, 129.0E0, 6.0E0,   65.0E0,
                48.0E0,  288.0E0,  340.0E0, 235.0E0, 205.0E0, 134.0E0, 322.0E0,
                190.0E0, 149.0E0,  222.0E0, 149.0E0, 352.0E0, 282.0E0, 57.0E0,
                115.0E0, 16.0E0,   57.0E0};
  double fmoonb = 0;
  int i;
  for (i = 0; i < 45; i++) {
    fmoonb += A[i] * cos((B[i] * time + C[i]) * 0.0174532925199433);
  }
  fmoonb *= 0.0174532925199433;
  return (fmoonb);
}


x86 assembly (clang, -O0):
<fmoonb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x170(%rbp),%rdi
lea    0xed2(%rip),%rsi
mov    $0x168,%edx
call   1030 <memcpy@plt>
lea    -0x2e0(%rbp),%rdi
lea    0x102a(%rip),%rsi
mov    $0x168,%edx
call   1030 <memcpy@plt>
lea    -0x450(%rbp),%rdi
lea    0x1182(%rip),%rsi
mov    $0x168,%edx
call   1030 <memcpy@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x458(%rbp)
ff
movl   $0x0,-0x45c(%rbp)
cmpl   $0x2d,-0x45c(%rbp)
jge    1227 <fmoonb+0x107>
movslq -0x45c(%rbp),%rax
movsd  -0x170(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x468(%rbp)
ff
movslq -0x45c(%rbp),%rax
movsd  -0x2e0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x8(%rbp),%xmm2
movslq -0x45c(%rbp),%rax
movsd  -0x450(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe19(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0x468(%rbp),%xmm0
ff
movsd  -0x458(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x458(%rbp)
ff
mov    -0x45c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x45c(%rbp)
jmp    118d <fmoonb+0x6d>
movsd  0xdd1(%rip),%xmm0
mulsd  -0x458(%rbp),%xmm0
ff
movsd  %xmm0,-0x458(%rbp)
ff
movsd  -0x458(%rbp),%xmm0
ff
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmoonb>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%ebx
lea    0xed9(%rip),%r14
lea    0x1042(%rip),%r15
lea    0x11ab(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
movsd  -0x8(%r15,%rbx,8),%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  -0x8(%r12,%rbx,8),%xmm0
mulsd  0xe94(%rip),%xmm0
call   1030 <cos@plt>
mulsd  -0x8(%r14,%rbx,8),%xmm0
addsd  0x8(%rsp),%xmm0
cmp    $0x2d,%rbx
je     11c1 <fmoonb+0xb1>
movsd  %xmm0,0x8(%rsp)
movsd  (%r15,%rbx,8),%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  (%r12,%rbx,8),%xmm0
mulsd  0xe5c(%rip),%xmm0
call   1030 <cos@plt>
mulsd  (%r14,%rbx,8),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
add    $0x2,%rbx
jmp    1150 <fmoonb+0x40>
mulsd  0xe37(%rip),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.fmoonb.A = [45 x double] [double 5.128100e+00, double 2.806000e-01, double 2.777000e-01, double 1.733000e-01, double 5.540000e-02, double 4.630000e-02, double 3.260000e-02, double 1.720000e-02, double 9.300000e-03, double 8.800000e-03, double 8.200000e-03, double 4.300000e-03, double 4.200000e-03, double 3.400000e-03, double 2.500000e-03, double 2.200000e-03, double 2.200000e-03, double 2.100000e-03, double 1.900000e-03, double 1.800000e-03, double 1.800000e-03, double 1.800000e-03, double 1.500000e-03, double 1.500000e-03, double 1.500000e-03, double 1.400000e-03, double 1.300000e-03, double 1.300000e-03, double 1.100000e-03, double 1.000000e-03, double 9.000000e-04, double 8.000000e-04, double 7.000000e-04, double 6.000000e-04, double 6.000000e-04, double 5.000000e-04, double 5.000000e-04, double 5.000000e-04, double 4.000000e-04, double 4.000000e-04, double 3.000000e-04, double 3.000000e-04, double 3.000000e-04, double 3.000000e-04, double 3.000000e-04]
@__const.fmoonb.B = [45 x double] [double 0x411D7E081374BC6A, double 0x412D4F21C7AE147B, double 0x40B7732666666666, double 0x4118DC90CCCCCCCD, double 0x412B5C32CCCCCCCD, double 6.986670e+04, double 0x4134F62833333333, double 0x4135EF9FCCCCCCCD, double 8.845310e+05, double 4.711960e+05, double 3.713330e+05, double 5.470660e+05, double 0x413C3E3700000000, double 4.433310e+05, double 8.605380e+05, double 4.812680e+05, double 0x4134698900000000, double 1.058660e+05, double 9.244020e+05, double 8.206680e+05, double 5.192010e+05, double 0x41361E8600000000, double 4.200200e+04, double 9.284690e+05, double 9.964000e+05, double 2.999600e+04, double 4.472030e+05, double 3.793500e+04, double 0x413D37AF00000000, double 0x4133CDCA00000000, double 0x413B44C000000000, double 9.724070e+05, double 0x4133FCB100000000, double 5.590720e+05, double 1.361730e+06, double 8.485320e+05, double 4.193390e+05, double 9.483950e+05, double 0x4141C32300000000, double 0x412F421000000000, double 9.325360e+05, double 0x413582C700000000, double 2.264270e+06, double 0x413BB19800000000, double 3.353340e+05]
@__const.fmoonb.C = [45 x double] [double 3.273000e+00, double 1.382400e+02, double 4.831000e+01, double 5.243000e+01, double 1.040000e+02, double 8.250000e+01, double 2.390000e+02, double 2.732000e+02, double 1.870000e+02, double 8.700000e+01, double 5.500000e+01, double 2.170000e+02, double 1.400000e+01, double 2.300000e+02, double 1.060000e+02, double 3.080000e+02, double 2.410000e+02, double 8.000000e+01, double 1.410000e+02, double 1.530000e+02, double 1.810000e+02, double 1.000000e+01, double 4.600000e+01, double 1.210000e+02, double 3.160000e+02, double 1.290000e+02, double 6.000000e+00, double 6.500000e+01, double 4.800000e+01, double 2.880000e+02, double 3.400000e+02, double 2.350000e+02, double 2.050000e+02, double 1.340000e+02, double 3.220000e+02, double 1.900000e+02, double 1.490000e+02, double 2.220000e+02, double 1.490000e+02, double 3.520000e+02, double 2.820000e+02, double 5.700000e+01, double 1.150000e+02, double 1.600000e+01, double 5.700000e+01]
define double @fmoonb(double %0) {
%2 = alloca double
%3 = alloca [45 x double]
%4 = alloca [45 x double]
%5 = alloca [45 x double]
%6 = alloca double
%7 = alloca i32
store double %0, double* %2
%8 = bitcast [45 x double]* %3 to i8*
%9 = bitcast [45 x double]* %4 to i8*
%10 = bitcast [45 x double]* %5 to i8*
store double 0.000000e+00, double* %6
store i32 0, i32* %7
br label %11
11: ; preds = %33, %1
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 45
br i1 %13, label %14, label %36
14: ; preds = %11
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [45 x double], [45 x double]* %3, i64 0, i64 %16
%18 = load double, double* %17
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [45 x double], [45 x double]* %4, i64 0, i64 %20
%22 = load double, double* %21
%23 = load double, double* %2
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [45 x double], [45 x double]* %5, i64 0, i64 %25
%27 = load double, double* %26
%28 = call double @llvm.fmuladd.f64(double %22, double %23, double %27)
%29 = fmul double %28, 0x3F91DF46A2529D3A
%30 = call double @cos(double %29)
%31 = load double, double* %6
%32 = call double @llvm.fmuladd.f64(double %18, double %30, double %31)
store double %32, double* %6
br label %33
33: ; preds = %14
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %11
36: ; preds = %11
%37 = load double, double* %6
%38 = fmul double %37, 0x3F91DF46A2529D3A
store double %38, double* %6
%39 = load double, double* %6
ret double %39
}

LLVM IR (-O2):
@__const.fmoonb.A = [45 x double] [double 5.128100e+00, double 2.806000e-01, double 2.777000e-01, double 1.733000e-01, double 5.540000e-02, double 4.630000e-02, double 3.260000e-02, double 1.720000e-02, double 9.300000e-03, double 8.800000e-03, double 8.200000e-03, double 4.300000e-03, double 4.200000e-03, double 3.400000e-03, double 2.500000e-03, double 2.200000e-03, double 2.200000e-03, double 2.100000e-03, double 1.900000e-03, double 1.800000e-03, double 1.800000e-03, double 1.800000e-03, double 1.500000e-03, double 1.500000e-03, double 1.500000e-03, double 1.400000e-03, double 1.300000e-03, double 1.300000e-03, double 1.100000e-03, double 1.000000e-03, double 9.000000e-04, double 8.000000e-04, double 7.000000e-04, double 6.000000e-04, double 6.000000e-04, double 5.000000e-04, double 5.000000e-04, double 5.000000e-04, double 4.000000e-04, double 4.000000e-04, double 3.000000e-04, double 3.000000e-04, double 3.000000e-04, double 3.000000e-04, double 3.000000e-04]
@__const.fmoonb.B = [45 x double] [double 0x411D7E081374BC6A, double 0x412D4F21C7AE147B, double 0x40B7732666666666, double 0x4118DC90CCCCCCCD, double 0x412B5C32CCCCCCCD, double 6.986670e+04, double 0x4134F62833333333, double 0x4135EF9FCCCCCCCD, double 8.845310e+05, double 4.711960e+05, double 3.713330e+05, double 5.470660e+05, double 0x413C3E3700000000, double 4.433310e+05, double 8.605380e+05, double 4.812680e+05, double 0x4134698900000000, double 1.058660e+05, double 9.244020e+05, double 8.206680e+05, double 5.192010e+05, double 0x41361E8600000000, double 4.200200e+04, double 9.284690e+05, double 9.964000e+05, double 2.999600e+04, double 4.472030e+05, double 3.793500e+04, double 0x413D37AF00000000, double 0x4133CDCA00000000, double 0x413B44C000000000, double 9.724070e+05, double 0x4133FCB100000000, double 5.590720e+05, double 1.361730e+06, double 8.485320e+05, double 4.193390e+05, double 9.483950e+05, double 0x4141C32300000000, double 0x412F421000000000, double 9.325360e+05, double 0x413582C700000000, double 2.264270e+06, double 0x413BB19800000000, double 3.353340e+05]
@__const.fmoonb.C = [45 x double] [double 3.273000e+00, double 1.382400e+02, double 4.831000e+01, double 5.243000e+01, double 1.040000e+02, double 8.250000e+01, double 2.390000e+02, double 2.732000e+02, double 1.870000e+02, double 8.700000e+01, double 5.500000e+01, double 2.170000e+02, double 1.400000e+01, double 2.300000e+02, double 1.060000e+02, double 3.080000e+02, double 2.410000e+02, double 8.000000e+01, double 1.410000e+02, double 1.530000e+02, double 1.810000e+02, double 1.000000e+01, double 4.600000e+01, double 1.210000e+02, double 3.160000e+02, double 1.290000e+02, double 6.000000e+00, double 6.500000e+01, double 4.800000e+01, double 2.880000e+02, double 3.400000e+02, double 2.350000e+02, double 2.050000e+02, double 1.340000e+02, double 3.220000e+02, double 1.900000e+02, double 1.490000e+02, double 2.220000e+02, double 1.490000e+02, double 3.520000e+02, double 2.820000e+02, double 5.700000e+01, double 1.150000e+02, double 1.600000e+01, double 5.700000e+01]
define double @fmoonb(double %0) {
br label %2
2: ; preds = %17, %1
%3 = phi i64 [ 0, %1 ], [ %28, %17 ]
%4 = phi double [ 0.000000e+00, %1 ], [ %27, %17 ]
%5 = getelementptr inbounds [45 x double], [45 x double]* @__const.fmoonb.A, i64 0, i64 %3
%6 = load double, double* %5
%7 = getelementptr inbounds [45 x double], [45 x double]* @__const.fmoonb.B, i64 0, i64 %3
%8 = load double, double* %7
%9 = getelementptr inbounds [45 x double], [45 x double]* @__const.fmoonb.C, i64 0, i64 %3
%10 = load double, double* %9
%11 = tail call double @llvm.fmuladd.f64(double %8, double %0, double %10)
%12 = fmul double %11, 0x3F91DF46A2529D3A
%13 = tail call double @cos(double %12)
%14 = tail call double @llvm.fmuladd.f64(double %6, double %13, double %4)
%15 = or i64 %3, 1
%16 = icmp eq i64 %15, 45
br i1 %16, label %29, label %17
17: ; preds = %2
%18 = getelementptr inbounds [45 x double], [45 x double]* @__const.fmoonb.A, i64 0, i64 %15
%19 = load double, double* %18
%20 = getelementptr inbounds [45 x double], [45 x double]* @__const.fmoonb.B, i64 0, i64 %15
%21 = load double, double* %20
%22 = getelementptr inbounds [45 x double], [45 x double]* @__const.fmoonb.C, i64 0, i64 %15
%23 = load double, double* %22
%24 = tail call double @llvm.fmuladd.f64(double %21, double %0, double %23)
%25 = fmul double %24, 0x3F91DF46A2529D3A
%26 = tail call double @cos(double %25)
%27 = tail call double @llvm.fmuladd.f64(double %19, double %26, double %14)
%28 = add nuw nsw i64 %3, 2
br label %2
29: ; preds = %2
%30 = fmul double %14, 0x3F91DF46A2529D3A
ret double %30
}