#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 M_PI;
float sinf(int);
__attribute__((cold)) void ff_sine_window_init(float *window, int n) {
  int i;
  for (i = 0; i < n; i++)
    window[i] = sinf((i + 0.5) * (M_PI / (2.0 * n)));
}


x86 assembly (clang, -O0):
<ff_sine_window_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118b <ff_sine_window_init+0x7b>
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    0x2e9e(%rip),%rax
movsd  (%rax),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm3
movsd  0xea5(%rip),%xmm2
mulsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sinf@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ff_sine_window_init+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_sine_window_init>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    10ad <ff_sine_window_init+0x5d>
mov    %rdi,%r14
cvtsi2sd %esi,%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
mov    %esi,%r15d
xor    %ebx,%ebx
mov    0x2f70(%rip),%r12
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
addsd  0xf79(%rip),%xmm0
movsd  (%r12),%xmm1
divsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sinf@plt>
movss  %xmm0,(%r14,%rbx,4)
inc    %rbx
cmp    %rbx,%r15
jne    1078 <ff_sine_window_init+0x28>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
nopl   0x0(%rax)

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @ff_sine_window_init(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %26, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %29
10: ; preds = %6
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to double
%13 = fadd double %12, 5.000000e-01
%14 = load double, double* @M_PI
%15 = load i32, i32* %4
%16 = sitofp i32 %15 to double
%17 = fmul double 2.000000e+00, %16
%18 = fdiv double %14, %17
%19 = fmul double %13, %18
%20 = fptosi double %19 to i32
%21 = call float @sinf(i32 %20)
%22 = load float*, float** %3
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds float, float* %22, i64 %24
store float %21, float* %25
br label %26
26: ; preds = %10
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %6
29: ; preds = %6
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @ff_sine_window_init(float* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = sitofp i32 %1 to double
%6 = fmul double %5, 2.000000e+00
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %19, %8 ]
%10 = trunc i64 %9 to i32
%11 = sitofp i32 %10 to double
%12 = fadd double %11, 5.000000e-01
%13 = load double, double* @M_PI
%14 = fdiv double %13, %6
%15 = fmul double %12, %14
%16 = fptosi double %15 to i32
%17 = tail call float @sinf(i32 %16)
%18 = getelementptr inbounds float, float* %0, i64 %9
store float %17, float* %18
%19 = add nuw nsw i64 %9, 1
%20 = icmp eq i64 %19, %7
br i1 %20, label %21, label %8
21: ; preds = %8, %2
ret void
}