#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 exp(float);
float factln(int);
long double floor(long double);
double dbico(int n, int k) {
  float a, b, c, d;
  long double e;
  a = factln(n);
  b = factln(k);
  c = factln(n - k);
  d = a - b - c;
  e = 0.5 + exp(d);
  e = floor(e);
  return e;
}


x86 assembly (clang, -O0):
<dbico>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factln@plt>
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factln@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
sub    %eax,%edi
call   1030 <factln@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
call   1040 <exp@plt>
movsd  0xe68(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
fldl   -0x38(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <floor@plt>
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fstpl  -0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbico>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <factln@plt>
movss  %xmm0,0x4(%rsp)
mov    %ebx,%edi
call   1030 <factln@plt>
movss  %xmm0,(%rsp)
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <factln@plt>
movss  0x4(%rsp),%xmm1
subss  (%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1040 <exp@plt>
addsd  0xe8a(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <floor@plt>

LLVM IR (-O0):
define double @dbico(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca x86_fp80
store i32 %0, i32* %3
store i32 %1, i32* %4
%10 = load i32, i32* %3
%11 = call float @factln(i32 %10)
store float %11, float* %5
%12 = load i32, i32* %4
%13 = call float @factln(i32 %12)
store float %13, float* %6
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
%17 = call float @factln(i32 %16)
store float %17, float* %7
%18 = load float, float* %5
%19 = load float, float* %6
%20 = fsub float %18, %19
%21 = load float, float* %7
%22 = fsub float %20, %21
store float %22, float* %8
%23 = load float, float* %8
%24 = call double @exp(float %23)
%25 = fadd double 5.000000e-01, %24
%26 = fpext double %25 to x86_fp80
store x86_fp80 %26, x86_fp80* %9
%27 = load x86_fp80, x86_fp80* %9
%28 = call x86_fp80 @floor(x86_fp80 %27)
store x86_fp80 %28, x86_fp80* %9
%29 = load x86_fp80, x86_fp80* %9
%30 = fptrunc x86_fp80 %29 to double
ret double %30
}

LLVM IR (-O2):
define double @dbico(i32 %0, i32 %1) {
%3 = tail call float @factln(i32 %0)
%4 = tail call float @factln(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call float @factln(i32 %5)
%7 = fsub float %3, %4
%8 = fsub float %7, %6
%9 = tail call double @exp(float %8)
%10 = fadd double %9, 5.000000e-01
%11 = tail call double @llvm.floor.f64(double %10)
ret double %11
}