#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() {
  int a[5] = {11, 22, 33, 44, 55};
  printf("a = %p\n", a);
  int i;
  for (i = 0; i < 5; i++) {
    printf("&a[%d] = %p\n", i, &a[i]);
  }
  for (i = 0; i < 5; i++)
    printf("a + %d = %p\n", i, a + i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    118f <main+0x7f>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
lea    -0x20(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1157 <main+0x47>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    11ce <main+0xbe>
mov    -0x24(%rbp),%esi
lea    -0x20(%rbp),%rdx
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1196 <main+0x86>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0xeec(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%r14
lea    0xed5(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec9(%rip),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%r15
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%r12
mov    %rbp,%rdi
mov    $0x2,%esi
mov    %r12,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%r13
mov    %rbp,%rdi
mov    $0x3,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    $0x4,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe69(%rip),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
mov    %r12,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    $0x3,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    $0x4,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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