#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 cubes(int *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int i;
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int s[2];
  int x[500];
  register i;
  for (s[0] = 1; s[0] <= 6; s[0]++)
    for (s[1] = 1; s[1] <= 6; s[1]++)
      x[cubes(s)]++;
  for (i = 0; i < 500; i++)
    if (x[i])
      printf("%d\t%d\n", i, x[i]);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jg     119f <main+0x6f>
movl   $0x1,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jg     118c <main+0x5c>
lea    -0xc(%rbp),%rdi
call   1040 <cubes@plt>
mov    -0x7e0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x7e0(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <main+0x2a>
jmp    1191 <main+0x61>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <main+0x19>
movl   $0x0,-0x7e4(%rbp)
cmpl   $0x1f4,-0x7e4(%rbp)
jge    1207 <main+0xd7>
movslq -0x7e4(%rbp),%rax
cmpl   $0x0,-0x7e0(%rbp,%rax,4)
je     11ee <main+0xbe>
mov    -0x7e4(%rbp),%esi
movslq -0x7e4(%rbp),%rax
mov    -0x7e0(%rbp,%rax,4),%edx
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <main+0xc3>
mov    -0x7e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7e4(%rbp)
jmp    11a9 <main+0x79>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7e8,%rsp
movl   $0x1,0x8(%rsp)
lea    0x8(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
movl   $0x1,0xc(%rsp)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <cubes@plt>
addl   $0x1,0x10(%rsp,%rax,4)
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x6,%eax
jl     1160 <main+0x30>
mov    0x8(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
cmp    $0x6,%eax
jl     1150 <main+0x20>
xor    %ebx,%ebx
lea    0xe6a(%rip),%r14
jmp    11ad <main+0x7d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x1f4,%rbx
je     11c1 <main+0x91>
mov    0x10(%rsp,%rbx,4),%edx
test   %edx,%edx
je     11a0 <main+0x70>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    11a0 <main+0x70>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d\09%d\0A\00"
@i = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca [500 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32 1, i32* %5
br label %6
6: ; preds = %27, %0
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %7
%9 = icmp sle i32 %8, 6
br i1 %9, label %10, label %31
10: ; preds = %6
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
store i32 1, i32* %11
br label %12
12: ; preds = %22, %10
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%14 = load i32, i32* %13
%15 = icmp sle i32 %14, 6
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%18 = call i64 @cubes(i32* %17)
%19 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1
store i32 %21, i32* %19
br label %22
22: ; preds = %16
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%24 = load i32, i32* %23
%25 = add nsw i32 %24, 1
store i32 %25, i32* %23
br label %12
26: ; preds = %12
br label %27
27: ; preds = %26
%28 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%29 = load i32, i32* %28
%30 = add nsw i32 %29, 1
store i32 %30, i32* %28
br label %6
31: ; preds = %6
store i32 0, i32* %4
br label %32
32: ; preds = %49, %31
%33 = load i32, i32* %4
%34 = icmp slt i32 %33, 500
br i1 %34, label %35, label %52
35: ; preds = %32
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %48
41: ; preds = %35
%42 = load i32, i32* %4
%43 = load i32, i32* %4
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %42, i32 %46)
br label %48
48: ; preds = %41, %35
br label %49
49: ; preds = %48
%50 = load i32, i32* %4
%51 = add nsw i32 %50, 1
store i32 %51, i32* %4
br label %32
52: ; preds = %32
%53 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d\09%d\0A\00"
@i = global i32 0
define i32 @main() {
%1 = alloca [2 x i32]
%2 = alloca [500 x i32]
%3 = bitcast [2 x i32]* %1 to i8*
%4 = bitcast [500 x i32]* %2 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
store i32 1, i32* %5
br label %7
7: ; preds = %0, %16
store i32 1, i32* %6
br label %8
8: ; preds = %7, %8
%9 = call i64 @cubes(i32* %5)
%10 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
%15 = icmp slt i32 %13, 6
br i1 %15, label %8, label %16
16: ; preds = %8
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
%19 = icmp slt i32 %17, 6
br i1 %19, label %7, label %20
20: ; preds = %16, %28
%21 = phi i64 [ %29, %28 ], [ 0, %16 ]
%22 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = icmp eq i32 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %20
%26 = trunc i64 %21 to i32
%27 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %26, i32 %23)
br label %28
28: ; preds = %20, %25
%29 = add nuw nsw i64 %21, 1
%30 = icmp eq i64 %29, 500
br i1 %30, label %31, label %20
31: ; preds = %28
%32 = call i32 @exit(i32 0)
unreachable
}