#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*/ poly_mult(double *, int, double *, int, double *, int);
int /*<<< orphan*/ poly_sum(double *, int, double *, int, double *, int);
void ft_closedloop_series(double c_num[], int Nc_num, double c_den[],
                          int Nc_den, double model_num[], int Nmodel_num,
                          double model_den[], int Nmodel_den, double ans_num[],
                          int Nans_num, double ans_den[], int Nans_den) {
  Nans_num = Nc_num + Nmodel_num - 1;
  Nans_den = Nc_den + Nmodel_den - 1;
  double den_mult[Nans_den];
  poly_mult(c_num, Nc_num, model_num, Nmodel_num, ans_num, Nans_num);
  poly_mult(c_den, Nc_den, model_den, Nmodel_den, den_mult, Nans_den);
  poly_sum(ans_num, Nans_num, den_mult, Nans_den, ans_den, Nans_den);
}


x86 assembly (clang, -O0):
<ft_closedloop_series>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
mov    %edx,%eax
lea    -0x1(%rax,%rcx,1),%eax
mov    %eax,0x28(%rbp)
mov    -0x1c(%rbp),%edx
mov    0x18(%rbp),%eax
mov    %eax,%ecx
mov    %edx,%eax
lea    -0x1(%rax,%rcx,1),%eax
mov    %eax,0x38(%rbp)
mov    0x38(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    0x20(%rbp),%r8
mov    0x28(%rbp),%r9d
call   1040 <poly_mult@plt>
mov    -0x48(%rbp),%r8
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    0x10(%rbp),%rdx
mov    0x18(%rbp),%ecx
mov    0x38(%rbp),%r9d
call   1040 <poly_mult@plt>
mov    -0x48(%rbp),%rdx
mov    0x20(%rbp),%rdi
mov    0x28(%rbp),%esi
mov    0x38(%rbp),%ecx
mov    0x30(%rbp),%r8
mov    0x38(%rbp),%r9d
call   1030 <poly_sum@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_closedloop_series>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r10
mov    %ecx,%r12d
mov    %rdx,%r14
mov    0x20(%rbp),%r8
mov    0x18(%rbp),%eax
lea    (%rsi,%r9,1),%r13d
add    $0xffffffff,%r13d
lea    (%r12,%rax,1),%ebx
add    $0xffffffff,%ebx
lea    0xf(,%rbx,8),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
mov    %r10,%rdx
mov    %r9d,%ecx
mov    %r13d,%r9d
call   1040 <poly_mult@plt>
mov    %r14,%rdi
mov    %r12d,%esi
mov    0x10(%rbp),%rdx
mov    0x18(%rbp),%ecx
mov    %r15,%r8
mov    %ebx,%r9d
call   1040 <poly_mult@plt>
mov    0x20(%rbp),%rdi
mov    %r13d,%esi
mov    %r15,%rdx
mov    %ebx,%ecx
mov    0x30(%rbp),%r8
mov    %ebx,%r9d
call   1030 <poly_sum@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @ft_closedloop_series(double* %0, i32 %1, double* %2, i32 %3, double* %4, i32 %5, double* %6, i32 %7, double* %8, i32 %9, double* %10, i32 %11) {
%13 = alloca double*
%14 = alloca i32
%15 = alloca double*
%16 = alloca i32
%17 = alloca double*
%18 = alloca i32
%19 = alloca double*
%20 = alloca i32
%21 = alloca double*
%22 = alloca i32
%23 = alloca double*
%24 = alloca i32
%25 = alloca i8*
%26 = alloca i64
store double* %0, double** %13
store i32 %1, i32* %14
store double* %2, double** %15
store i32 %3, i32* %16
store double* %4, double** %17
store i32 %5, i32* %18
store double* %6, double** %19
store i32 %7, i32* %20
store double* %8, double** %21
store i32 %9, i32* %22
store double* %10, double** %23
store i32 %11, i32* %24
%27 = load i32, i32* %14
%28 = load i32, i32* %18
%29 = add nsw i32 %27, %28
%30 = sub nsw i32 %29, 1
store i32 %30, i32* %22
%31 = load i32, i32* %16
%32 = load i32, i32* %20
%33 = add nsw i32 %31, %32
%34 = sub nsw i32 %33, 1
store i32 %34, i32* %24
%35 = load i32, i32* %24
%36 = zext i32 %35 to i64
%37 = call i8* @llvm.stacksave()
store i8* %37, i8** %25
%38 = alloca double, i64 %36
store i64 %36, i64* %26
%39 = load double*, double** %13
%40 = load i32, i32* %14
%41 = load double*, double** %17
%42 = load i32, i32* %18
%43 = load double*, double** %21
%44 = load i32, i32* %22
%45 = call i32 @poly_mult(double* %39, i32 %40, double* %41, i32 %42, double* %43, i32 %44)
%46 = load double*, double** %15
%47 = load i32, i32* %16
%48 = load double*, double** %19
%49 = load i32, i32* %20
%50 = load i32, i32* %24
%51 = call i32 @poly_mult(double* %46, i32 %47, double* %48, i32 %49, double* %38, i32 %50)
%52 = load double*, double** %21
%53 = load i32, i32* %22
%54 = load i32, i32* %24
%55 = load double*, double** %23
%56 = load i32, i32* %24
%57 = call i32 @poly_sum(double* %52, i32 %53, double* %38, i32 %54, double* %55, i32 %56)
%58 = load i8*, i8** %25
ret void
}

LLVM IR (-O2):
define void @ft_closedloop_series(double* %0, i32 %1, double* %2, i32 %3, double* %4, i32 %5, double* %6, i32 %7, double* %8, i32 %9, double* %10, i32 %11) {
%13 = add i32 %1, -1
%14 = add i32 %13, %5
%15 = add i32 %3, -1
%16 = add i32 %15, %7
%17 = zext i32 %16 to i64
%18 = alloca double, i64 %17
%19 = tail call i32 @poly_mult(double* %0, i32 %1, double* %4, i32 %5, double* %8, i32 %14)
%20 = call i32 @poly_mult(double* %2, i32 %3, double* %6, i32 %7, double* %18, i32 %16)
%21 = call i32 @poly_sum(double* %8, i32 %14, double* %18, i32 %16, double* %10, i32 %16)
ret void
}