#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[4];
  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]++)
          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     11e7 <main+0xb7>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jg     11d4 <main+0xa4>
movl   $0x1,-0x18(%rbp)
cmpl   $0x6,-0x18(%rbp)
jg     11c1 <main+0x91>
movl   $0x1,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jg     11ae <main+0x7e>
lea    -0x20(%rbp),%rdi
call   1040 <cubes@plt>
mov    -0x7f0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x7f0(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117c <main+0x4c>
jmp    11b3 <main+0x83>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116b <main+0x3b>
jmp    11c6 <main+0x96>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115a <main+0x2a>
jmp    11d9 <main+0xa9>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1149 <main+0x19>
movl   $0x0,-0x7f4(%rbp)
cmpl   $0x1f4,-0x7f4(%rbp)
jge    124f <main+0x11f>
movslq -0x7f4(%rbp),%rax
cmpl   $0x0,-0x7f0(%rbp,%rax,4)
je     1236 <main+0x106>
mov    -0x7f4(%rbp),%esi
movslq -0x7f4(%rbp),%rax
mov    -0x7f0(%rbp,%rax,4),%edx
lea    0xdcf(%rip),%rdi
call   1030 <printf@plt>
jmp    123b <main+0x10b>
mov    -0x7f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7f4(%rbp)
jmp    11f1 <main+0xc1>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7e8,%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)
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     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    0xe2c(%rip),%r14
jmp    11ed <main+0xbd>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x1f4,%rbx
je     1201 <main+0xd1>
mov    0x10(%rsp,%rbx,4),%edx
test   %edx,%edx
je     11e0 <main+0xb0>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    11e0 <main+0xb0>
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 [4 x i32]
%3 = alloca [500 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
store i32 1, i32* %5
br label %6
6: ; preds = %49, %0
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %7
%9 = icmp sle i32 %8, 6
br i1 %9, label %10, label %53
10: ; preds = %6
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
store i32 1, i32* %11
br label %12
12: ; preds = %44, %10
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%14 = load i32, i32* %13
%15 = icmp sle i32 %14, 6
br i1 %15, label %16, label %48
16: ; preds = %12
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
store i32 1, i32* %17
br label %18
18: ; preds = %39, %16
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%20 = load i32, i32* %19
%21 = icmp sle i32 %20, 6
br i1 %21, label %22, label %43
22: ; preds = %18
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
store i32 1, i32* %23
br label %24
24: ; preds = %34, %22
%25 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%26 = load i32, i32* %25
%27 = icmp sle i32 %26, 6
br i1 %27, label %28, label %38
28: ; preds = %24
%29 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%30 = call i64 @cubes(i32* %29)
%31 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = add nsw i32 %32, 1
store i32 %33, i32* %31
br label %34
34: ; preds = %28
%35 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%36 = load i32, i32* %35
%37 = add nsw i32 %36, 1
store i32 %37, i32* %35
br label %24
38: ; preds = %24
br label %39
39: ; preds = %38
%40 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%41 = load i32, i32* %40
%42 = add nsw i32 %41, 1
store i32 %42, i32* %40
br label %18
43: ; preds = %18
br label %44
44: ; preds = %43
%45 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%46 = load i32, i32* %45
%47 = add nsw i32 %46, 1
store i32 %47, i32* %45
br label %12
48: ; preds = %12
br label %49
49: ; preds = %48
%50 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%51 = load i32, i32* %50
%52 = add nsw i32 %51, 1
store i32 %52, i32* %50
br label %6
53: ; preds = %6
store i32 0, i32* %4
br label %54
54: ; preds = %71, %53
%55 = load i32, i32* %4
%56 = icmp slt i32 %55, 500
br i1 %56, label %57, label %74
57: ; preds = %54
%58 = load i32, i32* %4
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %70
63: ; preds = %57
%64 = load i32, i32* %4
%65 = load i32, i32* %4
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 %66
%68 = load i32, i32* %67
%69 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %64, i32 %68)
br label %70
70: ; preds = %63, %57
br label %71
71: ; preds = %70
%72 = load i32, i32* %4
%73 = add nsw i32 %72, 1
store i32 %73, i32* %4
br label %54
74: ; preds = %54
%75 = 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 [4 x i32]
%2 = alloca [500 x i32]
%3 = bitcast [4 x i32]* %1 to i8*
%4 = bitcast [500 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 3
store i32 1, i32* %5
br label %9
9: ; preds = %0, %28
store i32 1, i32* %6
br label %10
10: ; preds = %9, %24
store i32 1, i32* %7
br label %11
11: ; preds = %10, %20
store i32 1, i32* %8
br label %12
12: ; preds = %11, %12
%13 = call i64 @cubes(i32* %5)
%14 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
%17 = load i32, i32* %8
%18 = add nsw i32 %17, 1
store i32 %18, i32* %8
%19 = icmp slt i32 %17, 6
br i1 %19, label %12, label %20
20: ; preds = %12
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
%23 = icmp slt i32 %21, 6
br i1 %23, label %11, label %24
24: ; preds = %20
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
%27 = icmp slt i32 %25, 6
br i1 %27, label %10, label %28
28: ; preds = %24
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
%31 = icmp slt i32 %29, 6
br i1 %31, label %9, label %32
32: ; preds = %28, %40
%33 = phi i64 [ %41, %40 ], [ 0, %28 ]
%34 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = icmp eq i32 %35, 0
br i1 %36, label %40, label %37
37: ; preds = %32
%38 = trunc i64 %33 to i32
%39 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %38, i32 %35)
br label %40
40: ; preds = %32, %37
%41 = add nuw nsw i64 %33, 1
%42 = icmp eq i64 %41, 500
br i1 %42, label %43, label %32
43: ; preds = %40
%44 = call i32 @exit(i32 0)
unreachable
}