#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 */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
int main() {
  int count[999], i;
  int array[10] = {64, 8, 216, 512, 27, 729, 0, 1, 343, 125};
  memset(count, 0, 999 * sizeof(int));
  for (i = 0; i < 10; ++i)
    count[array[i]] = 1;
  for (i = 0; i < 999; ++i)
    if (count[i] == 1)
      printf("%-4d", i);
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xfd0(%rbp),%rdi
lea    0xea0(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    -0xfa0(%rbp),%rdi
xor    %esi,%esi
mov    $0xf9c,%edx
call   1050 <memset@plt>
movl   $0x0,-0xfa4(%rbp)
cmpl   $0xa,-0xfa4(%rbp)
jge    11c2 <main+0x82>
movslq -0xfa4(%rbp),%rax
movslq -0xfd0(%rbp,%rax,4),%rax
ff
movl   $0x1,-0xfa0(%rbp,%rax,4)
mov    -0xfa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfa4(%rbp)
jmp    1187 <main+0x47>
movl   $0x0,-0xfa4(%rbp)
cmpl   $0x3e7,-0xfa4(%rbp)
jge    121c <main+0xdc>
movslq -0xfa4(%rbp),%rax
cmpl   $0x1,-0xfa0(%rbp,%rax,4)
01
jne    1203 <main+0xc3>
mov    -0xfa4(%rbp),%esi
lea    0xe2a(%rip),%rdi
call   1040 <printf@plt>
jmp    1208 <main+0xc8>
mov    -0xfa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfa4(%rbp)
jmp    11cc <main+0x8c>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0xfd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xfa8,%rsp
mov    %rsp,%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0xf9c,%edx
call   1050 <memset@plt>
movl   $0x1,0x100(%rsp)
movl   $0x1,0x20(%rsp)
movl   $0x1,0x360(%rsp)
movl   $0x1,0x800(%rsp)
movl   $0x1,0x6c(%rsp)
movl   $0x1,0xb64(%rsp)
movabs $0x100000001,%rax
mov    %rax,(%rsp)
movl   $0x1,0x55c(%rsp)
movl   $0x1,0x1f4(%rsp)
mov    $0x1,%eax
lea    0xe49(%rip),%r14
cmp    $0x1,%eax
jne    11ca <main+0x9a>
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
cmp    $0x3e6,%rbx
je     11e2 <main+0xb2>
mov    0x4(%rsp,%rbx,4),%eax
add    $0x1,%rbx
cmp    $0x1,%eax
je     11c0 <main+0x90>
jmp    11ca <main+0x9a>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0xfa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.array = [10 x i32] [i32 64, i32 8, i32 216, i32 512, i32 27, i32 729, i32 0, i32 1, i32 343, i32 125]
@.str = [5 x i8] c"%-4d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [999 x i32]
%3 = alloca i32
%4 = alloca [10 x i32]
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %4 to i8*
%6 = getelementptr inbounds [999 x i32], [999 x i32]* %2, i64 0, i64 0
%7 = call i32 @memset(i32* %6, i32 0, i32 3996)
store i32 0, i32* %3
br label %8
8: ; preds = %18, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [999 x i32], [999 x i32]* %2, i64 0, i64 %16
store i32 1, i32* %17
br label %18
18: ; preds = %11
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %8
21: ; preds = %8
store i32 0, i32* %3
br label %22
22: ; preds = %35, %21
%23 = load i32, i32* %3
%24 = icmp slt i32 %23, 999
br i1 %24, label %25, label %38
25: ; preds = %22
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [999 x i32], [999 x i32]* %2, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %34
31: ; preds = %25
%32 = load i32, i32* %3
%33 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %31, %25
br label %35
35: ; preds = %34
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %22
38: ; preds = %22
%39 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%-4d\00"
define i32 @main() {
%1 = alloca [999 x i32]
%2 = bitcast [999 x i32]* %1 to i8*
%3 = getelementptr inbounds [999 x i32], [999 x i32]* %1, i64 0, i64 0
%4 = call i32 @memset(i32* %3, i32 0, i32 3996)
%5 = getelementptr inbounds [999 x i32], [999 x i32]* %1, i64 0, i64 64
store i32 1, i32* %5
%6 = getelementptr inbounds [999 x i32], [999 x i32]* %1, i64 0, i64 8
store i32 1, i32* %6
%7 = getelementptr inbounds [999 x i32], [999 x i32]* %1, i64 0, i64 216
store i32 1, i32* %7
%8 = getelementptr inbounds [999 x i32], [999 x i32]* %1, i64 0, i64 512
store i32 1, i32* %8
%9 = getelementptr inbounds [999 x i32], [999 x i32]* %1, i64 0, i64 27
store i32 1, i32* %9
%10 = getelementptr inbounds [999 x i32], [999 x i32]* %1, i64 0, i64 729
store i32 1, i32* %10
store i32 1, i32* %3
%11 = getelementptr inbounds [999 x i32], [999 x i32]* %1, i64 0, i64 1
store i32 1, i32* %11
%12 = getelementptr inbounds [999 x i32], [999 x i32]* %1, i64 0, i64 343
store i32 1, i32* %12
%13 = getelementptr inbounds [999 x i32], [999 x i32]* %1, i64 0, i64 125
store i32 1, i32* %13
br label %14
14: ; preds = %24, %0
%15 = phi i32 [ 1, %0 ], [ %26, %24 ]
%16 = phi i64 [ 0, %0 ], [ %22, %24 ]
%17 = icmp eq i32 %15, 1
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = trunc i64 %16 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %14, %18
%22 = add nuw nsw i64 %16, 1
%23 = icmp eq i64 %22, 999
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = getelementptr inbounds [999 x i32], [999 x i32]* %1, i64 0, i64 %22
%26 = load i32, i32* %25
br label %14
27: ; preds = %21
%28 = call i32 @putchar(i8 signext 10)
ret i32 0
}