#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*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int rolltimes;
  int dice;
  int ctr = 0;
  int uno = 0;
  int two = 0;
  int three = 0;
  int four = 0;
  int five = 0;
  int six = 0;
  srand(time(NULL));
  printf("Roll the die how many times? \n");
  scanf("%d", &rolltimes);
  while (ctr <= rolltimes) {
    dice = rand() % 6 + 1;
    if (dice == 1) {
      uno = uno + 1;
    }
    if (dice == 2) {
      two++;
    }
    if (dice == 3) {
      three++;
    }
    if (dice == 4) {
      four++;
    }
    if (dice == 5) {
      five++;
    }
    if (dice == 6) {
      six = six + 1;
    }
    ctr++;
  }
  printf("You rolled a one %d times! \n", uno);
  printf("You rolled a two %d times! \n", two);
  printf("You rolled a three %d times! \n", three);
  printf("You rolled a four %d times! \n", four);
  printf("You rolled a five %d times! \n", five);
  printf("You rolled a six %d times! \n", six);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     125f <main+0x10f>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11f2 <main+0xa2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1205 <main+0xb5>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x3,-0xc(%rbp)
jne    1218 <main+0xc8>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x4,-0xc(%rbp)
jne    122b <main+0xdb>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x5,-0xc(%rbp)
jne    123e <main+0xee>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x6,-0xc(%rbp)
jne    1251 <main+0x101>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11be <main+0x6e>
mov    -0x14(%rbp),%esi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xdd1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
xor    %ebx,%ebx
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xf46(%rip),%rdi
call   1030 <puts@plt>
lea    0xe85(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
js     121a <main+0xba>
pxor   %xmm0,%xmm0
movdqa %xmm0,0x10(%rsp)
mov    $0xffffffff,%ebp
xor    %r14d,%r14d
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
mov    %eax,%edx
sub    %ecx,%edx
neg    %ecx
cmp    $0x1,%edx
adc    $0x0,%ebx
add    %ecx,%eax
add    $0x1,%eax
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm0
pcmpeqd 0xe0c(%rip),%xmm0
movdqa 0x10(%rsp),%xmm1
psubd  %xmm0,%xmm1
movdqa %xmm1,0x10(%rsp)
xor    %ecx,%ecx
cmp    $0x6,%eax
sete   %cl
add    %ecx,%r14d
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     11b0 <main+0x50>
jmp    1227 <main+0xc7>
pxor   %xmm0,%xmm0
movdqa %xmm0,0x10(%rsp)
xor    %r14d,%r14d
lea    0xde5(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movdqa 0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xde8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pshufd $0x55,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xdec(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pshufd $0xee,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xdf2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pshufd $0xff,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xdf7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe07(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Roll the die how many times? \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"You rolled a one %d times! \0A\00"
@.str.3 = [29 x i8] c"You rolled a two %d times! \0A\00"
@.str.4 = [31 x i8] c"You rolled a three %d times! \0A\00"
@.str.5 = [30 x i8] c"You rolled a four %d times! \0A\00"
@.str.6 = [30 x i8] c"You rolled a five %d times! \0A\00"
@.str.7 = [29 x i8] c"You rolled a six %d times! \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%11 = call i32 @time(i32* null)
%12 = call i32 @srand(i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %15
15: ; preds = %58, %0
%16 = load i32, i32* %4
%17 = load i32, i32* %2
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %61
19: ; preds = %15
%20 = call i32 (...) @rand()
%21 = srem i32 %20, 6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
%23 = load i32, i32* %3
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %28
28: ; preds = %25, %19
%29 = load i32, i32* %3
%30 = icmp eq i32 %29, 2
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %34
34: ; preds = %31, %28
%35 = load i32, i32* %3
%36 = icmp eq i32 %35, 3
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %40
40: ; preds = %37, %34
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, 4
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %46
46: ; preds = %43, %40
%47 = load i32, i32* %3
%48 = icmp eq i32 %47, 5
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = load i32, i32* %9
%51 = add nsw i32 %50, 1
store i32 %51, i32* %9
br label %52
52: ; preds = %49, %46
%53 = load i32, i32* %3
%54 = icmp eq i32 %53, 6
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = load i32, i32* %10
%57 = add nsw i32 %56, 1
store i32 %57, i32* %10
br label %58
58: ; preds = %55, %52
%59 = load i32, i32* %4
%60 = add nsw i32 %59, 1
store i32 %60, i32* %4
br label %15
61: ; preds = %15
%62 = load i32, i32* %5
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %62)
%64 = load i32, i32* %6
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %64)
%66 = load i32, i32* %7
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i32 %66)
%68 = load i32, i32* %8
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %68)
%70 = load i32, i32* %9
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %70)
%72 = load i32, i32* %10
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i32 %72)
%74 = load i32, i32* %1
ret i32 %74
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"You rolled a one %d times! \0A\00"
@.str.3 = [29 x i8] c"You rolled a two %d times! \0A\00"
@.str.4 = [31 x i8] c"You rolled a three %d times! \0A\00"
@.str.5 = [30 x i8] c"You rolled a four %d times! \0A\00"
@.str.6 = [30 x i8] c"You rolled a five %d times! \0A\00"
@.str.7 = [29 x i8] c"You rolled a six %d times! \0A\00"
@str = [30 x i8] c"Roll the die how many times? \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 0
br i1 %8, label %31, label %9
9: ; preds = %0, %9
%10 = phi i32 [ %27, %9 ], [ 0, %0 ]
%11 = phi i32 [ %19, %9 ], [ 0, %0 ]
%12 = phi i32 [ %28, %9 ], [ 0, %0 ]
%13 = phi <4 x i32> [ %24, %9 ], [ zeroinitializer, %0 ]
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 6
%16 = add nsw i32 %15, 1
%17 = icmp eq i32 %15, 0
%18 = zext i1 %17 to i32
%19 = add nuw nsw i32 %11, %18
%20 = insertelement <4 x i32> poison, i32 %16, i64 0
%21 = shufflevector <4 x i32> %20, <4 x i32> poison, <4 x i32> zeroinitializer
%22 = icmp eq <4 x i32> %21, <i32 2, i32 3, i32 4, i32 5>
%23 = zext <4 x i1> %22 to <4 x i32>
%24 = add nuw nsw <4 x i32> %13, %23
%25 = icmp eq i32 %16, 6
%26 = zext i1 %25 to i32
%27 = add nuw nsw i32 %10, %26
%28 = add nuw nsw i32 %12, 1
%29 = load i32, i32* %1
%30 = icmp slt i32 %12, %29
br i1 %30, label %9, label %31
31: ; preds = %9, %0
%32 = phi i32 [ 0, %0 ], [ %19, %9 ]
%33 = phi i32 [ 0, %0 ], [ %27, %9 ]
%34 = phi <4 x i32> [ zeroinitializer, %0 ], [ %24, %9 ]
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%36 = extractelement <4 x i32> %34, i64 0
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %36)
%38 = extractelement <4 x i32> %34, i64 1
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i32 %38)
%40 = extractelement <4 x i32> %34, i64 2
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %40)
%42 = extractelement <4 x i32> %34, i64 3
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i32 %33)
ret i32 0
}