#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 calc_F(int, int);
double single_prob(int n, int A, int n0, int A0, double psi, int c) {
  double a;
  double out;
  a = (1 - psi) / psi;
  out = (calc_F(a, n) * calc_F((c - 1) * a, n0 - n)) / calc_F(c * a, n0);
  return out;
}


x86 assembly (clang, -O0):
<single_prob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
movsd  0xecb(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
cvttsd2si -0x28(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <calc_F@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    -0xc(%rbp),%esi
sub    -0x4(%rbp),%esi
call   1030 <calc_F@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    -0xc(%rbp),%esi
call   1030 <calc_F@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<single_prob>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %r8d,%ebx
mov    %edx,%r14d
mov    %edi,%ebp
movsd  0xed8(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
cvttsd2si %xmm1,%edi
mov    %ebp,%esi
call   1030 <calc_F@plt>
movsd  %xmm0,(%rsp)
lea    -0x1(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edi
mov    %r14d,%esi
sub    %ebp,%esi
call   1030 <calc_F@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
mulsd  0x8(%rsp),%xmm1
cvttsd2si %xmm1,%edi
mov    %r14d,%esi
call   1030 <calc_F@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @single_prob(i32 %0, i32 %1, i32 %2, i32 %3, double %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca i32
%13 = alloca double
%14 = alloca double
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store double %4, double* %11
store i32 %5, i32* %12
%15 = load double, double* %11
%16 = fsub double 1.000000e+00, %15
%17 = load double, double* %11
%18 = fdiv double %16, %17
store double %18, double* %13
%19 = load double, double* %13
%20 = fptosi double %19 to i32
%21 = load i32, i32* %7
%22 = call double @calc_F(i32 %20, i32 %21)
%23 = load i32, i32* %12
%24 = sub nsw i32 %23, 1
%25 = sitofp i32 %24 to double
%26 = load double, double* %13
%27 = fmul double %25, %26
%28 = fptosi double %27 to i32
%29 = load i32, i32* %9
%30 = load i32, i32* %7
%31 = sub nsw i32 %29, %30
%32 = call double @calc_F(i32 %28, i32 %31)
%33 = fmul double %22, %32
%34 = load i32, i32* %12
%35 = sitofp i32 %34 to double
%36 = load double, double* %13
%37 = fmul double %35, %36
%38 = fptosi double %37 to i32
%39 = load i32, i32* %9
%40 = call double @calc_F(i32 %38, i32 %39)
%41 = fdiv double %33, %40
store double %41, double* %14
%42 = load double, double* %14
ret double %42
}

LLVM IR (-O2):
define double @single_prob(i32 %0, i32 %1, i32 %2, i32 %3, double %4, i32 %5) {
%7 = fsub double 1.000000e+00, %4
%8 = fdiv double %7, %4
%9 = fptosi double %8 to i32
%10 = tail call double @calc_F(i32 %9, i32 %0)
%11 = add nsw i32 %5, -1
%12 = sitofp i32 %11 to double
%13 = fmul double %8, %12
%14 = fptosi double %13 to i32
%15 = sub nsw i32 %2, %0
%16 = tail call double @calc_F(i32 %14, i32 %15)
%17 = fmul double %10, %16
%18 = sitofp i32 %5 to double
%19 = fmul double %8, %18
%20 = fptosi double %19 to i32
%21 = tail call double @calc_F(i32 %20, i32 %2)
%22 = fdiv double %17, %21
ret double %22
}