void crossxyj(double **x, double **y, int n, int k, int p, double *xpy) {
  int i, j;
  double *xrow, yip;
  for (j = 0; j < k; j++) {
    xpy[j] = 0.0;
  }
  for (i = 0; i < n; i++) {
    xrow = x[i];
    yip = y[i][p];
    for (j = 0; j < k; j++) {
      xpy[j] += xrow[j] * yip;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<crossxyj>:
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 <crossxyj+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 <crossxyj+0x21>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11e8 <crossxyj+0xe8>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%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 <crossxyj+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 <crossxyj+0x8f>
jmp    11da <crossxyj+0xda>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1152 <crossxyj+0x52>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crossxyj>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%rbx
mov    %ecx,%ebp
mov    %edx,%r13d
mov    %rsi,%r14
mov    %rdi,%r15
mov    %ecx,%r12d
test   %ecx,%ecx
jle    114f <crossxyj+0x3f>
lea    0x0(,%r12,8),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r8d,0x8(%rsp)
call   1030 <memset@plt>
mov    0x8(%rsp),%r8d
test   %r13d,%r13d
jle    1346 <crossxyj+0x236>
movslq %r8d,%r10
mov    %r13d,%ecx
lea    (%rbx,%r12,8),%rax
mov    %rax,0x8(%rsp)
mov    %r12d,%r13d
and    $0xfffffffc,%r13d
lea    -0x4(%r13),%rax
mov    %rax,0x20(%rsp)
mov    %rax,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
mov    %rdx,%rax
mov    %rdx,0x18(%rsp)
and    $0xfffffffffffffffe,%rdx
mov    %rdx,0x10(%rsp)
mov    %r12,%r11
neg    %r11
xor    %edi,%edi
jmp    11ad <crossxyj+0x9d>
nopl   (%rax)
add    $0x1,%rdi
cmp    %rcx,%rdi
je     1346 <crossxyj+0x236>
test   %ebp,%ebp
jle    11a0 <crossxyj+0x90>
mov    (%r15,%rdi,8),%rsi
mov    (%r14,%rdi,8),%rax
movsd  (%rax,%r10,8),%xmm0
cmp    $0x4,%ebp
jb     11d4 <crossxyj+0xc4>
lea    (%rsi,%r12,8),%rax
cmp    %rbx,%rax
jbe    1247 <crossxyj+0x137>
cmp    0x8(%rsp),%rsi
jae    1247 <crossxyj+0x137>
xor    %edx,%edx
mov    %rdx,%rax
test   $0x1,%r12b
je     11f9 <crossxyj+0xe9>
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    %r11,%rdx
je     11a0 <crossxyj+0x90>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
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    1210 <crossxyj+0x100>
jmp    11a0 <crossxyj+0x90>
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
cmpq   $0x0,0x20(%rsp)
je     133a <crossxyj+0x22a>
mov    0x10(%rsp),%r8
xor    %r9d,%r9d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd (%rsi,%r9,8),%xmm2
movupd 0x10(%rsi,%r9,8),%xmm3
mulpd  %xmm1,%xmm2
movupd (%rbx,%r9,8),%xmm4
addpd  %xmm2,%xmm4
movupd 0x10(%rbx,%r9,8),%xmm2
movupd 0x20(%rbx,%r9,8),%xmm5
movupd 0x30(%rbx,%r9,8),%xmm6
mulpd  %xmm1,%xmm3
addpd  %xmm2,%xmm3
movupd %xmm4,(%rbx,%r9,8)
movupd %xmm3,0x10(%rbx,%r9,8)
movupd 0x20(%rsi,%r9,8),%xmm2
movupd 0x30(%rsi,%r9,8),%xmm3
mulpd  %xmm1,%xmm2
addpd  %xmm5,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm6,%xmm3
movupd %xmm2,0x20(%rbx,%r9,8)
movupd %xmm3,0x30(%rbx,%r9,8)
add    $0x8,%r9
add    $0xfffffffffffffffe,%r8
jne    1270 <crossxyj+0x160>
testb  $0x1,0x18(%rsp)
je     1329 <crossxyj+0x219>
movupd (%rsi,%r9,8),%xmm2
movupd 0x10(%rsi,%r9,8),%xmm3
movupd (%rbx,%r9,8),%xmm4
movupd 0x10(%rbx,%r9,8),%xmm5
mulpd  %xmm1,%xmm2
addpd  %xmm4,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm5,%xmm3
movupd %xmm2,(%rbx,%r9,8)
movupd %xmm3,0x10(%rbx,%r9,8)
mov    %r13,%rdx
cmp    %r12,%r13
je     11a0 <crossxyj+0x90>
jmp    11d6 <crossxyj+0xc6>
xor    %r9d,%r9d
testb  $0x1,0x18(%rsp)
jne    12f2 <crossxyj+0x1e2>
jmp    1329 <crossxyj+0x219>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @crossxyj(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* %13
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double*, double** %40, i64 %42
%44 = load double*, double** %43
%45 = load i32, i32* %11
%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 @crossxyj(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 = zext i32 %2 to i64
%17 = zext i32 %3 to i64
%18 = getelementptr double, double* %5, i64 %17
%19 = and i64 %17, 4294967292
%20 = add nsw i64 %19, -4
%21 = lshr exact i64 %20, 2
%22 = add nuw nsw i64 %21, 1
%23 = icmp ult i32 %3, 4
%24 = and i64 %17, 4294967292
%25 = and i64 %22, 1
%26 = icmp eq i64 %20, 0
%27 = and i64 %22, 9223372036854775806
%28 = icmp eq i64 %25, 0
%29 = icmp eq i64 %24, %17
%30 = and i64 %17, 1
%31 = icmp eq i64 %30, 0
%32 = sub nsw i64 0, %17
br label %33
33: ; preds = %14, %139
%34 = phi i64 [ 0, %14 ], [ %140, %139 ]
%35 = getelementptr inbounds double*, double** %0, i64 %34
%36 = load double*, double** %35
%37 = getelementptr inbounds double*, double** %1, i64 %34
%38 = load double*, double** %37
%39 = getelementptr inbounds double, double* %38, i64 %15
%40 = load double, double* %39
br i1 %7, label %41, label %139
41: ; preds = %33
br i1 %23, label %111, label %42
42: ; preds = %41
%43 = getelementptr double, double* %36, i64 %17
%44 = icmp ugt double* %43, %5
%45 = icmp ult double* %36, %18
%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 %26, 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* %36, 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* %36, 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, %27
br i1 %90, label %91, label %52
91: ; preds = %52, %47
%92 = phi i64 [ 0, %47 ], [ %88, %52 ]
br i1 %28, label %110, label %93
93: ; preds = %91
%94 = getelementptr inbounds double, double* %36, 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 %29, label %139, label %111
111: ; preds = %42, %41, %110
%112 = phi i64 [ 0, %42 ], [ 0, %41 ], [ %24, %110 ]
%113 = xor i64 %112, -1
br i1 %31, label %121, label %114
114: ; preds = %111
%115 = getelementptr inbounds double, double* %36, 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, %32
br i1 %123, label %139, label %124
124: ; preds = %121, %124
%125 = phi i64 [ %137, %124 ], [ %122, %121 ]
%126 = getelementptr inbounds double, double* %36, 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* %36, 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, %17
br i1 %138, label %139, label %124
139: ; preds = %121, %124, %110, %33
%140 = add nuw nsw i64 %34, 1
%141 = icmp eq i64 %140, %16
br i1 %141, label %142, label %33
142: ; preds = %139, %12
ret void
}