#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;
double cos(double);
double tan(double);
void bp2(float *a, float *b, float fc, float q) {
  double th = 2.0 * M_PI * fc;
  double C = (1.0 - tan(th * q / 2.0)) / (1.0 + tan(th * q / 2.0));
  a[0] = (1.0 + C) * cos(th);
  a[1] = -1 * C;
  b[0] = (1.0 - C) / 2.0;
  b[1] = -1.0050;
}


x86 assembly (clang, -O0):
<bp2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movsd  0xec6(%rip),%xmm0
mov    0x2e9f(%rip),%rax
mulsd  (%rax),%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <tan@plt>
movaps %xmm0,%xmm1
movsd  0xe83(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe58(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <tan@plt>
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
movsd  0xe47(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe32(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movsd  0xe06(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movsd  0xde4(%rip),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  0xdcf(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0xdab(%rip),%xmm0
movss  %xmm0,0x4(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bp2>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb4(%rip),%rax
movsd  (%rax),%xmm2
addsd  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  %xmm3,%xmm0
mulsd  0xea3(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <tan@plt>
movsd  0xe99(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <tan@plt>
movsd  0xe7d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0x8(%rsp),%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
xorps  0xe40(%rip),%xmm1
movss  %xmm0,(%rbx)
movss  %xmm1,0x4(%rbx)
movsd  0xe27(%rip),%xmm0
subsd  %xmm2,%xmm0
mulsd  0xe13(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14)
movl   $0xbf80a3d7,0x4(%r14)
bf
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

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