#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 */
size_t getRollResult();
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand((time(NULL)));
  int totals[13] = {0};
  int i;
  for (i = 0; i <= 36000; i++)
    ++totals[(getRollResult() + getRollResult())];
  for (i = 2; i <= 12; i++) {
    printf("%d:\t%d\n", i, totals[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x34,%edx
call   1040 <memset@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x8ca0,-0x44(%rbp)
jg     11c8 <main+0x78>
mov    $0x0,%al
call   1060 <getRollResult@plt>
mov    %rax,-0x50(%rbp)
mov    $0x0,%al
call   1060 <getRollResult@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
add    %rcx,%rax
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1186 <main+0x36>
movl   $0x2,-0x44(%rbp)
cmpl   $0xc,-0x44(%rbp)
jg     11fe <main+0xae>
mov    -0x44(%rbp),%esi
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11cf <main+0x7f>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x30(%rsp)
mov    $0x8ca1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <getRollResult@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <getRollResult@plt>
add    %rbx,%rax
addl   $0x1,(%rsp,%rax,4)
add    $0xffffffff,%ebp
jne    1180 <main+0x40>
mov    0x8(%rsp),%edx
lea    0xe58(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    0x10(%rsp),%edx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    0x14(%rsp),%edx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    0x18(%rsp),%edx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    0x1c(%rsp),%edx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    0x20(%rsp),%edx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    0x24(%rsp),%edx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    0x28(%rsp),%edx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    0x2c(%rsp),%edx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <printf@plt>
mov    0x30(%rsp),%edx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d:\09%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
%6 = bitcast [13 x i32]* %2 to i8*
store i32 0, i32* %3
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 36000
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = call i64 (...) @getRollResult()
%12 = call i64 (...) @getRollResult()
%13 = add i64 %11, %12
%14 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
br label %17
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
store i32 2, i32* %3
br label %21
21: ; preds = %31, %20
%22 = load i32, i32* %3
%23 = icmp sle i32 %22, 12
br i1 %23, label %24, label %34
24: ; preds = %21
%25 = load i32, i32* %3
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %29)
br label %31
31: ; preds = %24
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %21
34: ; preds = %21
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d:\09%d\0A\00"
define i32 @main() {
%1 = alloca [13 x i32]
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = bitcast [13 x i32]* %1 to i8*
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ 0, %0 ], [ %13, %5 ]
%7 = tail call i64 (...) @getRollResult()
%8 = tail call i64 (...) @getRollResult()
%9 = add i64 %8, %7
%10 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
%13 = add nuw nsw i32 %6, 1
%14 = icmp eq i32 %13, 36001
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 2
%17 = load i32, i32* %16
%18 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 2, i32 %17)
%19 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 3
%20 = load i32, i32* %19
%21 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 3, i32 %20)
%22 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 4
%23 = load i32, i32* %22
%24 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4, i32 %23)
%25 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 5
%26 = load i32, i32* %25
%27 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 5, i32 %26)
%28 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 6
%29 = load i32, i32* %28
%30 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 6, i32 %29)
%31 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 7
%32 = load i32, i32* %31
%33 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7, i32 %32)
%34 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 8
%35 = load i32, i32* %34
%36 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 8, i32 %35)
%37 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 9
%38 = load i32, i32* %37
%39 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 9, i32 %38)
%40 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 10
%41 = load i32, i32* %40
%42 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 10, i32 %41)
%43 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 11
%44 = load i32, i32* %43
%45 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 11, i32 %44)
%46 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 12
%47 = load i32, i32* %46
%48 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 12, i32 %47)
ret i32 0
}