#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 SetLP(float samplerate, float cutoff, double *a, double *b) {
  double w0, Q, alpha;
  w0 = 2 * 3.141592653589 * cutoff / samplerate;
  Q = 1.0;
  alpha = sin(w0) / (2.00 * Q);
  *b = (1.00 - cos(w0)) / 2.00;
  *(b + 1) = 1.00 - cos(w0);
  *(b + 2) = (1.00 - cos(w0)) / 2.00;
  *a = 1.00 + alpha;
  *(a + 1) = -2.00 * cos(w0);
  *(a + 2) = 1.00 - alpha;
}


x86 assembly (clang, -O0):
<SetLP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xecd(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movsd  0xe90(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe5d(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xe61(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe30(%rip),%xmm0
subsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe0e(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xe12(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  0xded(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xdd3(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  0xdb6(%rip),%xmm0
subsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetLP>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
cvtss2sd %xmm1,%xmm1
mulsd  0xec7(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1030 <sin@plt>
mulsd  0xeb0(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0xe9f(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe8b(%rip),%xmm1
movsd  %xmm1,(%rbx)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0xe7c(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rbx)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0xe60(%rip),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe48(%rip),%xmm1
movsd  %xmm1,0x10(%rbx)
movsd  0x10(%rsp),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%r14)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0xe31(%rip),%xmm0
movsd  %xmm0,0x8(%r14)
movsd  0xe1b(%rip),%xmm0
subsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @SetLP(float %0, float %1, double* %2, double* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
store float %0, float* %5
store float %1, float* %6
store double* %2, double** %7
store double* %3, double** %8
%12 = load float, float* %6
%13 = fpext float %12 to double
%14 = fmul double 0x401921FB5444261E, %13
%15 = load float, float* %5
%16 = fpext float %15 to double
%17 = fdiv double %14, %16
store double %17, double* %9
store double 1.000000e+00, double* %10
%18 = load double, double* %9
%19 = call double @sin(double %18)
%20 = load double, double* %10
%21 = fmul double 2.000000e+00, %20
%22 = fdiv double %19, %21
store double %22, double* %11
%23 = load double, double* %9
%24 = call double @cos(double %23)
%25 = fsub double 1.000000e+00, %24
%26 = fdiv double %25, 2.000000e+00
%27 = load double*, double** %8
store double %26, double* %27
%28 = load double, double* %9
%29 = call double @cos(double %28)
%30 = fsub double 1.000000e+00, %29
%31 = load double*, double** %8
%32 = getelementptr inbounds double, double* %31, i64 1
store double %30, double* %32
%33 = load double, double* %9
%34 = call double @cos(double %33)
%35 = fsub double 1.000000e+00, %34
%36 = fdiv double %35, 2.000000e+00
%37 = load double*, double** %8
%38 = getelementptr inbounds double, double* %37, i64 2
store double %36, double* %38
%39 = load double, double* %11
%40 = fadd double 1.000000e+00, %39
%41 = load double*, double** %7
store double %40, double* %41
%42 = load double, double* %9
%43 = call double @cos(double %42)
%44 = fmul double -2.000000e+00, %43
%45 = load double*, double** %7
%46 = getelementptr inbounds double, double* %45, i64 1
store double %44, double* %46
%47 = load double, double* %11
%48 = fsub double 1.000000e+00, %47
%49 = load double*, double** %7
%50 = getelementptr inbounds double, double* %49, i64 2
store double %48, double* %50
ret void
}

LLVM IR (-O2):
define void @SetLP(float %0, float %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = fpext float %1 to double
%6 = fmul double %5, 0x401921FB5444261E
%7 = fpext float %0 to double
%8 = fdiv double %6, %7
%9 = tail call double @sin(double %8)
%10 = fmul double %9, 5.000000e-01
%11 = tail call double @cos(double %8)
%12 = fsub double 1.000000e+00, %11
%13 = fmul double %12, 5.000000e-01
store double %13, double* %3
%14 = tail call double @cos(double %8)
%15 = fsub double 1.000000e+00, %14
%16 = getelementptr inbounds double, double* %3, i64 1
store double %15, double* %16
%17 = tail call double @cos(double %8)
%18 = fsub double 1.000000e+00, %17
%19 = fmul double %18, 5.000000e-01
%20 = getelementptr inbounds double, double* %3, i64 2
store double %19, double* %20
%21 = fadd double %10, 1.000000e+00
store double %21, double* %2
%22 = tail call double @cos(double %8)
%23 = fmul double %22, -2.000000e+00
%24 = getelementptr inbounds double, double* %2, i64 1
store double %23, double* %24
%25 = fsub double 1.000000e+00, %10
%26 = getelementptr inbounds double, double* %2, i64 2
store double %25, double* %26
ret void
}