#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 */
unsigned long binomial_d(int, int);
scalar_t__ ldexp(int, int);
double log2(double);
double dicho_si_lb_leaf(int m, int t, int l) {
  double y;
  unsigned long u;
  u = binomial_d(1 << m, t);
  u &= (((unsigned)-1) << l);
  y = 1.0 / u;
  y += ldexp(1, 2 - ((2 * 32) / 3) - l);
  return -log2(y);
}


x86 assembly (clang, -O0):
<dicho_si_lb_leaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%cl
mov    $0x1,%edi
shl    %cl,%edi
mov    -0x8(%rbp),%esi
call   1050 <binomial_d@plt>
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%cl
mov    %cl,-0x21(%rbp)
mov    -0x20(%rbp),%eax
shr    %cl,%eax
mov    -0x21(%rbp),%cl
shl    %cl,%eax
mov    %rax,-0x20(%rbp)
movaps 0xe9e(%rip),%xmm0
movq   -0x20(%rbp),%xmm1
punpckldq %xmm0,%xmm1
movapd 0xe9d(%rip),%xmm0
subpd  %xmm0,%xmm1
movaps %xmm1,%xmm0
unpckhpd %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe66(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0xffffffed,%esi
sub    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1030 <ldexp@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <log2@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dicho_si_lb_leaf>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %edi,%ecx
mov    $0x1,%edi
shl    %cl,%edi
call   1050 <binomial_d@plt>
mov    %ebx,%ecx
shr    %cl,%eax
shl    %cl,%eax
cvtsi2sd %rax,%xmm0
movsd  0xea8(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    $0xffffffed,%esi
sub    %ebx,%esi
mov    $0x1,%edi
call   1030 <ldexp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
call   1040 <log2@plt>
xorpd  0xe82(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @dicho_si_lb_leaf(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = shl i32 1, %9
%11 = load i32, i32* %5
%12 = call i64 @binomial_d(i32 %10, i32 %11)
store i64 %12, i64* %8
%13 = load i32, i32* %6
%14 = shl i32 -1, %13
%15 = zext i32 %14 to i64
%16 = load i64, i64* %8
%17 = and i64 %16, %15
store i64 %17, i64* %8
%18 = load i64, i64* %8
%19 = uitofp i64 %18 to double
%20 = fdiv double 1.000000e+00, %19
store double %20, double* %7
%21 = load i32, i32* %6
%22 = sub nsw i32 -19, %21
%23 = call i64 @ldexp(i32 1, i32 %22)
%24 = sitofp i64 %23 to double
%25 = load double, double* %7
%26 = fadd double %25, %24
store double %26, double* %7
%27 = load double, double* %7
%28 = call double @log2(double %27)
%29 = fneg double %28
ret double %29
}

LLVM IR (-O2):
define double @dicho_si_lb_leaf(i32 %0, i32 %1, i32 %2) {
%4 = shl nuw i32 1, %0
%5 = tail call i64 @binomial_d(i32 %4, i32 %1)
%6 = shl nsw i32 -1, %2
%7 = zext i32 %6 to i64
%8 = and i64 %5, %7
%9 = uitofp i64 %8 to double
%10 = fdiv double 1.000000e+00, %9
%11 = sub nsw i32 -19, %2
%12 = tail call i64 @ldexp(i32 1, i32 %11)
%13 = sitofp i64 %12 to double
%14 = fadd double %10, %13
%15 = tail call double @log2(double %14)
%16 = fneg double %15
ret double %16
}