#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*/ bla(int);
void foo(void) {
  int i;
  for (i = 0; i < 4; i++) {
    bla(i);
    bla(2 * i);
    bla(3 * i);
    bla(4 * i);
    bla(5 * i);
    bla(6 * i);
    bla(7 * i);
    bla(8 * i);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    1184 <foo+0x74>
mov    -0x4(%rbp),%edi
call   1030 <bla@plt>
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
call   1030 <bla@plt>
imul   $0x3,-0x4(%rbp),%edi
call   1030 <bla@plt>
mov    -0x4(%rbp),%edi
shl    $0x2,%edi
call   1030 <bla@plt>
imul   $0x5,-0x4(%rbp),%edi
call   1030 <bla@plt>
imul   $0x6,-0x4(%rbp),%edi
call   1030 <bla@plt>
imul   $0x7,-0x4(%rbp),%edi
call   1030 <bla@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
call   1030 <bla@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %edi,%edi
call   1030 <bla@plt>
xor    %edi,%edi
call   1030 <bla@plt>
xor    %edi,%edi
call   1030 <bla@plt>
xor    %edi,%edi
call   1030 <bla@plt>
xor    %edi,%edi
call   1030 <bla@plt>
xor    %edi,%edi
call   1030 <bla@plt>
xor    %edi,%edi
call   1030 <bla@plt>
xor    %edi,%edi
call   1030 <bla@plt>
mov    $0x1,%edi
call   1030 <bla@plt>
mov    $0x2,%edi
call   1030 <bla@plt>
mov    $0x3,%edi
call   1030 <bla@plt>
mov    $0x4,%edi
call   1030 <bla@plt>
mov    $0x5,%edi
call   1030 <bla@plt>
mov    $0x6,%edi
call   1030 <bla@plt>
mov    $0x7,%edi
call   1030 <bla@plt>
mov    $0x8,%edi
call   1030 <bla@plt>
mov    $0x2,%edi
call   1030 <bla@plt>
mov    $0x4,%edi
call   1030 <bla@plt>
mov    $0x6,%edi
call   1030 <bla@plt>
mov    $0x8,%edi
call   1030 <bla@plt>
mov    $0xa,%edi
call   1030 <bla@plt>
mov    $0xc,%edi
call   1030 <bla@plt>
mov    $0xe,%edi
call   1030 <bla@plt>
mov    $0x10,%edi
call   1030 <bla@plt>
mov    $0x3,%edi
call   1030 <bla@plt>
mov    $0x6,%edi
call   1030 <bla@plt>
mov    $0x9,%edi
call   1030 <bla@plt>
mov    $0xc,%edi
call   1030 <bla@plt>
mov    $0xf,%edi
call   1030 <bla@plt>
mov    $0x12,%edi
call   1030 <bla@plt>
mov    $0x15,%edi
call   1030 <bla@plt>
mov    $0x18,%edi
pop    %rax
jmp    1030 <bla@plt>

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %29, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 4
br i1 %4, label %5, label %32
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @bla(i32 %6)
%8 = load i32, i32* %1
%9 = mul nsw i32 2, %8
%10 = call i32 @bla(i32 %9)
%11 = load i32, i32* %1
%12 = mul nsw i32 3, %11
%13 = call i32 @bla(i32 %12)
%14 = load i32, i32* %1
%15 = mul nsw i32 4, %14
%16 = call i32 @bla(i32 %15)
%17 = load i32, i32* %1
%18 = mul nsw i32 5, %17
%19 = call i32 @bla(i32 %18)
%20 = load i32, i32* %1
%21 = mul nsw i32 6, %20
%22 = call i32 @bla(i32 %21)
%23 = load i32, i32* %1
%24 = mul nsw i32 7, %23
%25 = call i32 @bla(i32 %24)
%26 = load i32, i32* %1
%27 = mul nsw i32 8, %26
%28 = call i32 @bla(i32 %27)
br label %29
29: ; preds = %5
%30 = load i32, i32* %1
%31 = add nsw i32 %30, 1
store i32 %31, i32* %1
br label %2
32: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @bla(i32 0)
%2 = tail call i32 @bla(i32 0)
%3 = tail call i32 @bla(i32 0)
%4 = tail call i32 @bla(i32 0)
%5 = tail call i32 @bla(i32 0)
%6 = tail call i32 @bla(i32 0)
%7 = tail call i32 @bla(i32 0)
%8 = tail call i32 @bla(i32 0)
%9 = tail call i32 @bla(i32 1)
%10 = tail call i32 @bla(i32 2)
%11 = tail call i32 @bla(i32 3)
%12 = tail call i32 @bla(i32 4)
%13 = tail call i32 @bla(i32 5)
%14 = tail call i32 @bla(i32 6)
%15 = tail call i32 @bla(i32 7)
%16 = tail call i32 @bla(i32 8)
%17 = tail call i32 @bla(i32 2)
%18 = tail call i32 @bla(i32 4)
%19 = tail call i32 @bla(i32 6)
%20 = tail call i32 @bla(i32 8)
%21 = tail call i32 @bla(i32 10)
%22 = tail call i32 @bla(i32 12)
%23 = tail call i32 @bla(i32 14)
%24 = tail call i32 @bla(i32 16)
%25 = tail call i32 @bla(i32 3)
%26 = tail call i32 @bla(i32 6)
%27 = tail call i32 @bla(i32 9)
%28 = tail call i32 @bla(i32 12)
%29 = tail call i32 @bla(i32 15)
%30 = tail call i32 @bla(i32 18)
%31 = tail call i32 @bla(i32 21)
%32 = tail call i32 @bla(i32 24)
ret void
}