#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 probability(int, int);
double eight_f3(int a, int b, int c, int d, int e) {
  double ab, ac, ad, ae, bc, bd, be, cb, cd, ce, db, dc, de, eb, ec, ed;
  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);
  cd = probability(c, d);
  ce = probability(c, e);
  de = probability(d, e);
  cb = 1.0 - bc;
  db = 1.0 - bd;
  dc = 1.0 - cd;
  eb = 1.0 - be;
  ec = 1.0 - ce;
  ed = 1.0 - de;
  return (bc * de + be * dc) * ((ab - ad) * bd + ad) +
         (bd * ce + be * cd) * ((ab - ac) * bc + ac) +
         (cb * de + db * ce) * ((ac - ad) * cd + ad) +
         (cd * eb + cb * ed) * ((ac - ae) * ce + ae) +
         (dc * eb + db * ec) * ((ad - ae) * de + ae) +
         (bd * ec + bc * ed) * ((ae - ab) * eb + ab);
}


x86 assembly (clang, -O0):
<eight_f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%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   1030 <probability@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <probability@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <probability@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <probability@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <probability@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <probability@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <probability@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <probability@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <probability@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <probability@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  0xe2d(%rip),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe1b(%rip),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe09(%rip),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xdf7(%rip),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xde2(%rip),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xdcd(%rip),%xmm0
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x30(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x48(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm4
movsd  -0x50(%rbp),%xmm3
mulsd  -0x60(%rbp),%xmm3
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
movsd  -0x20(%rbp),%xmm3
subsd  -0x28(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm5
movsd  -0x28(%rbp),%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm3
movsd  -0x70(%rbp),%xmm2
mulsd  -0x68(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x28(%rbp),%xmm2
subsd  -0x30(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm3
ff
movsd  -0x58(%rbp),%xmm2
mulsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movsd  -0x28(%rbp),%xmm2
subsd  -0x38(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x78(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm3
ff
movsd  -0x70(%rbp),%xmm2
mulsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x30(%rbp),%xmm2
subsd  -0x38(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm3
ff
movsd  -0x40(%rbp),%xmm2
mulsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movsd  -0x38(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm4
ff
movsd  -0x20(%rbp),%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eight_f3>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x50,%rsp
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <probability@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
mov    %r12d,%esi
call   1030 <probability@plt>
movsd  %xmm0,0x40(%rsp)
mov    %ebx,%edi
mov    %r15d,%esi
call   1030 <probability@plt>
movsd  %xmm0,0x38(%rsp)
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <probability@plt>
movsd  %xmm0,0x48(%rsp)
mov    %ebp,%edi
mov    %r12d,%esi
call   1030 <probability@plt>
movsd  %xmm0,0x20(%rsp)
mov    %ebp,%edi
mov    %r15d,%esi
call   1030 <probability@plt>
movsd  %xmm0,0x30(%rsp)
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <probability@plt>
movsd  %xmm0,0x18(%rsp)
mov    %r12d,%edi
mov    %r15d,%esi
call   1030 <probability@plt>
movsd  %xmm0,0x10(%rsp)
mov    %r12d,%edi
mov    %r14d,%esi
call   1030 <probability@plt>
movsd  %xmm0,0x28(%rsp)
mov    %r15d,%edi
mov    %r14d,%esi
call   1030 <probability@plt>
movsd  0xe37(%rip),%xmm1
movapd %xmm1,%xmm9
movsd  0x20(%rsp),%xmm10
subsd  %xmm10,%xmm9
movapd %xmm1,%xmm3
movsd  0x10(%rsp),%xmm8
subsd  %xmm8,%xmm3
movapd %xmm1,%xmm12
movsd  0x18(%rsp),%xmm4
subsd  %xmm4,%xmm12
movapd %xmm4,%xmm5
mulsd  %xmm3,%xmm5
movapd %xmm10,%xmm6
mulsd  %xmm0,%xmm6
addsd  %xmm5,%xmm6
movsd  0x8(%rsp),%xmm7
movapd %xmm7,%xmm5
movsd  0x38(%rsp),%xmm11
subsd  %xmm11,%xmm5
movsd  0x30(%rsp),%xmm2
mulsd  %xmm2,%xmm5
addsd  %xmm11,%xmm5
mulsd  %xmm6,%xmm5
mulsd  %xmm8,%xmm4
movapd %xmm2,%xmm6
movapd %xmm2,%xmm13
movsd  0x28(%rsp),%xmm2
mulsd  %xmm2,%xmm6
addsd  %xmm4,%xmm6
movsd  0x40(%rsp),%xmm14
subsd  %xmm14,%xmm7
mulsd  %xmm10,%xmm7
addsd  %xmm14,%xmm7
mulsd  %xmm6,%xmm7
movapd %xmm1,%xmm6
subsd  %xmm13,%xmm6
addsd  %xmm5,%xmm7
movapd %xmm6,%xmm5
mulsd  %xmm2,%xmm5
movapd %xmm2,%xmm15
movapd %xmm9,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm5,%xmm4
movapd %xmm14,%xmm2
subsd  %xmm11,%xmm2
mulsd  %xmm8,%xmm2
addsd  %xmm11,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm7,%xmm2
movapd %xmm1,%xmm5
subsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm9
mulsd  %xmm12,%xmm8
addsd  %xmm9,%xmm8
subsd  %xmm15,%xmm5
movapd %xmm14,%xmm4
movsd  0x48(%rsp),%xmm7
subsd  %xmm7,%xmm4
mulsd  %xmm15,%xmm4
addsd  %xmm7,%xmm4
mulsd  %xmm8,%xmm4
addsd  %xmm2,%xmm4
mulsd  %xmm5,%xmm6
mulsd  %xmm12,%xmm3
addsd  %xmm6,%xmm3
movapd %xmm7,%xmm2
subsd  %xmm7,%xmm11
mulsd  %xmm11,%xmm0
addsd  %xmm7,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm10,%xmm1
mulsd  %xmm13,%xmm5
addsd  %xmm1,%xmm5
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm2
mulsd  %xmm12,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm5,%xmm2
addsd  %xmm2,%xmm0
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @eight_f3(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
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = 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
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = call double @probability(i32 %27, i32 %28)
store double %29, double* %11
%30 = load i32, i32* %6
%31 = load i32, i32* %8
%32 = call double @probability(i32 %30, i32 %31)
store double %32, double* %12
%33 = load i32, i32* %6
%34 = load i32, i32* %9
%35 = call double @probability(i32 %33, i32 %34)
store double %35, double* %13
%36 = load i32, i32* %6
%37 = load i32, i32* %10
%38 = call double @probability(i32 %36, i32 %37)
store double %38, double* %14
%39 = load i32, i32* %7
%40 = load i32, i32* %8
%41 = call double @probability(i32 %39, i32 %40)
store double %41, double* %15
%42 = load i32, i32* %7
%43 = load i32, i32* %9
%44 = call double @probability(i32 %42, i32 %43)
store double %44, double* %16
%45 = load i32, i32* %7
%46 = load i32, i32* %10
%47 = call double @probability(i32 %45, i32 %46)
store double %47, double* %17
%48 = load i32, i32* %8
%49 = load i32, i32* %9
%50 = call double @probability(i32 %48, i32 %49)
store double %50, double* %19
%51 = load i32, i32* %8
%52 = load i32, i32* %10
%53 = call double @probability(i32 %51, i32 %52)
store double %53, double* %20
%54 = load i32, i32* %9
%55 = load i32, i32* %10
%56 = call double @probability(i32 %54, i32 %55)
store double %56, double* %23
%57 = load double, double* %15
%58 = fsub double 1.000000e+00, %57
store double %58, double* %18
%59 = load double, double* %16
%60 = fsub double 1.000000e+00, %59
store double %60, double* %21
%61 = load double, double* %19
%62 = fsub double 1.000000e+00, %61
store double %62, double* %22
%63 = load double, double* %17
%64 = fsub double 1.000000e+00, %63
store double %64, double* %24
%65 = load double, double* %20
%66 = fsub double 1.000000e+00, %65
store double %66, double* %25
%67 = load double, double* %23
%68 = fsub double 1.000000e+00, %67
store double %68, double* %26
%69 = load double, double* %15
%70 = load double, double* %23
%71 = load double, double* %17
%72 = load double, double* %22
%73 = fmul double %71, %72
%74 = call double @llvm.fmuladd.f64(double %69, double %70, double %73)
%75 = load double, double* %11
%76 = load double, double* %13
%77 = fsub double %75, %76
%78 = load double, double* %16
%79 = load double, double* %13
%80 = call double @llvm.fmuladd.f64(double %77, double %78, double %79)
%81 = load double, double* %16
%82 = load double, double* %20
%83 = load double, double* %17
%84 = load double, double* %19
%85 = fmul double %83, %84
%86 = call double @llvm.fmuladd.f64(double %81, double %82, double %85)
%87 = load double, double* %11
%88 = load double, double* %12
%89 = fsub double %87, %88
%90 = load double, double* %15
%91 = load double, double* %12
%92 = call double @llvm.fmuladd.f64(double %89, double %90, double %91)
%93 = fmul double %86, %92
%94 = call double @llvm.fmuladd.f64(double %74, double %80, double %93)
%95 = load double, double* %18
%96 = load double, double* %23
%97 = load double, double* %21
%98 = load double, double* %20
%99 = fmul double %97, %98
%100 = call double @llvm.fmuladd.f64(double %95, double %96, double %99)
%101 = load double, double* %12
%102 = load double, double* %13
%103 = fsub double %101, %102
%104 = load double, double* %19
%105 = load double, double* %13
%106 = call double @llvm.fmuladd.f64(double %103, double %104, double %105)
%107 = call double @llvm.fmuladd.f64(double %100, double %106, double %94)
%108 = load double, double* %19
%109 = load double, double* %24
%110 = load double, double* %18
%111 = load double, double* %26
%112 = fmul double %110, %111
%113 = call double @llvm.fmuladd.f64(double %108, double %109, double %112)
%114 = load double, double* %12
%115 = load double, double* %14
%116 = fsub double %114, %115
%117 = load double, double* %20
%118 = load double, double* %14
%119 = call double @llvm.fmuladd.f64(double %116, double %117, double %118)
%120 = call double @llvm.fmuladd.f64(double %113, double %119, double %107)
%121 = load double, double* %22
%122 = load double, double* %24
%123 = load double, double* %21
%124 = load double, double* %25
%125 = fmul double %123, %124
%126 = call double @llvm.fmuladd.f64(double %121, double %122, double %125)
%127 = load double, double* %13
%128 = load double, double* %14
%129 = fsub double %127, %128
%130 = load double, double* %23
%131 = load double, double* %14
%132 = call double @llvm.fmuladd.f64(double %129, double %130, double %131)
%133 = call double @llvm.fmuladd.f64(double %126, double %132, double %120)
%134 = load double, double* %16
%135 = load double, double* %25
%136 = load double, double* %15
%137 = load double, double* %26
%138 = fmul double %136, %137
%139 = call double @llvm.fmuladd.f64(double %134, double %135, double %138)
%140 = load double, double* %14
%141 = load double, double* %11
%142 = fsub double %140, %141
%143 = load double, double* %24
%144 = load double, double* %11
%145 = call double @llvm.fmuladd.f64(double %142, double %143, double %144)
%146 = call double @llvm.fmuladd.f64(double %139, double %145, double %133)
ret double %146
}

LLVM IR (-O2):
define double @eight_f3(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 @probability(i32 %2, i32 %3)
%14 = tail call double @probability(i32 %2, i32 %4)
%15 = tail call double @probability(i32 %3, i32 %4)
%16 = fsub double 1.000000e+00, %10
%17 = fsub double 1.000000e+00, %11
%18 = fsub double 1.000000e+00, %13
%19 = fsub double 1.000000e+00, %12
%20 = fsub double 1.000000e+00, %14
%21 = fsub double 1.000000e+00, %15
%22 = fmul double %12, %18
%23 = tail call double @llvm.fmuladd.f64(double %10, double %15, double %22)
%24 = fsub double %6, %8
%25 = tail call double @llvm.fmuladd.f64(double %24, double %11, double %8)
%26 = fmul double %12, %13
%27 = tail call double @llvm.fmuladd.f64(double %11, double %14, double %26)
%28 = fsub double %6, %7
%29 = tail call double @llvm.fmuladd.f64(double %28, double %10, double %7)
%30 = fmul double %29, %27
%31 = tail call double @llvm.fmuladd.f64(double %23, double %25, double %30)
%32 = fmul double %17, %14
%33 = tail call double @llvm.fmuladd.f64(double %16, double %15, double %32)
%34 = fsub double %7, %8
%35 = tail call double @llvm.fmuladd.f64(double %34, double %13, double %8)
%36 = tail call double @llvm.fmuladd.f64(double %33, double %35, double %31)
%37 = fmul double %16, %21
%38 = tail call double @llvm.fmuladd.f64(double %13, double %19, double %37)
%39 = fsub double %7, %9
%40 = tail call double @llvm.fmuladd.f64(double %39, double %14, double %9)
%41 = tail call double @llvm.fmuladd.f64(double %38, double %40, double %36)
%42 = fmul double %17, %20
%43 = tail call double @llvm.fmuladd.f64(double %18, double %19, double %42)
%44 = fsub double %8, %9
%45 = tail call double @llvm.fmuladd.f64(double %44, double %15, double %9)
%46 = tail call double @llvm.fmuladd.f64(double %43, double %45, double %41)
%47 = fmul double %10, %21
%48 = tail call double @llvm.fmuladd.f64(double %11, double %20, double %47)
%49 = fsub double %9, %6
%50 = tail call double @llvm.fmuladd.f64(double %49, double %19, double %6)
%51 = tail call double @llvm.fmuladd.f64(double %48, double %50, double %46)
ret double %51
}