#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*/ printf(char *, ...);
int main() {
  int i, j, k, n;
  printf("parcissus numbers are ");
  for (n = 100; n < 1000; n++) {
    i = n / 100;
    j = n / 10 - i * 10;
    k = n % 10;
    if (n == i * i * i + j * j * j + k * k * k)
      printf("%d ", n);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x64,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    11c5 <main+0xb5>
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
imul   $0xa,-0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0xc(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
mov    -0x10(%rbp),%edx
imul   -0x10(%rbp),%edx
imul   -0x10(%rbp),%edx
add    %edx,%ecx
cmp    %ecx,%eax
jne    11b2 <main+0xa2>
mov    -0x14(%rbp),%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b7 <main+0xa7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%ebx
mov    $0xcccccccd,%r15d
lea    0xed2(%rip),%r14
jmp    115b <main+0x3b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x3e8,%ebx
je     11bc <main+0x9c>
mov    %ebx,%eax
imul   %r15,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
movzwl %bx,%ecx
imul   $0xcccd,%ecx,%edx
shr    $0x2,%ecx
imul   $0x147b,%ecx,%ecx
shr    $0x11,%ecx
shr    $0x13,%edx
lea    (%rcx,%rcx,1),%esi
lea    (%rsi,%rsi,4),%esi
sub    %esi,%edx
mov    %ebx,%esi
sub    %eax,%esi
mov    %ecx,%eax
imul   %ecx,%eax
imul   %ecx,%eax
mov    %edx,%ecx
imul   %edx,%ecx
imul   %edx,%ecx
mov    %esi,%edx
imul   %esi,%edx
imul   %esi,%edx
add    %eax,%edx
add    %ecx,%edx
cmp    %edx,%ebx
jne    1150 <main+0x30>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1150 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"parcissus numbers are \00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 100, i32* %5
br label %7
7: ; preds = %43, %0
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 1000
br i1 %9, label %10, label %46
10: ; preds = %7
%11 = load i32, i32* %5
%12 = sdiv i32 %11, 100
store i32 %12, i32* %2
%13 = load i32, i32* %5
%14 = sdiv i32 %13, 10
%15 = load i32, i32* %2
%16 = mul nsw i32 %15, 10
%17 = sub nsw i32 %14, %16
store i32 %17, i32* %3
%18 = load i32, i32* %5
%19 = srem i32 %18, 10
store i32 %19, i32* %4
%20 = load i32, i32* %5
%21 = load i32, i32* %2
%22 = load i32, i32* %2
%23 = mul nsw i32 %21, %22
%24 = load i32, i32* %2
%25 = mul nsw i32 %23, %24
%26 = load i32, i32* %3
%27 = load i32, i32* %3
%28 = mul nsw i32 %26, %27
%29 = load i32, i32* %3
%30 = mul nsw i32 %28, %29
%31 = add nsw i32 %25, %30
%32 = load i32, i32* %4
%33 = load i32, i32* %4
%34 = mul nsw i32 %32, %33
%35 = load i32, i32* %4
%36 = mul nsw i32 %34, %35
%37 = add nsw i32 %31, %36
%38 = icmp eq i32 %20, %37
br i1 %38, label %39, label %42
39: ; preds = %10
%40 = load i32, i32* %5
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %39, %10
br label %43
43: ; preds = %42
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %7
46: ; preds = %7
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"parcissus numbers are \00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %24
%3 = phi i32 [ 100, %0 ], [ %25, %24 ]
%4 = trunc i32 %3 to i16
%5 = udiv i16 %4, 100
%6 = zext i16 %5 to i32
%7 = udiv i16 %4, 10
%8 = zext i16 %7 to i32
%9 = mul nsw i32 %6, -10
%10 = add nsw i32 %9, %8
%11 = urem i16 %4, 10
%12 = zext i16 %11 to i32
%13 = mul nuw nsw i32 %6, %6
%14 = mul nuw nsw i32 %13, %6
%15 = mul nsw i32 %10, %10
%16 = mul nsw i32 %15, %10
%17 = mul nuw nsw i32 %12, %12
%18 = mul nuw nsw i32 %17, %12
%19 = add nuw nsw i32 %18, %14
%20 = add i32 %19, %16
%21 = icmp eq i32 %3, %20
br i1 %21, label %22, label %24
22: ; preds = %2
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
br label %24
24: ; preds = %2, %22
%25 = add nuw nsw i32 %3, 1
%26 = icmp eq i32 %25, 1000
br i1 %26, label %27, label %2
27: ; preds = %24
%28 = tail call i32 @putchar(i32 10)
ret i32 0
}