#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_winRec(long _N) {
  int i;
  double *ret = (double *)malloc(sizeof(double) * _N);
  double *x = ret;
  for (i = 0; i < _N; i++) {
    *x = 1.0;
    x++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<smileDsp_winRec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1176 <smileDsp_winRec+0x66>
mov    -0x20(%rbp),%rax
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <smileDsp_winRec+0x2e>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smileDsp_winRec>:
push   %rbx
mov    %rdi,%rbx
lea    0x0(,%rdi,8),%edi
call   1030 <malloc@plt>
test   %rbx,%rbx
jle    123d <smileDsp_winRec+0x12d>
cmp    $0x4,%rbx
jae    1139 <smileDsp_winRec+0x29>
xor    %ecx,%ecx
mov    %rax,%rdx
jmp    121b <smileDsp_winRec+0x10b>
mov    %rbx,%rcx
and    $0xfffffffffffffffc,%rcx
lea    -0x4(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x1c,%rdi
jae    1161 <smileDsp_winRec+0x51>
xor    %edi,%edi
jmp    11e1 <smileDsp_winRec+0xd1>
and    $0xfffffffffffffff8,%rsi
xor    %edi,%edi
movaps 0xe92(%rip),%xmm0
xchg   %ax,%ax
movups %xmm0,(%rax,%rdi,8)
movups %xmm0,0x10(%rax,%rdi,8)
movups %xmm0,0x20(%rax,%rdi,8)
movups %xmm0,0x30(%rax,%rdi,8)
movups %xmm0,0x40(%rax,%rdi,8)
movups %xmm0,0x50(%rax,%rdi,8)
movups %xmm0,0x60(%rax,%rdi,8)
movups %xmm0,0x70(%rax,%rdi,8)
movups %xmm0,0x80(%rax,%rdi,8)
movups %xmm0,0x90(%rax,%rdi,8)
movups %xmm0,0xa0(%rax,%rdi,8)
movups %xmm0,0xb0(%rax,%rdi,8)
movups %xmm0,0xc0(%rax,%rdi,8)
movups %xmm0,0xd0(%rax,%rdi,8)
movups %xmm0,0xe0(%rax,%rdi,8)
movups %xmm0,0xf0(%rax,%rdi,8)
add    $0x20,%rdi
add    $0xfffffffffffffff8,%rsi
jne    1170 <smileDsp_winRec+0x60>
test   %rdx,%rdx
je     1212 <smileDsp_winRec+0x102>
lea    (%rax,%rdi,8),%rsi
add    $0x10,%rsi
shl    $0x5,%rdx
xor    %edi,%edi
movaps 0xe05(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movups %xmm0,-0x10(%rsi,%rdi,1)
movups %xmm0,(%rsi,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%rdx
jne    1200 <smileDsp_winRec+0xf0>
cmp    %rbx,%rcx
je     123d <smileDsp_winRec+0x12d>
lea    (%rax,%rcx,8),%rdx
sub    %rcx,%rbx
xor    %ecx,%ecx
movabs $0x3ff0000000000000,%rsi
nopw   0x0(%rax,%rax,1)
mov    %rsi,(%rdx,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rbx
jne    1230 <smileDsp_winRec+0x120>
pop    %rbx
ret

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

LLVM IR (-O2):
define double* @smileDsp_winRec(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 = icmp sgt i64 %0, 0
br i1 %6, label %7, label %88
7: ; preds = %1
%8 = icmp ult i64 %0, 4
br i1 %8, label %79, label %9
9: ; preds = %7
%10 = and i64 %0, -4
%11 = getelementptr double, double* %5, i64 %10
%12 = add i64 %10, -4
%13 = lshr exact i64 %12, 2
%14 = add nuw nsw i64 %13, 1
%15 = and i64 %14, 7
%16 = icmp ult i64 %12, 28
br i1 %16, label %64, label %17
17: ; preds = %9
%18 = and i64 %14, 9223372036854775800
br label %19
19: ; preds = %19, %17
%20 = phi i64 [ 0, %17 ], [ %61, %19 ]
%21 = phi i64 [ 0, %17 ], [ %62, %19 ]
%22 = getelementptr double, double* %5, i64 %20
%23 = bitcast double* %22 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %23
%24 = getelementptr double, double* %22, i64 2
%25 = bitcast double* %24 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %25
%26 = or i64 %20, 4
%27 = getelementptr double, double* %5, i64 %26
%28 = bitcast double* %27 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %28
%29 = getelementptr double, double* %27, i64 2
%30 = bitcast double* %29 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %30
%31 = or i64 %20, 8
%32 = getelementptr double, double* %5, i64 %31
%33 = bitcast double* %32 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %33
%34 = getelementptr double, double* %32, i64 2
%35 = bitcast double* %34 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %35
%36 = or i64 %20, 12
%37 = getelementptr double, double* %5, i64 %36
%38 = bitcast double* %37 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %38
%39 = getelementptr double, double* %37, i64 2
%40 = bitcast double* %39 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %40
%41 = or i64 %20, 16
%42 = getelementptr double, double* %5, i64 %41
%43 = bitcast double* %42 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %43
%44 = getelementptr double, double* %42, i64 2
%45 = bitcast double* %44 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %45
%46 = or i64 %20, 20
%47 = getelementptr double, double* %5, i64 %46
%48 = bitcast double* %47 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %48
%49 = getelementptr double, double* %47, i64 2
%50 = bitcast double* %49 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %50
%51 = or i64 %20, 24
%52 = getelementptr double, double* %5, i64 %51
%53 = bitcast double* %52 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %53
%54 = getelementptr double, double* %52, i64 2
%55 = bitcast double* %54 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %55
%56 = or i64 %20, 28
%57 = getelementptr double, double* %5, i64 %56
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %58
%59 = getelementptr double, double* %57, i64 2
%60 = bitcast double* %59 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %60
%61 = add nuw i64 %20, 32
%62 = add i64 %21, 8
%63 = icmp eq i64 %62, %18
br i1 %63, label %64, label %19
64: ; preds = %19, %9
%65 = phi i64 [ 0, %9 ], [ %61, %19 ]
%66 = icmp eq i64 %15, 0
br i1 %66, label %77, label %67
67: ; preds = %64, %67
%68 = phi i64 [ %74, %67 ], [ %65, %64 ]
%69 = phi i64 [ %75, %67 ], [ 0, %64 ]
%70 = getelementptr double, double* %5, i64 %68
%71 = bitcast double* %70 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %71
%72 = getelementptr double, double* %70, i64 2
%73 = bitcast double* %72 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %73
%74 = add nuw i64 %68, 4
%75 = add i64 %69, 1
%76 = icmp eq i64 %75, %15
br i1 %76, label %77, label %67
77: ; preds = %67, %64
%78 = icmp eq i64 %10, %0
br i1 %78, label %88, label %79
79: ; preds = %7, %77
%80 = phi i64 [ 0, %7 ], [ %10, %77 ]
%81 = phi double* [ %5, %7 ], [ %11, %77 ]
br label %82
82: ; preds = %79, %82
%83 = phi i64 [ %86, %82 ], [ %80, %79 ]
%84 = phi double* [ %85, %82 ], [ %81, %79 ]
store double 1.000000e+00, double* %84
%85 = getelementptr inbounds double, double* %84, i64 1
%86 = add nuw nsw i64 %83, 1
%87 = icmp eq i64 %86, %0
br i1 %87, label %88, label %82
88: ; preds = %82, %77, %1
ret double* %5
}