#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);
int main() {
  int x, y, z;
  int i;
  for (i = 100; i < 1000; i++) {
    x = i / 100;
    y = (i / 10) % 10;
    z = (i % 100) % 10;
    if ((x * x * x + y * y * y + z * z * z) == i) {
      printf("%d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    11bf <main+0xaf>
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
imul   -0x10(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
cmp    -0x14(%rbp),%eax
jne    11ac <main+0x9c>
mov    -0x14(%rbp),%esi
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
jmp    11b1 <main+0xa1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x64,%ebx
mov    $0x64,%bp
lea    0xedc(%rip),%r14
jmp    1142 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
add    $0x1,%ebp
cmp    $0x3e8,%ebx
je     11d9 <main+0xc9>
movzwl %bp,%eax
shr    $0x2,%eax
imul   $0x147b,%eax,%eax
shr    $0x11,%eax
imul   $0x64,%eax,%eax
mov    %ebp,%ecx
sub    %al,%cl
movzbl %cl,%ecx
imul   $0xcd,%ecx,%ecx
shr    $0xa,%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
sub    %al,%cl
movzbl %cl,%eax
movzwl %bx,%ecx
imul   $0xcccd,%ecx,%edx
shr    $0x2,%ecx
imul   $0x147b,%ecx,%ecx
shr    $0x11,%ecx
shr    $0x13,%edx
movzbl %dl,%edx
imul   $0xcd,%edx,%esi
shr    $0xa,%esi
and    $0xfffffffe,%esi
lea    (%rsi,%rsi,4),%esi
sub    %sil,%dl
movzbl %dl,%edx
add    %ebx,%eax
movzbl %al,%eax
mov    %ecx,%esi
imul   %ecx,%esi
imul   %ecx,%esi
mov    %edx,%ecx
imul   %edx,%ecx
imul   %edx,%ecx
add    %esi,%ecx
mov    %eax,%edx
imul   %eax,%edx
imul   %eax,%edx
add    %ecx,%edx
cmp    %edx,%ebx
jne    1130 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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