int main(void) {
  int a[4];
  int b[4];
  a[0] = 42;
  a[1] = 42;
  a[2] = 42;
  a[3] = 42;
  assert(a[0] == 42);
  assert(a[1] == 42);
  assert(a[2] == 42);
  assert(a[3] == 42);
  int *ptr = &b;
  *ptr = 1;
  ptr++;
  *ptr = 1;
  ptr++;
  *ptr = 1;
  ptr++;
  *ptr = 1;
  ptr++;
  assert(b[0] == 1);
  assert(b[1] == 1);
  assert(b[2] == 1);
  assert(b[3] == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x2a,-0x10(%rbp)
movl   $0x2a,-0xc(%rbp)
movl   $0x2a,-0x8(%rbp)
movl   $0x2a,-0x4(%rbp)
cmpl   $0x2a,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x2a,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x2a,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x2a,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x1,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x1,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x1,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x1,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32]
%3 = alloca i32*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
store i32 42, i32* %4
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
store i32 42, i32* %5
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
store i32 42, i32* %6
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 3
store i32 42, i32* %7
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 42
%11 = zext i1 %10 to i32
%12 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %11)
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 42
%16 = zext i1 %15 to i32
%17 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %16)
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 42
%21 = zext i1 %20 to i32
%22 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %21)
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 3
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, 42
%26 = zext i1 %25 to i32
%27 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %26)
%28 = bitcast [4 x i32]* %2 to i32*
store i32* %28, i32** %3
%29 = load i32*, i32** %3
store i32 1, i32* %29
%30 = load i32*, i32** %3
%31 = getelementptr inbounds i32, i32* %30, i32 1
store i32* %31, i32** %3
%32 = load i32*, i32** %3
store i32 1, i32* %32
%33 = load i32*, i32** %3
%34 = getelementptr inbounds i32, i32* %33, i32 1
store i32* %34, i32** %3
%35 = load i32*, i32** %3
store i32 1, i32* %35
%36 = load i32*, i32** %3
%37 = getelementptr inbounds i32, i32* %36, i32 1
store i32* %37, i32** %3
%38 = load i32*, i32** %3
store i32 1, i32* %38
%39 = load i32*, i32** %3
%40 = getelementptr inbounds i32, i32* %39, i32 1
store i32* %40, i32** %3
%41 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%42 = load i32, i32* %41
%43 = icmp eq i32 %42, 1
%44 = zext i1 %43 to i32
%45 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %44)
%46 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%47 = load i32, i32* %46
%48 = icmp eq i32 %47, 1
%49 = zext i1 %48 to i32
%50 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %49)
%51 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%52 = load i32, i32* %51
%53 = icmp eq i32 %52, 1
%54 = zext i1 %53 to i32
%55 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %54)
%56 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%57 = load i32, i32* %56
%58 = icmp eq i32 %57, 1
%59 = zext i1 %58 to i32
%60 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %59)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 0
}