int main(void) {
  int a[] = {1, 2, 3};
  printf("%d %d %d %d \n", &a[0], &a[1], &a[2], &a[3]);
  printf("%p %p %p %p \n", &a[0], &a[1], &a[2], &a[3]);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
lea    -0x10(%rbp),%rdx
add    $0x4,%rdx
lea    -0x10(%rbp),%rcx
add    $0x8,%rcx
lea    -0x10(%rbp),%r8
add    $0xc,%r8
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    -0x10(%rbp),%rdx
add    $0x4,%rdx
lea    -0x10(%rbp),%rcx
add    $0x8,%rcx
lea    -0x10(%rbp),%r8
add    $0xc,%r8
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0xee7(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xed4(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%r12
lea    0x14(%rsp),%r15
lea    0xec5(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [14 x i8] c"%d %d %d %d \0A\00"
@.str.1 = [14 x i8] c"%p %p %p %p \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5, i32* %6, i32* %7)
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* %9, i32* %10, i32* %11, i32* %12)
ret i32 1
}

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [14 x i8] c"%d %d %d %d \0A\00"
@.str.1 = [14 x i8] c"%p %p %p %p \0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 3
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
ret i32 1
}