f0() {
  int a[] = {1, 2, 3};
  if (a == &a) {
    printf("a==&a is true.\n");
  } else {
    printf("a==&a is false.\n");
  }
  print_i(a[0]);
  f1(a);
  print_i(*a);
  printf("-----------------\n");
  print_i(a[2]);
  f2(a + 2);
  print_i(a[2]);
  printf("-----------------\n");
  print_i(a + 3);
}


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xeb1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeaf(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%edi
mov    $0x0,%al
call   1040 <print_i@plt>
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1060 <f1@plt>
mov    -0x10(%rbp),%edi
mov    $0x0,%al
call   1040 <print_i@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <print_i@plt>
lea    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    $0x0,%al
call   1030 <f2@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <print_i@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x10(%rbp),%rdi
add    $0xc,%rdi
mov    $0x0,%al
call   1040 <print_i@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0xebb(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xea8(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%r14
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <print_i@plt>
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1060 <f1@plt>
mov    0x8(%rsp),%edi
xor    %eax,%eax
call   1050 <print_i@plt>
lea    0xe83(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    0x10(%rsp),%edi
xor    %eax,%eax
call   1050 <print_i@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <f2@plt>
mov    0x10(%rsp),%edi
xor    %eax,%eax
call   1050 <print_i@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x14(%rsp),%rdi
xor    %eax,%eax
call   1050 <print_i@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.f0.a = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [16 x i8] c"a==&a is true.\0A\00"
@.str.1 = [19 x i8] c"-----------------\0A\00"
define i32 @f0() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %2 to i8*
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %5
%7 = call i32 (i32, ...) bitcast (i32 (...)* @print_i to i32 (i32, ...)*)(i32 %6)
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%9 = call i32 (i32*, ...) bitcast (i32 (...)* @f1 to i32 (i32*, ...)*)(i32* %8)
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%11 = load i32, i32* %10
%12 = call i32 (i32, ...) bitcast (i32 (...)* @print_i to i32 (i32, ...)*)(i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%15 = load i32, i32* %14
%16 = call i32 (i32, ...) bitcast (i32 (...)* @print_i to i32 (i32, ...)*)(i32 %15)
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%18 = getelementptr inbounds i32, i32* %17, i64 2
%19 = call i32 (i32*, ...) bitcast (i32 (...)* @f2 to i32 (i32*, ...)*)(i32* %18)
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%21 = load i32, i32* %20
%22 = call i32 (i32, ...) bitcast (i32 (...)* @print_i to i32 (i32, ...)*)(i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%25 = getelementptr inbounds i32, i32* %24, i64 3
%26 = call i32 (i32*, ...) bitcast (i32 (...)* @print_i to i32 (i32*, ...)*)(i32* %25)
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@__const.f0.a = [3 x i32] [i32 1, i32 2, i32 3]
@str = [15 x i8] c"a==&a is true.\00"
@str.3 = [18 x i8] c"-----------------\00"
define i32 @f0() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @print_i to i32 (i32, ...)*)(i32 1)
%6 = call i32 (i32*, ...) bitcast (i32 (...)* @f1 to i32 (i32*, ...)*)(i32* %4)
%7 = load i32, i32* %4
%8 = call i32 (i32, ...) bitcast (i32 (...)* @print_i to i32 (i32, ...)*)(i32 %7)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.3, i64 0, i64 0))
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%11 = load i32, i32* %10
%12 = call i32 (i32, ...) bitcast (i32 (...)* @print_i to i32 (i32, ...)*)(i32 %11)
%13 = call i32 (i32*, ...) bitcast (i32 (...)* @f2 to i32 (i32*, ...)*)(i32* %10)
%14 = load i32, i32* %10
%15 = call i32 (i32, ...) bitcast (i32 (...)* @print_i to i32 (i32, ...)*)(i32 %14)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.3, i64 0, i64 0))
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 3
%18 = call i32 (i32*, ...) bitcast (i32 (...)* @print_i to i32 (i32*, ...)*)(i32* %17)
ret i32 undef
}