#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 compute_combinations(int, int);
double pow(double, int);
double compute_expected_fraction_heads_min() {
  int num_heads;
  int greater_num_heads;
  int equal_coins;
  int factorials[10 + 1];
  double probability_of_sequence;
  double num_heads_probabilities[10 + 1];
  double greater_than_num_heads_probabilities[10 + 1];
  double ways_to_pick_equal_coins_coins[1000 + 1];
  double num_heads_is_min_probabilities[10 + 1];
  double expected_value;
  num_heads = 0;
  while (num_heads <= 10) {
    num_heads++;
  }
  factorials[0] = 1;
  num_heads = 1;
  while (num_heads <= 10) {
    factorials[num_heads] = num_heads * factorials[num_heads - 1];
    num_heads++;
  }
  probability_of_sequence = 1.0 / pow(2.0, 10);
  num_heads = 0;
  while (num_heads <= 10) {
    num_heads_probabilities[num_heads] =
        probability_of_sequence * factorials[10] /
        (factorials[num_heads] * factorials[10 - num_heads]);
    num_heads++;
  }
  num_heads = 0;
  while (num_heads <= 10) {
    greater_than_num_heads_probabilities[num_heads] = 0;
    greater_num_heads = num_heads + 1;
    while (greater_num_heads <= 10) {
      greater_than_num_heads_probabilities[num_heads] +=
          num_heads_probabilities[greater_num_heads];
      greater_num_heads++;
    }
    num_heads++;
  }
  equal_coins = 1;
  while (equal_coins <= 1000) {
    equal_coins++;
  }
  equal_coins = 1;
  while (equal_coins <= 1000) {
    ways_to_pick_equal_coins_coins[equal_coins] =
        compute_combinations(1000, equal_coins);
    equal_coins++;
  }
  num_heads = 0;
  while (num_heads <= 10) {
    equal_coins = 1;
    num_heads_is_min_probabilities[num_heads] = 0;
    while (equal_coins <= 1000) {
      num_heads_is_min_probabilities[num_heads] +=
          ways_to_pick_equal_coins_coins[equal_coins] *
          pow(num_heads_probabilities[num_heads], equal_coins) *
          pow(greater_than_num_heads_probabilities[num_heads],
              1000 - equal_coins);
      equal_coins++;
    }
    num_heads++;
  }
  num_heads = 0;
  expected_value = 0;
  while (num_heads <= 10) {
    expected_value += num_heads * num_heads_is_min_probabilities[num_heads];
    num_heads++;
  }
  return expected_value / 10;
}


x86 assembly (clang, -O0):
<compute_expected_fraction_heads_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20d0,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jg     114a <compute_expected_fraction_heads_min+0x2a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <compute_expected_fraction_heads_min+0x12>
movl   $0x1,-0x40(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jg     1188 <compute_expected_fraction_heads_min+0x68>
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
imul   -0x40(%rbp,%rax,4),%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <compute_expected_fraction_heads_min+0x38>
movsd  0xe78(%rip),%xmm0
mov    $0xa,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe5b(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jg     1208 <compute_expected_fraction_heads_min+0xe8>
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movslq -0x4(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    $0xa,%ecx
sub    -0x4(%rbp),%ecx
movslq %ecx,%rcx
imul   -0x40(%rbp,%rcx,4),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movslq -0x4(%rbp),%rax
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11b5 <compute_expected_fraction_heads_min+0x95>
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jg     127b <compute_expected_fraction_heads_min+0x15b>
movslq -0x4(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x100(%rbp,%rax,8)
ff ff
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     126d <compute_expected_fraction_heads_min+0x14d>
movslq -0x8(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movslq -0x4(%rbp),%rax
addsd  -0x100(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x100(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1232 <compute_expected_fraction_heads_min+0x112>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    120f <compute_expected_fraction_heads_min+0xef>
movl   $0x1,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jg     129d <compute_expected_fraction_heads_min+0x17d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1282 <compute_expected_fraction_heads_min+0x162>
movl   $0x1,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jg     12d9 <compute_expected_fraction_heads_min+0x1b9>
mov    -0xc(%rbp),%esi
mov    $0x3e8,%edi
call   1030 <compute_combinations@plt>
movslq -0xc(%rbp),%rax
movsd  %xmm0,-0x2050(%rbp,%rax,8)
ff ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12a4 <compute_expected_fraction_heads_min+0x184>
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jg     13ae <compute_expected_fraction_heads_min+0x28e>
movl   $0x1,-0xc(%rbp)
movslq -0x4(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20b0(%rbp,%rax,8)
ff ff
cmpl   $0x3e8,-0xc(%rbp)
jg     13a0 <compute_expected_fraction_heads_min+0x280>
movslq -0xc(%rbp),%rax
movsd  -0x2050(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x20c8(%rbp)
ff
movslq -0x4(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
mov    -0xc(%rbp),%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20c8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20c0(%rbp)
ff
movslq -0x4(%rbp),%rax
movsd  -0x100(%rbp,%rax,8),%xmm0
ff ff
mov    $0x3e8,%edi
sub    -0xc(%rbp),%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x20c0(%rbp),%xmm0
ff
movslq -0x4(%rbp),%rax
movsd  -0x20b0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20b0(%rbp,%rax,8)
ff ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1301 <compute_expected_fraction_heads_min+0x1e1>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    12e0 <compute_expected_fraction_heads_min+0x1c0>
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20b8(%rbp)
ff
cmpl   $0xa,-0x4(%rbp)
jg     1402 <compute_expected_fraction_heads_min+0x2e2>
cvtsi2sdl -0x4(%rbp),%xmm0
movslq -0x4(%rbp),%rax
movsd  -0x20b0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x20b8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20b8(%rbp)
ff
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    13c0 <compute_expected_fraction_heads_min+0x2a0>
movsd  -0x20b8(%rbp),%xmm0
ff
movsd  0xbfe(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_expected_fraction_heads_min>:
push   %r15
push   %r14
push   %rbx
sub    $0x2090,%rsp
movsd  0xecc(%rip),%xmm0
mov    $0xa,%edi
call   1040 <pow@plt>
movsd  0xec2(%rip),%xmm1
divsd  %xmm0,%xmm1
mulsd  0xebe(%rip),%xmm1
unpcklpd %xmm1,%xmm1
movapd %xmm1,%xmm3
divpd  0xefe(%rip),%xmm3
movapd %xmm3,0x80(%rsp)
movapd %xmm1,%xmm0
divpd  0xef9(%rip),%xmm0
movapd %xmm0,0x90(%rsp)
movapd %xmm1,%xmm0
divpd  0xef4(%rip),%xmm0
movapd %xmm1,%xmm2
divpd  0xef8(%rip),%xmm2
movapd %xmm0,0xa0(%rsp)
movapd %xmm2,0xb0(%rsp)
divpd  0xeee(%rip),%xmm1
movapd %xmm1,0xc0(%rsp)
movlpd %xmm3,0xd0(%rsp)
mov    $0x1,%eax
xor    %ecx,%ecx
jmp    11da <compute_expected_fraction_heads_min+0xba>
nopl   (%rax)
add    $0x1,%rax
cmp    $0xb,%rcx
je     121e <compute_expected_fraction_heads_min+0xfe>
mov    %rcx,%rdx
movq   $0x0,0xe0(%rsp,%rcx,8)
add    $0x1,%rcx
cmp    $0x9,%rdx
ja     11d0 <compute_expected_fraction_heads_min+0xb0>
xorpd  %xmm0,%xmm0
mov    %rax,%rsi
nopw   0x0(%rax,%rax,1)
addsd  0x80(%rsp,%rsi,8),%xmm0
add    $0x1,%rsi
cmp    $0xb,%rsi
jne    1200 <compute_expected_fraction_heads_min+0xe0>
movsd  %xmm0,0xe0(%rsp,%rdx,8)
jmp    11d0 <compute_expected_fraction_heads_min+0xb0>
movapd %xmm3,0x10(%rsp)
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    $0x3e8,%edi
mov    %ebx,%esi
call   1030 <compute_combinations@plt>
movsd  %xmm0,0x140(%rsp,%rbx,8)
add    $0x1,%rbx
cmp    $0x3e9,%rbx
jne    1230 <compute_expected_fraction_heads_min+0x110>
xor    %r15d,%r15d
movapd 0x10(%rsp),%xmm1
nopl   0x0(%rax,%rax,1)
movq   $0x0,0x20(%rsp,%r15,8)
mov    $0x1,%ebx
xorpd  %xmm0,%xmm0
mov    $0x3e7,%r14d
movapd %xmm1,0x10(%rsp)
xchg   %ax,%ax
movsd  %xmm0,0x8(%rsp)
movsd  0x140(%rsp,%rbx,8),%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
mov    %ebx,%edi
call   1040 <pow@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe0(%rsp,%r15,8),%xmm0
mov    %r14d,%edi
call   1040 <pow@plt>
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  %xmm0,0x20(%rsp,%r15,8)
movsd  0x148(%rsp,%rbx,8),%xmm0
movsd  %xmm0,(%rsp)
lea    0x1(%rbx),%edi
movapd 0x10(%rsp),%xmm0
call   1040 <pow@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe0(%rsp,%r15,8),%xmm0
lea    -0x1(%r14),%edi
call   1040 <pow@plt>
movapd 0x10(%rsp),%xmm1
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp,%r15,8)
add    $0xfffffffe,%r14d
add    $0x2,%rbx
cmp    $0x3e9,%rbx
jne    1280 <compute_expected_fraction_heads_min+0x160>
add    $0x1,%r15
cmp    $0xb,%r15
je     1352 <compute_expected_fraction_heads_min+0x232>
movsd  0x80(%rsp,%r15,8),%xmm1
jmp    1260 <compute_expected_fraction_heads_min+0x140>
xorpd  %xmm0,%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm1
addsd  0x28(%rsp),%xmm1
movsd  0x30(%rsp),%xmm0
movsd  0x38(%rsp),%xmm2
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xc92(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  0x40(%rsp),%xmm0
mulsd  0xc88(%rip),%xmm0
addsd  %xmm2,%xmm0
movsd  0x48(%rsp),%xmm1
mulsd  0xc7e(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0x50(%rsp),%xmm0
mulsd  0xc74(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0x58(%rsp),%xmm1
mulsd  0xc6a(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0x60(%rsp),%xmm0
mulsd  0xc60(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0x68(%rsp),%xmm1
mulsd  0xc56(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xc52(%rip),%xmm2
movsd  0x70(%rsp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
add    $0x2090,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double @compute_expected_fraction_heads_min() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [11 x i32]
%5 = alloca double
%6 = alloca [11 x double]
%7 = alloca [11 x double]
%8 = alloca [1001 x double]
%9 = alloca [11 x double]
%10 = alloca double
store i32 0, i32* %1
br label %11
11: ; preds = %14, %0
%12 = load i32, i32* %1
%13 = icmp sle i32 %12, 10
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %11
17: ; preds = %11
%18 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 0
store i32 1, i32* %18
store i32 1, i32* %1
br label %19
19: ; preds = %22, %17
%20 = load i32, i32* %1
%21 = icmp sle i32 %20, 10
br i1 %21, label %22, label %35
22: ; preds = %19
%23 = load i32, i32* %1
%24 = load i32, i32* %1
%25 = sub nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = mul nsw i32 %23, %28
%30 = load i32, i32* %1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 %31
store i32 %29, i32* %32
%33 = load i32, i32* %1
%34 = add nsw i32 %33, 1
store i32 %34, i32* %1
br label %19
35: ; preds = %19
%36 = call double @pow(double 2.000000e+00, i32 10)
%37 = fdiv double 1.000000e+00, %36
store double %37, double* %5
store i32 0, i32* %1
br label %38
38: ; preds = %41, %35
%39 = load i32, i32* %1
%40 = icmp sle i32 %39, 10
br i1 %40, label %41, label %64
41: ; preds = %38
%42 = load double, double* %5
%43 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 10
%44 = load i32, i32* %43
%45 = sitofp i32 %44 to double
%46 = fmul double %42, %45
%47 = load i32, i32* %1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = load i32, i32* %1
%52 = sub nsw i32 10, %51
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = mul nsw i32 %50, %55
%57 = sitofp i32 %56 to double
%58 = fdiv double %46, %57
%59 = load i32, i32* %1
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [11 x double], [11 x double]* %6, i64 0, i64 %60
store double %58, double* %61
%62 = load i32, i32* %1
%63 = add nsw i32 %62, 1
store i32 %63, i32* %1
br label %38
64: ; preds = %38
store i32 0, i32* %1
br label %65
65: ; preds = %89, %64
%66 = load i32, i32* %1
%67 = icmp sle i32 %66, 10
br i1 %67, label %68, label %92
68: ; preds = %65
%69 = load i32, i32* %1
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [11 x double], [11 x double]* %7, i64 0, i64 %70
store double 0.000000e+00, double* %71
%72 = load i32, i32* %1
%73 = add nsw i32 %72, 1
store i32 %73, i32* %2
br label %74
74: ; preds = %77, %68
%75 = load i32, i32* %2
%76 = icmp sle i32 %75, 10
br i1 %76, label %77, label %89
77: ; preds = %74
%78 = load i32, i32* %2
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [11 x double], [11 x double]* %6, i64 0, i64 %79
%81 = load double, double* %80
%82 = load i32, i32* %1
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [11 x double], [11 x double]* %7, i64 0, i64 %83
%85 = load double, double* %84
%86 = fadd double %85, %81
store double %86, double* %84
%87 = load i32, i32* %2
%88 = add nsw i32 %87, 1
store i32 %88, i32* %2
br label %74
89: ; preds = %74
%90 = load i32, i32* %1
%91 = add nsw i32 %90, 1
store i32 %91, i32* %1
br label %65
92: ; preds = %65
store i32 1, i32* %3
br label %93
93: ; preds = %96, %92
%94 = load i32, i32* %3
%95 = icmp sle i32 %94, 1000
br i1 %95, label %96, label %99
96: ; preds = %93
%97 = load i32, i32* %3
%98 = add nsw i32 %97, 1
store i32 %98, i32* %3
br label %93
99: ; preds = %93
store i32 1, i32* %3
br label %100
100: ; preds = %103, %99
%101 = load i32, i32* %3
%102 = icmp sle i32 %101, 1000
br i1 %102, label %103, label %111
103: ; preds = %100
%104 = load i32, i32* %3
%105 = call double @compute_combinations(i32 1000, i32 %104)
%106 = load i32, i32* %3
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [1001 x double], [1001 x double]* %8, i64 0, i64 %107
store double %105, double* %108
%109 = load i32, i32* %3
%110 = add nsw i32 %109, 1
store i32 %110, i32* %3
br label %100
111: ; preds = %100
store i32 0, i32* %1
br label %112
112: ; preds = %148, %111
%113 = load i32, i32* %1
%114 = icmp sle i32 %113, 10
br i1 %114, label %115, label %151
115: ; preds = %112
store i32 1, i32* %3
%116 = load i32, i32* %1
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [11 x double], [11 x double]* %9, i64 0, i64 %117
store double 0.000000e+00, double* %118
br label %119
119: ; preds = %122, %115
%120 = load i32, i32* %3
%121 = icmp sle i32 %120, 1000
br i1 %121, label %122, label %148
122: ; preds = %119
%123 = load i32, i32* %3
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [1001 x double], [1001 x double]* %8, i64 0, i64 %124
%126 = load double, double* %125
%127 = load i32, i32* %1
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds [11 x double], [11 x double]* %6, i64 0, i64 %128
%130 = load double, double* %129
%131 = load i32, i32* %3
%132 = call double @pow(double %130, i32 %131)
%133 = fmul double %126, %132
%134 = load i32, i32* %1
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [11 x double], [11 x double]* %7, i64 0, i64 %135
%137 = load double, double* %136
%138 = load i32, i32* %3
%139 = sub nsw i32 1000, %138
%140 = call double @pow(double %137, i32 %139)
%141 = load i32, i32* %1
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [11 x double], [11 x double]* %9, i64 0, i64 %142
%144 = load double, double* %143
%145 = call double @llvm.fmuladd.f64(double %133, double %140, double %144)
store double %145, double* %143
%146 = load i32, i32* %3
%147 = add nsw i32 %146, 1
store i32 %147, i32* %3
br label %119
148: ; preds = %119
%149 = load i32, i32* %1
%150 = add nsw i32 %149, 1
store i32 %150, i32* %1
br label %112
151: ; preds = %112
store i32 0, i32* %1
store double 0.000000e+00, double* %10
br label %152
152: ; preds = %155, %151
%153 = load i32, i32* %1
%154 = icmp sle i32 %153, 10
br i1 %154, label %155, label %166
155: ; preds = %152
%156 = load i32, i32* %1
%157 = sitofp i32 %156 to double
%158 = load i32, i32* %1
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds [11 x double], [11 x double]* %9, i64 0, i64 %159
%161 = load double, double* %160
%162 = load double, double* %10
%163 = call double @llvm.fmuladd.f64(double %157, double %161, double %162)
store double %163, double* %10
%164 = load i32, i32* %1
%165 = add nsw i32 %164, 1
store i32 %165, i32* %1
br label %152
166: ; preds = %152
%167 = load double, double* %10
%168 = fdiv double %167, 1.000000e+01
ret double %168
}

LLVM IR (-O2):
define double @compute_expected_fraction_heads_min() {
%1 = alloca [11 x double]
%2 = alloca [11 x double]
%3 = alloca [1001 x double]
%4 = alloca [11 x double]
%5 = bitcast [11 x double]* %1 to i8*
%6 = bitcast [11 x double]* %2 to i8*
%7 = bitcast [1001 x double]* %3 to i8*
%8 = bitcast [11 x double]* %4 to i8*
%9 = tail call double @pow(double 2.000000e+00, i32 10)
%10 = fdiv double 1.000000e+00, %9
%11 = fmul double %10, 3.628800e+06
%12 = insertelement <2 x double> poison, double %11, i64 0
%13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> zeroinitializer
%14 = fdiv <2 x double> %13, <double 3.628800e+06, double 3.628800e+05>
%15 = bitcast [11 x double]* %1 to <2 x double>*
store <2 x double> %14, <2 x double>* %15
%16 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 2
%17 = fdiv <2 x double> %13, <double 8.064000e+04, double 3.024000e+04>
%18 = bitcast double* %16 to <2 x double>*
store <2 x double> %17, <2 x double>* %18
%19 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 4
%20 = fdiv <2 x double> %13, <double 1.728000e+04, double 1.440000e+04>
%21 = bitcast double* %19 to <2 x double>*
store <2 x double> %20, <2 x double>* %21
%22 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 6
%23 = fdiv <2 x double> %13, <double 1.728000e+04, double 3.024000e+04>
%24 = bitcast double* %22 to <2 x double>*
store <2 x double> %23, <2 x double>* %24
%25 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 8
%26 = fdiv <2 x double> %13, <double 8.064000e+04, double 3.628800e+05>
%27 = bitcast double* %25 to <2 x double>*
store <2 x double> %26, <2 x double>* %27
%28 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 10
%29 = extractelement <2 x double> %14, i64 0
store double %29, double* %28
br label %34
30: ; preds = %40
store double %45, double* %37
br label %31
31: ; preds = %30, %34
%32 = add nuw nsw i64 %36, 1
%33 = icmp eq i64 %38, 11
br i1 %33, label %48, label %34
34: ; preds = %0, %31
%35 = phi i64 [ 0, %0 ], [ %38, %31 ]
%36 = phi i64 [ 1, %0 ], [ %32, %31 ]
%37 = getelementptr inbounds [11 x double], [11 x double]* %2, i64 0, i64 %35
store double 0.000000e+00, double* %37
%38 = add nuw nsw i64 %35, 1
%39 = icmp ult i64 %35, 10
br i1 %39, label %40, label %31
40: ; preds = %34, %40
%41 = phi i64 [ %46, %40 ], [ %36, %34 ]
%42 = phi double [ %45, %40 ], [ 0.000000e+00, %34 ]
%43 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 %41
%44 = load double, double* %43
%45 = fadd double %44, %42
%46 = add nuw nsw i64 %41, 1
%47 = icmp eq i64 %46, 11
br i1 %47, label %30, label %40
48: ; preds = %31, %48
%49 = phi i64 [ %53, %48 ], [ 1, %31 ]
%50 = trunc i64 %49 to i32
%51 = tail call double @compute_combinations(i32 1000, i32 %50)
%52 = getelementptr inbounds [1001 x double], [1001 x double]* %3, i64 0, i64 %49
store double %51, double* %52
%53 = add nuw nsw i64 %49, 1
%54 = icmp eq i64 %53, 1001
br i1 %54, label %55, label %48
55: ; preds = %48, %89
%56 = phi double [ %91, %89 ], [ %29, %48 ]
%57 = phi i64 [ %87, %89 ], [ 0, %48 ]
%58 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 %57
store double 0.000000e+00, double* %58
%59 = getelementptr inbounds [11 x double], [11 x double]* %2, i64 0, i64 %57
br label %60
60: ; preds = %60, %55
%61 = phi double [ 0.000000e+00, %55 ], [ %83, %60 ]
%62 = phi i64 [ 1, %55 ], [ %84, %60 ]
%63 = getelementptr inbounds [1001 x double], [1001 x double]* %3, i64 0, i64 %62
%64 = load double, double* %63
%65 = trunc i64 %62 to i32
%66 = tail call double @pow(double %56, i32 %65)
%67 = fmul double %64, %66
%68 = load double, double* %59
%69 = trunc i64 %62 to i32
%70 = sub nuw nsw i32 1000, %69
%71 = tail call double @pow(double %68, i32 %70)
%72 = tail call double @llvm.fmuladd.f64(double %67, double %71, double %61)
store double %72, double* %58
%73 = add nuw nsw i64 %62, 1
%74 = getelementptr inbounds [1001 x double], [1001 x double]* %3, i64 0, i64 %73
%75 = load double, double* %74
%76 = trunc i64 %73 to i32
%77 = tail call double @pow(double %56, i32 %76)
%78 = fmul double %75, %77
%79 = load double, double* %59
%80 = trunc i64 %73 to i32
%81 = sub nuw nsw i32 1000, %80
%82 = tail call double @pow(double %79, i32 %81)
%83 = tail call double @llvm.fmuladd.f64(double %78, double %82, double %72)
store double %83, double* %58
%84 = add nuw nsw i64 %62, 2
%85 = icmp eq i64 %84, 1001
br i1 %85, label %86, label %60
86: ; preds = %60
%87 = add nuw nsw i64 %57, 1
%88 = icmp eq i64 %87, 11
br i1 %88, label %92, label %89
89: ; preds = %86
%90 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 %87
%91 = load double, double* %90
br label %55
92: ; preds = %86
%93 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 0
%94 = load double, double* %93
%95 = tail call double @llvm.fmuladd.f64(double %94, double 0.000000e+00, double 0.000000e+00)
%96 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 1
%97 = load double, double* %96
%98 = fadd double %97, %95
%99 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 2
%100 = load double, double* %99
%101 = tail call double @llvm.fmuladd.f64(double %100, double 2.000000e+00, double %98)
%102 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 3
%103 = load double, double* %102
%104 = tail call double @llvm.fmuladd.f64(double %103, double 3.000000e+00, double %101)
%105 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 4
%106 = load double, double* %105
%107 = tail call double @llvm.fmuladd.f64(double %106, double 4.000000e+00, double %104)
%108 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 5
%109 = load double, double* %108
%110 = tail call double @llvm.fmuladd.f64(double %109, double 5.000000e+00, double %107)
%111 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 6
%112 = load double, double* %111
%113 = tail call double @llvm.fmuladd.f64(double %112, double 6.000000e+00, double %110)
%114 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 7
%115 = load double, double* %114
%116 = tail call double @llvm.fmuladd.f64(double %115, double 7.000000e+00, double %113)
%117 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 8
%118 = load double, double* %117
%119 = tail call double @llvm.fmuladd.f64(double %118, double 8.000000e+00, double %116)
%120 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 9
%121 = load double, double* %120
%122 = tail call double @llvm.fmuladd.f64(double %121, double 9.000000e+00, double %119)
%123 = getelementptr inbounds [11 x double], [11 x double]* %4, i64 0, i64 10
%124 = load double, double* %123
%125 = tail call double @llvm.fmuladd.f64(double %124, double 1.000000e+01, double %122)
%126 = fdiv double %125, 1.000000e+01
ret double %126
}