void ArrayStuff(void) {
  char foo[][12] = {
      "Hello",
      "World",
  };
  for (int i = 0; i < 2; i++) {
    printf("%p, %p, %s, %c, %c\n", foo[i], foo + i, foo[i], **(foo + i),
           *(*(foo + i) + 1));
  }
}


x86 assembly (clang, -O0):
<ArrayStuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    11ba <ArrayStuff+0xaa>
movslq -0x24(%rbp),%rax
lea    -0x20(%rbp),%rsi
imul   $0xc,%rax,%rax
add    %rax,%rsi
lea    -0x20(%rbp),%rdx
movslq -0x24(%rbp),%rax
imul   $0xc,%rax,%rax
add    %rax,%rdx
movslq -0x24(%rbp),%rax
lea    -0x20(%rbp),%rcx
imul   $0xc,%rax,%rax
add    %rax,%rcx
lea    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rdi
imul   $0xc,%rdi,%rdi
add    %rdi,%rax
movsbl (%rax),%r8d
lea    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rdi
imul   $0xc,%rdi,%rdi
add    %rdi,%rax
movsbl 0x1(%rax),%r9d
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1140 <ArrayStuff+0x30>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ArrayStuff>:
push   %rbx
sub    $0x20,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee5(%rip),%rbx
mov    %rsp,%rcx
mov    %rbx,%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
mov    $0x48,%r8d
mov    $0x65,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rcx
movsbl 0xc(%rsp),%r8d
movsbl 0xd(%rsp),%r9d
mov    %rbx,%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.ArrayStuff.foo = [2 x [12 x i8]] [[12 x i8] c"Hello\00\00\00\00\00\00\00", [12 x i8] c"World\00\00\00\00\00\00\00"]
@.str = [20 x i8] c"%p, %p, %s, %c, %c\0A\00"
define void @ArrayStuff() {
%1 = alloca [2 x [12 x i8]]
%2 = getelementptr inbounds [2 x [12 x i8]], [2 x [12 x i8]]* %1, i64 0, i64 0, i64 0
%3 = getelementptr inbounds [2 x [12 x i8]], [2 x [12 x i8]]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %2, [12 x i8]* %3, i8* %2, i32 72, i32 101)
%5 = getelementptr inbounds [2 x [12 x i8]], [2 x [12 x i8]]* %1, i64 0, i64 1, i64 0
%6 = getelementptr inbounds [2 x [12 x i8]], [2 x [12 x i8]]* %1, i64 0, i64 1
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = getelementptr inbounds [2 x [12 x i8]], [2 x [12 x i8]]* %1, i64 0, i64 1, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5, [12 x i8]* %6, i8* %5, i32 %9, i32 %12)
ret void
}