#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 */
float M_PI;
double tan(float);
void prewarp(float *a, float fc, float fs) {
  float wp;
  wp = 2.0 * fs * tan(M_PI * fc / fs);
  a[2] = a[2] / (wp * wp);
  a[1] = a[1] / wp;
}


x86 assembly (clang, -O0):
<prewarp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0x2ea1(%rip),%rax
movss  (%rax),%xmm0
mulss  -0xc(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
call   1030 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
divss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prewarp>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
cvtss2sd %xmm1,%xmm2
addsd  %xmm2,%xmm2
movsd  %xmm2,0x8(%rsp)
mov    0x2ebb(%rip),%rax
mulss  (%rax),%xmm0
divss  %xmm1,%xmm0
call   1030 <tan@plt>
mulsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0x4(%rbx),%xmm1
movss  0x8(%rbx),%xmm2
divss  %xmm0,%xmm1
mulss  %xmm0,%xmm0
divss  %xmm0,%xmm2
movss  %xmm2,0x8(%rbx)
movss  %xmm1,0x4(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define void @prewarp(float* %0, float %1, float %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float* %0, float** %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %6
%9 = fpext float %8 to double
%10 = fmul double 2.000000e+00, %9
%11 = load float, float* @M_PI
%12 = load float, float* %5
%13 = fmul float %11, %12
%14 = load float, float* %6
%15 = fdiv float %13, %14
%16 = call double @tan(float %15)
%17 = fmul double %10, %16
%18 = fptrunc double %17 to float
store float %18, float* %7
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float, float* %7
%23 = load float, float* %7
%24 = fmul float %22, %23
%25 = fdiv float %21, %24
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 2
store float %25, float* %27
%28 = load float*, float** %4
%29 = getelementptr inbounds float, float* %28, i64 1
%30 = load float, float* %29
%31 = load float, float* %7
%32 = fdiv float %30, %31
%33 = load float*, float** %4
%34 = getelementptr inbounds float, float* %33, i64 1
store float %32, float* %34
ret void
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define void @prewarp(float* nocapture %0, float %1, float %2) {
%4 = fpext float %2 to double
%5 = fmul double %4, 2.000000e+00
%6 = load float, float* @M_PI
%7 = fmul float %6, %1
%8 = fdiv float %7, %2
%9 = tail call double @tan(float %8)
%10 = fmul double %5, %9
%11 = fptrunc double %10 to float
%12 = getelementptr inbounds float, float* %0, i64 2
%13 = load float, float* %12
%14 = fmul float %11, %11
%15 = fdiv float %13, %14
store float %15, float* %12
%16 = getelementptr inbounds float, float* %0, i64 1
%17 = load float, float* %16
%18 = fdiv float %17, %11
store float %18, float* %16
ret void
}