#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 */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int M_PI;
double const log10(double);
int32_t num_of_oof_poles(double fmin, double fknee, double fsample) {
  const double wmin = log10(2 * M_PI * fmin);
  const double wmax = log10(2 * M_PI * fknee);
  return (int32_t)((wmax - wmin) * 2 + log10(fsample));
}


x86 assembly (clang, -O0):
<num_of_oof_poles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
movsd  %xmm0,-0x20(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <log10@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_of_oof_poles>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x8(%rsp)
mov    0x2ec0(%rip),%rbx
mov    (%rbx),%eax
add    %eax,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <log10@plt>
movsd  %xmm0,0x10(%rsp)
mov    (%rbx),%eax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
call   1030 <log10@plt>
subsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <log10@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global i32 0
define i32 @num_of_oof_poles(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load i32, i32* @M_PI
%10 = mul nsw i32 2, %9
%11 = sitofp i32 %10 to double
%12 = load double, double* %4
%13 = fmul double %11, %12
%14 = call double @log10(double %13)
store double %14, double* %7
%15 = load i32, i32* @M_PI
%16 = mul nsw i32 2, %15
%17 = sitofp i32 %16 to double
%18 = load double, double* %5
%19 = fmul double %17, %18
%20 = call double @log10(double %19)
store double %20, double* %8
%21 = load double, double* %8
%22 = load double, double* %7
%23 = fsub double %21, %22
%24 = load double, double* %6
%25 = call double @log10(double %24)
%26 = call double @llvm.fmuladd.f64(double %23, double 2.000000e+00, double %25)
%27 = fptosi double %26 to i32
ret i32 %27
}

LLVM IR (-O2):
@M_PI = global i32 0
define i32 @num_of_oof_poles(double %0, double %1, double %2) {
%4 = load i32, i32* @M_PI
%5 = shl nsw i32 %4, 1
%6 = sitofp i32 %5 to double
%7 = fmul double %6, %0
%8 = tail call double @log10(double %7)
%9 = load i32, i32* @M_PI
%10 = shl nsw i32 %9, 1
%11 = sitofp i32 %10 to double
%12 = fmul double %11, %1
%13 = tail call double @log10(double %12)
%14 = fsub double %13, %8
%15 = tail call double @log10(double %2)
%16 = tail call double @llvm.fmuladd.f64(double %14, double 2.000000e+00, double %15)
%17 = fptosi double %16 to i32
ret i32 %17
}