void linspace(double y[131073]) {
  int k;
  y[131072] = 1.0;
  y[0] = 0.0;
  for (k = 0; k < 131071; k++) {
    y[1 + k] = (1.0 + (double)k) * 7.62939453125E-6;
  }
}


x86 assembly (clang, -O0):
<linspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,0x100000(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1ffff,-0xc(%rbp)
jge    1178 <linspace+0x78>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xeb8(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb4(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <linspace+0x2e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<linspace>:
movabs $0x3ff0000000000000,%rax
mov    %rax,0x100000(%rdi)
movq   $0x0,(%rdi)
movdqa 0xee0(%rip),%xmm0
mov    $0x7,%eax
movdqa 0xee2(%rip),%xmm8
movapd 0xeea(%rip),%xmm2
movapd 0xef2(%rip),%xmm3
movdqa 0xefa(%rip),%xmm4
movdqa 0xf02(%rip),%xmm5
movdqa 0xf0a(%rip),%xmm6
cs nopw 0x0(%rax,%rax,1)
movdqa %xmm0,%xmm7
paddd  %xmm8,%xmm7
cvtdq2pd %xmm0,%xmm1
cvtdq2pd %xmm7,%xmm7
addpd  %xmm2,%xmm1
addpd  %xmm2,%xmm7
mulpd  %xmm3,%xmm1
mulpd  %xmm3,%xmm7
movupd %xmm1,-0x30(%rdi,%rax,8)
movupd %xmm7,-0x20(%rdi,%rax,8)
cmp    $0x1ffff,%rax
je     11d2 <linspace+0xd2>
movdqa %xmm0,%xmm1
paddd  %xmm4,%xmm1
movdqa %xmm0,%xmm7
paddd  %xmm5,%xmm7
cvtdq2pd %xmm1,%xmm1
cvtdq2pd %xmm7,%xmm7
addpd  %xmm2,%xmm1
addpd  %xmm2,%xmm7
mulpd  %xmm3,%xmm1
mulpd  %xmm3,%xmm7
movupd %xmm1,-0x10(%rdi,%rax,8)
movupd %xmm7,(%rdi,%rax,8)
paddd  %xmm6,%xmm0
add    $0x8,%rax
jmp    1160 <linspace+0x60>
movabs $0x3fefffd000000000,%rax
ff ef 3f
mov    %rax,0xfffe8(%rdi)
movabs $0x3fefffe000000000,%rax
ff ef 3f
mov    %rax,0xffff0(%rdi)
movabs $0x3feffff000000000,%rax
ff ef 3f
mov    %rax,0xffff8(%rdi)
ret

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

LLVM IR (-O2):
define void @linspace(double* nocapture writeonly %0) {
%2 = getelementptr inbounds double, double* %0, i64 131072
store double 1.000000e+00, double* %2
store double 0.000000e+00, double* %0
br label %3
3: ; preds = %19, %1
%4 = phi i64 [ 0, %1 ], [ %33, %19 ]
%5 = phi <2 x i32> [ <i32 0, i32 1>, %1 ], [ %34, %19 ]
%6 = add <2 x i32> %5, <i32 2, i32 2>
%7 = sitofp <2 x i32> %5 to <2 x double>
%8 = sitofp <2 x i32> %6 to <2 x double>
%9 = fadd <2 x double> %7, <double 1.000000e+00, double 1.000000e+00>
%10 = fadd <2 x double> %8, <double 1.000000e+00, double 1.000000e+00>
%11 = fmul <2 x double> %9, <double 0x3EE0000000000000, double 0x3EE0000000000000>
%12 = fmul <2 x double> %10, <double 0x3EE0000000000000, double 0x3EE0000000000000>
%13 = or i64 %4, 1
%14 = getelementptr inbounds double, double* %0, i64 %13
%15 = bitcast double* %14 to <2 x double>*
store <2 x double> %11, <2 x double>* %15
%16 = getelementptr inbounds double, double* %14, i64 2
%17 = bitcast double* %16 to <2 x double>*
store <2 x double> %12, <2 x double>* %17
%18 = icmp eq i64 %4, 131064
br i1 %18, label %35, label %19
19: ; preds = %3
%20 = add <2 x i32> %5, <i32 4, i32 4>
%21 = add <2 x i32> %5, <i32 6, i32 6>
%22 = sitofp <2 x i32> %20 to <2 x double>
%23 = sitofp <2 x i32> %21 to <2 x double>
%24 = fadd <2 x double> %22, <double 1.000000e+00, double 1.000000e+00>
%25 = fadd <2 x double> %23, <double 1.000000e+00, double 1.000000e+00>
%26 = fmul <2 x double> %24, <double 0x3EE0000000000000, double 0x3EE0000000000000>
%27 = fmul <2 x double> %25, <double 0x3EE0000000000000, double 0x3EE0000000000000>
%28 = or i64 %4, 5
%29 = getelementptr inbounds double, double* %0, i64 %28
%30 = bitcast double* %29 to <2 x double>*
store <2 x double> %26, <2 x double>* %30
%31 = getelementptr inbounds double, double* %29, i64 2
%32 = bitcast double* %31 to <2 x double>*
store <2 x double> %27, <2 x double>* %32
%33 = add nuw nsw i64 %4, 8
%34 = add <2 x i32> %5, <i32 8, i32 8>
br label %3
35: ; preds = %3
%36 = getelementptr inbounds double, double* %0, i64 131069
store double 0x3FEFFFD000000000, double* %36
%37 = getelementptr inbounds double, double* %0, i64 131070
store double 0x3FEFFFE000000000, double* %37
%38 = getelementptr inbounds double, double* %0, i64 131071
store double 0x3FEFFFF000000000, double* %38
ret void
}