#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 */
long double pow_d(long double, unsigned long);
long double px_simplificada(long double *degrees, unsigned long size,
                            long double x) {
  long double y;
  long double objects;
  unsigned long i;
  if (!x)
    return degrees[0];
  else {
    y = 0;
    i = 0;
    unsigned long _iobjects = 0;
    for (objects = degrees[_iobjects]; _iobjects++ < size;
         objects = degrees[_iobjects]) {
      if (objects)
        y += objects * pow_d(x, i);
      i++;
    }
  }
  return y;
}


x86 assembly (clang, -O0):
<px_simplificada>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
fldt   0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1153 <px_simplificada+0x43>
jp     1153 <px_simplificada+0x43>
jmp    1145 <px_simplificada+0x35>
mov    -0x18(%rbp),%rax
fldt   (%rax)
fstpt  -0x10(%rbp)
jmp    1203 <px_simplificada+0xf3>
fldz
fstpt  -0x40(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x60(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
fstpt  -0x50(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x60(%rbp)
cmp    -0x20(%rbp),%rax
jae    11f8 <px_simplificada+0xe8>
fldt   -0x50(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    11af <px_simplificada+0x9f>
jp     11af <px_simplificada+0x9f>
jmp    11d5 <px_simplificada+0xc5>
fldt   -0x50(%rbp)
fstpt  -0x6c(%rbp)
fldt   -0x30(%rbp)
mov    -0x58(%rbp),%rdi
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <pow_d@plt>
fldt   -0x6c(%rbp)
fldt   -0x40(%rbp)
fxch   %st(1)
fmulp  %st,%st(2)
faddp  %st,%st(1)
fstpt  -0x40(%rbp)
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x60(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
fstpt  -0x50(%rbp)
jmp    117a <px_simplificada+0x6a>
jmp    11fd <px_simplificada+0xed>
fldt   -0x40(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<px_simplificada>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%r15
fldt   0x60(%rsp)
fldz
fld    %st(1)
fstpt  0x10(%rsp)
fxch   %st(1)
fucomip %st(1),%st
jne    1130 <px_simplificada+0x20>
jnp    1197 <px_simplificada+0x87>
mov    %rsi,%r14
test   %rsi,%rsi
je     119c <px_simplificada+0x8c>
fstp   %st(0)
fldz
xor    %ebx,%ebx
fld    %st(0)
fstpt  0x1c(%rsp)
jmp    1182 <px_simplificada+0x72>
cs nopw 0x0(%rax,%rax,1)
fldt   0x10(%rsp)
fstpt  (%rsp)
mov    %rbx,%rdi
fxch   %st(1)
fstpt  0x34(%rsp)
fstpt  0x28(%rsp)
call   1030 <pow_d@plt>
fldt   0x34(%rsp)
fldt   0x28(%rsp)
fmulp  %st,%st(2)
faddp  %st,%st(1)
add    $0x1,%rbx
add    $0x10,%r15
cmp    %rbx,%r14
je     119c <px_simplificada+0x8c>
fldt   (%r15)
fldt   0x1c(%rsp)
fxch   %st(1)
fucomi %st(1),%st
fstp   %st(1)
jne    1150 <px_simplificada+0x40>
jp     1150 <px_simplificada+0x40>
fstp   %st(0)
jmp    1175 <px_simplificada+0x65>
fstp   %st(0)
fldt   (%r15)
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define x86_fp80 @px_simplificada(x86_fp80* %0, i64 %1, x86_fp80 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80*
%6 = alloca i64
%7 = alloca x86_fp80
%8 = alloca x86_fp80
%9 = alloca x86_fp80
%10 = alloca i64
%11 = alloca i64
store x86_fp80* %0, x86_fp80** %5
store i64 %1, i64* %6
store x86_fp80 %2, x86_fp80* %7
%12 = load x86_fp80, x86_fp80* %7
%13 = fcmp une x86_fp80 %12, 0xK00000000000000000000
br i1 %13, label %18, label %14
14: ; preds = %3
%15 = load x86_fp80*, x86_fp80** %5
%16 = getelementptr inbounds x86_fp80, x86_fp80* %15, i64 0
%17 = load x86_fp80, x86_fp80* %16
store x86_fp80 %17, x86_fp80* %4
br label %49
18: ; preds = %3
store x86_fp80 0xK00000000000000000000, x86_fp80* %8
store i64 0, i64* %10
store i64 0, i64* %11
%19 = load x86_fp80*, x86_fp80** %5
%20 = load i64, i64* %11
%21 = getelementptr inbounds x86_fp80, x86_fp80* %19, i64 %20
%22 = load x86_fp80, x86_fp80* %21
store x86_fp80 %22, x86_fp80* %9
br label %23
23: ; preds = %41, %18
%24 = load i64, i64* %11
%25 = add i64 %24, 1
store i64 %25, i64* %11
%26 = load i64, i64* %6
%27 = icmp ult i64 %24, %26
br i1 %27, label %28, label %46
28: ; preds = %23
%29 = load x86_fp80, x86_fp80* %9
%30 = fcmp une x86_fp80 %29, 0xK00000000000000000000
br i1 %30, label %31, label %38
31: ; preds = %28
%32 = load x86_fp80, x86_fp80* %9
%33 = load x86_fp80, x86_fp80* %7
%34 = load i64, i64* %10
%35 = call x86_fp80 @pow_d(x86_fp80 %33, i64 %34)
%36 = load x86_fp80, x86_fp80* %8
%37 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %32, x86_fp80 %35, x86_fp80 %36)
store x86_fp80 %37, x86_fp80* %8
br label %38
38: ; preds = %31, %28
%39 = load i64, i64* %10
%40 = add i64 %39, 1
store i64 %40, i64* %10
br label %41
41: ; preds = %38
%42 = load x86_fp80*, x86_fp80** %5
%43 = load i64, i64* %11
%44 = getelementptr inbounds x86_fp80, x86_fp80* %42, i64 %43
%45 = load x86_fp80, x86_fp80* %44
store x86_fp80 %45, x86_fp80* %9
br label %23
46: ; preds = %23
br label %47
47: ; preds = %46
%48 = load x86_fp80, x86_fp80* %8
store x86_fp80 %48, x86_fp80* %4
br label %49
49: ; preds = %47, %14
%50 = load x86_fp80, x86_fp80* %4
ret x86_fp80 %50
}

LLVM IR (-O2):
define x86_fp80 @px_simplificada(x86_fp80* nocapture %0, i64 %1, x86_fp80 %2) {
%4 = fcmp une x86_fp80 %2, 0xK00000000000000000000
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = icmp eq i64 %1, 0
br i1 %6, label %25, label %9
7: ; preds = %3
%8 = load x86_fp80, x86_fp80* %0
br label %25
9: ; preds = %5, %19
%10 = phi i64 [ %23, %19 ], [ 1, %5 ]
%11 = phi x86_fp80* [ %22, %19 ], [ %0, %5 ]
%12 = phi i64 [ %21, %19 ], [ 0, %5 ]
%13 = phi x86_fp80 [ %20, %19 ], [ 0xK00000000000000000000, %5 ]
%14 = load x86_fp80, x86_fp80* %11
%15 = fcmp une x86_fp80 %14, 0xK00000000000000000000
br i1 %15, label %16, label %19
16: ; preds = %9
%17 = tail call x86_fp80 @pow_d(x86_fp80 %2, i64 %12)
%18 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %14, x86_fp80 %17, x86_fp80 %13)
br label %19
19: ; preds = %16, %9
%20 = phi x86_fp80 [ %18, %16 ], [ %13, %9 ]
%21 = add nuw i64 %12, 1
%22 = getelementptr inbounds x86_fp80, x86_fp80* %0, i64 %10
%23 = add i64 %10, 1
%24 = icmp eq i64 %21, %1
br i1 %24, label %25, label %9
25: ; preds = %19, %5, %7
%26 = phi x86_fp80 [ %8, %7 ], [ 0xK00000000000000000000, %5 ], [ %20, %19 ]
ret x86_fp80 %26
}