#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 */
scalar_t__ dfsConnect(int *);
int /*<<< orphan*/ fatShuffle(int *);
int /*<<< orphan*/ guardInit(int *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ srand(int);
void ksubWinProbs(void) {
  int fatV[((9 + 2) * (9 + 2))];
  guardInit(fatV);
  srand(9913987);
  int j, wins = 0;
  for (j = 0; j < 1000000; j++) {
    fatShuffle(fatV);
    wins += dfsConnect(fatV);
  }
  printf("%f\n", (1.0 * wins) / (1.0 * 1000000));
}


x86 assembly (clang, -O0):
<ksubWinProbs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x1f0(%rbp),%rdi
call   1050 <guardInit@plt>
mov    $0x974683,%edi
call   1040 <srand@plt>
movl   $0x0,-0x1f8(%rbp)
movl   $0x0,-0x1f4(%rbp)
cmpl   $0xf4240,-0x1f4(%rbp)
jge    11d4 <ksubWinProbs+0x84>
lea    -0x1f0(%rbp),%rdi
call   1060 <fatShuffle@plt>
lea    -0x1f0(%rbp),%rdi
call   1070 <dfsConnect@plt>
mov    %rax,%rcx
movslq -0x1f8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x1f8(%rbp)
mov    -0x1f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f4(%rbp)
jmp    1185 <ksubWinProbs+0x35>
cvtsi2sdl -0x1f8(%rbp),%xmm1
ff
movsd  0xe24(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe10(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ksubWinProbs>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1f0,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <guardInit@plt>
mov    $0x974683,%edi
call   1040 <srand@plt>
xor    %ebp,%ebp
mov    $0xf4240,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1060 <fatShuffle@plt>
mov    %r14,%rdi
call   1070 <dfsConnect@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
jne    1180 <ksubWinProbs+0x30>
cvtsi2sd %ebp,%xmm0
divsd  0xe5d(%rip),%xmm0
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
add    $0x1f0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define void @ksubWinProbs() {
%1 = alloca [121 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [121 x i32], [121 x i32]* %1, i64 0, i64 0
%5 = call i32 @guardInit(i32* %4)
%6 = call i32 @srand(i32 9913987)
store i32 0, i32* %3
store i32 0, i32* %2
br label %7
7: ; preds = %19, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1000000
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = getelementptr inbounds [121 x i32], [121 x i32]* %1, i64 0, i64 0
%12 = call i32 @fatShuffle(i32* %11)
%13 = getelementptr inbounds [121 x i32], [121 x i32]* %1, i64 0, i64 0
%14 = call i64 @dfsConnect(i32* %13)
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = add nsw i64 %16, %14
%18 = trunc i64 %17 to i32
store i32 %18, i32* %3
br label %19
19: ; preds = %10
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %7
22: ; preds = %7
%23 = load i32, i32* %3
%24 = sitofp i32 %23 to double
%25 = fmul double 1.000000e+00, %24
%26 = fdiv double %25, 1.000000e+06
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %26)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @ksubWinProbs() {
%1 = alloca [121 x i32]
%2 = bitcast [121 x i32]* %1 to i8*
%3 = getelementptr inbounds [121 x i32], [121 x i32]* %1, i64 0, i64 0
%4 = call i32 @guardInit(i32* %3)
%5 = call i32 @srand(i32 9913987)
br label %6
6: ; preds = %0, %6
%7 = phi i32 [ 0, %0 ], [ %12, %6 ]
%8 = phi i32 [ 0, %0 ], [ %13, %6 ]
%9 = call i32 @fatShuffle(i32* %3)
%10 = call i64 @dfsConnect(i32* %3)
%11 = trunc i64 %10 to i32
%12 = add i32 %7, %11
%13 = add nuw nsw i32 %8, 1
%14 = icmp eq i32 %13, 1000000
br i1 %14, label %15, label %6
15: ; preds = %6
%16 = sitofp i32 %12 to double
%17 = fdiv double %16, 1.000000e+06
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %17)
ret void
}