int main(int argc, char *argv[]) {
  int vet[] = {-1, 0, -2};
  int i;
  for (i = 0; i < 3; i++) {
    printf("[%X][%i]\n", vet + i, *(vet + i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xed1(%rip),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    117e <main+0x6e>
lea    -0x1c(%rbp),%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x20(%rbp),%rax
mov    -0x1c(%rbp,%rax,4),%edx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1141 <main+0x31>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0xeeb(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xed8(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%r14
lea    0xed3(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.vet = [3 x i32] [i32 -1, i32 0, i32 -2]
@.str = [10 x i8] c"[%X][%i]\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %5, i32 -1)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%8 = load i32, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %7, i32 %8)
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%11 = load i32, i32* %10
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %10, i32 %11)
ret i32 0
}