main() {
  struct {
    int i;
  } ar[5];
  __typeof(*ar) *ar_p;
  int *p = ar;
  ar_p = ar + 1;
  for (int i = 0; i < 5; i++)
    p[i] = i;
  ar_p--->i = 8;
  ar_p->i = 9;
  print_ar(p, 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    1160 <main+0x50>
mov    -0x34(%rbp),%edx
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113a <main+0x2a>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x28(%rbp)
movl   $0x8,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x9,(%rax)
mov    -0x30(%rbp),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <print_ar@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x4,0x10(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <print_ar@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x %struct.anon]
%3 = alloca %struct.anon*
%4 = alloca i32*
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [5 x %struct.anon], [5 x %struct.anon]* %2, i64 0, i64 0
%7 = bitcast %struct.anon* %6 to i32*
store i32* %7, i32** %4
%8 = getelementptr inbounds [5 x %struct.anon], [5 x %struct.anon]* %2, i64 0, i64 0
%9 = getelementptr inbounds %struct.anon, %struct.anon* %8, i64 1
store %struct.anon* %9, %struct.anon** %3
store i32 0, i32* %5
br label %10
10: ; preds = %19, %0
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %5
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
store i32 %14, i32* %18
br label %19
19: ; preds = %13
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %10
22: ; preds = %10
%23 = load %struct.anon*, %struct.anon** %3
%24 = getelementptr inbounds %struct.anon, %struct.anon* %23, i32 -1
store %struct.anon* %24, %struct.anon** %3
%25 = getelementptr inbounds %struct.anon, %struct.anon* %23, i32 0, i32 0
store i32 8, i32* %25
%26 = load %struct.anon*, %struct.anon** %3
%27 = getelementptr inbounds %struct.anon, %struct.anon* %26, i32 0, i32 0
store i32 9, i32* %27
%28 = load i32*, i32** %4
%29 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @print_ar to i32 (i32*, i32, ...)*)(i32* %28, i32 5)
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
%struct.anon = type { i32 }
define i32 @main() {
%1 = alloca [5 x %struct.anon]
%2 = bitcast [5 x %struct.anon]* %1 to i8*
%3 = getelementptr inbounds [5 x %struct.anon], [5 x %struct.anon]* %1, i64 0, i64 0, i32 0
%4 = getelementptr inbounds [5 x %struct.anon], [5 x %struct.anon]* %1, i64 0, i64 4, i32 0
store i32 4, i32* %4
%5 = bitcast [5 x %struct.anon]* %1 to <4 x i32>*
store <4 x i32> <i32 9, i32 8, i32 2, i32 3>, <4 x i32>* %5
%6 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @print_ar to i32 (i32*, i32, ...)*)(i32* %3, i32 5)
ret i32 0
}