#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ func(unsigned int *, int /*<<< orphan*/);
main() {
  unsigned int data[5] = {1L, 2L, 3L, 4L, 5L};
  unsigned int *p;
  int i;
  p = data;
  for (i = 0; i < 4; i++) {
    func(p, *(p++));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    117f <main+0x6f>
mov    -0x28(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%esi
call   1030 <func@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    114d <main+0x3d>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    0xef1(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x4(%rsp),%r14
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <func@plt>
lea    0x8(%rsp),%r15
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1030 <func@plt>
lea    0xc(%rsp),%rbx
mov    0x8(%rsp),%esi
mov    %r15,%rdi
call   1030 <func@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <func@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.data = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [5 x i32]* %2 to i8*
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
store i32* %6, i32** %3
store i32 0, i32* %4
br label %7
7: ; preds = %16, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %3
%14 = load i32, i32* %12
%15 = call i32 @func(i32* %11, i32 %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %7
19: ; preds = %7
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@__const.main.data = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%5 = call i32 @func(i32* %3, i32 1)
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%7 = load i32, i32* %4
%8 = call i32 @func(i32* %4, i32 %7)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%10 = load i32, i32* %6
%11 = call i32 @func(i32* %6, i32 %10)
%12 = load i32, i32* %9
%13 = call i32 @func(i32* %9, i32 %12)
ret i32 0
}