#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*/ foo(float *);
int bar() {
  int i, j;
  float A[100];
  for (i = 0; i < 5; i++) {
    A[i * 3] = i + 3;
    A[i + 7] = i;
  }
  foo(A);
  return A[1];
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1169 <bar+0x59>
mov    -0x4(%rbp),%eax
add    $0x3,%eax
cvtsi2ss %eax,%xmm0
imul   $0x3,-0x4(%rbp),%eax
cltq
movss  %xmm0,-0x1a0(%rbp,%rax,4)
ff ff
cvtsi2ssl -0x4(%rbp),%xmm0
mov    -0x4(%rbp),%eax
add    $0x7,%eax
cltq
movss  %xmm0,-0x1a0(%rbp,%rax,4)
ff ff
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <bar+0x12>
lea    -0x1a0(%rbp),%rdi
call   1030 <foo@plt>
cvttss2si -0x19c(%rbp),%eax
ff
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
sub    $0x198,%rsp
movl   $0x40400000,(%rsp)
movl   $0x40800000,0xc(%rsp)
40
movaps 0xed3(%rip),%xmm0
movups %xmm0,0x18(%rsp)
movabs $0x4080000040400000,%rax
mov    %rax,0x28(%rsp)
movl   $0x40e00000,0x30(%rsp)
40
mov    %rsp,%rdi
call   1030 <foo@plt>
cvttss2si 0x4(%rsp),%eax
add    $0x198,%rsp
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x float]
store i32 0, i32* %1
br label %4
4: ; preds = %21, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %24
7: ; preds = %4
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 3
%10 = sitofp i32 %9 to float
%11 = load i32, i32* %1
%12 = mul nsw i32 %11, 3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [100 x float], [100 x float]* %3, i64 0, i64 %13
store float %10, float* %14
%15 = load i32, i32* %1
%16 = sitofp i32 %15 to float
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [100 x float], [100 x float]* %3, i64 0, i64 %19
store float %16, float* %20
br label %21
21: ; preds = %7
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 1
store i32 %23, i32* %1
br label %4
24: ; preds = %4
%25 = getelementptr inbounds [100 x float], [100 x float]* %3, i64 0, i64 0
%26 = call i32 @foo(float* %25)
%27 = getelementptr inbounds [100 x float], [100 x float]* %3, i64 0, i64 1
%28 = load float, float* %27
%29 = fptosi float %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @bar() {
%1 = alloca [100 x float]
%2 = bitcast [100 x float]* %1 to i8*
%3 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 0
store float 3.000000e+00, float* %3
%4 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 3
store float 4.000000e+00, float* %4
%5 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 6
%6 = bitcast float* %5 to <4 x float>*
store <4 x float> <float 5.000000e+00, float 0.000000e+00, float 1.000000e+00, float 6.000000e+00>, <4 x float>* %6
%7 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 10
store float 3.000000e+00, float* %7
%8 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 12
store float 7.000000e+00, float* %8
%9 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 11
store float 4.000000e+00, float* %9
%10 = call i32 @foo(float* %3)
%11 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 1
%12 = load float, float* %11
%13 = fptosi float %12 to i32
ret i32 %13
}