#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 main(void) {
  int x = 123;
  int a[5] = {1, 2, 3, 4, 5};
  int y = 456;
  int i;
  for (i = -1; i <= 7; i++)
    printf("%d ", a[i]);
  printf("\n");
  printf("&x=%p\n&y=%p\n", &x, &y);
  printf("a+5=%p\na+6=%p\n", a + 5, a + 6);
  *(a + 5) = 110;
  printf("x=%d\n", x);
  for (i = -1; i <= 7; i++)
    a[i] = 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x1c8,-0x24(%rbp)
movl   $0xffffffff,-0x28(%rbp)
cmpl   $0x7,-0x28(%rbp)
jg     1181 <main+0x71>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1153 <main+0x43>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe82(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x24(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
add    $0x14,%rsi
lea    -0x20(%rbp),%rdx
add    $0x18,%rdx
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x6e,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x28(%rbp)
cmpl   $0x7,-0x28(%rbp)
jg     1206 <main+0xf6>
movslq -0x28(%rbp),%rax
movl   $0x0,-0x20(%rbp,%rax,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11e2 <main+0xd2>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
movl   $0x7b,0x8(%rsp)
mov    0xed9(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x1c8,0xc(%rsp)
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x24(%rsp),%r14
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x28(%rsp),%r15
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe34(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe29(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x6e,0x24(%rsp)
mov    0x8(%rsp),%esi
lea    0xe18(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [13 x i8] c"&x=%p\0A&y=%p\0A\00"
@.str.3 = [15 x i8] c"a+5=%p\0Aa+6=%p\0A\00"
@.str.4 = [6 x i8] c"x=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 123, i32* %2
%6 = bitcast [5 x i32]* %3 to i8*
store i32 456, i32* %4
store i32 -1, i32* %5
br label %7
7: ; preds = %16, %0
%8 = load i32, i32* %5
%9 = icmp sle i32 %8, 7
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %12
%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)
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %7
19: ; preds = %7
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %4)
%22 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%23 = getelementptr inbounds i32, i32* %22, i64 5
%24 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%25 = getelementptr inbounds i32, i32* %24, i64 6
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32* %23, i32* %25)
%27 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%28 = getelementptr inbounds i32, i32* %27, i64 5
store i32 110, i32* %28
%29 = load i32, i32* %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %29)
store i32 -1, i32* %5
br label %31
31: ; preds = %38, %19
%32 = load i32, i32* %5
%33 = icmp sle i32 %32, 7
br i1 %33, label %34, label %41
34: ; preds = %31
%35 = load i32, i32* %5
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %36
store i32 0, i32* %37
br label %38
38: ; preds = %34
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %31
41: ; preds = %31
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [4 x i8] c"%d \00"
@.str.2 = [13 x i8] c"&x=%p\0A&y=%p\0A\00"
@.str.3 = [15 x i8] c"a+5=%p\0Aa+6=%p\0A\00"
@.str.4 = [6 x i8] c"x=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 123, i32* %1
%5 = bitcast [5 x i32]* %2 to i8*
%6 = bitcast i32* %3 to i8*
store i32 456, i32* %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 5
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 6
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
%18 = tail call i32 @putchar(i32 10)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %3)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32* %13, i32* %15)
store i32 110, i32* %13
%21 = load i32, i32* %1
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %21)
ret i32 0
}