#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 five_f2(int, int, int);
double probability(int, int);
double five_f1(int a, int b, int c, int d, int e) {
  double ab, ac, ad, ae, bc, bd, be;
  ab = probability(a, b);
  ac = probability(a, c);
  ad = probability(a, d);
  ae = probability(a, e);
  bc = probability(b, c);
  bd = probability(b, d);
  be = probability(b, e);
  return ab * (ac * five_f2(c, d, e) + ad * five_f2(d, e, c) +
               ae * five_f2(e, c, d) + bc * five_f2(a, d, e) +
               bd * five_f2(a, c, e) + be * five_f2(a, c, d));
}


x86 assembly (clang, -O0):
<five_f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <probability@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <probability@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <probability@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <probability@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <probability@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <probability@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <probability@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <five_f2@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <five_f2@plt>
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <five_f2@plt>
movsd  -0x98(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <five_f2@plt>
movsd  -0x88(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <five_f2@plt>
movsd  -0x78(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <five_f2@plt>
movsd  -0x68(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<five_f1>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %r8d,%ebp
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%r12d
call   1040 <probability@plt>
movsd  %xmm0,0x38(%rsp)
mov    %r12d,%edi
mov    %r15d,%esi
call   1040 <probability@plt>
movsd  %xmm0,(%rsp)
mov    %r12d,%edi
mov    %r14d,%esi
call   1040 <probability@plt>
movsd  %xmm0,0x20(%rsp)
mov    %r12d,%edi
mov    %ebp,%esi
call   1040 <probability@plt>
movsd  %xmm0,0x28(%rsp)
mov    %ebx,%edi
mov    %r15d,%esi
call   1040 <probability@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
mov    %r14d,%esi
call   1040 <probability@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <probability@plt>
movsd  %xmm0,0x30(%rsp)
mov    %r15d,%edi
mov    %r14d,%esi
mov    %ebp,%edx
call   1030 <five_f2@plt>
movsd  %xmm0,0x18(%rsp)
mov    %r14d,%edi
mov    %ebp,%esi
mov    %r15d,%edx
call   1030 <five_f2@plt>
mulsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  (%rsp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %ebp,%edi
mov    %r15d,%esi
mov    %r14d,%edx
call   1030 <five_f2@plt>
mulsd  0x28(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    %r12d,%edi
mov    %r14d,%esi
mov    %ebp,%edx
call   1030 <five_f2@plt>
mulsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r12d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
call   1030 <five_f2@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
call   1030 <five_f2@plt>
mulsd  0x30(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
mulsd  0x38(%rsp),%xmm0
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @five_f1(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = call double @probability(i32 %18, i32 %19)
store double %20, double* %11
%21 = load i32, i32* %6
%22 = load i32, i32* %8
%23 = call double @probability(i32 %21, i32 %22)
store double %23, double* %12
%24 = load i32, i32* %6
%25 = load i32, i32* %9
%26 = call double @probability(i32 %24, i32 %25)
store double %26, double* %13
%27 = load i32, i32* %6
%28 = load i32, i32* %10
%29 = call double @probability(i32 %27, i32 %28)
store double %29, double* %14
%30 = load i32, i32* %7
%31 = load i32, i32* %8
%32 = call double @probability(i32 %30, i32 %31)
store double %32, double* %15
%33 = load i32, i32* %7
%34 = load i32, i32* %9
%35 = call double @probability(i32 %33, i32 %34)
store double %35, double* %16
%36 = load i32, i32* %7
%37 = load i32, i32* %10
%38 = call double @probability(i32 %36, i32 %37)
store double %38, double* %17
%39 = load double, double* %11
%40 = load double, double* %12
%41 = load i32, i32* %8
%42 = load i32, i32* %9
%43 = load i32, i32* %10
%44 = call double @five_f2(i32 %41, i32 %42, i32 %43)
%45 = load double, double* %13
%46 = load i32, i32* %9
%47 = load i32, i32* %10
%48 = load i32, i32* %8
%49 = call double @five_f2(i32 %46, i32 %47, i32 %48)
%50 = fmul double %45, %49
%51 = call double @llvm.fmuladd.f64(double %40, double %44, double %50)
%52 = load double, double* %14
%53 = load i32, i32* %10
%54 = load i32, i32* %8
%55 = load i32, i32* %9
%56 = call double @five_f2(i32 %53, i32 %54, i32 %55)
%57 = call double @llvm.fmuladd.f64(double %52, double %56, double %51)
%58 = load double, double* %15
%59 = load i32, i32* %6
%60 = load i32, i32* %9
%61 = load i32, i32* %10
%62 = call double @five_f2(i32 %59, i32 %60, i32 %61)
%63 = call double @llvm.fmuladd.f64(double %58, double %62, double %57)
%64 = load double, double* %16
%65 = load i32, i32* %6
%66 = load i32, i32* %8
%67 = load i32, i32* %10
%68 = call double @five_f2(i32 %65, i32 %66, i32 %67)
%69 = call double @llvm.fmuladd.f64(double %64, double %68, double %63)
%70 = load double, double* %17
%71 = load i32, i32* %6
%72 = load i32, i32* %8
%73 = load i32, i32* %9
%74 = call double @five_f2(i32 %71, i32 %72, i32 %73)
%75 = call double @llvm.fmuladd.f64(double %70, double %74, double %69)
%76 = fmul double %39, %75
ret double %76
}

LLVM IR (-O2):
define double @five_f1(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call double @probability(i32 %0, i32 %1)
%7 = tail call double @probability(i32 %0, i32 %2)
%8 = tail call double @probability(i32 %0, i32 %3)
%9 = tail call double @probability(i32 %0, i32 %4)
%10 = tail call double @probability(i32 %1, i32 %2)
%11 = tail call double @probability(i32 %1, i32 %3)
%12 = tail call double @probability(i32 %1, i32 %4)
%13 = tail call double @five_f2(i32 %2, i32 %3, i32 %4)
%14 = tail call double @five_f2(i32 %3, i32 %4, i32 %2)
%15 = fmul double %8, %14
%16 = tail call double @llvm.fmuladd.f64(double %7, double %13, double %15)
%17 = tail call double @five_f2(i32 %4, i32 %2, i32 %3)
%18 = tail call double @llvm.fmuladd.f64(double %9, double %17, double %16)
%19 = tail call double @five_f2(i32 %0, i32 %3, i32 %4)
%20 = tail call double @llvm.fmuladd.f64(double %10, double %19, double %18)
%21 = tail call double @five_f2(i32 %0, i32 %2, i32 %4)
%22 = tail call double @llvm.fmuladd.f64(double %11, double %21, double %20)
%23 = tail call double @five_f2(i32 %0, i32 %2, i32 %3)
%24 = tail call double @llvm.fmuladd.f64(double %12, double %23, double %22)
%25 = fmul double %6, %24
ret double %25
}