#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[5];
  int x[500];
  register i;
  for (s[0] = 1; s[0] <= 6; s[0]++)
    for (s[1] = 1; s[1] <= 6; s[1]++)
      for (s[2] = 1; s[2] <= 6; s[2]++)
        for (s[3] = 1; s[3] <= 6; s[3]++)
          for (s[4] = 1; s[4] <= 6; s[4]++)
            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    $0x800,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x20(%rbp)
cmpl   $0x6,-0x20(%rbp)
jg     120b <main+0xdb>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jg     11f8 <main+0xc8>
movl   $0x1,-0x18(%rbp)
cmpl   $0x6,-0x18(%rbp)
jg     11e5 <main+0xb5>
movl   $0x1,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jg     11d2 <main+0xa2>
movl   $0x1,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jg     11bf <main+0x8f>
lea    -0x20(%rbp),%rdi
call   1040 <cubes@plt>
mov    -0x7f0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x7f0(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    118d <main+0x5d>
jmp    11c4 <main+0x94>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117c <main+0x4c>
jmp    11d7 <main+0xa7>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116b <main+0x3b>
jmp    11ea <main+0xba>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115a <main+0x2a>
jmp    11fd <main+0xcd>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1149 <main+0x19>
movl   $0x0,-0x7f4(%rbp)
cmpl   $0x1f4,-0x7f4(%rbp)
jge    1273 <main+0x143>
movslq -0x7f4(%rbp),%rax
cmpl   $0x0,-0x7f0(%rbp,%rax,4)
je     125a <main+0x12a>
mov    -0x7f4(%rbp),%esi
movslq -0x7f4(%rbp),%rax
mov    -0x7f0(%rbp,%rax,4),%edx
lea    0xdab(%rip),%rdi
call   1030 <printf@plt>
jmp    125f <main+0x12f>
mov    -0x7f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7f4(%rbp)
jmp    1215 <main+0xe5>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7f8,%rsp
movl   $0x1,(%rsp)
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movl   $0x1,0x4(%rsp)
nopl   0x0(%rax,%rax,1)
movl   $0x1,0x8(%rsp)
nopl   0x0(%rax,%rax,1)
movl   $0x1,0xc(%rsp)
nopl   0x0(%rax,%rax,1)
movl   $0x1,0x10(%rsp)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <cubes@plt>
addl   $0x1,0x20(%rsp,%rax,4)
mov    0x10(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x10(%rsp)
cmp    $0x6,%eax
jl     1190 <main+0x60>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x6,%eax
jl     1180 <main+0x50>
mov    0x8(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
cmp    $0x6,%eax
jl     1170 <main+0x40>
mov    0x4(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
cmp    $0x6,%eax
jl     1160 <main+0x30>
mov    (%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rsp)
cmp    $0x6,%eax
jl     1150 <main+0x20>
xor    %ebx,%ebx
lea    0xe08(%rip),%r14
jmp    120d <main+0xdd>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x1f4,%rbx
je     1221 <main+0xf1>
mov    0x20(%rsp,%rbx,4),%edx
test   %edx,%edx
je     1200 <main+0xd0>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1200 <main+0xd0>
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 [5 x i32]
%3 = alloca [500 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
store i32 1, i32* %5
br label %6
6: ; preds = %60, %0
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %7
%9 = icmp sle i32 %8, 6
br i1 %9, label %10, label %64
10: ; preds = %6
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
store i32 1, i32* %11
br label %12
12: ; preds = %55, %10
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
%14 = load i32, i32* %13
%15 = icmp sle i32 %14, 6
br i1 %15, label %16, label %59
16: ; preds = %12
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
store i32 1, i32* %17
br label %18
18: ; preds = %50, %16
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
%20 = load i32, i32* %19
%21 = icmp sle i32 %20, 6
br i1 %21, label %22, label %54
22: ; preds = %18
%23 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
store i32 1, i32* %23
br label %24
24: ; preds = %45, %22
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
%26 = load i32, i32* %25
%27 = icmp sle i32 %26, 6
br i1 %27, label %28, label %49
28: ; preds = %24
%29 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
store i32 1, i32* %29
br label %30
30: ; preds = %40, %28
%31 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
%32 = load i32, i32* %31
%33 = icmp sle i32 %32, 6
br i1 %33, label %34, label %44
34: ; preds = %30
%35 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%36 = call i64 @cubes(i32* %35)
%37 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = add nsw i32 %38, 1
store i32 %39, i32* %37
br label %40
40: ; preds = %34
%41 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
%42 = load i32, i32* %41
%43 = add nsw i32 %42, 1
store i32 %43, i32* %41
br label %30
44: ; preds = %30
br label %45
45: ; preds = %44
%46 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
%47 = load i32, i32* %46
%48 = add nsw i32 %47, 1
store i32 %48, i32* %46
br label %24
49: ; preds = %24
br label %50
50: ; preds = %49
%51 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
%52 = load i32, i32* %51
%53 = add nsw i32 %52, 1
store i32 %53, i32* %51
br label %18
54: ; preds = %18
br label %55
55: ; preds = %54
%56 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
%57 = load i32, i32* %56
%58 = add nsw i32 %57, 1
store i32 %58, i32* %56
br label %12
59: ; preds = %12
br label %60
60: ; preds = %59
%61 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%62 = load i32, i32* %61
%63 = add nsw i32 %62, 1
store i32 %63, i32* %61
br label %6
64: ; preds = %6
store i32 0, i32* %4
br label %65
65: ; preds = %82, %64
%66 = load i32, i32* %4
%67 = icmp slt i32 %66, 500
br i1 %67, label %68, label %85
68: ; preds = %65
%69 = load i32, i32* %4
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 %70
%72 = load i32, i32* %71
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %81
74: ; preds = %68
%75 = load i32, i32* %4
%76 = load i32, i32* %4
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 %77
%79 = load i32, i32* %78
%80 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %75, i32 %79)
br label %81
81: ; preds = %74, %68
br label %82
82: ; preds = %81
%83 = load i32, i32* %4
%84 = add nsw i32 %83, 1
store i32 %84, i32* %4
br label %65
85: ; preds = %65
%86 = 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 [5 x i32]
%2 = alloca [500 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [500 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
store i32 1, i32* %5
br label %10
10: ; preds = %0, %34
store i32 1, i32* %6
br label %11
11: ; preds = %10, %30
store i32 1, i32* %7
br label %12
12: ; preds = %11, %26
store i32 1, i32* %8
br label %13
13: ; preds = %12, %22
store i32 1, i32* %9
br label %14
14: ; preds = %13, %14
%15 = call i64 @cubes(i32* %5)
%16 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1
store i32 %18, i32* %16
%19 = load i32, i32* %9
%20 = add nsw i32 %19, 1
store i32 %20, i32* %9
%21 = icmp slt i32 %19, 6
br i1 %21, label %14, label %22
22: ; preds = %14
%23 = load i32, i32* %8
%24 = add nsw i32 %23, 1
store i32 %24, i32* %8
%25 = icmp slt i32 %23, 6
br i1 %25, label %13, label %26
26: ; preds = %22
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
store i32 %28, i32* %7
%29 = icmp slt i32 %27, 6
br i1 %29, label %12, label %30
30: ; preds = %26
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
%33 = icmp slt i32 %31, 6
br i1 %33, label %11, label %34
34: ; preds = %30
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
%37 = icmp slt i32 %35, 6
br i1 %37, label %10, label %38
38: ; preds = %34, %46
%39 = phi i64 [ %47, %46 ], [ 0, %34 ]
%40 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = icmp eq i32 %41, 0
br i1 %42, label %46, label %43
43: ; preds = %38
%44 = trunc i64 %39 to i32
%45 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %44, i32 %41)
br label %46
46: ; preds = %38, %43
%47 = add nuw nsw i64 %39, 1
%48 = icmp eq i64 %47, 500
br i1 %48, label %49, label %38
49: ; preds = %46
%50 = call i32 @exit(i32 0)
unreachable
}