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


x86 assembly (clang, -O0):
<Central_TO_NonCentral>:
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)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x2,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     124c <Central_TO_NonCentral+0x12c>
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    11f7 <Central_TO_NonCentral+0xd7>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1030 <CombNumber@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%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    117d <Central_TO_NonCentral+0x5d>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1030 <CombNumber@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%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    1155 <Central_TO_NonCentral+0x35>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Central_TO_NonCentral>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r12
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdx)
mov    %rsi,0x10(%rsp)
movq   $0x0,(%rsi)
cmp    $0x2,%edi
jl     1207 <Central_TO_NonCentral+0xe7>
mov    %edi,%r15d
add    $0x1,%r15d
mov    0x10(%rsp),%rax
lea    0x8(%rax),%r14
mov    $0x2,%r13d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movq   $0x0,-0x8(%r12,%r13,8)
mov    %r14,%rbp
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %r13d,%edi
mov    %ebx,%esi
call   1030 <CombNumber@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%r12),%xmm0
mov    %ebx,%edi
call   1040 <pow@plt>
mulsd  0x8(%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 <Central_TO_NonCentral+0x60>
mov    %r13d,%edi
mov    %r13d,%esi
call   1030 <CombNumber@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%r12),%xmm0
mov    %r13d,%edi
call   1040 <pow@plt>
mulsd  0x8(%rsp),%xmm0
addsd  -0x8(%r12,%r13,8),%xmm0
movsd  %xmm0,-0x8(%r12,%r13,8)
add    $0x1,%r13
add    $0x8,%r14
cmp    %r15,%r13
jne    1170 <Central_TO_NonCentral+0x50>
movsd  (%r12),%xmm0
mov    0x10(%rsp),%rax
movsd  %xmm0,(%rax)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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