#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 eight_f3(int, int, int, int, int);
double probability(int, int);
double eight_f2(int a, int b, int c, int d, int e, int f, int g) {
  double ab, bc, bd, be, bf, bg;
  ab = probability(a, b);
  bc = probability(b, c);
  bd = probability(b, d);
  be = probability(b, e);
  bf = probability(b, f);
  bg = probability(b, g);
  return ab * (eight_f3(a, d, e, f, g) * bc + eight_f3(a, c, e, f, g) * bd +
               eight_f3(a, c, d, f, g) * be + eight_f3(a, c, d, e, g) * bf +
               eight_f3(a, c, d, e, f) * bg);
}


x86 assembly (clang, -O0):
<eight_f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <probability@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <probability@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <probability@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <probability@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x18(%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)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    0x10(%rbp),%r8d
call   1030 <eight_f3@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    0x10(%rbp),%r8d
call   1030 <eight_f3@plt>
movsd  -0x78(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    0x10(%rbp),%r8d
call   1030 <eight_f3@plt>
movsd  -0x68(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    0x10(%rbp),%r8d
call   1030 <eight_f3@plt>
movsd  -0x60(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <eight_f3@plt>
movsd  -0x58(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x80,%rsp
pop    %rbp
ret

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

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

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