void crossxyi(double **beta, double **w, int m, int d, int p, double *bpw) {
  int j, k;
  double *betarow, wpj;
  for (k = 0; k < d; k++) {
    bpw[k] = 0.0;
  }
  for (j = 0; j < m; j++) {
    betarow = beta[j];
    wpj = w[p][j];
    for (k = 0; k < d; k++) {
      bpw[k] += betarow[k] * wpj;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<crossxyi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    114b <crossxyi+0x4b>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1121 <crossxyi+0x21>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11e8 <crossxyi+0xe8>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11d5 <crossxyi+0xd5>
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    118f <crossxyi+0x8f>
jmp    11da <crossxyi+0xda>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1152 <crossxyi+0x52>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crossxyi>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%rbx
mov    %r8d,%r13d
mov    %ecx,%ebp
mov    %edx,%r15d
mov    %rdi,%r14
mov    %ecx,%r12d
test   %ecx,%ecx
jle    114f <crossxyi+0x3f>
lea    0x0(,%r12,8),%rdx
mov    %rbx,%rdi
mov    %rsi,0x8(%rsp)
xor    %esi,%esi
call   1030 <memset@plt>
mov    0x8(%rsp),%rsi
test   %r15d,%r15d
jle    1321 <crossxyi+0x211>
movslq %r13d,%rax
mov    (%rsi,%rax,8),%r13
mov    %r15d,%ecx
lea    (%rbx,%r12,8),%r10
mov    %r12d,%r15d
and    $0xfffffffc,%r15d
lea    -0x4(%r15),%r11
mov    %r11,0x8(%rsp)
shr    $0x2,%r11
add    $0x1,%r11
mov    %r11,%rax
and    $0xfffffffffffffffe,%rax
mov    %rax,0x10(%rsp)
mov    %r12,%r8
neg    %r8
xor    %edi,%edi
jmp    11ad <crossxyi+0x9d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rdi
cmp    %rcx,%rdi
je     1321 <crossxyi+0x211>
test   %ebp,%ebp
jle    11a0 <crossxyi+0x90>
mov    (%r14,%rdi,8),%rsi
movsd  0x0(%r13,%rdi,8),%xmm0
cmp    $0x4,%ebp
jb     11cf <crossxyi+0xbf>
lea    (%rsi,%r12,8),%rax
cmp    %rbx,%rax
jbe    1237 <crossxyi+0x127>
cmp    %r10,%rsi
jae    1237 <crossxyi+0x127>
xor    %edx,%edx
mov    %rdx,%rax
test   $0x1,%r12b
je     11f4 <crossxyi+0xe4>
movsd  (%rsi,%rdx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx,%rdx,8),%xmm1
movsd  %xmm1,(%rbx,%rdx,8)
mov    %rdx,%rax
or     $0x1,%rax
not    %rdx
cmp    %r8,%rdx
je     11a0 <crossxyi+0x90>
nopl   0x0(%rax)
movsd  (%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx,%rax,8),%xmm1
movsd  %xmm1,(%rbx,%rax,8)
movsd  0x8(%rsi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rbx,%rax,8),%xmm1
movsd  %xmm1,0x8(%rbx,%rax,8)
add    $0x2,%rax
cmp    %rax,%r12
jne    1200 <crossxyi+0xf0>
jmp    11a0 <crossxyi+0x90>
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
cmpq   $0x0,0x8(%rsp)
je     1317 <crossxyi+0x207>
mov    0x10(%rsp),%r9
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd (%rsi,%rax,8),%xmm2
movupd 0x10(%rsi,%rax,8),%xmm3
mulpd  %xmm1,%xmm2
movupd (%rbx,%rax,8),%xmm4
addpd  %xmm2,%xmm4
movupd 0x10(%rbx,%rax,8),%xmm2
movupd 0x20(%rbx,%rax,8),%xmm5
movupd 0x30(%rbx,%rax,8),%xmm6
mulpd  %xmm1,%xmm3
addpd  %xmm2,%xmm3
movupd %xmm4,(%rbx,%rax,8)
movupd %xmm3,0x10(%rbx,%rax,8)
movupd 0x20(%rsi,%rax,8),%xmm2
movupd 0x30(%rsi,%rax,8),%xmm3
mulpd  %xmm1,%xmm2
addpd  %xmm5,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm6,%xmm3
movupd %xmm2,0x20(%rbx,%rax,8)
movupd %xmm3,0x30(%rbx,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%r9
jne    1260 <crossxyi+0x150>
test   $0x1,%r11b
je     1306 <crossxyi+0x1f6>
movupd (%rsi,%rax,8),%xmm2
movupd 0x10(%rsi,%rax,8),%xmm3
movupd (%rbx,%rax,8),%xmm4
movupd 0x10(%rbx,%rax,8),%xmm5
mulpd  %xmm1,%xmm2
addpd  %xmm4,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm5,%xmm3
movupd %xmm2,(%rbx,%rax,8)
movupd %xmm3,0x10(%rbx,%rax,8)
mov    %r15,%rdx
cmp    %r12,%r15
je     11a0 <crossxyi+0x90>
jmp    11d1 <crossxyi+0xc1>
xor    %eax,%eax
test   $0x1,%r11b
jne    12d5 <crossxyi+0x1c5>
jmp    1306 <crossxyi+0x1f6>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @crossxyi(double** %0, double** %1, i32 %2, i32 %3, i32 %4, double* %5) {
%7 = alloca double**
%8 = alloca double**
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca double*
%16 = alloca double
store double** %0, double*** %7
store double** %1, double*** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store double* %5, double** %12
store i32 0, i32* %14
br label %17
17: ; preds = %26, %6
%18 = load i32, i32* %14
%19 = load i32, i32* %10
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %29
21: ; preds = %17
%22 = load double*, double** %12
%23 = load i32, i32* %14
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %22, i64 %24
store double 0.000000e+00, double* %25
br label %26
26: ; preds = %21
%27 = load i32, i32* %14
%28 = add nsw i32 %27, 1
store i32 %28, i32* %14
br label %17
29: ; preds = %17
store i32 0, i32* %13
br label %30
30: ; preds = %70, %29
%31 = load i32, i32* %13
%32 = load i32, i32* %9
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %73
34: ; preds = %30
%35 = load double**, double*** %7
%36 = load i32, i32* %13
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double*, double** %35, i64 %37
%39 = load double*, double** %38
store double* %39, double** %15
%40 = load double**, double*** %8
%41 = load i32, i32* %11
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double*, double** %40, i64 %42
%44 = load double*, double** %43
%45 = load i32, i32* %13
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
%48 = load double, double* %47
store double %48, double* %16
store i32 0, i32* %14
br label %49
49: ; preds = %66, %34
%50 = load i32, i32* %14
%51 = load i32, i32* %10
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %69
53: ; preds = %49
%54 = load double*, double** %15
%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* %16
%60 = load double*, double** %12
%61 = load i32, i32* %14
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = call double @llvm.fmuladd.f64(double %58, double %59, double %64)
store double %65, double* %63
br label %66
66: ; preds = %53
%67 = load i32, i32* %14
%68 = add nsw i32 %67, 1
store i32 %68, i32* %14
br label %49
69: ; preds = %49
br label %70
70: ; preds = %69
%71 = load i32, i32* %13
%72 = add nsw i32 %71, 1
store i32 %72, i32* %13
br label %30
73: ; preds = %30
ret void
}

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