#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 six_f3(int, int, int, int);
double six_f2(int a, int b, int c, int d, int e, int f) {
  double ab, ac, ad, ae, af;
  ab = probability(a, b);
  ac = probability(a, c);
  ad = probability(a, d);
  ae = probability(a, e);
  af = probability(a, f);
  return (six_f3(c, d, e, f) * ab * ac + six_f3(d, c, e, f) * ab * ad +
          six_f3(e, c, d, f) * ab * ae + six_f3(f, c, d, e) * ab * af);
}


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

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

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

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