#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 *, ...);
void arrays() {
  int luckyNumbers[] = {1, 2, 3, 4, 5, 6};
  printf("%d\n", luckyNumbers[0]);
  luckyNumbers[1] = 0;
  printf("%d\n", luckyNumbers[1]);
  int lucky[10];
  luckyNumbers[1] = 81;
  printf("%d\n", luckyNumbers[1]);
  char phrase[20] = "Array";
  printf("%s\n", phrase);
}


x86 assembly (clang, -O0):
<arrays>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%esi
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x51,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xe9f(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe9c(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe9a(%rip),%eax
mov    %eax,-0x60(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrays>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x51,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.arrays.luckyNumbers = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@.str = [4 x i8] c"%d\0A\00"
@__const.arrays.phrase = [20 x i8] c"Array\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @arrays() {
%1 = alloca [6 x i32]
%2 = alloca [10 x i32]
%3 = alloca [20 x i8]
%4 = bitcast [6 x i32]* %1 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 1
store i32 0, i32* %8
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 1
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 1
store i32 81, i32* %12
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 1
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = bitcast [20 x i8]* %3 to i8*
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@__const.arrays.phrase = [20 x i8] c"Array\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @arrays() {
%1 = alloca [20 x i8]
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 81)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = call i32 @puts(i8* %5)
ret void
}