#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 CombNumber(int, int);
double pow(double const, int);
void NonCentral_TO_Central(int const nmb_mom, double const nc_mom[],
                           double c_mom[]) {
  int j, k;
  c_mom[0] = nc_mom[0];
  for (k = 2; k <= nmb_mom; k++) {
    c_mom[k - 1] = 0;
    for (j = 0; j < k; j++)
      c_mom[k - 1] += CombNumber(k, j) * pow(-nc_mom[0], j) * nc_mom[k - 1 - j];
    c_mom[k - 1] += CombNumber(k, j) * pow(-nc_mom[0], j);
  }
  return;
}


x86 assembly (clang, -O0):
<NonCentral_TO_Central>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x2,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     126f <NonCentral_TO_Central+0x14f>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1203 <NonCentral_TO_Central+0xe3>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1030 <CombNumber@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x1c(%rbp),%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
sub    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1172 <NonCentral_TO_Central+0x52>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1030 <CombNumber@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x1c(%rbp),%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    114a <NonCentral_TO_Central+0x2a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NonCentral_TO_Central>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdx)
mov    %rdi,0x8(%rsp)
cmp    $0x2,%edi
jl     1217 <NonCentral_TO_Central+0xf7>
mov    %rdx,%r12
mov    %rsi,%r14
mov    0x8(%rsp),%rax
add    $0x1,%eax
mov    %rax,0x8(%rsp)
lea    0x8(%rsi),%r15
mov    $0x2,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movq   $0x0,-0x8(%r12,%r13,8)
mov    %r15,%rbp
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %r13d,%edi
mov    %ebx,%esi
call   1030 <CombNumber@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%r14),%xmm0
xorpd  0xe63(%rip),%xmm0
mov    %ebx,%edi
call   1040 <pow@plt>
mulsd  0x10(%rsp),%xmm0
mulsd  0x0(%rbp),%xmm0
addsd  -0x8(%r12,%r13,8),%xmm0
movsd  %xmm0,-0x8(%r12,%r13,8)
add    $0x1,%rbx
add    $0xfffffffffffffff8,%rbp
cmp    %rbx,%r13
jne    1180 <NonCentral_TO_Central+0x60>
mov    %r13d,%edi
mov    %r13d,%esi
call   1030 <CombNumber@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%r14),%xmm0
xorpd  0xe18(%rip),%xmm0
mov    %r13d,%edi
call   1040 <pow@plt>
mulsd  0x10(%rsp),%xmm0
addsd  -0x8(%r12,%r13,8),%xmm0
movsd  %xmm0,-0x8(%r12,%r13,8)
add    $0x1,%r13
add    $0x8,%r15
cmp    0x8(%rsp),%r13
jne    1170 <NonCentral_TO_Central+0x50>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @NonCentral_TO_Central(i32 %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
store double %4, double* %2
%5 = icmp slt i32 %0, 2
br i1 %5, label %39, label %6
6: ; preds = %3
%7 = add nuw i32 %0, 1
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %6, %29
%10 = phi i64 [ 2, %6 ], [ %37, %29 ]
%11 = add nsw i64 %10, -1
%12 = getelementptr inbounds double, double* %2, i64 %11
store double 0.000000e+00, double* %12
%13 = trunc i64 %10 to i32
br label %14
14: ; preds = %9, %14
%15 = phi i64 [ 0, %9 ], [ %27, %14 ]
%16 = trunc i64 %15 to i32
%17 = tail call double @CombNumber(i32 %13, i32 %16)
%18 = load double, double* %1
%19 = fneg double %18
%20 = tail call double @pow(double %19, i32 %16)
%21 = fmul double %17, %20
%22 = sub nsw i64 %11, %15
%23 = getelementptr inbounds double, double* %1, i64 %22
%24 = load double, double* %23
%25 = load double, double* %12
%26 = tail call double @llvm.fmuladd.f64(double %21, double %24, double %25)
store double %26, double* %12
%27 = add nuw nsw i64 %15, 1
%28 = icmp eq i64 %27, %10
br i1 %28, label %29, label %14
29: ; preds = %14
%30 = trunc i64 %10 to i32
%31 = tail call double @CombNumber(i32 %30, i32 %30)
%32 = load double, double* %1
%33 = fneg double %32
%34 = tail call double @pow(double %33, i32 %30)
%35 = load double, double* %12
%36 = tail call double @llvm.fmuladd.f64(double %31, double %34, double %35)
store double %36, double* %12
%37 = add nuw nsw i64 %10, 1
%38 = icmp eq i64 %37, %8
br i1 %38, label %39, label %9
39: ; preds = %29, %3
ret void
}