#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*/ bar(int *);
int /*<<< orphan*/ baz(int);
void fn7(void) {
  int a[16], b, c;
  bar(a);
  for (b = a[c = 0]; c < 16; b = a[++c])
    baz(b);
}


x86 assembly (clang, -O0):
<fn7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
call   1040 <bar@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x10,-0x48(%rbp)
jge    1167 <fn7+0x47>
mov    -0x44(%rbp),%edi
call   1030 <baz@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
cltq
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x44(%rbp)
jmp    113e <fn7+0x1e>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn7>:
sub    $0x48,%rsp
mov    %rsp,%rdi
call   1040 <bar@plt>
mov    (%rsp),%edi
call   1030 <baz@plt>
mov    0x4(%rsp),%edi
call   1030 <baz@plt>
mov    0x8(%rsp),%edi
call   1030 <baz@plt>
mov    0xc(%rsp),%edi
call   1030 <baz@plt>
mov    0x10(%rsp),%edi
call   1030 <baz@plt>
mov    0x14(%rsp),%edi
call   1030 <baz@plt>
mov    0x18(%rsp),%edi
call   1030 <baz@plt>
mov    0x1c(%rsp),%edi
call   1030 <baz@plt>
mov    0x20(%rsp),%edi
call   1030 <baz@plt>
mov    0x24(%rsp),%edi
call   1030 <baz@plt>
mov    0x28(%rsp),%edi
call   1030 <baz@plt>
mov    0x2c(%rsp),%edi
call   1030 <baz@plt>
mov    0x30(%rsp),%edi
call   1030 <baz@plt>
mov    0x34(%rsp),%edi
call   1030 <baz@plt>
mov    0x38(%rsp),%edi
call   1030 <baz@plt>
mov    0x3c(%rsp),%edi
call   1030 <baz@plt>
add    $0x48,%rsp
ret

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

LLVM IR (-O2):
define void @fn7() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%4 = call i32 @bar(i32* %3)
%5 = load i32, i32* %3
%6 = call i32 @baz(i32 %5)
%7 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 1
%8 = load i32, i32* %7
%9 = call i32 @baz(i32 %8)
%10 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 2
%11 = load i32, i32* %10
%12 = call i32 @baz(i32 %11)
%13 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 3
%14 = load i32, i32* %13
%15 = call i32 @baz(i32 %14)
%16 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 4
%17 = load i32, i32* %16
%18 = call i32 @baz(i32 %17)
%19 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 5
%20 = load i32, i32* %19
%21 = call i32 @baz(i32 %20)
%22 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 6
%23 = load i32, i32* %22
%24 = call i32 @baz(i32 %23)
%25 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 7
%26 = load i32, i32* %25
%27 = call i32 @baz(i32 %26)
%28 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 8
%29 = load i32, i32* %28
%30 = call i32 @baz(i32 %29)
%31 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 9
%32 = load i32, i32* %31
%33 = call i32 @baz(i32 %32)
%34 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 10
%35 = load i32, i32* %34
%36 = call i32 @baz(i32 %35)
%37 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 11
%38 = load i32, i32* %37
%39 = call i32 @baz(i32 %38)
%40 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 12
%41 = load i32, i32* %40
%42 = call i32 @baz(i32 %41)
%43 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 13
%44 = load i32, i32* %43
%45 = call i32 @baz(i32 %44)
%46 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 14
%47 = load i32, i32* %46
%48 = call i32 @baz(i32 %47)
%49 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 15
%50 = load i32, i32* %49
%51 = call i32 @baz(i32 %50)
ret void
}