#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 */
int dfsConnect(int *);
int /*<<< orphan*/ fatShuffle(int *);
int /*<<< orphan*/ guardInit(int *);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ showAsBoard(int *);
int /*<<< orphan*/ srand(int);
int main(void) {
  srand(9913985);
  int fatV[((35 + 2) * (35 + 2))];
  guardInit(fatV);
  int j, wins = 0;
  for (j = 0; j < 1000; j++) {
    fatShuffle(fatV);
    wins += dfsConnect(fatV);
  }
  printf("shuffled %d wins %d samples\n", wins, 1000);
  wins = 0;
  for (j = 0; !wins; j++) {
    fatShuffle(fatV);
    wins = dfsConnect(fatV);
    printf("%d try\n", j);
  }
  showAsBoard(fatV);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1580,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x974681,%edi
call   1040 <srand@plt>
lea    -0x1570(%rbp),%rdi
call   1050 <guardInit@plt>
movl   $0x0,-0x1578(%rbp)
movl   $0x0,-0x1574(%rbp)
cmpl   $0x3e8,-0x1574(%rbp)
jge    11e4 <main+0x84>
lea    -0x1570(%rbp),%rdi
call   1060 <fatShuffle@plt>
lea    -0x1570(%rbp),%rdi
call   1070 <dfsConnect@plt>
add    -0x1578(%rbp),%eax
mov    %eax,-0x1578(%rbp)
mov    -0x1574(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1574(%rbp)
jmp    119c <main+0x3c>
mov    -0x1578(%rbp),%esi
lea    0xe0f(%rip),%rdi
mov    $0x3e8,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1578(%rbp)
movl   $0x0,-0x1574(%rbp)
cmpl   $0x0,-0x1578(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    122a <main+0xca>
jmp    1270 <main+0x110>
lea    -0x1570(%rbp),%rdi
call   1060 <fatShuffle@plt>
lea    -0x1570(%rbp),%rdi
call   1070 <dfsConnect@plt>
mov    %eax,-0x1578(%rbp)
mov    -0x1574(%rbp),%esi
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1574(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1574(%rbp)
jmp    1211 <main+0xb1>
lea    -0x1570(%rbp),%rdi
call   1080 <showAsBoard@plt>
xor    %eax,%eax
add    $0x1580,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x1568,%rsp
mov    $0x974681,%edi
call   1040 <srand@plt>
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <guardInit@plt>
xor    %ebx,%ebx
mov    $0x3e8,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
call   1060 <fatShuffle@plt>
mov    %r14,%rdi
call   1070 <dfsConnect@plt>
add    %eax,%ebx
add    $0xffffffff,%ebp
jne    1190 <main+0x30>
lea    0xe52(%rip),%rdi
mov    %ebx,%esi
mov    $0x3e8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%r15
lea    0xe57(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1060 <fatShuffle@plt>
mov    %r15,%rdi
call   1070 <dfsConnect@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
test   %ebx,%ebx
je     11d0 <main+0x70>
mov    %rsp,%rdi
call   1080 <showAsBoard@plt>
xor    %eax,%eax
add    $0x1568,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"shuffled %d wins %d samples\0A\00"
@.str.1 = [8 x i8] c"%d try\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1369 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @srand(i32 9913985)
%6 = getelementptr inbounds [1369 x i32], [1369 x i32]* %2, i64 0, i64 0
%7 = call i32 @guardInit(i32* %6)
store i32 0, i32* %4
store i32 0, i32* %3
br label %8
8: ; preds = %18, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 1000
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = getelementptr inbounds [1369 x i32], [1369 x i32]* %2, i64 0, i64 0
%13 = call i32 @fatShuffle(i32* %12)
%14 = getelementptr inbounds [1369 x i32], [1369 x i32]* %2, i64 0, i64 0
%15 = call i32 @dfsConnect(i32* %14)
%16 = load i32, i32* %4
%17 = add nsw i32 %16, %15
store i32 %17, i32* %4
br label %18
18: ; preds = %11
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %8
21: ; preds = %8
%22 = load i32, i32* %4
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %22, i32 1000)
store i32 0, i32* %4
store i32 0, i32* %3
br label %24
24: ; preds = %35, %21
%25 = load i32, i32* %4
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
br i1 %27, label %28, label %38
28: ; preds = %24
%29 = getelementptr inbounds [1369 x i32], [1369 x i32]* %2, i64 0, i64 0
%30 = call i32 @fatShuffle(i32* %29)
%31 = getelementptr inbounds [1369 x i32], [1369 x i32]* %2, i64 0, i64 0
%32 = call i32 @dfsConnect(i32* %31)
store i32 %32, i32* %4
%33 = load i32, i32* %3
%34 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %28
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %24
38: ; preds = %24
%39 = getelementptr inbounds [1369 x i32], [1369 x i32]* %2, i64 0, i64 0
%40 = call i32 @showAsBoard(i32* %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"shuffled %d wins %d samples\0A\00"
@.str.1 = [8 x i8] c"%d try\0A\00"
define i32 @main() {
%1 = alloca [1369 x i32]
%2 = tail call i32 @srand(i32 9913985)
%3 = bitcast [1369 x i32]* %1 to i8*
%4 = getelementptr inbounds [1369 x i32], [1369 x i32]* %1, i64 0, i64 0
%5 = call i32 @guardInit(i32* %4)
br label %6
6: ; preds = %0, %6
%7 = phi i32 [ 0, %0 ], [ %11, %6 ]
%8 = phi i32 [ 0, %0 ], [ %12, %6 ]
%9 = call i32 @fatShuffle(i32* %4)
%10 = call i32 @dfsConnect(i32* %4)
%11 = add nsw i32 %10, %7
%12 = add nuw nsw i32 %8, 1
%13 = icmp eq i32 %12, 1000
br i1 %13, label %14, label %6
14: ; preds = %6
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %11, i32 1000)
br label %16
16: ; preds = %14, %16
%17 = phi i32 [ 0, %14 ], [ %21, %16 ]
%18 = call i32 @fatShuffle(i32* %4)
%19 = call i32 @dfsConnect(i32* %4)
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%21 = add nuw nsw i32 %17, 1
%22 = icmp eq i32 %19, 0
br i1 %22, label %16, label %23
23: ; preds = %16
%24 = call i32 @showAsBoard(i32* %4)
ret i32 0
}