#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 i = 0, j = 0, k = 0;
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      for (k = 0; k < 10; k++) {
        printf("%d\n", (((i) << 16) + ((j) << 8) + (k)));
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11b8 <main+0xa8>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11a5 <main+0x95>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1192 <main+0x82>
mov    -0x8(%rbp),%esi
shl    $0x10,%esi
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
add    %eax,%esi
add    -0x10(%rbp),%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115d <main+0x4d>
jmp    1197 <main+0x87>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <main+0x3c>
jmp    11aa <main+0x9a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee0(%rip),%r14
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rbx,%rbp,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    (%rbx,%rbp,1),%esi
add    $0x1,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    (%rbx,%rbp,1),%esi
add    $0x2,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    (%rbx,%rbp,1),%esi
add    $0x3,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    (%rbx,%rbp,1),%esi
add    $0x4,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    (%rbx,%rbp,1),%esi
add    $0x5,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    (%rbx,%rbp,1),%esi
add    $0x6,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    (%rbx,%rbp,1),%esi
add    $0x7,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    (%rbx,%rbp,1),%esi
add    $0x8,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    (%rbx,%rbp,1),%esi
add    $0x9,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x100,%ebp
cmp    $0xa00,%ebp
jne    1140 <main+0x30>
add    $0x1,%r15d
add    $0x10000,%ebx
cmp    $0xa,%r15d
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
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
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %2
br label %5
5: ; preds = %33, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %36
8: ; preds = %5
store i32 0, i32* %3
br label %9
9: ; preds = %29, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %32
12: ; preds = %9
store i32 0, i32* %4
br label %13
13: ; preds = %25, %12
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 10
br i1 %15, label %16, label %28
16: ; preds = %13
%17 = load i32, i32* %2
%18 = shl i32 %17, 16
%19 = load i32, i32* %3
%20 = shl i32 %19, 8
%21 = add nsw i32 %18, %20
%22 = load i32, i32* %4
%23 = add nsw i32 %21, %22
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %16
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %13
28: ; preds = %13
br label %29
29: ; preds = %28
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %9
32: ; preds = %9
br label %33
33: ; preds = %32
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %5
36: ; preds = %5
ret i32 0
}

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