#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*/ finn_vec4_mul_mat4(float *, float *, float *);
void finn_mat4_mul_mat4(float *result, float *lhs, float *rhs) {
  finn_vec4_mul_mat4(&result[0], &lhs[0], rhs);
  finn_vec4_mul_mat4(&result[4], &lhs[4], rhs);
  finn_vec4_mul_mat4(&result[8], &lhs[8], rhs);
  finn_vec4_mul_mat4(&result[12], &lhs[12], rhs);
}


x86 assembly (clang, -O0):
<finn_mat4_mul_mat4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <finn_vec4_mul_mat4@plt>
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
mov    -0x18(%rbp),%rdx
call   1030 <finn_vec4_mul_mat4@plt>
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
mov    -0x18(%rbp),%rdx
call   1030 <finn_vec4_mul_mat4@plt>
mov    -0x8(%rbp),%rdi
add    $0x30,%rdi
mov    -0x10(%rbp),%rsi
add    $0x30,%rsi
mov    -0x18(%rbp),%rdx
call   1030 <finn_vec4_mul_mat4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_mat4_mul_mat4>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <finn_vec4_mul_mat4@plt>
lea    0x10(%rbx),%rdi
lea    0x10(%r15),%rsi
mov    %r14,%rdx
call   1030 <finn_vec4_mul_mat4@plt>
lea    0x20(%rbx),%rdi
lea    0x20(%r15),%rsi
mov    %r14,%rdx
call   1030 <finn_vec4_mul_mat4@plt>
add    $0x30,%rbx
add    $0x30,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <finn_vec4_mul_mat4@plt>

LLVM IR (-O0):
define void @finn_mat4_mul_mat4(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float*, float** %5
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float*, float** %6
%12 = call i32 @finn_vec4_mul_mat4(float* %8, float* %10, float* %11)
%13 = load float*, float** %4
%14 = getelementptr inbounds float, float* %13, i64 4
%15 = load float*, float** %5
%16 = getelementptr inbounds float, float* %15, i64 4
%17 = load float*, float** %6
%18 = call i32 @finn_vec4_mul_mat4(float* %14, float* %16, float* %17)
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 8
%21 = load float*, float** %5
%22 = getelementptr inbounds float, float* %21, i64 8
%23 = load float*, float** %6
%24 = call i32 @finn_vec4_mul_mat4(float* %20, float* %22, float* %23)
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 12
%27 = load float*, float** %5
%28 = getelementptr inbounds float, float* %27, i64 12
%29 = load float*, float** %6
%30 = call i32 @finn_vec4_mul_mat4(float* %26, float* %28, float* %29)
ret void
}

LLVM IR (-O2):
define void @finn_mat4_mul_mat4(float* %0, float* %1, float* %2) {
%4 = tail call i32 @finn_vec4_mul_mat4(float* %0, float* %1, float* %2)
%5 = getelementptr inbounds float, float* %0, i64 4
%6 = getelementptr inbounds float, float* %1, i64 4
%7 = tail call i32 @finn_vec4_mul_mat4(float* %5, float* %6, float* %2)
%8 = getelementptr inbounds float, float* %0, i64 8
%9 = getelementptr inbounds float, float* %1, i64 8
%10 = tail call i32 @finn_vec4_mul_mat4(float* %8, float* %9, float* %2)
%11 = getelementptr inbounds float, float* %0, i64 12
%12 = getelementptr inbounds float, float* %1, i64 12
%13 = tail call i32 @finn_vec4_mul_mat4(float* %11, float* %12, float* %2)
ret void
}