#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_feedback(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_den + Nmodel_num - 1;
  Nans_den = Nc_den + Nmodel_den - 1;
  int Nnum_mult = Nc_num + Nmodel_num - 1;
  double den_mult[Nans_den];
  double num_mult[Nnum_mult];
  poly_mult(c_num, Nc_num, model_num, Nmodel_num, num_mult, Nnum_mult);
  poly_mult(c_den, Nc_den, model_den, Nmodel_den, den_mult, Nans_den);
  poly_sum(num_mult, Nnum_mult, den_mult, Nans_den, ans_den, Nans_den);
  poly_mult(c_den, Nc_den, model_num, Nmodel_num, ans_num, Nans_num);
}


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

x86 assembly (clang, -O2):
<ft_closedloop_feedback>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,-0x48(%rbp)
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    0x18(%rbp),%edx
lea    -0x1(%r14,%r9,1),%eax
mov    %eax,-0x2c(%rbp)
lea    (%r14,%rdx,1),%r12d
add    $0xffffffff,%r12d
lea    0xf(,%r12,8),%rax
and    $0xfffffffffffffff0,%rax
lea    (%r9,%rsi,1),%edx
add    $0xffffffff,%edx
mov    %r9,%rcx
mov    %r9,-0x40(%rbp)
mov    %rsp,%r13
sub    %rax,%r13
mov    %r13,%rsp
lea    0xf(,%rdx,8),%rax
mov    %rdx,%r9
mov    %rdx,-0x38(%rbp)
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
mov    %r8,%rdx
mov    %r15,%r8
call   1040 <poly_mult@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    0x10(%rbp),%rdx
mov    0x18(%rbp),%ecx
mov    %r13,%r8
mov    %r12d,%r9d
call   1040 <poly_mult@plt>
mov    %r15,%rdi
mov    -0x38(%rbp),%rsi
mov    %r13,%rdx
mov    %r12d,%ecx
mov    0x30(%rbp),%r8
mov    %r12d,%r9d
call   1030 <poly_sum@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    -0x48(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    0x20(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1040 <poly_mult@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_feedback(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 i32
%26 = alloca i8*
%27 = alloca i64
%28 = 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
%29 = load i32, i32* %16
%30 = load i32, i32* %18
%31 = add nsw i32 %29, %30
%32 = sub nsw i32 %31, 1
store i32 %32, i32* %22
%33 = load i32, i32* %16
%34 = load i32, i32* %20
%35 = add nsw i32 %33, %34
%36 = sub nsw i32 %35, 1
store i32 %36, i32* %24
%37 = load i32, i32* %14
%38 = load i32, i32* %18
%39 = add nsw i32 %37, %38
%40 = sub nsw i32 %39, 1
store i32 %40, i32* %25
%41 = load i32, i32* %24
%42 = zext i32 %41 to i64
%43 = call i8* @llvm.stacksave()
store i8* %43, i8** %26
%44 = alloca double, i64 %42
store i64 %42, i64* %27
%45 = load i32, i32* %25
%46 = zext i32 %45 to i64
%47 = alloca double, i64 %46
store i64 %46, i64* %28
%48 = load double*, double** %13
%49 = load i32, i32* %14
%50 = load double*, double** %17
%51 = load i32, i32* %18
%52 = load i32, i32* %25
%53 = call i32 @poly_mult(double* %48, i32 %49, double* %50, i32 %51, double* %47, i32 %52)
%54 = load double*, double** %15
%55 = load i32, i32* %16
%56 = load double*, double** %19
%57 = load i32, i32* %20
%58 = load i32, i32* %24
%59 = call i32 @poly_mult(double* %54, i32 %55, double* %56, i32 %57, double* %44, i32 %58)
%60 = load i32, i32* %25
%61 = load i32, i32* %24
%62 = load double*, double** %23
%63 = load i32, i32* %24
%64 = call i32 @poly_sum(double* %47, i32 %60, double* %44, i32 %61, double* %62, i32 %63)
%65 = load double*, double** %15
%66 = load i32, i32* %16
%67 = load double*, double** %17
%68 = load i32, i32* %18
%69 = load double*, double** %21
%70 = load i32, i32* %22
%71 = call i32 @poly_mult(double* %65, i32 %66, double* %67, i32 %68, double* %69, i32 %70)
%72 = load i8*, i8** %26
ret void
}

LLVM IR (-O2):
define void @ft_closedloop_feedback(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 %3, -1
%14 = add i32 %13, %5
%15 = add i32 %13, %7
%16 = add i32 %5, -1
%17 = add i32 %16, %1
%18 = zext i32 %15 to i64
%19 = alloca double, i64 %18
%20 = zext i32 %17 to i64
%21 = alloca double, i64 %20
%22 = call i32 @poly_mult(double* %0, i32 %1, double* %4, i32 %5, double* %21, i32 %17)
%23 = call i32 @poly_mult(double* %2, i32 %3, double* %6, i32 %7, double* %19, i32 %15)
%24 = call i32 @poly_sum(double* %21, i32 %17, double* %19, i32 %15, double* %10, i32 %15)
%25 = call i32 @poly_mult(double* %2, i32 %3, double* %4, i32 %5, double* %8, i32 %14)
ret void
}