#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 log(double);
int numberOfBands(int b_p_o, int start, int stop, float warp_factor) {
  int result = 0;
  ;
  ;
  ;
  ;
  ;
  ;
  result = 2 * (int)(b_p_o * log((float)(stop) / start) /
                         (2.0 * log(2.0) * warp_factor) +
                     0.5);
  ;
  return (result);
}


x86 assembly (clang, -O0):
<numberOfBands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xea1(%rip),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xe8c(%rip),%xmm1
mulsd  %xmm2,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xe67(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberOfBands>:
sub    $0x18,%rsp
cvtsi2ss %edx,%xmm1
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
cvtsi2sd %edi,%xmm2
movsd  %xmm2,0x10(%rsp)
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
call   1030 <log@plt>
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xeaf(%rip),%xmm1
mulsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
addsd  0xea5(%rip),%xmm0
cvttsd2si %xmm0,%eax
add    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @numberOfBands(i32 %0, i32 %1, i32 %2, float %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store float %3, float* %8
store i32 0, i32* %9
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = load i32, i32* %7
%13 = sitofp i32 %12 to float
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to float
%16 = fdiv float %13, %15
%17 = fpext float %16 to double
%18 = call double @log(double %17)
%19 = fmul double %11, %18
%20 = call double @log(double 2.000000e+00)
%21 = fmul double 2.000000e+00, %20
%22 = load float, float* %8
%23 = fpext float %22 to double
%24 = fmul double %21, %23
%25 = fdiv double %19, %24
%26 = fadd double %25, 5.000000e-01
%27 = fptosi double %26 to i32
%28 = mul nsw i32 2, %27
store i32 %28, i32* %9
%29 = load i32, i32* %9
ret i32 %29
}

LLVM IR (-O2):
define i32 @numberOfBands(i32 %0, i32 %1, i32 %2, float %3) {
%5 = sitofp i32 %0 to double
%6 = sitofp i32 %2 to float
%7 = sitofp i32 %1 to float
%8 = fdiv float %6, %7
%9 = fpext float %8 to double
%10 = tail call double @log(double %9)
%11 = fmul double %10, %5
%12 = fpext float %3 to double
%13 = fmul double %12, 0x3FF62E42FEFA39EF
%14 = fdiv double %11, %13
%15 = fadd double %14, 5.000000e-01
%16 = fptosi double %15 to i32
%17 = shl nsw i32 %16, 1
ret i32 %17
}