#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 *smileDsp_winTri(long);
double *smileDsp_winTrP(long _N) {
  double *w = smileDsp_winTri(_N);
  double *x = w;
  long n;
  for (n = 0; n < _N; n++)
    *x = *x * (*(x++));
  return w;
}


x86 assembly (clang, -O0):
<smileDsp_winTrP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <smileDsp_winTri@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    117b <smileDsp_winTrP+0x6b>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
mulsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1139 <smileDsp_winTrP+0x29>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smileDsp_winTrP>:
push   %rbx
mov    %rdi,%rbx
call   1030 <smileDsp_winTri@plt>
test   %rbx,%rbx
jle    11c3 <smileDsp_winTrP+0xb3>
movsd  (%rax),%xmm0
lea    -0x1(%rbx),%rdx
mov    %ebx,%ecx
and    $0x7,%ecx
cmp    $0x7,%rdx
jae    113a <smileDsp_winTrP+0x2a>
mov    %rax,%rdx
jmp    11a2 <smileDsp_winTrP+0x92>
and    $0xfffffffffffffff8,%rbx
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rdx)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rdx)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rdx)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x20(%rdx)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x28(%rdx)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x30(%rdx)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x38(%rdx)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x40(%rdx)
add    $0x40,%rdx
add    $0xfffffffffffffff8,%rbx
jne    1150 <smileDsp_winTrP+0x40>
test   %rcx,%rcx
je     11c3 <smileDsp_winTrP+0xb3>
xor    %esi,%esi
nopl   0x0(%rax)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rdx,%rsi,8)
add    $0x1,%rsi
cmp    %rsi,%rcx
jne    11b0 <smileDsp_winTrP+0xa0>
pop    %rbx
ret

LLVM IR (-O0):
define double* @smileDsp_winTrP(i64 %0) {
%2 = alloca i64
%3 = alloca double*
%4 = alloca double*
%5 = alloca i64
store i64 %0, i64* %2
%6 = load i64, i64* %2
%7 = call double* @smileDsp_winTri(i64 %6)
store double* %7, double** %3
%8 = load double*, double** %3
store double* %8, double** %4
store i64 0, i64* %5
br label %9
9: ; preds = %21, %1
%10 = load i64, i64* %5
%11 = load i64, i64* %2
%12 = icmp slt i64 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = load double*, double** %4
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i32 1
store double* %17, double** %4
%18 = load double, double* %16
%19 = fmul double %15, %18
%20 = load double*, double** %4
store double %19, double* %20
br label %21
21: ; preds = %13
%22 = load i64, i64* %5
%23 = add nsw i64 %22, 1
store i64 %23, i64* %5
br label %9
24: ; preds = %9
%25 = load double*, double** %3
ret double* %25
}

LLVM IR (-O2):
define double* @smileDsp_winTrP(i64 %0) {
%2 = tail call double* @smileDsp_winTri(i64 %0)
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %45
4: ; preds = %1
%5 = load double, double* %2
%6 = add i64 %0, -1
%7 = and i64 %0, 7
%8 = icmp ult i64 %6, 7
br i1 %8, label %33, label %9
9: ; preds = %4
%10 = and i64 %0, -8
br label %11
11: ; preds = %11, %9
%12 = phi double [ %5, %9 ], [ %30, %11 ]
%13 = phi double* [ %2, %9 ], [ %29, %11 ]
%14 = phi i64 [ 0, %9 ], [ %31, %11 ]
%15 = getelementptr inbounds double, double* %13, i64 1
%16 = fmul double %12, %12
store double %16, double* %15
%17 = getelementptr inbounds double, double* %13, i64 2
%18 = fmul double %16, %16
store double %18, double* %17
%19 = getelementptr inbounds double, double* %13, i64 3
%20 = fmul double %18, %18
store double %20, double* %19
%21 = getelementptr inbounds double, double* %13, i64 4
%22 = fmul double %20, %20
store double %22, double* %21
%23 = getelementptr inbounds double, double* %13, i64 5
%24 = fmul double %22, %22
store double %24, double* %23
%25 = getelementptr inbounds double, double* %13, i64 6
%26 = fmul double %24, %24
store double %26, double* %25
%27 = getelementptr inbounds double, double* %13, i64 7
%28 = fmul double %26, %26
store double %28, double* %27
%29 = getelementptr inbounds double, double* %13, i64 8
%30 = fmul double %28, %28
store double %30, double* %29
%31 = add i64 %14, 8
%32 = icmp eq i64 %31, %10
br i1 %32, label %33, label %11
33: ; preds = %11, %4
%34 = phi double [ %5, %4 ], [ %30, %11 ]
%35 = phi double* [ %2, %4 ], [ %29, %11 ]
%36 = icmp eq i64 %7, 0
br i1 %36, label %45, label %37
37: ; preds = %33, %37
%38 = phi double [ %42, %37 ], [ %34, %33 ]
%39 = phi double* [ %41, %37 ], [ %35, %33 ]
%40 = phi i64 [ %43, %37 ], [ 0, %33 ]
%41 = getelementptr inbounds double, double* %39, i64 1
%42 = fmul double %38, %38
store double %42, double* %41
%43 = add i64 %40, 1
%44 = icmp eq i64 %43, %7
br i1 %44, label %45, label %37
45: ; preds = %33, %37, %1
ret double* %2
}