#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*/ l_coeff(double *, unsigned int, double, double);
int /*<<< orphan*/ memcpy(double *, double *, unsigned int);
void l_coeffs2poly(double *coeffs, double CENTER, double WIDTH,
                   unsigned int order) {
  double CC[(order + 1) * (order + 1)];
  l_coeff(CC, order, CENTER, WIDTH);
  double result[order + 1];
  result[0] = coeffs[0];
  for (int n = 1; n <= order; ++n) {
    double *r = CC + n * (order + 1);
    for (int i = 0; i <= n; ++i)
      result[i] += coeffs[n] * *r++;
    *r = coeffs[n] * *r;
  }
  memcpy(coeffs, result, (order + 1) * sizeof(double));
}


x86 assembly (clang, -O0):
<l_coeffs2poly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
imul   %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,8),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x60(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <l_coeff@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
lea    0xf(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,-0x58(%rbp)
mov    %rax,%rsp
mov    %rcx,-0x38(%rbp)
mov    -0x8(%rbp),%rcx
movsd  (%rcx),%xmm0
movsd  %xmm0,(%rax)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
ja     125f <l_coeffs2poly+0x13f>
mov    -0x60(%rbp),%rax
mov    -0x3c(%rbp),%ecx
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
mov    %ecx,%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jg     1234 <l_coeffs2poly+0x114>
mov    -0x58(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm0
mov    -0x48(%rbp),%rcx
mov    %rcx,%rdx
add    $0x8,%rdx
mov    %rdx,-0x48(%rbp)
movsd  (%rcx),%xmm2
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11e0 <l_coeffs2poly+0xc0>
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11b0 <l_coeffs2poly+0x90>
mov    -0x58(%rbp),%rsi
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_coeffs2poly>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,%r12d
mov    %rdi,%rbx
lea    0x1(%r12),%r13d
mov    %r13d,%eax
imul   %eax,%eax
mov    %rsp,%rdi
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
mov    %rdi,-0x30(%rbp)
call   1040 <l_coeff@plt>
mov    %rsp,%rax
lea    0xf(,%r13,8),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rax,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
neg    %rcx
movsd  (%rbx),%xmm0
movsd  %xmm0,(%rax,%rcx,1)
test   %r12d,%r12d
je     1336 <l_coeffs2poly+0x216>
mov    -0x30(%rbp),%rax
add    $0x30,%rax
mov    %rax,-0x38(%rbp)
mov    $0x2,%ecx
mov    $0x1,%r15d
mov    $0xfffffffffffffffe,%r9
xor    %r14d,%r14d
mov    %r13d,%r11d
mov    %rbx,-0x40(%rbp)
jmp    11e4 <l_coeffs2poly+0xc4>
nopw   0x0(%rax,%rax,1)
mulsd  (%rdi),%xmm0
movsd  %xmm0,(%rdi)
add    $0x1,%r15
add    $0x1,%rcx
add    $0x1,%r14
add    %r13d,%r11d
add    $0x1,%r9
cmp    %r13,%r15
je     1336 <l_coeffs2poly+0x216>
lea    0x2(%r14),%r8
mov    %r13d,%eax
imul   %r15d,%eax
mov    -0x30(%rbp),%rdx
lea    (%rdx,%rax,8),%rdi
movsd  (%rbx,%r15,8),%xmm0
cmp    $0x4,%r8
jae    1210 <l_coeffs2poly+0xf0>
xor    %r10d,%r10d
jmp    1310 <l_coeffs2poly+0x1f0>
nopl   0x0(%rax,%rax,1)
lea    -0x2(%r14),%rax
mov    %rax,%r12
shr    $0x2,%r12
add    $0x1,%r12
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
cmp    $0x4,%rax
jae    1240 <l_coeffs2poly+0x120>
xor    %ebx,%ebx
jmp    12bf <l_coeffs2poly+0x19f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r11d,%eax
mov    -0x38(%rbp),%rdx
lea    (%rdx,%rax,8),%rax
mov    %r9,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
and    $0xfffffffffffffffe,%rdx
xor    %ebx,%ebx
nopl   0x0(%rax)
movupd -0x30(%rax,%rbx,8),%xmm2
movupd -0x20(%rax,%rbx,8),%xmm3
mulpd  %xmm1,%xmm2
addpd  (%rsi,%rbx,8),%xmm2
mulpd  %xmm1,%xmm3
addpd  0x10(%rsi,%rbx,8),%xmm3
movapd %xmm2,(%rsi,%rbx,8)
movapd %xmm3,0x10(%rsi,%rbx,8)
movupd -0x10(%rax,%rbx,8),%xmm2
mulpd  %xmm1,%xmm2
addpd  0x20(%rsi,%rbx,8),%xmm2
movupd (%rax,%rbx,8),%xmm3
mulpd  %xmm1,%xmm3
addpd  0x30(%rsi,%rbx,8),%xmm3
movapd %xmm2,0x20(%rsi,%rbx,8)
movapd %xmm3,0x30(%rsi,%rbx,8)
add    $0x8,%rbx
add    $0xfffffffffffffffe,%rdx
jne    1260 <l_coeffs2poly+0x140>
mov    %r8,%r10
and    $0xfffffffffffffffc,%r10
test   $0x1,%r12b
je     12f5 <l_coeffs2poly+0x1d5>
movupd (%rdi,%rbx,8),%xmm2
movupd 0x10(%rdi,%rbx,8),%xmm3
mulpd  %xmm1,%xmm2
addpd  (%rsi,%rbx,8),%xmm2
mulpd  %xmm1,%xmm3
addpd  0x10(%rsi,%rbx,8),%xmm3
movapd %xmm2,(%rsi,%rbx,8)
movapd %xmm3,0x10(%rsi,%rbx,8)
lea    (%rdi,%r10,8),%rdi
cmp    %r10,%r8
mov    -0x40(%rbp),%rbx
je     11c0 <l_coeffs2poly+0xa0>
cs nopw 0x0(%rax,%rax,1)
movsd  (%rdi),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rsi,%r10,8),%xmm1
add    $0x8,%rdi
movsd  %xmm1,(%rsi,%r10,8)
add    $0x1,%r10
cmp    %r10,%rcx
jne    1310 <l_coeffs2poly+0x1f0>
jmp    11c0 <l_coeffs2poly+0xa0>
shl    $0x3,%r13d
mov    %rbx,%rdi
mov    %r13d,%edx
call   1030 <memcpy@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @l_coeffs2poly(double* %0, double %1, double %2, i32 %3) {
%5 = alloca double*
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i32
%13 = alloca double*
%14 = alloca i32
store double* %0, double** %5
store double %1, double* %6
store double %2, double* %7
store i32 %3, i32* %8
%15 = load i32, i32* %8
%16 = add i32 %15, 1
%17 = load i32, i32* %8
%18 = add i32 %17, 1
%19 = mul i32 %16, %18
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %9
%22 = alloca double, i64 %20
store i64 %20, i64* %10
%23 = load i32, i32* %8
%24 = load double, double* %6
%25 = load double, double* %7
%26 = call i32 @l_coeff(double* %22, i32 %23, double %24, double %25)
%27 = load i32, i32* %8
%28 = add i32 %27, 1
%29 = zext i32 %28 to i64
%30 = alloca double, i64 %29
store i64 %29, i64* %11
%31 = load double*, double** %5
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = getelementptr inbounds double, double* %30, i64 0
store double %33, double* %34
store i32 1, i32* %12
br label %35
35: ; preds = %77, %4
%36 = load i32, i32* %12
%37 = load i32, i32* %8
%38 = icmp ule i32 %36, %37
br i1 %38, label %39, label %80
39: ; preds = %35
%40 = load i32, i32* %12
%41 = load i32, i32* %8
%42 = add i32 %41, 1
%43 = mul i32 %40, %42
%44 = zext i32 %43 to i64
%45 = getelementptr inbounds double, double* %22, i64 %44
store double* %45, double** %13
store i32 0, i32* %14
br label %46
46: ; preds = %64, %39
%47 = load i32, i32* %14
%48 = load i32, i32* %12
%49 = icmp sle i32 %47, %48
br i1 %49, label %50, label %67
50: ; preds = %46
%51 = load double*, double** %5
%52 = load i32, i32* %12
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
%55 = load double, double* %54
%56 = load double*, double** %13
%57 = getelementptr inbounds double, double* %56, i32 1
store double* %57, double** %13
%58 = load double, double* %56
%59 = load i32, i32* %14
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %30, i64 %60
%62 = load double, double* %61
%63 = call double @llvm.fmuladd.f64(double %55, double %58, double %62)
store double %63, double* %61
br label %64
64: ; preds = %50
%65 = load i32, i32* %14
%66 = add nsw i32 %65, 1
store i32 %66, i32* %14
br label %46
67: ; preds = %46
%68 = load double*, double** %5
%69 = load i32, i32* %12
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %68, i64 %70
%72 = load double, double* %71
%73 = load double*, double** %13
%74 = load double, double* %73
%75 = fmul double %72, %74
%76 = load double*, double** %13
store double %75, double* %76
br label %77
77: ; preds = %67
%78 = load i32, i32* %12
%79 = add nsw i32 %78, 1
store i32 %79, i32* %12
br label %35
80: ; preds = %35
%81 = load double*, double** %5
%82 = load i32, i32* %8
%83 = add i32 %82, 1
%84 = zext i32 %83 to i64
%85 = mul i64 %84, 8
%86 = trunc i64 %85 to i32
%87 = call i32 @memcpy(double* %81, double* %30, i32 %86)
%88 = load i8*, i8** %9
ret void
}

LLVM IR (-O2):
define void @l_coeffs2poly(double* %0, double %1, double %2, i32 %3) {
%5 = add i32 %3, 1
%6 = mul i32 %5, %5
%7 = zext i32 %6 to i64
%8 = alloca double, i64 %7
%9 = call i32 @l_coeff(double* %8, i32 %3, double %1, double %2)
%10 = zext i32 %5 to i64
%11 = alloca double, i64 %10
%12 = load double, double* %0
store double %12, double* %11
%13 = icmp eq i32 %3, 0
br i1 %13, label %14, label %17
14: ; preds = %107, %4
%15 = shl i32 %5, 3
%16 = call i32 @memcpy(double* %0, double* %11, i32 %15)
ret void
17: ; preds = %4, %107
%18 = phi i64 [ %114, %107 ], [ 0, %4 ]
%19 = phi i64 [ %111, %107 ], [ 1, %4 ]
%20 = phi i64 [ %112, %107 ], [ 2, %4 ]
%21 = add i64 %18, -2
%22 = lshr i64 %21, 2
%23 = add nuw nsw i64 %22, 1
%24 = add i64 %18, 2
%25 = trunc i64 %19 to i32
%26 = mul i32 %5, %25
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds double, double* %8, i64 %27
%29 = getelementptr inbounds double, double* %0, i64 %19
%30 = load double, double* %29
%31 = icmp ult i64 %24, 4
br i1 %31, label %104, label %32
32: ; preds = %17
%33 = and i64 %24, -4
%34 = getelementptr double, double* %28, i64 %33
%35 = insertelement <2 x double> poison, double %30, i64 0
%36 = shufflevector <2 x double> %35, <2 x double> poison, <2 x i32> zeroinitializer
%37 = insertelement <2 x double> poison, double %30, i64 0
%38 = shufflevector <2 x double> %37, <2 x double> poison, <2 x i32> zeroinitializer
%39 = and i64 %23, 1
%40 = icmp ult i64 %21, 4
br i1 %40, label %82, label %41
41: ; preds = %32
%42 = and i64 %23, 9223372036854775806
br label %43
43: ; preds = %43, %41
%44 = phi i64 [ 0, %41 ], [ %79, %43 ]
%45 = phi i64 [ 0, %41 ], [ %80, %43 ]
%46 = getelementptr double, double* %28, i64 %44
%47 = bitcast double* %46 to <2 x double>*
%48 = load <2 x double>, <2 x double>* %47
%49 = getelementptr double, double* %46, i64 2
%50 = bitcast double* %49 to <2 x double>*
%51 = load <2 x double>, <2 x double>* %50
%52 = getelementptr inbounds double, double* %11, i64 %44
%53 = bitcast double* %52 to <2 x double>*
%54 = load <2 x double>, <2 x double>* %53
%55 = getelementptr inbounds double, double* %52, i64 2
%56 = bitcast double* %55 to <2 x double>*
%57 = load <2 x double>, <2 x double>* %56
%58 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %36, <2 x double> %48, <2 x double> %54)
%59 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %38, <2 x double> %51, <2 x double> %57)
%60 = bitcast double* %52 to <2 x double>*
store <2 x double> %58, <2 x double>* %60
%61 = bitcast double* %55 to <2 x double>*
store <2 x double> %59, <2 x double>* %61
%62 = or i64 %44, 4
%63 = getelementptr double, double* %28, i64 %62
%64 = bitcast double* %63 to <2 x double>*
%65 = load <2 x double>, <2 x double>* %64
%66 = getelementptr double, double* %63, i64 2
%67 = bitcast double* %66 to <2 x double>*
%68 = load <2 x double>, <2 x double>* %67
%69 = getelementptr inbounds double, double* %11, i64 %62
%70 = bitcast double* %69 to <2 x double>*
%71 = load <2 x double>, <2 x double>* %70
%72 = getelementptr inbounds double, double* %69, i64 2
%73 = bitcast double* %72 to <2 x double>*
%74 = load <2 x double>, <2 x double>* %73
%75 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %36, <2 x double> %65, <2 x double> %71)
%76 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %38, <2 x double> %68, <2 x double> %74)
%77 = bitcast double* %69 to <2 x double>*
store <2 x double> %75, <2 x double>* %77
%78 = bitcast double* %72 to <2 x double>*
store <2 x double> %76, <2 x double>* %78
%79 = add nuw i64 %44, 8
%80 = add i64 %45, 2
%81 = icmp eq i64 %80, %42
br i1 %81, label %82, label %43
82: ; preds = %43, %32
%83 = phi i64 [ 0, %32 ], [ %79, %43 ]
%84 = icmp eq i64 %39, 0
br i1 %84, label %102, label %85
85: ; preds = %82
%86 = getelementptr double, double* %28, i64 %83
%87 = bitcast double* %86 to <2 x double>*
%88 = load <2 x double>, <2 x double>* %87
%89 = getelementptr double, double* %86, i64 2
%90 = bitcast double* %89 to <2 x double>*
%91 = load <2 x double>, <2 x double>* %90
%92 = getelementptr inbounds double, double* %11, i64 %83
%93 = bitcast double* %92 to <2 x double>*
%94 = load <2 x double>, <2 x double>* %93
%95 = getelementptr inbounds double, double* %92, i64 2
%96 = bitcast double* %95 to <2 x double>*
%97 = load <2 x double>, <2 x double>* %96
%98 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %36, <2 x double> %88, <2 x double> %94)
%99 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %38, <2 x double> %91, <2 x double> %97)
%100 = bitcast double* %92 to <2 x double>*
store <2 x double> %98, <2 x double>* %100
%101 = bitcast double* %95 to <2 x double>*
store <2 x double> %99, <2 x double>* %101
br label %102
102: ; preds = %82, %85
%103 = icmp eq i64 %24, %33
br i1 %103, label %107, label %104
104: ; preds = %17, %102
%105 = phi i64 [ 0, %17 ], [ %33, %102 ]
%106 = phi double* [ %28, %17 ], [ %34, %102 ]
br label %115
107: ; preds = %115, %102
%108 = phi double* [ %34, %102 ], [ %118, %115 ]
%109 = load double, double* %108
%110 = fmul double %30, %109
store double %110, double* %108
%111 = add nuw nsw i64 %19, 1
%112 = add nuw nsw i64 %20, 1
%113 = icmp eq i64 %111, %10
%114 = add i64 %18, 1
br i1 %113, label %14, label %17
115: ; preds = %104, %115
%116 = phi i64 [ %123, %115 ], [ %105, %104 ]
%117 = phi double* [ %118, %115 ], [ %106, %104 ]
%118 = getelementptr inbounds double, double* %117, i64 1
%119 = load double, double* %117
%120 = getelementptr inbounds double, double* %11, i64 %116
%121 = load double, double* %120
%122 = call double @llvm.fmuladd.f64(double %30, double %119, double %121)
store double %122, double* %120
%123 = add nuw nsw i64 %116, 1
%124 = icmp eq i64 %123, %20
br i1 %124, label %107, label %115
}