#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 /*<<< orphan*/ defineSeed(int);
size_t polyRollDice(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
void randomTest() {
  int frequency[19], loop;
  for (loop = 0; loop < 19; ++loop)
    frequency[loop] = 0;
  for (loop = 1; loop < 216; ++loop) {
    defineSeed(loop);
    frequency[polyRollDice(3, 6)]++;
  }
  for (loop = 3; loop < 19; ++loop)
    printf("%d\t%d\n", loop, frequency[loop]);
  scanf("%d", &loop);
  return;
}


x86 assembly (clang, -O0):
<randomTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x54(%rbp)
cmpl   $0x13,-0x54(%rbp)
jge    1173 <randomTest+0x33>
movslq -0x54(%rbp),%rax
movl   $0x0,-0x50(%rbp,%rax,4)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    114f <randomTest+0xf>
movl   $0x1,-0x54(%rbp)
cmpl   $0xd8,-0x54(%rbp)
jge    11b7 <randomTest+0x77>
mov    -0x54(%rbp),%edi
call   1030 <defineSeed@plt>
mov    $0x3,%edi
mov    $0x6,%esi
call   1050 <polyRollDice@plt>
mov    -0x50(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    117a <randomTest+0x3a>
movl   $0x3,-0x54(%rbp)
cmpl   $0x13,-0x54(%rbp)
jge    11ed <randomTest+0xad>
mov    -0x54(%rbp),%esi
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%edx
lea    0xe26(%rip),%rdi
call   1040 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11be <randomTest+0x7e>
lea    0xe13(%rip),%rdi
lea    -0x54(%rbp),%rsi
call   1060 <scanf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomTest>:
push   %rbx
sub    $0x60,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movups %xmm0,0x4c(%rsp)
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <defineSeed@plt>
mov    $0x3,%edi
mov    $0x6,%esi
call   1050 <polyRollDice@plt>
addl   $0x1,0x10(%rsp,%rax,4)
add    $0x1,%ebx
cmp    $0xd8,%ebx
jne    1170 <randomTest+0x30>
mov    0x1c(%rsp),%edx
lea    0xe5f(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
mov    0x20(%rsp),%edx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
mov    0x24(%rsp),%edx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
mov    0x28(%rsp),%edx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <printf@plt>
mov    0x2c(%rsp),%edx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
mov    0x30(%rsp),%edx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    0x34(%rsp),%edx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <printf@plt>
mov    0x38(%rsp),%edx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
mov    0x3c(%rsp),%edx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <printf@plt>
mov    0x40(%rsp),%edx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1040 <printf@plt>
mov    0x44(%rsp),%edx
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <printf@plt>
mov    0x48(%rsp),%edx
mov    %rbx,%rdi
mov    $0xe,%esi
call   1040 <printf@plt>
mov    0x4c(%rsp),%edx
mov    %rbx,%rdi
mov    $0xf,%esi
call   1040 <printf@plt>
mov    0x50(%rsp),%edx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <printf@plt>
mov    0x54(%rsp),%edx
mov    %rbx,%rdi
mov    $0x11,%esi
call   1040 <printf@plt>
mov    0x58(%rsp),%edx
mov    %rbx,%rdi
mov    $0x12,%esi
call   1040 <printf@plt>
movl   $0x13,0xc(%rsp)
lea    0xd4b(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d\09%d\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define void @randomTest() {
%1 = alloca [19 x i32]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 19
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 %8
store i32 0, i32* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
store i32 1, i32* %2
br label %14
14: ; preds = %24, %13
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 216
br i1 %16, label %17, label %27
17: ; preds = %14
%18 = load i32, i32* %2
%19 = call i32 @defineSeed(i32 %18)
%20 = call i64 @polyRollDice(i32 3, i32 6)
%21 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 1
store i32 %23, i32* %21
br label %24
24: ; preds = %17
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %14
27: ; preds = %14
store i32 3, i32* %2
br label %28
28: ; preds = %38, %27
%29 = load i32, i32* %2
%30 = icmp slt i32 %29, 19
br i1 %30, label %31, label %41
31: ; preds = %28
%32 = load i32, i32* %2
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %32, i32 %36)
br label %38
38: ; preds = %31
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %28
41: ; preds = %28
%42 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d\09%d\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define void @randomTest() {
%1 = alloca [19 x i32]
%2 = bitcast [19 x i32]* %1 to i8*
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %55
5: ; preds = %55
%6 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 3
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 3, i32 %7)
%9 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 4
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 4, i32 %10)
%12 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 5
%13 = load i32, i32* %12
%14 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5, i32 %13)
%15 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 6
%16 = load i32, i32* %15
%17 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6, i32 %16)
%18 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 7
%19 = load i32, i32* %18
%20 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 7, i32 %19)
%21 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 8
%22 = load i32, i32* %21
%23 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 8, i32 %22)
%24 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 9
%25 = load i32, i32* %24
%26 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 9, i32 %25)
%27 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 10
%28 = load i32, i32* %27
%29 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 10, i32 %28)
%30 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 11
%31 = load i32, i32* %30
%32 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 11, i32 %31)
%33 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 12
%34 = load i32, i32* %33
%35 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 12, i32 %34)
%36 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 13
%37 = load i32, i32* %36
%38 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 13, i32 %37)
%39 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 14
%40 = load i32, i32* %39
%41 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 14, i32 %40)
%42 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 15
%43 = load i32, i32* %42
%44 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 15, i32 %43)
%45 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 16
%46 = load i32, i32* %45
%47 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 16, i32 %46)
%48 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 17
%49 = load i32, i32* %48
%50 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 17, i32 %49)
%51 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 18
%52 = load i32, i32* %51
%53 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 18, i32 %52)
store i32 19, i32* %3
%54 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
ret void
55: ; preds = %0, %55
%56 = phi i32 [ 1, %0 ], [ %62, %55 ]
%57 = tail call i32 @defineSeed(i32 %56)
%58 = tail call i64 @polyRollDice(i32 3, i32 6)
%59 = getelementptr inbounds [19 x i32], [19 x i32]* %1, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = add nsw i32 %60, 1
store i32 %61, i32* %59
%62 = add nuw nsw i32 %56, 1
%63 = icmp eq i32 %62, 216
br i1 %63, label %5, label %55
}