#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 */
double vec4_dot(double const *, double const *);
void mat43_mult_vec3(double *v1, const double *m2, const double *v3) {
  v1[0] = vec4_dot(&m2[0], v3);
  v1[1] = vec4_dot(&m2[4], v3);
  v1[2] = vec4_dot(&m2[8], v3);
}


x86 assembly (clang, -O0):
<mat43_mult_vec3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <vec4_dot@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rdi
add    $0x20,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <vec4_dot@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rdi
add    $0x40,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <vec4_dot@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat43_mult_vec3>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <vec4_dot@plt>
movsd  %xmm0,(%r15)
lea    0x20(%rbx),%rdi
mov    %r14,%rsi
call   1030 <vec4_dot@plt>
movsd  %xmm0,0x8(%r15)
add    $0x40,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <vec4_dot@plt>
movsd  %xmm0,0x10(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @mat43_mult_vec3(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double*, double** %6
%10 = call double @vec4_dot(double* %8, double* %9)
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 0
store double %10, double* %12
%13 = load double*, double** %5
%14 = getelementptr inbounds double, double* %13, i64 4
%15 = load double*, double** %6
%16 = call double @vec4_dot(double* %14, double* %15)
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 1
store double %16, double* %18
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 8
%21 = load double*, double** %6
%22 = call double @vec4_dot(double* %20, double* %21)
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 2
store double %22, double* %24
ret void
}

LLVM IR (-O2):
define void @mat43_mult_vec3(double* nocapture writeonly %0, double* %1, double* %2) {
%4 = tail call double @vec4_dot(double* %1, double* %2)
store double %4, double* %0
%5 = getelementptr inbounds double, double* %1, i64 4
%6 = tail call double @vec4_dot(double* %5, double* %2)
%7 = getelementptr inbounds double, double* %0, i64 1
store double %6, double* %7
%8 = getelementptr inbounds double, double* %1, i64 8
%9 = tail call double @vec4_dot(double* %8, double* %2)
%10 = getelementptr inbounds double, double* %0, i64 2
store double %9, double* %10
ret void
}