void fn4(void) {
  unsigned int *a[32], *o, i;
  bar(a);
  for (i = 0; i <= sizeof(a) / sizeof(a[0]); i++) {
    o = a[i];
    bar(o);
  }
}


x86 assembly (clang, -O0):
<fn4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rdi
mov    $0x0,%al
call   1030 <bar@plt>
movl   $0x0,-0x10c(%rbp)
mov    -0x10c(%rbp),%eax
cmp    $0x20,%rax
ja     117a <fn4+0x6a>
mov    -0x10c(%rbp),%eax
mov    -0x100(%rbp,%rax,8),%rax
ff
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rdi
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x10c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10c(%rbp)
jmp    1133 <fn4+0x23>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn4>:
sub    $0x108,%rsp
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    (%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x8(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x10(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x18(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x20(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x28(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x30(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x38(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x40(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x48(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x50(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x58(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x60(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x68(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x70(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x78(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x80(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x88(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x90(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x98(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0xa0(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0xa8(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0xb0(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0xb8(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0xc0(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0xc8(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0xd0(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0xd8(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0xe0(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0xe8(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0xf0(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0xf8(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x100(%rsp),%rdi
xor    %eax,%eax
call   1030 <bar@plt>
add    $0x108,%rsp
ret

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

LLVM IR (-O2):
define void @fn4() {
%1 = alloca [32 x i32*]
%2 = bitcast [32 x i32*]* %1 to i8*
%3 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 0
%4 = call i32 (i32**, ...) bitcast (i32 (...)* @bar to i32 (i32**, ...)*)(i32** %3)
%5 = load i32*, i32** %3
%6 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %5)
%7 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 1
%8 = load i32*, i32** %7
%9 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %8)
%10 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 2
%11 = load i32*, i32** %10
%12 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %11)
%13 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 3
%14 = load i32*, i32** %13
%15 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %14)
%16 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 4
%17 = load i32*, i32** %16
%18 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %17)
%19 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 5
%20 = load i32*, i32** %19
%21 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %20)
%22 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 6
%23 = load i32*, i32** %22
%24 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %23)
%25 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 7
%26 = load i32*, i32** %25
%27 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %26)
%28 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 8
%29 = load i32*, i32** %28
%30 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %29)
%31 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 9
%32 = load i32*, i32** %31
%33 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %32)
%34 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 10
%35 = load i32*, i32** %34
%36 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %35)
%37 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 11
%38 = load i32*, i32** %37
%39 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %38)
%40 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 12
%41 = load i32*, i32** %40
%42 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %41)
%43 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 13
%44 = load i32*, i32** %43
%45 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %44)
%46 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 14
%47 = load i32*, i32** %46
%48 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %47)
%49 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 15
%50 = load i32*, i32** %49
%51 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %50)
%52 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 16
%53 = load i32*, i32** %52
%54 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %53)
%55 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 17
%56 = load i32*, i32** %55
%57 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %56)
%58 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 18
%59 = load i32*, i32** %58
%60 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %59)
%61 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 19
%62 = load i32*, i32** %61
%63 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %62)
%64 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 20
%65 = load i32*, i32** %64
%66 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %65)
%67 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 21
%68 = load i32*, i32** %67
%69 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %68)
%70 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 22
%71 = load i32*, i32** %70
%72 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %71)
%73 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 23
%74 = load i32*, i32** %73
%75 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %74)
%76 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 24
%77 = load i32*, i32** %76
%78 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %77)
%79 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 25
%80 = load i32*, i32** %79
%81 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %80)
%82 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 26
%83 = load i32*, i32** %82
%84 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %83)
%85 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 27
%86 = load i32*, i32** %85
%87 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %86)
%88 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 28
%89 = load i32*, i32** %88
%90 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %89)
%91 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 29
%92 = load i32*, i32** %91
%93 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %92)
%94 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 30
%95 = load i32*, i32** %94
%96 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %95)
%97 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 31
%98 = load i32*, i32** %97
%99 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %98)
%100 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 32
%101 = load i32*, i32** %100
%102 = call i32 (i32*, ...) bitcast (i32 (...)* @bar to i32 (i32*, ...)*)(i32* %101)
ret void
}