#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);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n[10], i;
  scanf("%d", &n[0]);
  printf("N[%d] = %d\n", 0, n[0]);
  for (i = 1; i < 10; i++) {
    n[i] = n[i - 1] * 2;
    printf("N[%d] = %d\n", i, n[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x30(%rbp),%edx
lea    0xeba(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movl   $0x1,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    119d <main+0x7d>
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%ecx
shl    $0x1,%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%esi
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1157 <main+0x37>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%edx
lea    0xec5(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    (%rsp),%edx
add    %edx,%edx
mov    %edx,0x4(%rsp)
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    0x4(%rsp),%edx
add    %edx,%edx
mov    %edx,0x8(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
add    %edx,%edx
mov    %edx,0xc(%rsp)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    0xc(%rsp),%edx
add    %edx,%edx
mov    %edx,0x10(%rsp)
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    0x10(%rsp),%edx
add    %edx,%edx
mov    %edx,0x14(%rsp)
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    0x14(%rsp),%edx
add    %edx,%edx
mov    %edx,0x18(%rsp)
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    0x18(%rsp),%edx
add    %edx,%edx
mov    %edx,0x1c(%rsp)
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    0x1c(%rsp),%edx
add    %edx,%edx
mov    %edx,0x20(%rsp)
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    0x20(%rsp),%edx
add    %edx,%edx
mov    %edx,0x24(%rsp)
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"N[%d] = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %7)
store i32 1, i32* %3
br label %9
9: ; preds = %28, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %31
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = mul nsw i32 %17, 2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %20
store i32 %18, i32* %21
%22 = load i32, i32* %3
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %26)
br label %28
28: ; preds = %12
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %9
31: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"N[%d] = %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %5)
%7 = load i32, i32* %3
%8 = shl nsw i32 %7, 1
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
store i32 %8, i32* %9
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %8)
%11 = load i32, i32* %9
%12 = shl nsw i32 %11, 1
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
store i32 %12, i32* %13
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %12)
%15 = load i32, i32* %13
%16 = shl nsw i32 %15, 1
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
store i32 %16, i32* %17
%18 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 %16)
%19 = load i32, i32* %17
%20 = shl nsw i32 %19, 1
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
store i32 %20, i32* %21
%22 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 %20)
%23 = load i32, i32* %21
%24 = shl nsw i32 %23, 1
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
store i32 %24, i32* %25
%26 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 %24)
%27 = load i32, i32* %25
%28 = shl nsw i32 %27, 1
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
store i32 %28, i32* %29
%30 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 %28)
%31 = load i32, i32* %29
%32 = shl nsw i32 %31, 1
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
store i32 %32, i32* %33
%34 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 7, i32 %32)
%35 = load i32, i32* %33
%36 = shl nsw i32 %35, 1
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
store i32 %36, i32* %37
%38 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 %36)
%39 = load i32, i32* %37
%40 = shl nsw i32 %39, 1
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 %40, i32* %41
%42 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 9, i32 %40)
ret i32 0
}