#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int x = -2;
  int arr[] = {0, 1, 2, 3, 4};
  int y = 15;
  printf("& x      = %p, & y      = %p\n", &x, &y);
  printf("& arr[0] = %p, & arr[4] = %p\n", &arr[0], &arr[4]);
  printf("x = %d, y = %d\n", x, y);
  arr[-1] = 7;
  arr[5] = -23;
  printf("x = %d, y = %d\n", x, y);
  arr[6] = 108;
  printf("x = %d, y = %d\n", x, y);
  arr[7] = -353;
  printf("x = %d, y = %d\n", x, y);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xfffffffe,-0x14(%rbp)
mov    0xecc(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec9(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec7(%rip),%eax
mov    %eax,-0x20(%rbp)
movl   $0xf,-0x34(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x34(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    -0x30(%rbp),%rdx
add    $0x10,%rdx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x7,-0x34(%rbp)
movl   $0xffffffe9,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x6c,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xfffffe9f,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2dea(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movl   $0xfffffffe,0xc(%rsp)
ff
mov    0xeed(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x20(%rsp),%rbx
movl   $0xf,0x8(%rsp)
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xed3(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x7,0xc(%rsp)
movl   $0xffffffe9,0x24(%rsp)
ff
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x6c,0x28(%rsp)
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xfffffe9f,0x2c(%rsp)
ff
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2dfc(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4]
@.str = [30 x i8] c"& x = %p, & y = %p\0A\00"
@.str.1 = [30 x i8] c"& arr[0] = %p, & arr[4] = %p\0A\00"
@.str.2 = [16 x i8] c"x = %d, y = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [5 x i32]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -2, i32* %6
%9 = bitcast [5 x i32]* %7 to i8*
store i32 15, i32* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %8)
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32* %11, i32* %12)
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %14, i32 %15)
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 -1
store i32 7, i32* %17
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 5
store i32 -23, i32* %18
%19 = load i32, i32* %6
%20 = load i32, i32* %8
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %19, i32 %20)
%22 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 6
store i32 108, i32* %22
%23 = load i32, i32* %6
%24 = load i32, i32* %8
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %23, i32 %24)
%26 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 7
store i32 -353, i32* %26
%27 = load i32, i32* %6
%28 = load i32, i32* %8
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %27, i32 %28)
%30 = load i32, i32* @EXIT_SUCCESS
ret i32 %30
}

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4]
@.str = [30 x i8] c"& x = %p, & y = %p\0A\00"
@.str.1 = [30 x i8] c"& arr[0] = %p, & arr[4] = %p\0A\00"
@.str.2 = [16 x i8] c"x = %d, y = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [5 x i32]
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
store i32 -2, i32* %3
%7 = bitcast [5 x i32]* %4 to i8*
%8 = bitcast i32* %5 to i8*
store i32 15, i32* %5
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %5)
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 4
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32* %10, i32* %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %14)
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 -1
store i32 7, i32* %16
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 5
store i32 -23, i32* %17
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %18, i32 %19)
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 6
store i32 108, i32* %21
%22 = load i32, i32* %3
%23 = load i32, i32* %5
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %22, i32 %23)
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 7
store i32 -353, i32* %25
%26 = load i32, i32* %3
%27 = load i32, i32* %5
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %26, i32 %27)
%29 = load i32, i32* @EXIT_SUCCESS
ret i32 %29
}