void LLsinHalfTblFloatM(float *dst, unsigned int fftLen) {
  const double twopi_over_n = 6.283185307179586476925286766559 / fftLen;
  for (int i = 0; i < fftLen >> 1; ++i)
    dst[i] = (float)sin(twopi_over_n * i);
}


x86 assembly (clang, -O0):
<LLsinHalfTblFloatM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm1
movsd  0xed1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x1,%ecx
cmp    %ecx,%eax
jae    1182 <LLsinHalfTblFloatM+0x72>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113f <LLsinHalfTblFloatM+0x2f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LLsinHalfTblFloatM>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%esi
jb     11c8 <LLsinHalfTblFloatM+0xb8>
mov    %esi,%r14d
mov    %rdi,%r15
mov    %esi,%eax
cvtsi2sd %rax,%xmm0
movsd  0xeca(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
shr    %r14d
cmp    $0x1,%r14d
jne    1151 <LLsinHalfTblFloatM+0x41>
xor    %ebx,%ebx
test   $0x1,%r14b
jne    11ae <LLsinHalfTblFloatM+0x9e>
jmp    11c8 <LLsinHalfTblFloatM+0xb8>
mov    %r14d,%r12d
and    $0xfffffffe,%r12d
xor    %ebx,%ebx
movsd  %xmm0,(%rsp)
nop
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  (%rsp),%xmm0
call   1030 <sin@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r15,%rbx,4)
lea    0x1(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
call   1030 <sin@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%r15,%rbx,4)
add    $0x2,%rbx
cmp    %r12,%rbx
jne    1160 <LLsinHalfTblFloatM+0x50>
movsd  (%rsp),%xmm0
test   $0x1,%r14b
je     11c8 <LLsinHalfTblFloatM+0xb8>
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r15,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @LLsinHalfTblFloatM(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = uitofp i32 %7 to double
%9 = fdiv double 0x401921FB54442D18, %8
store double %9, double* %5
store i32 0, i32* %6
br label %10
10: ; preds = %26, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = lshr i32 %12, 1
%14 = icmp ult i32 %11, %13
br i1 %14, label %15, label %29
15: ; preds = %10
%16 = load double, double* %5
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to double
%19 = fmul double %16, %18
%20 = call double @sin(double %19)
%21 = fptrunc double %20 to float
%22 = load float*, float** %3
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds float, float* %22, i64 %24
store float %21, float* %25
br label %26
26: ; preds = %15
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %10
29: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @LLsinHalfTblFloatM(float* nocapture writeonly %0, i32 %1) {
%3 = uitofp i32 %1 to double
%4 = fdiv double 0x401921FB54442D18, %3
%5 = icmp ult i32 %1, 2
br i1 %5, label %23, label %6
6: ; preds = %2
%7 = lshr i32 %1, 1
%8 = zext i32 %7 to i64
%9 = and i64 %8, 1
%10 = icmp eq i32 %7, 1
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = and i64 %8, 2147483646
br label %24
13: ; preds = %24, %6
%14 = phi i64 [ 0, %6 ], [ %40, %24 ]
%15 = icmp eq i64 %9, 0
br i1 %15, label %23, label %16
16: ; preds = %13
%17 = trunc i64 %14 to i32
%18 = sitofp i32 %17 to double
%19 = fmul double %4, %18
%20 = tail call double @sin(double %19)
%21 = fptrunc double %20 to float
%22 = getelementptr inbounds float, float* %0, i64 %14
store float %21, float* %22
br label %23
23: ; preds = %16, %13, %2
ret void
24: ; preds = %24, %11
%25 = phi i64 [ 0, %11 ], [ %40, %24 ]
%26 = phi i64 [ 0, %11 ], [ %41, %24 ]
%27 = trunc i64 %25 to i32
%28 = sitofp i32 %27 to double
%29 = fmul double %4, %28
%30 = tail call double @sin(double %29)
%31 = fptrunc double %30 to float
%32 = getelementptr inbounds float, float* %0, i64 %25
store float %31, float* %32
%33 = or i64 %25, 1
%34 = trunc i64 %33 to i32
%35 = sitofp i32 %34 to double
%36 = fmul double %4, %35
%37 = tail call double @sin(double %36)
%38 = fptrunc double %37 to float
%39 = getelementptr inbounds float, float* %0, i64 %33
store float %38, float* %39
%40 = add nuw nsw i64 %25, 2
%41 = add i64 %26, 2
%42 = icmp eq i64 %41, %12
br i1 %42, label %13, label %24
}