#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 cos(double);
double sin(double);
void stepfm(double *result_real, double *result_imag, double f1, double f2,
            int n, int num_bins) {
  int i;
  double f;
  double increment = (double)(f2 - f1) / (num_bins - 1);
  double bin_size = (double)n / (double)num_bins;
  double sum = 0.0;
  double wind[3] = {0, 0, 0};
  double smoothed_freq;
  if (result_imag == NULL) {
    for (i = 0; i < num_bins * bin_size; i++) {
      f = f1 + (int)(i / bin_size) * increment;
      if (i < 3) {
        smoothed_freq = f;
        sum += f;
        wind[i] = f;
      } else {
        sum += f - wind[i % 3];
        smoothed_freq = sum / 3;
        wind[i % 3] = f;
      }
      result_real[i] =
          cos(2.0 * 3.14159265358979323846 * smoothed_freq * (double)i);
    }
    for (; i < n; i++) {
      result_real[i] =
          cos(2.0 * 3.14159265358979323846 * smoothed_freq * (double)i);
    }
  } else {
    for (i = 0; i < num_bins * bin_size; i++) {
      f = f1 + (int)(i / bin_size) * increment;
      if (i < 3) {
        smoothed_freq = f;
        sum += f;
        wind[i] = f;
      } else {
        sum += f - wind[i % 3];
        smoothed_freq = sum / 3;
        wind[i % 3] = f;
      }
      result_real[i] =
          cos(2.0 * 3.14159265358979323846 * smoothed_freq * (double)i);
      result_imag[i] =
          sin(2.0 * 3.14159265358979323846 * smoothed_freq * (double)i);
    }
    for (; i < n; i++) {
      result_real[i] =
          cos(2.0 * 3.14159265358979323846 * smoothed_freq * (double)i);
      result_imag[i] =
          sin(2.0 * 3.14159265358979323846 * smoothed_freq * (double)i);
    }
  }
}


x86 assembly (clang, -O0):
<stepfm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    %ecx,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1030 <memset@plt>
cmpq   $0x0,-0x10(%rbp)
jne    12fa <stepfm+0x1ca>
movl   $0x0,-0x2c(%rbp)
cvtsi2sdl -0x2c(%rbp),%xmm1
cvtsi2sdl -0x28(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    12ae <stepfm+0x17e>
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x2c(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jge    1226 <stepfm+0xf6>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movslq -0x2c(%rbp),%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
jmp    1278 <stepfm+0x148>
movsd  -0x38(%rbp),%xmm0
mov    -0x2c(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
subsd  -0x70(%rbp,%rax,8),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xdb2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x2c(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
movsd  0xd80(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11ad <stepfm+0x7d>
jmp    12b3 <stepfm+0x183>
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12f5 <stepfm+0x1c5>
movsd  0xd39(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12b3 <stepfm+0x183>
jmp    149e <stepfm+0x36e>
movl   $0x0,-0x2c(%rbp)
cvtsi2sdl -0x2c(%rbp),%xmm1
cvtsi2sdl -0x28(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    142a <stepfm+0x2fa>
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x2c(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jge    137a <stepfm+0x24a>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movslq -0x2c(%rbp),%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
jmp    13cc <stepfm+0x29c>
movsd  -0x38(%rbp),%xmm0
mov    -0x2c(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
subsd  -0x70(%rbp,%rax,8),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xc5e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x2c(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
movsd  0xc2c(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xc04(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1301 <stepfm+0x1d1>
jmp    142f <stepfm+0x2ff>
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1499 <stepfm+0x369>
movsd  0xbbd(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xb95(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    142f <stepfm+0x2ff>
jmp    149e <stepfm+0x36e>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stepfm>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %edx,%r14d
movapd %xmm0,%xmm3
mov    %rdi,%r12
lea    -0x1(%rcx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
subsd  %xmm3,%xmm1
divsd  %xmm0,%xmm1
cvtsi2sd %edx,%xmm4
cvtsi2sd %ecx,%xmm5
divsd  %xmm5,%xmm4
xorpd  %xmm0,%xmm0
movapd %xmm0,0x50(%rsp)
movq   $0x0,0x60(%rsp)
mulsd  %xmm4,%xmm5
test   %rsi,%rsi
movsd  %xmm5,0x8(%rsp)
je     13f8 <stepfm+0x2d8>
mov    %rsi,%r15
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm5
jbe    160d <stepfm+0x4ed>
xorpd  %xmm0,%xmm0
divsd  %xmm4,%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm5
mulsd  %xmm1,%xmm5
addsd  %xmm3,%xmm5
movsd  %xmm5,0x50(%rsp)
movsd  0xe4a(%rip),%xmm0
movapd %xmm5,0x10(%rsp)
mulsd  %xmm5,%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  %xmm1,0x38(%rsp)
movsd  %xmm3,0x30(%rsp)
movsd  %xmm4,0x28(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,(%r12)
movsd  0x40(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,(%r15)
mov    $0x1,%ebp
movsd  0x8(%rsp),%xmm0
ucomisd 0xdfe(%rip),%xmm0
jbe    13ed <stepfm+0x2cd>
movsd  0xdf0(%rip),%xmm0
divsd  0x28(%rsp),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm1
mulsd  0x38(%rsp),%xmm1
addsd  0x30(%rsp),%xmm1
movsd  %xmm1,0x58(%rsp)
movsd  0xdc0(%rip),%xmm0
movapd %xmm1,0x70(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x40(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x8(%r12)
movsd  0x40(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%r15)
mov    $0x2,%ebp
movsd  0x8(%rsp),%xmm0
ucomisd 0xd90(%rip),%xmm0
jbe    17eb <stepfm+0x6cb>
movsd  0xd82(%rip),%xmm0
divsd  0x28(%rsp),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm1
mulsd  0x38(%rsp),%xmm1
addsd  0x30(%rsp),%xmm1
movsd  %xmm1,0x60(%rsp)
movsd  0xd4a(%rip),%xmm0
movapd %xmm1,0x40(%rsp)
mulsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x80(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x10(%r12)
movsd  0x80(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x10(%r15)
mov    $0x3,%ebp
movsd  0x8(%rsp),%xmm0
ucomisd 0xd18(%rip),%xmm0
jbe    1807 <stepfm+0x6e7>
movapd 0x10(%rsp),%xmm1
addsd  0xd0c(%rip),%xmm1
addsd  0x70(%rsp),%xmm1
addsd  0x40(%rsp),%xmm1
movsd  0xcf0(%rip),%xmm0
mov    $0x3,%ebp
mov    $0x4,%ebx
mov    $0xaaaaaaab,%r13d
movapd %xmm1,%xmm3
nopl   0x0(%rax)
movapd %xmm0,%xmm1
divsd  0x28(%rsp),%xmm1
cvttpd2dq %xmm1,%xmm1
mov    %ebp,%eax
cvtdq2pd %xmm1,%xmm1
imul   %r13,%rax
shr    $0x21,%rax
mulsd  0x38(%rsp),%xmm1
addsd  0x30(%rsp),%xmm1
lea    (%rax,%rax,2),%eax
mov    %ebp,%ecx
sub    %eax,%ecx
movapd %xmm1,%xmm2
subsd  0x50(%rsp,%rcx,8),%xmm2
addsd  %xmm2,%xmm3
movsd  %xmm3,0x40(%rsp)
divsd  0xc8d(%rip),%xmm3
movapd %xmm3,0x10(%rsp)
mulsd  0xc67(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x70(%rsp)
movsd  %xmm1,0x50(%rsp,%rcx,8)
movapd %xmm3,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,(%r12,%rbp,8)
movsd  0x70(%rsp),%xmm0
call   1030 <sin@plt>
movsd  0x40(%rsp),%xmm3
movsd  %xmm0,(%r15,%rbp,8)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
add    $0x1,%rbp
add    $0x1,%ebx
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     1340 <stepfm+0x220>
movapd 0x10(%rsp),%xmm1
jmp    160f <stepfm+0x4ef>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm5
jbe    16f5 <stepfm+0x5d5>
xorpd  %xmm0,%xmm0
divsd  %xmm4,%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm5
mulsd  %xmm1,%xmm5
addsd  %xmm3,%xmm5
movsd  %xmm5,0x50(%rsp)
movsd  0xbd4(%rip),%xmm0
movapd %xmm5,0x10(%rsp)
mulsd  %xmm5,%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm1,0x38(%rsp)
movsd  %xmm3,0x30(%rsp)
movsd  %xmm4,0x28(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,(%r12)
mov    $0x1,%r13d
movsd  0x8(%rsp),%xmm0
ucomisd 0xb9d(%rip),%xmm0
jbe    16f8 <stepfm+0x5d8>
movsd  0xb8f(%rip),%xmm0
divsd  0x28(%rsp),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm1
mulsd  0x38(%rsp),%xmm1
addsd  0x30(%rsp),%xmm1
movsd  %xmm1,0x58(%rsp)
movsd  0xb5f(%rip),%xmm0
movapd %xmm1,0x40(%rsp)
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x8(%r12)
mov    $0x2,%r13d
movsd  0x8(%rsp),%xmm0
ucomisd 0xb45(%rip),%xmm0
jbe    17f6 <stepfm+0x6d6>
movsd  0xb37(%rip),%xmm0
divsd  0x28(%rsp),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm1
mulsd  0x38(%rsp),%xmm1
addsd  0x30(%rsp),%xmm1
movapd %xmm1,0x70(%rsp)
movsd  %xmm1,0x60(%rsp)
movsd  0xaf9(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
call   1040 <cos@plt>
movapd 0x70(%rsp),%xmm1
movsd  %xmm0,0x10(%r12)
mov    $0x3,%r13d
movsd  0x8(%rsp),%xmm0
ucomisd 0xae3(%rip),%xmm0
jbe    1812 <stepfm+0x6f2>
xorpd  %xmm0,%xmm0
movapd 0x10(%rsp),%xmm2
addsd  %xmm0,%xmm2
addsd  0x40(%rsp),%xmm2
addsd  %xmm1,%xmm2
lea    0x18(%r12),%rbx
movsd  0xab8(%rip),%xmm1
mov    $0x3,%r13d
mov    $0xaaaaaaab,%r15d
movapd %xmm2,%xmm3
mov    %r13d,%eax
imul   %r15,%rax
mov    %r13d,%ecx
movapd %xmm1,%xmm0
shr    $0x21,%rax
divsd  0x28(%rsp),%xmm0
cvttpd2dq %xmm0,%xmm0
lea    (%rax,%rax,2),%eax
cvtdq2pd %xmm0,%xmm2
mulsd  0x38(%rsp),%xmm2
sub    %eax,%ecx
addsd  0x30(%rsp),%xmm2
movapd %xmm2,%xmm0
subsd  0x50(%rsp,%rcx,8),%xmm0
addsd  %xmm0,%xmm3
movsd  %xmm3,0x40(%rsp)
movapd %xmm3,%xmm0
divsd  0xa57(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
mulsd  0xa31(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm2,0x50(%rsp,%rcx,8)
call   1040 <cos@plt>
movsd  0x40(%rsp),%xmm3
add    $0x1,%r13d
xorps  %xmm1,%xmm1
cvtsi2sd %r13d,%xmm1
movsd  %xmm0,(%rbx)
add    $0x8,%rbx
movsd  0x8(%rsp),%xmm0
ucomisd %xmm1,%xmm0
ja     1570 <stepfm+0x450>
jmp    16f8 <stepfm+0x5d8>
xor    %ebp,%ebp
cmp    %r14d,%ebp
jge    17d9 <stepfm+0x6b9>
mulsd  0x9e0(%rip),%xmm1
mov    %ebp,%ebx
mov    %r14d,%eax
sub    %ebp,%eax
mov    %ebp,%r13d
not    %r13d
test   $0x1,%al
movapd %xmm1,0x10(%rsp)
je     166e <stepfm+0x54e>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,(%r12,%rbx,8)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0x10(%rsp),%xmm1
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
add    %r14d,%r13d
je     17d9 <stepfm+0x6b9>
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,(%r12,%rbx,8)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,(%r15,%rbx,8)
lea    0x1(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x8(%r12,%rbx,8)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0x10(%rsp),%xmm1
movsd  %xmm0,0x8(%r15,%rbx,8)
add    $0x2,%rbx
cmp    %r14d,%ebx
jl     1680 <stepfm+0x560>
jmp    17d9 <stepfm+0x6b9>
xor    %r13d,%r13d
cmp    %r14d,%r13d
movapd 0x10(%rsp),%xmm0
jge    17d9 <stepfm+0x6b9>
mulsd  0x8f1(%rip),%xmm0
mov    %r13d,%ebx
mov    %r14d,%ebp
sub    %r13d,%ebp
not    %r13d
add    %r14d,%r13d
and    $0x3,%ebp
movapd %xmm0,0x10(%rsp)
movapd %xmm0,%xmm1
je     1755 <stepfm+0x635>
nopl   (%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
movapd 0x10(%rsp),%xmm1
movsd  %xmm0,(%r12,%rbx,8)
add    $0x1,%rbx
add    $0xffffffff,%ebp
jne    1730 <stepfm+0x610>
cmp    $0x3,%r13d
jb     17d9 <stepfm+0x6b9>
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,(%r12,%rbx,8)
lea    0x1(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x8(%r12,%rbx,8)
lea    0x2(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x10(%r12,%rbx,8)
lea    0x3(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
movapd 0x10(%rsp),%xmm1
movsd  %xmm0,0x18(%r12,%rbx,8)
add    $0x4,%rbx
cmp    %r14d,%ebx
jl     1760 <stepfm+0x640>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movapd 0x70(%rsp),%xmm1
jmp    160f <stepfm+0x4ef>
movapd 0x40(%rsp),%xmm0
movapd %xmm0,0x10(%rsp)
jmp    16f8 <stepfm+0x5d8>
movapd 0x40(%rsp),%xmm1
jmp    160f <stepfm+0x4ef>
movapd %xmm1,0x10(%rsp)
jmp    16f8 <stepfm+0x5d8>

LLVM IR (-O0):
define void @stepfm(double* %0, double* %1, double %2, double %3, i32 %4, i32 %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca [3 x double]
%19 = alloca double
store double* %0, double** %7
store double* %1, double** %8
store double %2, double* %9
store double %3, double* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%20 = load double, double* %10
%21 = load double, double* %9
%22 = fsub double %20, %21
%23 = load i32, i32* %12
%24 = sub nsw i32 %23, 1
%25 = sitofp i32 %24 to double
%26 = fdiv double %22, %25
store double %26, double* %15
%27 = load i32, i32* %11
%28 = sitofp i32 %27 to double
%29 = load i32, i32* %12
%30 = sitofp i32 %29 to double
%31 = fdiv double %28, %30
store double %31, double* %16
store double 0.000000e+00, double* %17
%32 = bitcast [3 x double]* %18 to i8*
%33 = load double*, double** %8
%34 = icmp eq double* %33, null
br i1 %34, label %35, label %116
35: ; preds = %6
store i32 0, i32* %13
br label %36
36: ; preds = %93, %35
%37 = load i32, i32* %13
%38 = sitofp i32 %37 to double
%39 = load i32, i32* %12
%40 = sitofp i32 %39 to double
%41 = load double, double* %16
%42 = fmul double %40, %41
%43 = fcmp olt double %38, %42
br i1 %43, label %44, label %96
44: ; preds = %36
%45 = load double, double* %9
%46 = load i32, i32* %13
%47 = sitofp i32 %46 to double
%48 = load double, double* %16
%49 = fdiv double %47, %48
%50 = fptosi double %49 to i32
%51 = sitofp i32 %50 to double
%52 = load double, double* %15
%53 = call double @llvm.fmuladd.f64(double %51, double %52, double %45)
store double %53, double* %14
%54 = load i32, i32* %13
%55 = icmp slt i32 %54, 3
br i1 %55, label %56, label %65
56: ; preds = %44
%57 = load double, double* %14
store double %57, double* %19
%58 = load double, double* %14
%59 = load double, double* %17
%60 = fadd double %59, %58
store double %60, double* %17
%61 = load double, double* %14
%62 = load i32, i32* %13
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 %63
store double %61, double* %64
br label %82
65: ; preds = %44
%66 = load double, double* %14
%67 = load i32, i32* %13
%68 = srem i32 %67, 3
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 %69
%71 = load double, double* %70
%72 = fsub double %66, %71
%73 = load double, double* %17
%74 = fadd double %73, %72
store double %74, double* %17
%75 = load double, double* %17
%76 = fdiv double %75, 3.000000e+00
store double %76, double* %19
%77 = load double, double* %14
%78 = load i32, i32* %13
%79 = srem i32 %78, 3
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 %80
store double %77, double* %81
br label %82
82: ; preds = %65, %56
%83 = load double, double* %19
%84 = fmul double 0x401921FB54442D18, %83
%85 = load i32, i32* %13
%86 = sitofp i32 %85 to double
%87 = fmul double %84, %86
%88 = call double @cos(double %87)
%89 = load double*, double** %7
%90 = load i32, i32* %13
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %89, i64 %91
store double %88, double* %92
br label %93
93: ; preds = %82
%94 = load i32, i32* %13
%95 = add nsw i32 %94, 1
store i32 %95, i32* %13
br label %36
96: ; preds = %36
br label %97
97: ; preds = %112, %96
%98 = load i32, i32* %13
%99 = load i32, i32* %11
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %115
101: ; preds = %97
%102 = load double, double* %19
%103 = fmul double 0x401921FB54442D18, %102
%104 = load i32, i32* %13
%105 = sitofp i32 %104 to double
%106 = fmul double %103, %105
%107 = call double @cos(double %106)
%108 = load double*, double** %7
%109 = load i32, i32* %13
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %108, i64 %110
store double %107, double* %111
br label %112
112: ; preds = %101
%113 = load i32, i32* %13
%114 = add nsw i32 %113, 1
store i32 %114, i32* %13
br label %97
115: ; preds = %97
br label %217
116: ; preds = %6
store i32 0, i32* %13
br label %117
117: ; preds = %184, %116
%118 = load i32, i32* %13
%119 = sitofp i32 %118 to double
%120 = load i32, i32* %12
%121 = sitofp i32 %120 to double
%122 = load double, double* %16
%123 = fmul double %121, %122
%124 = fcmp olt double %119, %123
br i1 %124, label %125, label %187
125: ; preds = %117
%126 = load double, double* %9
%127 = load i32, i32* %13
%128 = sitofp i32 %127 to double
%129 = load double, double* %16
%130 = fdiv double %128, %129
%131 = fptosi double %130 to i32
%132 = sitofp i32 %131 to double
%133 = load double, double* %15
%134 = call double @llvm.fmuladd.f64(double %132, double %133, double %126)
store double %134, double* %14
%135 = load i32, i32* %13
%136 = icmp slt i32 %135, 3
br i1 %136, label %137, label %146
137: ; preds = %125
%138 = load double, double* %14
store double %138, double* %19
%139 = load double, double* %14
%140 = load double, double* %17
%141 = fadd double %140, %139
store double %141, double* %17
%142 = load double, double* %14
%143 = load i32, i32* %13
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 %144
store double %142, double* %145
br label %163
146: ; preds = %125
%147 = load double, double* %14
%148 = load i32, i32* %13
%149 = srem i32 %148, 3
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 %150
%152 = load double, double* %151
%153 = fsub double %147, %152
%154 = load double, double* %17
%155 = fadd double %154, %153
store double %155, double* %17
%156 = load double, double* %17
%157 = fdiv double %156, 3.000000e+00
store double %157, double* %19
%158 = load double, double* %14
%159 = load i32, i32* %13
%160 = srem i32 %159, 3
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 %161
store double %158, double* %162
br label %163
163: ; preds = %146, %137
%164 = load double, double* %19
%165 = fmul double 0x401921FB54442D18, %164
%166 = load i32, i32* %13
%167 = sitofp i32 %166 to double
%168 = fmul double %165, %167
%169 = call double @cos(double %168)
%170 = load double*, double** %7
%171 = load i32, i32* %13
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds double, double* %170, i64 %172
store double %169, double* %173
%174 = load double, double* %19
%175 = fmul double 0x401921FB54442D18, %174
%176 = load i32, i32* %13
%177 = sitofp i32 %176 to double
%178 = fmul double %175, %177
%179 = call double @sin(double %178)
%180 = load double*, double** %8
%181 = load i32, i32* %13
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds double, double* %180, i64 %182
store double %179, double* %183
br label %184
184: ; preds = %163
%185 = load i32, i32* %13
%186 = add nsw i32 %185, 1
store i32 %186, i32* %13
br label %117
187: ; preds = %117
br label %188
188: ; preds = %213, %187
%189 = load i32, i32* %13
%190 = load i32, i32* %11
%191 = icmp slt i32 %189, %190
br i1 %191, label %192, label %216
192: ; preds = %188
%193 = load double, double* %19
%194 = fmul double 0x401921FB54442D18, %193
%195 = load i32, i32* %13
%196 = sitofp i32 %195 to double
%197 = fmul double %194, %196
%198 = call double @cos(double %197)
%199 = load double*, double** %7
%200 = load i32, i32* %13
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %199, i64 %201
store double %198, double* %202
%203 = load double, double* %19
%204 = fmul double 0x401921FB54442D18, %203
%205 = load i32, i32* %13
%206 = sitofp i32 %205 to double
%207 = fmul double %204, %206
%208 = call double @sin(double %207)
%209 = load double*, double** %8
%210 = load i32, i32* %13
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds double, double* %209, i64 %211
store double %208, double* %212
br label %213
213: ; preds = %192
%214 = load i32, i32* %13
%215 = add nsw i32 %214, 1
store i32 %215, i32* %13
br label %188
216: ; preds = %188
br label %217
217: ; preds = %216, %115
ret void
}

LLVM IR (-O2):
define void @stepfm(double* nocapture writeonly %0, double* writeonly %1, double %2, double %3, i32 %4, i32 %5) {
%7 = alloca [3 x double]
%8 = fsub double %3, %2
%9 = add nsw i32 %5, -1
%10 = sitofp i32 %9 to double
%11 = fdiv double %8, %10
%12 = sitofp i32 %4 to double
%13 = sitofp i32 %5 to double
%14 = fdiv double %12, %13
%15 = bitcast [3 x double]* %7 to i8*
%16 = icmp eq double* %1, null
%17 = fmul double %14, %13
%18 = fcmp ogt double %17, 0.000000e+00
br i1 %16, label %59, label %19
19: ; preds = %6
br i1 %18, label %20, label %177
20: ; preds = %19
%21 = fdiv double 0.000000e+00, %14
%22 = fptosi double %21 to i32
%23 = sitofp i32 %22 to double
%24 = tail call double @llvm.fmuladd.f64(double %23, double %11, double %2)
%25 = fadd double %24, 0.000000e+00
%26 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
store double %24, double* %26
%27 = fmul double %24, 0x401921FB54442D18
%28 = fmul double %27, 0.000000e+00
%29 = tail call double @cos(double %28)
store double %29, double* %0
%30 = tail call double @sin(double %28)
store double %30, double* %1
%31 = fcmp ogt double %17, 1.000000e+00
br i1 %31, label %32, label %177
32: ; preds = %20
%33 = fdiv double 1.000000e+00, %14
%34 = fptosi double %33 to i32
%35 = sitofp i32 %34 to double
%36 = tail call double @llvm.fmuladd.f64(double %35, double %11, double %2)
%37 = fadd double %25, %36
%38 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
store double %36, double* %38
%39 = fmul double %36, 0x401921FB54442D18
%40 = tail call double @cos(double %39)
%41 = getelementptr inbounds double, double* %0, i64 1
store double %40, double* %41
%42 = tail call double @sin(double %39)
%43 = getelementptr inbounds double, double* %1, i64 1
store double %42, double* %43
%44 = fcmp ogt double %17, 2.000000e+00
br i1 %44, label %45, label %177
45: ; preds = %32
%46 = fdiv double 2.000000e+00, %14
%47 = fptosi double %46 to i32
%48 = sitofp i32 %47 to double
%49 = tail call double @llvm.fmuladd.f64(double %48, double %11, double %2)
%50 = fadd double %37, %49
%51 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
store double %49, double* %51
%52 = fmul double %49, 0x401921FB54442D18
%53 = fmul double %52, 2.000000e+00
%54 = tail call double @cos(double %53)
%55 = getelementptr inbounds double, double* %0, i64 2
store double %54, double* %55
%56 = tail call double @sin(double %53)
%57 = getelementptr inbounds double, double* %1, i64 2
store double %56, double* %57
%58 = fcmp ogt double %17, 3.000000e+00
br i1 %58, label %200, label %177
59: ; preds = %6
br i1 %18, label %60, label %97
60: ; preds = %59
%61 = fdiv double 0.000000e+00, %14
%62 = fptosi double %61 to i32
%63 = sitofp i32 %62 to double
%64 = tail call double @llvm.fmuladd.f64(double %63, double %11, double %2)
%65 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
store double %64, double* %65
%66 = fmul double %64, 0x401921FB54442D18
%67 = fmul double %66, 0.000000e+00
%68 = tail call double @cos(double %67)
store double %68, double* %0
%69 = fcmp ogt double %17, 1.000000e+00
br i1 %69, label %70, label %97
70: ; preds = %60
%71 = fdiv double 1.000000e+00, %14
%72 = fptosi double %71 to i32
%73 = sitofp i32 %72 to double
%74 = tail call double @llvm.fmuladd.f64(double %73, double %11, double %2)
%75 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
store double %74, double* %75
%76 = fmul double %74, 0x401921FB54442D18
%77 = tail call double @cos(double %76)
%78 = getelementptr inbounds double, double* %0, i64 1
store double %77, double* %78
%79 = fcmp ogt double %17, 2.000000e+00
br i1 %79, label %80, label %97
80: ; preds = %70
%81 = fdiv double 2.000000e+00, %14
%82 = fptosi double %81 to i32
%83 = sitofp i32 %82 to double
%84 = tail call double @llvm.fmuladd.f64(double %83, double %11, double %2)
%85 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
store double %84, double* %85
%86 = fmul double %84, 0x401921FB54442D18
%87 = fmul double %86, 2.000000e+00
%88 = tail call double @cos(double %87)
%89 = getelementptr inbounds double, double* %0, i64 2
store double %88, double* %89
%90 = fcmp ogt double %17, 3.000000e+00
br i1 %90, label %91, label %97
91: ; preds = %80
%92 = fadd double %64, 0.000000e+00
%93 = fadd double %92, %74
%94 = fadd double %93, %84
br label %123
95: ; preds = %123
%96 = trunc i64 %143 to i32
br label %97
97: ; preds = %60, %70, %80, %95, %59
%98 = phi i32 [ 0, %59 ], [ 1, %60 ], [ 2, %70 ], [ 3, %80 ], [ %96, %95 ]
%99 = phi double [ undef, %59 ], [ %64, %60 ], [ %74, %70 ], [ %84, %80 ], [ %138, %95 ]
%100 = icmp slt i32 %98, %4
br i1 %100, label %101, label %246
101: ; preds = %97
%102 = fmul double %99, 0x401921FB54442D18
%103 = zext i32 %98 to i64
%104 = sub i32 %4, %98
%105 = xor i32 %98, -1
%106 = add i32 %105, %4
%107 = and i32 %104, 3
%108 = icmp eq i32 %107, 0
br i1 %108, label %120, label %109
109: ; preds = %101, %109
%110 = phi i64 [ %117, %109 ], [ %103, %101 ]
%111 = phi i32 [ %118, %109 ], [ 0, %101 ]
%112 = trunc i64 %110 to i32
%113 = sitofp i32 %112 to double
%114 = fmul double %102, %113
%115 = tail call double @cos(double %114)
%116 = getelementptr inbounds double, double* %0, i64 %110
store double %115, double* %116
%117 = add nuw nsw i64 %110, 1
%118 = add i32 %111, 1
%119 = icmp eq i32 %118, %107
br i1 %119, label %120, label %109
120: ; preds = %109, %101
%121 = phi i64 [ %103, %101 ], [ %117, %109 ]
%122 = icmp ult i32 %106, 3
br i1 %122, label %246, label %147
123: ; preds = %91, %123
%124 = phi i64 [ %143, %123 ], [ 3, %91 ]
%125 = phi double [ %145, %123 ], [ 3.000000e+00, %91 ]
%126 = phi double [ %137, %123 ], [ %94, %91 ]
%127 = fdiv double %125, %14
%128 = fptosi double %127 to i32
%129 = sitofp i32 %128 to double
%130 = tail call double @llvm.fmuladd.f64(double %129, double %11, double %2)
%131 = trunc i64 %124 to i32
%132 = urem i32 %131, 3
%133 = zext i32 %132 to i64
%134 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 %133
%135 = load double, double* %134
%136 = fsub double %130, %135
%137 = fadd double %126, %136
%138 = fdiv double %137, 3.000000e+00
store double %130, double* %134
%139 = fmul double %138, 0x401921FB54442D18
%140 = fmul double %125, %139
%141 = tail call double @cos(double %140)
%142 = getelementptr inbounds double, double* %0, i64 %124
store double %141, double* %142
%143 = add nuw i64 %124, 1
%144 = trunc i64 %143 to i32
%145 = sitofp i32 %144 to double
%146 = fcmp ogt double %17, %145
br i1 %146, label %123, label %95
147: ; preds = %120, %147
%148 = phi i64 [ %172, %147 ], [ %121, %120 ]
%149 = trunc i64 %148 to i32
%150 = sitofp i32 %149 to double
%151 = fmul double %102, %150
%152 = tail call double @cos(double %151)
%153 = getelementptr inbounds double, double* %0, i64 %148
store double %152, double* %153
%154 = add nuw nsw i64 %148, 1
%155 = trunc i64 %154 to i32
%156 = sitofp i32 %155 to double
%157 = fmul double %102, %156
%158 = tail call double @cos(double %157)
%159 = getelementptr inbounds double, double* %0, i64 %154
store double %158, double* %159
%160 = add nuw nsw i64 %148, 2
%161 = trunc i64 %160 to i32
%162 = sitofp i32 %161 to double
%163 = fmul double %102, %162
%164 = tail call double @cos(double %163)
%165 = getelementptr inbounds double, double* %0, i64 %160
store double %164, double* %165
%166 = add nuw nsw i64 %148, 3
%167 = trunc i64 %166 to i32
%168 = sitofp i32 %167 to double
%169 = fmul double %102, %168
%170 = tail call double @cos(double %169)
%171 = getelementptr inbounds double, double* %0, i64 %166
store double %170, double* %171
%172 = add nuw nsw i64 %148, 4
%173 = trunc i64 %172 to i32
%174 = icmp slt i32 %173, %4
br i1 %174, label %147, label %246
175: ; preds = %200
%176 = trunc i64 %222 to i32
br label %177
177: ; preds = %20, %32, %45, %175, %19
%178 = phi i32 [ 0, %19 ], [ 1, %20 ], [ 2, %32 ], [ 3, %45 ], [ %176, %175 ]
%179 = phi double [ undef, %19 ], [ %24, %20 ], [ %36, %32 ], [ %49, %45 ], [ %215, %175 ]
%180 = icmp slt i32 %178, %4
br i1 %180, label %181, label %246
181: ; preds = %177
%182 = fmul double %179, 0x401921FB54442D18
%183 = zext i32 %178 to i64
%184 = sub i32 %4, %178
%185 = xor i32 %178, -1
%186 = and i32 %184, 1
%187 = icmp eq i32 %186, 0
br i1 %187, label %196, label %188
188: ; preds = %181
%189 = sitofp i32 %178 to double
%190 = fmul double %182, %189
%191 = tail call double @cos(double %190)
%192 = getelementptr inbounds double, double* %0, i64 %183
store double %191, double* %192
%193 = tail call double @sin(double %190)
%194 = getelementptr inbounds double, double* %1, i64 %183
store double %193, double* %194
%195 = add nuw nsw i64 %183, 1
br label %196
196: ; preds = %188, %181
%197 = phi i64 [ %183, %181 ], [ %195, %188 ]
%198 = sub i32 0, %4
%199 = icmp eq i32 %185, %198
br i1 %199, label %246, label %226
200: ; preds = %45, %200
%201 = phi i64 [ %222, %200 ], [ 3, %45 ]
%202 = phi double [ %224, %200 ], [ 3.000000e+00, %45 ]
%203 = phi double [ %214, %200 ], [ %50, %45 ]
%204 = fdiv double %202, %14
%205 = fptosi double %204 to i32
%206 = sitofp i32 %205 to double
%207 = tail call double @llvm.fmuladd.f64(double %206, double %11, double %2)
%208 = trunc i64 %201 to i32
%209 = urem i32 %208, 3
%210 = zext i32 %209 to i64
%211 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 %210
%212 = load double, double* %211
%213 = fsub double %207, %212
%214 = fadd double %203, %213
%215 = fdiv double %214, 3.000000e+00
store double %207, double* %211
%216 = fmul double %215, 0x401921FB54442D18
%217 = fmul double %202, %216
%218 = tail call double @cos(double %217)
%219 = getelementptr inbounds double, double* %0, i64 %201
store double %218, double* %219
%220 = tail call double @sin(double %217)
%221 = getelementptr inbounds double, double* %1, i64 %201
store double %220, double* %221
%222 = add nuw i64 %201, 1
%223 = trunc i64 %222 to i32
%224 = sitofp i32 %223 to double
%225 = fcmp ogt double %17, %224
br i1 %225, label %200, label %175
226: ; preds = %196, %226
%227 = phi i64 [ %243, %226 ], [ %197, %196 ]
%228 = trunc i64 %227 to i32
%229 = sitofp i32 %228 to double
%230 = fmul double %182, %229
%231 = tail call double @cos(double %230)
%232 = getelementptr inbounds double, double* %0, i64 %227
store double %231, double* %232
%233 = tail call double @sin(double %230)
%234 = getelementptr inbounds double, double* %1, i64 %227
store double %233, double* %234
%235 = add nuw nsw i64 %227, 1
%236 = trunc i64 %235 to i32
%237 = sitofp i32 %236 to double
%238 = fmul double %182, %237
%239 = tail call double @cos(double %238)
%240 = getelementptr inbounds double, double* %0, i64 %235
store double %239, double* %240
%241 = tail call double @sin(double %238)
%242 = getelementptr inbounds double, double* %1, i64 %235
store double %241, double* %242
%243 = add nuw nsw i64 %227, 2
%244 = trunc i64 %243 to i32
%245 = icmp slt i32 %244, %4
br i1 %245, label %226, label %246
246: ; preds = %196, %226, %120, %147, %177, %97
ret void
}