#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 /*<<< orphan*/ pwm(double *, int, double *, double, double,
                       int /*<<< orphan*/);
void lMoments(double series[], int n, double lMoment[], double A, double B) {
  int i, j, ordenLMom;
  double C, D, E, acum[3], alpha[3];
  pwm(series, n, alpha, A, B, 0);
  lMoment[1] = alpha[0];
  lMoment[2] = alpha[0] - 2 * alpha[1];
  lMoment[3] = alpha[0] - 6 * alpha[1] + 6 * alpha[2];
}


x86 assembly (clang, -O0):
<lMoments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x90(%rbp),%rdx
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
xor    %ecx,%ecx
call   1030 <pwm@plt>
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm1
ff
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  0xe6f(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
movsd  0xe52(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lMoments>:
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%rbx
mov    %rsp,%rdx
xor    %ecx,%ecx
call   1030 <pwm@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rbx)
movupd 0x8(%rsp),%xmm1
movsd  0xec6(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
unpcklpd %xmm2,%xmm0
mulpd  0xec2(%rip),%xmm1
addpd  %xmm0,%xmm1
movupd %xmm1,0x10(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @lMoments(double* %0, i32 %1, double* %2, double %3, double %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca [3 x double]
%18 = alloca [3 x double]
store double* %0, double** %6
store i32 %1, i32* %7
store double* %2, double** %8
store double %3, double* %9
store double %4, double* %10
%19 = load double*, double** %6
%20 = load i32, i32* %7
%21 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 0
%22 = load double, double* %9
%23 = load double, double* %10
%24 = call i32 @pwm(double* %19, i32 %20, double* %21, double %22, double %23, i32 0)
%25 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 0
%26 = load double, double* %25
%27 = load double*, double** %8
%28 = getelementptr inbounds double, double* %27, i64 1
store double %26, double* %28
%29 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 0
%30 = load double, double* %29
%31 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 1
%32 = load double, double* %31
%33 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %32, double %30)
%34 = load double*, double** %8
%35 = getelementptr inbounds double, double* %34, i64 2
store double %33, double* %35
%36 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 0
%37 = load double, double* %36
%38 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 1
%39 = load double, double* %38
%40 = call double @llvm.fmuladd.f64(double -6.000000e+00, double %39, double %37)
%41 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 2
%42 = load double, double* %41
%43 = call double @llvm.fmuladd.f64(double 6.000000e+00, double %42, double %40)
%44 = load double*, double** %8
%45 = getelementptr inbounds double, double* %44, i64 3
store double %43, double* %45
ret void
}

LLVM IR (-O2):
define void @lMoments(double* %0, i32 %1, double* nocapture writeonly %2, double %3, double %4) {
%6 = alloca [3 x double]
%7 = bitcast [3 x double]* %6 to i8*
%8 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%9 = call i32 @pwm(double* %0, i32 %1, double* %8, double %3, double %4, i32 0)
%10 = load double, double* %8
%11 = getelementptr inbounds double, double* %2, i64 1
store double %10, double* %11
%12 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
%13 = getelementptr inbounds double, double* %2, i64 2
%14 = bitcast double* %12 to <2 x double>*
%15 = load <2 x double>, <2 x double>* %14
%16 = extractelement <2 x double> %15, i64 0
%17 = call double @llvm.fmuladd.f64(double %16, double -6.000000e+00, double %10)
%18 = insertelement <2 x double> poison, double %10, i64 0
%19 = insertelement <2 x double> %18, double %17, i64 1
%20 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %15, <2 x double> <double -2.000000e+00, double 6.000000e+00>, <2 x double> %19)
%21 = bitcast double* %13 to <2 x double>*
store <2 x double> %20, <2 x double>* %21
ret void
}