#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(void) {
  int n = 7, i;
  int a[n];
  for (i = 0; i < n; i++)
    a[i] = i;
  n = 200;
  for (i = 0; i < n; i++)
    a[i] = 2 * i;
  printf("%5d\n", a[n - 1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117c <main+0x6c>
mov    -0x28(%rbp),%rax
mov    -0xc(%rbp),%edx
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <main+0x44>
movl   $0xc8,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b5 <main+0xa5>
mov    -0x28(%rbp),%rax
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118a <main+0x7a>
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movdqa 0xee4(%rip),%xmm0
movdqa %xmm0,(%rsp)
movabs $0x500000004,%rax
mov    %rax,0x10(%rsp)
movl   $0x6,0x18(%rsp)
mov    $0xc,%eax
movdqa 0xecb(%rip),%xmm1
movdqa 0xed3(%rip),%xmm2
nopl   (%rax)
movdqa %xmm0,%xmm3
paddd  %xmm0,%xmm3
movdqa %xmm3,-0x30(%rsp,%rax,4)
paddd  %xmm1,%xmm3
movdqa %xmm3,-0x20(%rsp,%rax,4)
cmp    $0xcc,%rax
je     1195 <main+0x85>
movdqa %xmm0,%xmm3
paddd  %xmm1,%xmm3
paddd  %xmm3,%xmm3
movdqa %xmm3,-0x10(%rsp,%rax,4)
paddd  %xmm1,%xmm3
movdqa %xmm3,(%rsp,%rax,4)
paddd  %xmm2,%xmm0
add    $0x10,%rax
jmp    1150 <main+0x40>
mov    0x31c(%rsp),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

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