#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 */
typedef scalar_t__ z;
typedef scalar_t__ y;
typedef scalar_t__ x;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ matprod_mat_vec_n2(double *, double *, double *, int, int);
int /*<<< orphan*/ matprod_mat_vec_n3(double *, double *, double *, int, int);
int /*<<< orphan*/ matprod_mat_vec_n4(double *, double *, double *, int, int);
int /*<<< orphan*/ matprod_mat_vec_sub_xrows0(double *, double *, double *, int,
                                              int, int, int);
int /*<<< orphan*/ matprod_scalar_vec(double, double *, double *, int);
double matprod_vec_vec_sub(double *, double *, int, double);
int /*<<< orphan*/ set_to_zeros(double *, int);
void matprod_mat_vec_sub(double *restrict x, double *restrict y,
                         double *restrict z, int n, int k, int add) {
  assert(((uintptr_t)(x) & (1 - 1)) == 0);
  assert(((uintptr_t)(y) & (1 - 1)) == 0);
  assert(((uintptr_t)(z) & (1 - 1)) == 0);
  x = (x);
  y = (y);
  z = (z);
  if (k <= 1) {
    if (k == 1) {
      if (add) {
        double t = y[0];
        int i;
        for (i = 0; i < n; i++)
          z[i] += t * x[i];
      } else {
        matprod_scalar_vec(y[0], x, z, n);
      }
    } else {
      if (!add) {
        set_to_zeros(z, n);
      }
    }
    return;
  }
  if (n <= 4) {
    if (n == 4) {
      matprod_mat_vec_n4(x, y, z, k, add);
    } else if (n == 3) {
      matprod_mat_vec_n3(x, y, z, k, add);
    } else if (n == 2) {
      matprod_mat_vec_n2(x, y, z, k, add);
    } else if (n == 1) {
      z[0] = matprod_vec_vec_sub(x, y, k, add ? z[0] : 0.0);
    }
    return;
  }
  matprod_mat_vec_sub_xrows0(x, y, z, n, k, n, add);
}


x86 assembly (clang, -O0):
<matprod_mat_vec_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x10(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x18(%rbp),%rax
and    $0x0,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x20(%rbp)
jg     12bc <matprod_mat_vec_sub+0x13c>
cmpl   $0x1,-0x20(%rbp)
jne    129c <matprod_mat_vec_sub+0x11c>
cmpl   $0x0,-0x24(%rbp)
je     127f <matprod_mat_vec_sub+0xff>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    127a <matprod_mat_vec_sub+0xfa>
movsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1234 <matprod_mat_vec_sub+0xb4>
jmp    1297 <matprod_mat_vec_sub+0x117>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   10a0 <matprod_scalar_vec@plt>
jmp    12b7 <matprod_mat_vec_sub+0x137>
cmpl   $0x0,-0x24(%rbp)
jne    12b2 <matprod_mat_vec_sub+0x132>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1080 <set_to_zeros@plt>
jmp    12b7 <matprod_mat_vec_sub+0x137>
jmp    13d7 <matprod_mat_vec_sub+0x257>
cmpl   $0x4,-0x1c(%rbp)
jg     13b5 <matprod_mat_vec_sub+0x235>
cmpl   $0x4,-0x1c(%rbp)
jne    12ed <matprod_mat_vec_sub+0x16d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
call   1060 <matprod_mat_vec_n4@plt>
jmp    13b0 <matprod_mat_vec_sub+0x230>
cmpl   $0x3,-0x1c(%rbp)
jne    1314 <matprod_mat_vec_sub+0x194>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
call   1090 <matprod_mat_vec_n3@plt>
jmp    13ab <matprod_mat_vec_sub+0x22b>
cmpl   $0x2,-0x1c(%rbp)
jne    133b <matprod_mat_vec_sub+0x1bb>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
call   1040 <matprod_mat_vec_n2@plt>
jmp    13a6 <matprod_mat_vec_sub+0x226>
cmpl   $0x1,-0x1c(%rbp)
jne    13a1 <matprod_mat_vec_sub+0x221>
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1377 <matprod_mat_vec_sub+0x1f7>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1384 <matprod_mat_vec_sub+0x204>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1384 <matprod_mat_vec_sub+0x204>
mov    -0x38(%rbp),%edx
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdi
movsd  -0x50(%rbp),%xmm0
call   1050 <matprod_vec_vec_sub@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13a6 <matprod_mat_vec_sub+0x226>
jmp    13ab <matprod_mat_vec_sub+0x22b>
jmp    13b0 <matprod_mat_vec_sub+0x230>
jmp    13d7 <matprod_mat_vec_sub+0x257>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x24(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <matprod_mat_vec_sub_xrows0@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matprod_mat_vec_sub>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r13d
mov    %r8d,%r15d
mov    %ecx,%ebp
mov    %rdx,%rbx
mov    %rsi,%r12
mov    %rdi,%r14
mov    $0x1,%edi
call   1070 <assert@plt>
mov    $0x1,%edi
call   1070 <assert@plt>
mov    $0x1,%edi
call   1070 <assert@plt>
cmp    $0x1,%r15d
jg     11eb <matprod_mat_vec_sub+0x6b>
jne    121e <matprod_mat_vec_sub+0x9e>
movsd  (%r12),%xmm0
test   %r13d,%r13d
je     125e <matprod_mat_vec_sub+0xde>
test   %ebp,%ebp
jle    140b <matprod_mat_vec_sub+0x28b>
mov    %ebp,%eax
cmp    $0x4,%ebp
jae    1279 <matprod_mat_vec_sub+0xf9>
xor    %ecx,%ecx
jmp    1370 <matprod_mat_vec_sub+0x1f0>
cmp    $0x4,%ebp
jg     123f <matprod_mat_vec_sub+0xbf>
add    $0xffffffff,%ebp
cmp    $0x3,%ebp
ja     140b <matprod_mat_vec_sub+0x28b>
lea    0xdfd(%rip),%rax
movslq (%rax,%rbp,4),%rcx
add    %rax,%rcx
jmp    *%rcx
test   %r13d,%r13d
je     13f5 <matprod_mat_vec_sub+0x275>
movsd  (%rbx),%xmm0
jmp    13f9 <matprod_mat_vec_sub+0x279>
test   %r13d,%r13d
jne    140b <matprod_mat_vec_sub+0x28b>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <set_to_zeros@plt>
mov    %r13d,(%rsp)
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    %r15d,%r8d
mov    %ebp,%r9d
call   1030 <matprod_mat_vec_sub_xrows0@plt>
jmp    140b <matprod_mat_vec_sub+0x28b>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10a0 <matprod_scalar_vec@plt>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%rcx),%rdx
mov    %rdx,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
test   %rdx,%rdx
je     141a <matprod_mat_vec_sub+0x29a>
mov    %rsi,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movupd (%r14,%rdx,8),%xmm2
movupd 0x10(%r14,%rdx,8),%xmm3
mulpd  %xmm1,%xmm2
movupd (%rbx,%rdx,8),%xmm4
addpd  %xmm2,%xmm4
movupd 0x10(%rbx,%rdx,8),%xmm2
movupd 0x20(%rbx,%rdx,8),%xmm5
movupd 0x30(%rbx,%rdx,8),%xmm6
mulpd  %xmm1,%xmm3
addpd  %xmm2,%xmm3
movupd %xmm4,(%rbx,%rdx,8)
movupd %xmm3,0x10(%rbx,%rdx,8)
movupd 0x20(%r14,%rdx,8),%xmm2
movupd 0x30(%r14,%rdx,8),%xmm3
mulpd  %xmm1,%xmm2
addpd  %xmm5,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm6,%xmm3
movupd %xmm2,0x20(%rbx,%rdx,8)
movupd %xmm3,0x30(%rbx,%rdx,8)
add    $0x8,%rdx
add    $0xfffffffffffffffe,%rdi
jne    12b0 <matprod_mat_vec_sub+0x130>
test   $0x1,%sil
je     135c <matprod_mat_vec_sub+0x1dc>
movupd (%r14,%rdx,8),%xmm2
movupd 0x10(%r14,%rdx,8),%xmm3
movupd (%rbx,%rdx,8),%xmm4
movupd 0x10(%rbx,%rdx,8),%xmm5
mulpd  %xmm1,%xmm2
addpd  %xmm4,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm5,%xmm3
movupd %xmm2,(%rbx,%rdx,8)
movupd %xmm3,0x10(%rbx,%rdx,8)
cmp    %rax,%rcx
je     140b <matprod_mat_vec_sub+0x28b>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r14,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx,%rcx,8),%xmm1
movsd  %xmm1,(%rbx,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1370 <matprod_mat_vec_sub+0x1f0>
jmp    140b <matprod_mat_vec_sub+0x28b>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r15d,%ecx
mov    %r13d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <matprod_mat_vec_n2@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r15d,%ecx
mov    %r13d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1090 <matprod_mat_vec_n3@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r15d,%ecx
mov    %r13d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <matprod_mat_vec_n4@plt>
xorpd  %xmm0,%xmm0
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
call   1050 <matprod_vec_vec_sub@plt>
movsd  %xmm0,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edx,%edx
test   $0x1,%sil
jne    1329 <matprod_mat_vec_sub+0x1a9>
jmp    135c <matprod_mat_vec_sub+0x1dc>

LLVM IR (-O0):
define void @matprod_mat_vec_sub(double* noalias %0, double* noalias %1, double* noalias %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca i32
store double* %0, double** %7
store double* %1, double** %8
store double* %2, double** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%15 = load double*, double** %7
%16 = ptrtoint double* %15 to i64
%17 = and i64 %16, 0
%18 = icmp eq i64 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load double*, double** %8
%22 = ptrtoint double* %21 to i64
%23 = and i64 %22, 0
%24 = icmp eq i64 %23, 0
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = load double*, double** %9
%28 = ptrtoint double* %27 to i64
%29 = and i64 %28, 0
%30 = icmp eq i64 %29, 0
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = load double*, double** %7
store double* %33, double** %7
%34 = load double*, double** %8
store double* %34, double** %8
%35 = load double*, double** %9
store double* %35, double** %9
%36 = load i32, i32* %11
%37 = icmp sle i32 %36, 1
br i1 %37, label %38, label %87
38: ; preds = %6
%39 = load i32, i32* %11
%40 = icmp eq i32 %39, 1
br i1 %40, label %41, label %78
41: ; preds = %38
%42 = load i32, i32* %12
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %69
44: ; preds = %41
%45 = load double*, double** %8
%46 = getelementptr inbounds double, double* %45, i64 0
%47 = load double, double* %46
store double %47, double* %13
store i32 0, i32* %14
br label %48
48: ; preds = %65, %44
%49 = load i32, i32* %14
%50 = load i32, i32* %10
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %68
52: ; preds = %48
%53 = load double, double* %13
%54 = load double*, double** %7
%55 = load i32, i32* %14
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
%58 = load double, double* %57
%59 = load double*, double** %9
%60 = load i32, i32* %14
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %59, i64 %61
%63 = load double, double* %62
%64 = call double @llvm.fmuladd.f64(double %53, double %58, double %63)
store double %64, double* %62
br label %65
65: ; preds = %52
%66 = load i32, i32* %14
%67 = add nsw i32 %66, 1
store i32 %67, i32* %14
br label %48
68: ; preds = %48
br label %77
69: ; preds = %41
%70 = load double*, double** %8
%71 = getelementptr inbounds double, double* %70, i64 0
%72 = load double, double* %71
%73 = load double*, double** %7
%74 = load double*, double** %9
%75 = load i32, i32* %10
%76 = call i32 @matprod_scalar_vec(double %72, double* %73, double* %74, i32 %75)
br label %77
77: ; preds = %69, %68
br label %86
78: ; preds = %38
%79 = load i32, i32* %12
%80 = icmp ne i32 %79, 0
br i1 %80, label %85, label %81
81: ; preds = %78
%82 = load double*, double** %9
%83 = load i32, i32* %10
%84 = call i32 @set_to_zeros(double* %82, i32 %83)
br label %85
85: ; preds = %81, %78
br label %86
86: ; preds = %85, %77
br label %152
87: ; preds = %6
%88 = load i32, i32* %10
%89 = icmp sle i32 %88, 4
br i1 %89, label %90, label %143
90: ; preds = %87
%91 = load i32, i32* %10
%92 = icmp eq i32 %91, 4
br i1 %92, label %93, label %100
93: ; preds = %90
%94 = load double*, double** %7
%95 = load double*, double** %8
%96 = load double*, double** %9
%97 = load i32, i32* %11
%98 = load i32, i32* %12
%99 = call i32 @matprod_mat_vec_n4(double* %94, double* %95, double* %96, i32 %97, i32 %98)
br label %142
100: ; preds = %90
%101 = load i32, i32* %10
%102 = icmp eq i32 %101, 3
br i1 %102, label %103, label %110
103: ; preds = %100
%104 = load double*, double** %7
%105 = load double*, double** %8
%106 = load double*, double** %9
%107 = load i32, i32* %11
%108 = load i32, i32* %12
%109 = call i32 @matprod_mat_vec_n3(double* %104, double* %105, double* %106, i32 %107, i32 %108)
br label %141
110: ; preds = %100
%111 = load i32, i32* %10
%112 = icmp eq i32 %111, 2
br i1 %112, label %113, label %120
113: ; preds = %110
%114 = load double*, double** %7
%115 = load double*, double** %8
%116 = load double*, double** %9
%117 = load i32, i32* %11
%118 = load i32, i32* %12
%119 = call i32 @matprod_mat_vec_n2(double* %114, double* %115, double* %116, i32 %117, i32 %118)
br label %140
120: ; preds = %110
%121 = load i32, i32* %10
%122 = icmp eq i32 %121, 1
br i1 %122, label %123, label %139
123: ; preds = %120
%124 = load double*, double** %7
%125 = load double*, double** %8
%126 = load i32, i32* %11
%127 = load i32, i32* %12
%128 = icmp ne i32 %127, 0
br i1 %128, label %129, label %133
129: ; preds = %123
%130 = load double*, double** %9
%131 = getelementptr inbounds double, double* %130, i64 0
%132 = load double, double* %131
br label %134
133: ; preds = %123
br label %134
134: ; preds = %133, %129
%135 = phi double [ %132, %129 ], [ 0.000000e+00, %133 ]
%136 = call double @matprod_vec_vec_sub(double* %124, double* %125, i32 %126, double %135)
%137 = load double*, double** %9
%138 = getelementptr inbounds double, double* %137, i64 0
store double %136, double* %138
br label %139
139: ; preds = %134, %120
br label %140
140: ; preds = %139, %113
br label %141
141: ; preds = %140, %103
br label %142
142: ; preds = %141, %93
br label %152
143: ; preds = %87
%144 = load double*, double** %7
%145 = load double*, double** %8
%146 = load double*, double** %9
%147 = load i32, i32* %10
%148 = load i32, i32* %11
%149 = load i32, i32* %10
%150 = load i32, i32* %12
%151 = call i32 @matprod_mat_vec_sub_xrows0(double* %144, double* %145, double* %146, i32 %147, i32 %148, i32 %149, i32 %150)
br label %152
152: ; preds = %143, %142, %86
ret void
}

LLVM IR (-O2):
define void @matprod_mat_vec_sub(double* noalias %0, double* noalias %1, double* noalias %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @assert(i32 1)
%8 = tail call i32 @assert(i32 1)
%9 = tail call i32 @assert(i32 1)
%10 = icmp slt i32 %4, 2
br i1 %10, label %11, label %111
11: ; preds = %6
%12 = icmp eq i32 %4, 1
%13 = icmp eq i32 %5, 0
br i1 %12, label %14, label %108
14: ; preds = %11
%15 = load double, double* %1
br i1 %13, label %106, label %16
16: ; preds = %14
%17 = icmp sgt i32 %3, 0
br i1 %17, label %18, label %129
18: ; preds = %16
%19 = zext i32 %3 to i64
%20 = icmp ult i32 %3, 4
br i1 %20, label %95, label %21
21: ; preds = %18
%22 = and i64 %19, 4294967292
%23 = insertelement <2 x double> poison, double %15, i64 0
%24 = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> zeroinitializer
%25 = insertelement <2 x double> poison, double %15, i64 0
%26 = shufflevector <2 x double> %25, <2 x double> poison, <2 x i32> zeroinitializer
%27 = add nsw i64 %22, -4
%28 = lshr exact i64 %27, 2
%29 = add nuw nsw i64 %28, 1
%30 = and i64 %29, 1
%31 = icmp eq i64 %27, 0
br i1 %31, label %73, label %32
32: ; preds = %21
%33 = and i64 %29, 9223372036854775806
br label %34
34: ; preds = %34, %32
%35 = phi i64 [ 0, %32 ], [ %70, %34 ]
%36 = phi i64 [ 0, %32 ], [ %71, %34 ]
%37 = getelementptr inbounds double, double* %0, i64 %35
%38 = bitcast double* %37 to <2 x double>*
%39 = load <2 x double>, <2 x double>* %38
%40 = getelementptr inbounds double, double* %37, i64 2
%41 = bitcast double* %40 to <2 x double>*
%42 = load <2 x double>, <2 x double>* %41
%43 = getelementptr inbounds double, double* %2, i64 %35
%44 = bitcast double* %43 to <2 x double>*
%45 = load <2 x double>, <2 x double>* %44
%46 = getelementptr inbounds double, double* %43, i64 2
%47 = bitcast double* %46 to <2 x double>*
%48 = load <2 x double>, <2 x double>* %47
%49 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %24, <2 x double> %39, <2 x double> %45)
%50 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %26, <2 x double> %42, <2 x double> %48)
%51 = bitcast double* %43 to <2 x double>*
store <2 x double> %49, <2 x double>* %51
%52 = bitcast double* %46 to <2 x double>*
store <2 x double> %50, <2 x double>* %52
%53 = or i64 %35, 4
%54 = getelementptr inbounds double, double* %0, i64 %53
%55 = bitcast double* %54 to <2 x double>*
%56 = load <2 x double>, <2 x double>* %55
%57 = getelementptr inbounds double, double* %54, i64 2
%58 = bitcast double* %57 to <2 x double>*
%59 = load <2 x double>, <2 x double>* %58
%60 = getelementptr inbounds double, double* %2, i64 %53
%61 = bitcast double* %60 to <2 x double>*
%62 = load <2 x double>, <2 x double>* %61
%63 = getelementptr inbounds double, double* %60, i64 2
%64 = bitcast double* %63 to <2 x double>*
%65 = load <2 x double>, <2 x double>* %64
%66 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %24, <2 x double> %56, <2 x double> %62)
%67 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %26, <2 x double> %59, <2 x double> %65)
%68 = bitcast double* %60 to <2 x double>*
store <2 x double> %66, <2 x double>* %68
%69 = bitcast double* %63 to <2 x double>*
store <2 x double> %67, <2 x double>* %69
%70 = add nuw i64 %35, 8
%71 = add i64 %36, 2
%72 = icmp eq i64 %71, %33
br i1 %72, label %73, label %34
73: ; preds = %34, %21
%74 = phi i64 [ 0, %21 ], [ %70, %34 ]
%75 = icmp eq i64 %30, 0
br i1 %75, label %93, label %76
76: ; preds = %73
%77 = getelementptr inbounds double, double* %0, i64 %74
%78 = bitcast double* %77 to <2 x double>*
%79 = load <2 x double>, <2 x double>* %78
%80 = getelementptr inbounds double, double* %77, i64 2
%81 = bitcast double* %80 to <2 x double>*
%82 = load <2 x double>, <2 x double>* %81
%83 = getelementptr inbounds double, double* %2, i64 %74
%84 = bitcast double* %83 to <2 x double>*
%85 = load <2 x double>, <2 x double>* %84
%86 = getelementptr inbounds double, double* %83, i64 2
%87 = bitcast double* %86 to <2 x double>*
%88 = load <2 x double>, <2 x double>* %87
%89 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %24, <2 x double> %79, <2 x double> %85)
%90 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %26, <2 x double> %82, <2 x double> %88)
%91 = bitcast double* %83 to <2 x double>*
store <2 x double> %89, <2 x double>* %91
%92 = bitcast double* %86 to <2 x double>*
store <2 x double> %90, <2 x double>* %92
br label %93
93: ; preds = %73, %76
%94 = icmp eq i64 %22, %19
br i1 %94, label %129, label %95
95: ; preds = %18, %93
%96 = phi i64 [ 0, %18 ], [ %22, %93 ]
br label %97
97: ; preds = %95, %97
%98 = phi i64 [ %104, %97 ], [ %96, %95 ]
%99 = getelementptr inbounds double, double* %0, i64 %98
%100 = load double, double* %99
%101 = getelementptr inbounds double, double* %2, i64 %98
%102 = load double, double* %101
%103 = tail call double @llvm.fmuladd.f64(double %15, double %100, double %102)
store double %103, double* %101
%104 = add nuw nsw i64 %98, 1
%105 = icmp eq i64 %104, %19
br i1 %105, label %129, label %97
106: ; preds = %14
%107 = tail call i32 @matprod_scalar_vec(double %15, double* %0, double* %2, i32 %3)
br label %129
108: ; preds = %11
br i1 %13, label %109, label %129
109: ; preds = %108
%110 = tail call i32 @set_to_zeros(double* %2, i32 %3)
br label %129
111: ; preds = %6
%112 = icmp slt i32 %3, 5
br i1 %112, label %113, label %127
113: ; preds = %111
switch i32 %3, label %129 [
i32 4, label %114
i32 3, label %116
i32 2, label %118
i32 1, label %120
]
114: ; preds = %113
%115 = tail call i32 @matprod_mat_vec_n4(double* %0, double* %1, double* %2, i32 %4, i32 %5)
br label %129
116: ; preds = %113
%117 = tail call i32 @matprod_mat_vec_n3(double* %0, double* %1, double* %2, i32 %4, i32 %5)
br label %129
118: ; preds = %113
%119 = tail call i32 @matprod_mat_vec_n2(double* %0, double* %1, double* %2, i32 %4, i32 %5)
br label %129
120: ; preds = %113
%121 = icmp eq i32 %5, 0
br i1 %121, label %124, label %122
122: ; preds = %120
%123 = load double, double* %2
br label %124
124: ; preds = %120, %122
%125 = phi double [ %123, %122 ], [ 0.000000e+00, %120 ]
%126 = tail call double @matprod_vec_vec_sub(double* %0, double* %1, i32 %4, double %125)
store double %126, double* %2
br label %129
127: ; preds = %111
%128 = tail call i32 @matprod_mat_vec_sub_xrows0(double* %0, double* %1, double* %2, i32 %3, i32 %4, i32 %3, i32 %5)
br label %129
129: ; preds = %97, %93, %16, %113, %114, %118, %124, %116, %106, %109, %108, %127
ret void
}