#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 roll;
  int a;
  int b;
  int ones = 0;
  int twos = 0;
  int three = 0;
  int four = 0;
  int five = 0;
  int sixs = 0;
  int counter = 1;
  srand(time(NULL));
  printf("How many times do you want to roll the dice?\n");
  scanf("%d", &b);
  while (counter <= b) {
    roll = rand() % 6;
    a = rand() % 6 + 1;
    if (a == 1) {
      ones++;
    } else if (a == 2) {
      twos++;
    } else if (a == 3) {
      three++;
    } else if (a == 4) {
      four++;
    } else if (a == 5) {
      five++;
    } else if (a == 6) {
      sixs++;
    }
    counter++;
  }
  printf("Ones = %d\n", ones);
  printf("Twos = %d\n", twos);
  printf("Threes = %d\n", three);
  printf("Fours = %d\n", four);
  printf("Fives = %d\n", five);
  printf("Sixes = %d\n", sixs);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%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)
movl   $0x1,-0x2c(%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    0xe79(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x2c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     12a3 <main+0x153>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
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    1209 <main+0xb9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1295 <main+0x145>
cmpl   $0x2,-0xc(%rbp)
jne    1221 <main+0xd1>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1290 <main+0x140>
cmpl   $0x3,-0xc(%rbp)
jne    1239 <main+0xe9>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    128b <main+0x13b>
cmpl   $0x4,-0xc(%rbp)
jne    1251 <main+0x101>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1286 <main+0x136>
cmpl   $0x5,-0xc(%rbp)
jne    1269 <main+0x119>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1281 <main+0x131>
cmpl   $0x6,-0xc(%rbp)
jne    127c <main+0x12c>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1281 <main+0x131>
jmp    1286 <main+0x136>
jmp    128b <main+0x13b>
jmp    1290 <main+0x140>
jmp    1295 <main+0x145>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11be <main+0x6e>
mov    -0x14(%rbp),%esi
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %r12d,%r12d
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xe86(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1070 <scanf@plt>
cmpl   $0x0,0x14(%rsp)
mov    $0x0,%ebp
mov    $0x0,%ebx
mov    $0x0,%r13d
movl   $0x0,0xc(%rsp)
movl   $0x0,0x10(%rsp)
jle    1261 <main+0x101>
lea    0xe32(%rip),%r14
xor    %r15d,%r15d
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
xor    %r13d,%r13d
xor    %ebx,%ebx
xor    %ebp,%ebp
xor    %r12d,%r12d
jmp    120b <main+0xab>
addl   $0x1,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r15d
cmp    0x14(%rsp),%r15d
jge    1261 <main+0x101>
xor    %eax,%eax
call   1080 <rand@plt>
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
sub    %ecx,%eax
cmp    $0x5,%eax
ja     1200 <main+0xa0>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
add    $0x1,%r12d
jmp    1200 <main+0xa0>
add    $0x1,%ebp
jmp    1200 <main+0xa0>
add    $0x1,%ebx
jmp    1200 <main+0xa0>
add    $0x1,%r13d
jmp    1200 <main+0xa0>
addl   $0x1,0xc(%rsp)
jmp    1200 <main+0xa0>
lea    0xdb3(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdad(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xda8(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xda5(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xda0(%rip),%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd9a(%rip),%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"How many times do you want to roll the dice?\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [11 x i8] c"Ones = %d\0A\00"
@.str.3 = [11 x i8] c"Twos = %d\0A\00"
@.str.4 = [13 x i8] c"Threes = %d\0A\00"
@.str.5 = [12 x i8] c"Fours = %d\0A\00"
@.str.6 = [12 x i8] c"Fives = %d\0A\00"
@.str.7 = [12 x i8] c"Sixes = %d\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
%11 = alloca i32
store i32 0, i32* %1
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
store i32 1, i32* %11
%12 = call i32 @time(i32* null)
%13 = call i32 @srand(i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
br label %16
16: ; preds = %66, %0
%17 = load i32, i32* %11
%18 = load i32, i32* %4
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %69
20: ; preds = %16
%21 = call i32 (...) @rand()
%22 = srem i32 %21, 6
store i32 %22, i32* %2
%23 = call i32 (...) @rand()
%24 = srem i32 %23, 6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %31
28: ; preds = %20
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %66
31: ; preds = %20
%32 = load i32, i32* %3
%33 = icmp eq i32 %32, 2
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %65
37: ; preds = %31
%38 = load i32, i32* %3
%39 = icmp eq i32 %38, 3
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %64
43: ; preds = %37
%44 = load i32, i32* %3
%45 = icmp eq i32 %44, 4
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = load i32, i32* %8
%48 = add nsw i32 %47, 1
store i32 %48, i32* %8
br label %63
49: ; preds = %43
%50 = load i32, i32* %3
%51 = icmp eq i32 %50, 5
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load i32, i32* %9
%54 = add nsw i32 %53, 1
store i32 %54, i32* %9
br label %62
55: ; preds = %49
%56 = load i32, i32* %3
%57 = icmp eq i32 %56, 6
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i32, i32* %10
%60 = add nsw i32 %59, 1
store i32 %60, i32* %10
br label %61
61: ; preds = %58, %55
br label %62
62: ; preds = %61, %52
br label %63
63: ; preds = %62, %46
br label %64
64: ; preds = %63, %40
br label %65
65: ; preds = %64, %34
br label %66
66: ; preds = %65, %28
%67 = load i32, i32* %11
%68 = add nsw i32 %67, 1
store i32 %68, i32* %11
br label %16
69: ; preds = %16
%70 = load i32, i32* %5
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %70)
%72 = load i32, i32* %6
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %72)
%74 = load i32, i32* %7
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %74)
%76 = load i32, i32* %8
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %76)
%78 = load i32, i32* %9
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %78)
%80 = load i32, i32* %10
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %80)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [11 x i8] c"Ones = %d\0A\00"
@.str.3 = [11 x i8] c"Twos = %d\0A\00"
@.str.4 = [13 x i8] c"Threes = %d\0A\00"
@.str.5 = [12 x i8] c"Fours = %d\0A\00"
@.str.6 = [12 x i8] c"Fives = %d\0A\00"
@.str.7 = [12 x i8] c"Sixes = %d\0A\00"
@str = [45 x i8] c"How many times do you want to roll the dice?\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 ([45 x i8], [45 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, 1
br i1 %8, label %42, label %9
9: ; preds = %0, %32
%10 = phi i32 [ %39, %32 ], [ 1, %0 ]
%11 = phi i32 [ %38, %32 ], [ 0, %0 ]
%12 = phi i32 [ %37, %32 ], [ 0, %0 ]
%13 = phi i32 [ %36, %32 ], [ 0, %0 ]
%14 = phi i32 [ %35, %32 ], [ 0, %0 ]
%15 = phi i32 [ %34, %32 ], [ 0, %0 ]
%16 = phi i32 [ %33, %32 ], [ 0, %0 ]
%17 = call i32 (...) @rand()
%18 = call i32 (...) @rand()
%19 = srem i32 %18, 6
switch i32 %19, label %32 [
i32 0, label %20
i32 1, label %22
i32 2, label %24
i32 3, label %26
i32 4, label %28
i32 5, label %30
]
20: ; preds = %9
%21 = add nsw i32 %16, 1
br label %32
22: ; preds = %9
%23 = add nsw i32 %15, 1
br label %32
24: ; preds = %9
%25 = add nsw i32 %14, 1
br label %32
26: ; preds = %9
%27 = add nsw i32 %13, 1
br label %32
28: ; preds = %9
%29 = add nsw i32 %12, 1
br label %32
30: ; preds = %9
%31 = add nsw i32 %11, 1
br label %32
32: ; preds = %9, %22, %26, %30, %28, %24, %20
%33 = phi i32 [ %21, %20 ], [ %16, %22 ], [ %16, %24 ], [ %16, %26 ], [ %16, %28 ], [ %16, %30 ], [ %16, %9 ]
%34 = phi i32 [ %15, %20 ], [ %23, %22 ], [ %15, %24 ], [ %15, %26 ], [ %15, %28 ], [ %15, %30 ], [ %15, %9 ]
%35 = phi i32 [ %14, %20 ], [ %14, %22 ], [ %25, %24 ], [ %14, %26 ], [ %14, %28 ], [ %14, %30 ], [ %14, %9 ]
%36 = phi i32 [ %13, %20 ], [ %13, %22 ], [ %13, %24 ], [ %27, %26 ], [ %13, %28 ], [ %13, %30 ], [ %13, %9 ]
%37 = phi i32 [ %12, %20 ], [ %12, %22 ], [ %12, %24 ], [ %12, %26 ], [ %29, %28 ], [ %12, %30 ], [ %12, %9 ]
%38 = phi i32 [ %11, %20 ], [ %11, %22 ], [ %11, %24 ], [ %11, %26 ], [ %11, %28 ], [ %31, %30 ], [ %11, %9 ]
%39 = add nuw nsw i32 %10, 1
%40 = load i32, i32* %1
%41 = icmp slt i32 %10, %40
br i1 %41, label %9, label %42
42: ; preds = %32, %0
%43 = phi i32 [ 0, %0 ], [ %33, %32 ]
%44 = phi i32 [ 0, %0 ], [ %34, %32 ]
%45 = phi i32 [ 0, %0 ], [ %35, %32 ]
%46 = phi i32 [ 0, %0 ], [ %36, %32 ]
%47 = phi i32 [ 0, %0 ], [ %37, %32 ]
%48 = phi i32 [ 0, %0 ], [ %38, %32 ]
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %43)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %44)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %45)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %46)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %47)
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %48)
ret i32 0
}