#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(float *, float **);
void foo(unsigned long n, const float *__restrict u0,
         const float *__restrict u1, const float *__restrict u2,
         const float *__restrict u3, const float *__restrict u4,
         const float *__restrict s0, const float *__restrict s1,
         const float *__restrict s2, float *__restrict t3,
         float *__restrict t4) {
  unsigned long i;
  for (i = 0; i < n; i++) {
    float u[5], f[3][5];
    u[0] = u0[i];
    u[1] = u1[i];
    u[2] = u2[i];
    u[3] = u3[i];
    u[4] = u4[i];
    bar(u, f);
    t3[i] = s0[i] * f[0][3] + s1[i] * f[1][3] + s2[i] * f[2][3];
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    122e <foo+0x11e>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x48(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x40(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <bar@plt>
mov    0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
movss  -0x84(%rbp),%xmm2
ff
mov    0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mulss  -0x70(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    0x20(%rbp),%rax
mov    -0x38(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  -0x5c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    114f <foo+0x3f>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
test   %rdi,%rdi
je     11ee <foo+0xde>
mov    %r9,%r15
mov    %r8,%r12
mov    %rcx,%r13
mov    %rdx,%rbx
mov    %rsi,%rbp
xor    %r14d,%r14d
mov    %rdi,0x18(%rsp)
xchg   %ax,%ax
movss  0x0(%rbp,%r14,4),%xmm0
movss  %xmm0,(%rsp)
movss  (%rbx,%r14,4),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0x0(%r13,%r14,4),%xmm0
movss  %xmm0,0x8(%rsp)
movss  (%r12,%r14,4),%xmm0
movss  %xmm0,0xc(%rsp)
movss  (%r15,%r14,4),%xmm0
movss  %xmm0,0x10(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
call   1030 <bar@plt>
mov    0x18(%rsp),%rdi
mov    0xa0(%rsp),%rax
movss  (%rax,%r14,4),%xmm0
mov    0xa8(%rsp),%rax
movss  (%rax,%r14,4),%xmm1
mulss  0x40(%rsp),%xmm1
mulss  0x2c(%rsp),%xmm0
addss  %xmm1,%xmm0
mov    0xb0(%rsp),%rax
movss  (%rax,%r14,4),%xmm1
mulss  0x54(%rsp),%xmm1
addss  %xmm0,%xmm1
mov    0xb8(%rsp),%rax
movss  %xmm1,(%rax,%r14,4)
add    $0x1,%r14
cmp    %r14,%rdi
jne    1140 <foo+0x30>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @foo(i64 %0, float* noalias %1, float* noalias %2, float* noalias %3, float* noalias %4, float* noalias %5, float* noalias %6, float* noalias %7, float* noalias %8, float* noalias %9, float* noalias %10) {
%12 = alloca i64
%13 = alloca float*
%14 = alloca float*
%15 = alloca float*
%16 = alloca float*
%17 = alloca float*
%18 = alloca float*
%19 = alloca float*
%20 = alloca float*
%21 = alloca float*
%22 = alloca float*
%23 = alloca i64
%24 = alloca [5 x float]
%25 = alloca [3 x [5 x float]]
store i64 %0, i64* %12
store float* %1, float** %13
store float* %2, float** %14
store float* %3, float** %15
store float* %4, float** %16
store float* %5, float** %17
store float* %6, float** %18
store float* %7, float** %19
store float* %8, float** %20
store float* %9, float** %21
store float* %10, float** %22
store i64 0, i64* %23
br label %26
26: ; preds = %87, %11
%27 = load i64, i64* %23
%28 = load i64, i64* %12
%29 = icmp ult i64 %27, %28
br i1 %29, label %30, label %90
30: ; preds = %26
%31 = load float*, float** %13
%32 = load i64, i64* %23
%33 = getelementptr inbounds float, float* %31, i64 %32
%34 = load float, float* %33
%35 = getelementptr inbounds [5 x float], [5 x float]* %24, i64 0, i64 0
store float %34, float* %35
%36 = load float*, float** %14
%37 = load i64, i64* %23
%38 = getelementptr inbounds float, float* %36, i64 %37
%39 = load float, float* %38
%40 = getelementptr inbounds [5 x float], [5 x float]* %24, i64 0, i64 1
store float %39, float* %40
%41 = load float*, float** %15
%42 = load i64, i64* %23
%43 = getelementptr inbounds float, float* %41, i64 %42
%44 = load float, float* %43
%45 = getelementptr inbounds [5 x float], [5 x float]* %24, i64 0, i64 2
store float %44, float* %45
%46 = load float*, float** %16
%47 = load i64, i64* %23
%48 = getelementptr inbounds float, float* %46, i64 %47
%49 = load float, float* %48
%50 = getelementptr inbounds [5 x float], [5 x float]* %24, i64 0, i64 3
store float %49, float* %50
%51 = load float*, float** %17
%52 = load i64, i64* %23
%53 = getelementptr inbounds float, float* %51, i64 %52
%54 = load float, float* %53
%55 = getelementptr inbounds [5 x float], [5 x float]* %24, i64 0, i64 4
store float %54, float* %55
%56 = getelementptr inbounds [5 x float], [5 x float]* %24, i64 0, i64 0
%57 = getelementptr inbounds [3 x [5 x float]], [3 x [5 x float]]* %25, i64 0, i64 0
%58 = bitcast [5 x float]* %57 to float**
%59 = call i32 @bar(float* %56, float** %58)
%60 = load float*, float** %18
%61 = load i64, i64* %23
%62 = getelementptr inbounds float, float* %60, i64 %61
%63 = load float, float* %62
%64 = getelementptr inbounds [3 x [5 x float]], [3 x [5 x float]]* %25, i64 0, i64 0
%65 = getelementptr inbounds [5 x float], [5 x float]* %64, i64 0, i64 3
%66 = load float, float* %65
%67 = load float*, float** %19
%68 = load i64, i64* %23
%69 = getelementptr inbounds float, float* %67, i64 %68
%70 = load float, float* %69
%71 = getelementptr inbounds [3 x [5 x float]], [3 x [5 x float]]* %25, i64 0, i64 1
%72 = getelementptr inbounds [5 x float], [5 x float]* %71, i64 0, i64 3
%73 = load float, float* %72
%74 = fmul float %70, %73
%75 = call float @llvm.fmuladd.f32(float %63, float %66, float %74)
%76 = load float*, float** %20
%77 = load i64, i64* %23
%78 = getelementptr inbounds float, float* %76, i64 %77
%79 = load float, float* %78
%80 = getelementptr inbounds [3 x [5 x float]], [3 x [5 x float]]* %25, i64 0, i64 2
%81 = getelementptr inbounds [5 x float], [5 x float]* %80, i64 0, i64 3
%82 = load float, float* %81
%83 = call float @llvm.fmuladd.f32(float %79, float %82, float %75)
%84 = load float*, float** %21
%85 = load i64, i64* %23
%86 = getelementptr inbounds float, float* %84, i64 %85
store float %83, float* %86
br label %87
87: ; preds = %30
%88 = load i64, i64* %23
%89 = add i64 %88, 1
store i64 %89, i64* %23
br label %26
90: ; preds = %26
ret void
}

LLVM IR (-O2):
define void @foo(i64 %0, float* noalias nocapture %1, float* noalias nocapture %2, float* noalias nocapture %3, float* noalias nocapture %4, float* noalias nocapture %5, float* noalias nocapture %6, float* noalias nocapture %7, float* noalias nocapture %8, float* noalias nocapture writeonly %9, float* noalias nocapture readnone %10) {
%12 = alloca [5 x float]
%13 = alloca [3 x [5 x float]]
%14 = icmp eq i64 %0, 0
br i1 %14, label %55, label %15
15: ; preds = %11
%16 = bitcast [5 x float]* %12 to i8*
%17 = bitcast [3 x [5 x float]]* %13 to i8*
%18 = getelementptr inbounds [5 x float], [5 x float]* %12, i64 0, i64 0
%19 = getelementptr inbounds [5 x float], [5 x float]* %12, i64 0, i64 1
%20 = getelementptr inbounds [5 x float], [5 x float]* %12, i64 0, i64 2
%21 = getelementptr inbounds [5 x float], [5 x float]* %12, i64 0, i64 3
%22 = getelementptr inbounds [5 x float], [5 x float]* %12, i64 0, i64 4
%23 = bitcast [3 x [5 x float]]* %13 to float**
%24 = getelementptr inbounds [3 x [5 x float]], [3 x [5 x float]]* %13, i64 0, i64 0, i64 3
%25 = getelementptr inbounds [3 x [5 x float]], [3 x [5 x float]]* %13, i64 0, i64 1, i64 3
%26 = getelementptr inbounds [3 x [5 x float]], [3 x [5 x float]]* %13, i64 0, i64 2, i64 3
br label %27
27: ; preds = %15, %27
%28 = phi i64 [ 0, %15 ], [ %53, %27 ]
%29 = getelementptr inbounds float, float* %1, i64 %28
%30 = load float, float* %29
store float %30, float* %18
%31 = getelementptr inbounds float, float* %2, i64 %28
%32 = load float, float* %31
store float %32, float* %19
%33 = getelementptr inbounds float, float* %3, i64 %28
%34 = load float, float* %33
store float %34, float* %20
%35 = getelementptr inbounds float, float* %4, i64 %28
%36 = load float, float* %35
store float %36, float* %21
%37 = getelementptr inbounds float, float* %5, i64 %28
%38 = load float, float* %37
store float %38, float* %22
%39 = call i32 @bar(float* %18, float** %23)
%40 = getelementptr inbounds float, float* %6, i64 %28
%41 = load float, float* %40
%42 = load float, float* %24
%43 = getelementptr inbounds float, float* %7, i64 %28
%44 = load float, float* %43
%45 = load float, float* %25
%46 = fmul float %44, %45
%47 = call float @llvm.fmuladd.f32(float %41, float %42, float %46)
%48 = getelementptr inbounds float, float* %8, i64 %28
%49 = load float, float* %48
%50 = load float, float* %26
%51 = call float @llvm.fmuladd.f32(float %49, float %50, float %47)
%52 = getelementptr inbounds float, float* %9, i64 %28
store float %51, float* %52
%53 = add nuw i64 %28, 1
%54 = icmp eq i64 %53, %0
br i1 %54, label %55, label %27
55: ; preds = %27, %11
ret void
}