#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 */
scalar_t__ malloc(int);
double smileDsp_lcSinc(double);
double *smileDsp_winLac(long _N) {
  double i;
  double *ret = (double *)malloc(sizeof(double) * _N);
  double *x = ret;
  double NN = (double)_N;
  for (i = 0.0; i < NN; i += 1.0) {
    *x = smileDsp_lcSinc((2.0 * i) / (NN - 1.0) - 1.0);
    x++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<smileDsp_winLac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11cc <smileDsp_winLac+0xac>
movsd  0xe92(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xe78(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xe68(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <smileDsp_lcSinc@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
movsd  0xe43(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    115a <smileDsp_winLac+0x3a>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smileDsp_winLac>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0x0(,%rdi,8),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
jle    11bd <smileDsp_winLac+0x9d>
cvtsi2sd %rbx,%xmm0
movsd  0xeb5(%rip),%xmm1
movsd  %xmm0,0x10(%rsp)
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xorpd  %xmm0,%xmm0
mov    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
addsd  %xmm0,%xmm0
divsd  0x8(%rsp),%xmm0
addsd  0xe74(%rip),%xmm0
call   1030 <smileDsp_lcSinc@plt>
movsd  %xmm0,(%rbx)
add    $0x8,%rbx
movsd  (%rsp),%xmm0
addsd  0xe62(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
ucomisd (%rsp),%xmm0
movsd  (%rsp),%xmm0
ja     1170 <smileDsp_winLac+0x50>
mov    %r14,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double* @smileDsp_winLac(i64 %0) {
%2 = alloca i64
%3 = alloca double
%4 = alloca double*
%5 = alloca double*
%6 = alloca double
store i64 %0, i64* %2
%7 = load i64, i64* %2
%8 = mul i64 8, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to double*
store double* %11, double** %4
%12 = load double*, double** %4
store double* %12, double** %5
%13 = load i64, i64* %2
%14 = sitofp i64 %13 to double
store double %14, double* %6
store double 0.000000e+00, double* %3
br label %15
15: ; preds = %30, %1
%16 = load double, double* %3
%17 = load double, double* %6
%18 = fcmp olt double %16, %17
br i1 %18, label %19, label %33
19: ; preds = %15
%20 = load double, double* %3
%21 = fmul double 2.000000e+00, %20
%22 = load double, double* %6
%23 = fsub double %22, 1.000000e+00
%24 = fdiv double %21, %23
%25 = fsub double %24, 1.000000e+00
%26 = call double @smileDsp_lcSinc(double %25)
%27 = load double*, double** %5
store double %26, double* %27
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i32 1
store double* %29, double** %5
br label %30
30: ; preds = %19
%31 = load double, double* %3
%32 = fadd double %31, 1.000000e+00
store double %32, double* %3
br label %15
33: ; preds = %15
%34 = load double*, double** %4
ret double* %34
}

LLVM IR (-O2):
define double* @smileDsp_winLac(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl i32 %2, 3
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to double*
%6 = sitofp i64 %0 to double
%7 = icmp sgt i64 %0, 0
br i1 %7, label %8, label %20
8: ; preds = %1
%9 = fadd double %6, -1.000000e+00
br label %10
10: ; preds = %8, %10
%11 = phi double [ 0.000000e+00, %8 ], [ %18, %10 ]
%12 = phi double* [ %5, %8 ], [ %17, %10 ]
%13 = fmul double %11, 2.000000e+00
%14 = fdiv double %13, %9
%15 = fadd double %14, -1.000000e+00
%16 = tail call double @smileDsp_lcSinc(double %15)
store double %16, double* %12
%17 = getelementptr inbounds double, double* %12, i64 1
%18 = fadd double %11, 1.000000e+00
%19 = fcmp olt double %18, %6
br i1 %19, label %10, label %20
20: ; preds = %10, %1
ret double* %5
}