#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[1];
  int x[500];
  register i;
  for (s[0] = 1; s[0] <= 6; s[0]++)
    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,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jg     117b <main+0x4b>
lea    -0x8(%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    1149 <main+0x19>
movl   $0x0,-0x7e4(%rbp)
cmpl   $0x1f4,-0x7e4(%rbp)
jge    11e3 <main+0xb3>
movslq -0x7e4(%rbp),%rax
cmpl   $0x0,-0x7e0(%rbp,%rax,4)
je     11ca <main+0x9a>
mov    -0x7e4(%rbp),%esi
movslq -0x7e4(%rbp),%rax
mov    -0x7e0(%rbp,%rax,4),%edx
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
jmp    11cf <main+0x9f>
mov    -0x7e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7e4(%rbp)
jmp    1185 <main+0x55>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7e8,%rsp
movl   $0x1,0xc(%rsp)
lea    0xc(%rsp),%rbx
nopw   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     1150 <main+0x20>
xor    %ebx,%ebx
lea    0xe8a(%rip),%r14
jmp    118d <main+0x5d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x1f4,%rbx
je     11a1 <main+0x71>
mov    0x10(%rsp,%rbx,4),%edx
test   %edx,%edx
je     1180 <main+0x50>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1180 <main+0x50>
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 [1 x i32]
%3 = alloca [500 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 1, i32* %5
br label %6
6: ; preds = %16, %0
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %7
%9 = icmp sle i32 %8, 6
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%12 = call i64 @cubes(i32* %11)
%13 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %13
br label %16
16: ; preds = %10
%17 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %17
br label %6
20: ; preds = %6
store i32 0, i32* %4
br label %21
21: ; preds = %38, %20
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, 500
br i1 %23, label %24, label %41
24: ; preds = %21
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %37
30: ; preds = %24
%31 = load i32, i32* %4
%32 = load i32, i32* %4
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %31, i32 %35)
br label %37
37: ; preds = %30, %24
br label %38
38: ; preds = %37
%39 = load i32, i32* %4
%40 = add nsw i32 %39, 1
store i32 %40, i32* %4
br label %21
41: ; preds = %21
%42 = 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 [1 x i32]
%2 = alloca [500 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = bitcast [500 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 1, i32* %5
br label %6
6: ; preds = %0, %6
%7 = call i64 @cubes(i32* %5)
%8 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %8
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
store i32 %12, i32* %5
%13 = icmp slt i32 %11, 6
br i1 %13, label %6, label %14
14: ; preds = %6, %22
%15 = phi i64 [ %23, %22 ], [ 0, %6 ]
%16 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %14
%20 = trunc i64 %15 to i32
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %17)
br label %22
22: ; preds = %14, %19
%23 = add nuw nsw i64 %15, 1
%24 = icmp eq i64 %23, 500
br i1 %24, label %25, label %14
25: ; preds = %22
%26 = call i32 @exit(i32 0)
unreachable
}