#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*/ hpmMat4VecMult(float const *, float *);
void hpmMat4VecArrayMult(const float *mat, float *vec, size_t length,
                         size_t stride) {
  int i;
  stride = (stride) ? stride : 3 * sizeof(float);
  for (i = 0; i < length; i++) {
    hpmMat4VecMult(mat, vec);
    vec = ((float *)((char *)vec + stride));
  }
}


x86 assembly (clang, -O0):
<hpmMat4VecArrayMult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1140 <hpmMat4VecArrayMult+0x30>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    114e <hpmMat4VecArrayMult+0x3e>
mov    $0xc,%eax
mov    %rax,-0x30(%rbp)
jmp    114e <hpmMat4VecArrayMult+0x3e>
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1192 <hpmMat4VecArrayMult+0x82>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <hpmMat4VecMult@plt>
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115d <hpmMat4VecArrayMult+0x4d>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpmMat4VecArrayMult>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rcx,%rcx
mov    $0xc,%r12d
cmovne %rcx,%r12
test   %rdx,%rdx
je     1154 <hpmMat4VecArrayMult+0x44>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <hpmMat4VecMult@plt>
add    %r12,%rbx
add    $0xffffffffffffffff,%r14
jne    1140 <hpmMat4VecArrayMult+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @hpmMat4VecArrayMult(float* %0, float* %1, i64 %2, i64 %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
store float* %0, float** %5
store float* %1, float** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %8
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load i64, i64* %8
br label %15
14: ; preds = %4
br label %15
15: ; preds = %14, %12
%16 = phi i64 [ %13, %12 ], [ 12, %14 ]
store i64 %16, i64* %8
store i32 0, i32* %9
br label %17
17: ; preds = %31, %15
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = load i64, i64* %7
%21 = icmp ult i64 %19, %20
br i1 %21, label %22, label %34
22: ; preds = %17
%23 = load float*, float** %5
%24 = load float*, float** %6
%25 = call i32 @hpmMat4VecMult(float* %23, float* %24)
%26 = load float*, float** %6
%27 = bitcast float* %26 to i8*
%28 = load i64, i64* %8
%29 = getelementptr inbounds i8, i8* %27, i64 %28
%30 = bitcast i8* %29 to float*
store float* %30, float** %6
br label %31
31: ; preds = %22
%32 = load i32, i32* %9
%33 = add nsw i32 %32, 1
store i32 %33, i32* %9
br label %17
34: ; preds = %17
ret void
}

LLVM IR (-O2):
define void @hpmMat4VecArrayMult(float* %0, float* %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %3, 0
%6 = select i1 %5, i64 12, i64 %3
%7 = icmp eq i64 %2, 0
br i1 %7, label %17, label %8
8: ; preds = %4, %8
%9 = phi i64 [ %15, %8 ], [ 0, %4 ]
%10 = phi float* [ %14, %8 ], [ %1, %4 ]
%11 = tail call i32 @hpmMat4VecMult(float* %0, float* %10)
%12 = bitcast float* %10 to i8*
%13 = getelementptr inbounds i8, i8* %12, i64 %6
%14 = bitcast i8* %13 to float*
%15 = add nuw i64 %9, 1
%16 = icmp eq i64 %15, %2
br i1 %16, label %17, label %8
17: ; preds = %8, %4
ret void
}