#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 tan(double);
void prewarp(double *a0, double *a1, double *a2, double fc, double fs) {
  double wp;
  if (fc <= 0)
    fc = .00001;
  wp = 2.0 * fs * tan(M_PI * fc / fs);
  *a2 = (*a2) / (wp * wp);
  *a1 = (*a1) / wp;
}


x86 assembly (clang, -O0):
<prewarp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1149 <prewarp+0x39>
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb7(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    0x2e86(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
call   1030 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prewarp>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm2
cmpnlesd %xmm3,%xmm2
andpd  %xmm2,%xmm0
movsd  0xecd(%rip),%xmm3
andnpd %xmm3,%xmm2
orpd   %xmm2,%xmm0
mov    0x2ea6(%rip),%rax
mulsd  (%rax),%xmm0
divsd  %xmm1,%xmm0
addsd  %xmm1,%xmm1
movsd  %xmm1,(%rsp)
call   1030 <tan@plt>
mulsd  (%rsp),%xmm0
movsd  (%rbx),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx)
movsd  (%r14),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @prewarp(double* %0, double* %1, double* %2, double %3, double %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double %3, double* %9
store double %4, double* %10
%12 = load double, double* %9
%13 = fcmp ole double %12, 0.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %5
store double 1.000000e-05, double* %9
br label %15
15: ; preds = %14, %5
%16 = load double, double* %10
%17 = fmul double 2.000000e+00, %16
%18 = load double, double* @M_PI
%19 = load double, double* %9
%20 = fmul double %18, %19
%21 = load double, double* %10
%22 = fdiv double %20, %21
%23 = call double @tan(double %22)
%24 = fmul double %17, %23
store double %24, double* %11
%25 = load double*, double** %8
%26 = load double, double* %25
%27 = load double, double* %11
%28 = load double, double* %11
%29 = fmul double %27, %28
%30 = fdiv double %26, %29
%31 = load double*, double** %8
store double %30, double* %31
%32 = load double*, double** %7
%33 = load double, double* %32
%34 = load double, double* %11
%35 = fdiv double %33, %34
%36 = load double*, double** %7
store double %35, double* %36
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @prewarp(double* nocapture readnone %0, double* nocapture %1, double* nocapture %2, double %3, double %4) {
%6 = fcmp ugt double %3, 0.000000e+00
%7 = select i1 %6, double %3, double 1.000000e-05
%8 = fmul double %4, 2.000000e+00
%9 = load double, double* @M_PI
%10 = fmul double %7, %9
%11 = fdiv double %10, %4
%12 = tail call double @tan(double %11)
%13 = fmul double %8, %12
%14 = load double, double* %2
%15 = fmul double %13, %13
%16 = fdiv double %14, %15
store double %16, double* %2
%17 = load double, double* %1
%18 = fdiv double %17, %13
store double %18, double* %1
ret void
}