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


x86 assembly (clang, -O0):
<crossxyjusevoter>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
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    114f <crossxyjusevoter+0x4f>
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    1125 <crossxyjusevoter+0x25>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1203 <crossxyjusevoter+0x103>
mov    0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    11f0 <crossxyjusevoter+0xf0>
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    11eb <crossxyjusevoter+0xeb>
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    11a5 <crossxyjusevoter+0xa5>
jmp    11f0 <crossxyjusevoter+0xf0>
jmp    11f5 <crossxyjusevoter+0xf5>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1156 <crossxyjusevoter+0x56>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crossxyjusevoter>:
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    1159 <crossxyjusevoter+0x49>
lea    0x0(,%r12,8),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15,(%rsp)
mov    %r14,%r15
mov    %r8d,%r14d
call   1030 <memset@plt>
mov    %r14d,%r8d
mov    %r15,%r14
mov    (%rsp),%r15
test   %r13d,%r13d
jle    135b <crossxyjusevoter+0x24b>
mov    0x60(%rsp),%rax
movslq %r8d,%r11
mov    %r13d,%edx
lea    (%rbx,%r12,8),%rcx
mov    %rcx,(%rsp)
mov    %r12d,%ecx
and    $0xfffffffc,%ecx
mov    %rcx,0x20(%rsp)
add    $0xfffffffffffffffc,%rcx
mov    %rcx,0x18(%rsp)
mov    %rcx,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %rsi,%rcx
mov    %rsi,0x10(%rsp)
and    $0xfffffffffffffffe,%rsi
mov    %rsi,0x8(%rsp)
mov    %r12,%r13
neg    %r13
xor    %edi,%edi
jmp    11bd <crossxyjusevoter+0xad>
nop
add    $0x1,%rdi
cmp    %rdx,%rdi
je     135b <crossxyjusevoter+0x24b>
cmpl   $0x0,(%rax,%rdi,4)
jle    11b0 <crossxyjusevoter+0xa0>
test   %ebp,%ebp
jle    11b0 <crossxyjusevoter+0xa0>
mov    (%r15,%rdi,8),%r10
mov    (%r14,%rdi,8),%rcx
movsd  (%rcx,%r11,8),%xmm0
cmp    $0x4,%ebp
jb     11e9 <crossxyjusevoter+0xd9>
lea    (%r10,%r12,8),%rcx
cmp    %rbx,%rcx
jbe    1259 <crossxyjusevoter+0x149>
cmp    (%rsp),%r10
jae    1259 <crossxyjusevoter+0x149>
xor    %esi,%esi
mov    %rsi,%rcx
test   $0x1,%r12b
je     120f <crossxyjusevoter+0xff>
movsd  (%r10,%rsi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx,%rsi,8),%xmm1
movsd  %xmm1,(%rbx,%rsi,8)
mov    %rsi,%rcx
or     $0x1,%rcx
not    %rsi
cmp    %r13,%rsi
je     11b0 <crossxyjusevoter+0xa0>
nopw   0x0(%rax,%rax,1)
movsd  (%r10,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx,%rcx,8),%xmm1
movsd  %xmm1,(%rbx,%rcx,8)
movsd  0x8(%r10,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rbx,%rcx,8),%xmm1
movsd  %xmm1,0x8(%rbx,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%r12
jne    1220 <crossxyjusevoter+0x110>
jmp    11b0 <crossxyjusevoter+0xa0>
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
cmpq   $0x0,0x18(%rsp)
je     134f <crossxyjusevoter+0x23f>
mov    0x8(%rsp),%r9
xor    %r8d,%r8d
cs nopw 0x0(%rax,%rax,1)
nop
movupd (%r10,%r8,8),%xmm2
movupd 0x10(%r10,%r8,8),%xmm3
mulpd  %xmm1,%xmm2
movupd (%rbx,%r8,8),%xmm4
addpd  %xmm2,%xmm4
movupd 0x10(%rbx,%r8,8),%xmm2
movupd 0x20(%rbx,%r8,8),%xmm5
movupd 0x30(%rbx,%r8,8),%xmm6
mulpd  %xmm1,%xmm3
addpd  %xmm2,%xmm3
movupd %xmm4,(%rbx,%r8,8)
movupd %xmm3,0x10(%rbx,%r8,8)
movupd 0x20(%r10,%r8,8),%xmm2
movupd 0x30(%r10,%r8,8),%xmm3
mulpd  %xmm1,%xmm2
addpd  %xmm5,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm6,%xmm3
movupd %xmm2,0x20(%rbx,%r8,8)
movupd %xmm3,0x30(%rbx,%r8,8)
add    $0x8,%r8
add    $0xfffffffffffffffe,%r9
jne    1280 <crossxyjusevoter+0x170>
testb  $0x1,0x10(%rsp)
je     1339 <crossxyjusevoter+0x229>
movupd (%r10,%r8,8),%xmm2
movupd 0x10(%r10,%r8,8),%xmm3
movupd (%rbx,%r8,8),%xmm4
movupd 0x10(%rbx,%r8,8),%xmm5
mulpd  %xmm1,%xmm2
addpd  %xmm4,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm5,%xmm3
movupd %xmm2,(%rbx,%r8,8)
movupd %xmm3,0x10(%rbx,%r8,8)
mov    0x20(%rsp),%rcx
mov    %rcx,%rsi
cmp    %r12,%rcx
je     11b0 <crossxyjusevoter+0xa0>
jmp    11eb <crossxyjusevoter+0xdb>
xor    %r8d,%r8d
testb  $0x1,0x10(%rsp)
jne    1302 <crossxyjusevoter+0x1f2>
jmp    1339 <crossxyjusevoter+0x229>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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