void computeATvAndAddAtIdx_CFP64_INT64(long long *rowptr, double _Complex *valA,
                                       long long *colA,
                                       double _Complex *local_v,
                                       double _Complex *x, long long *Idxs,
                                       long long blockSize) {
  long long i, tt;
  for (i = 0; i < blockSize; ++i) {
    for (tt = rowptr[Idxs[i] - 1]; tt <= rowptr[Idxs[i]] - 1; ++tt) {
      x[colA[tt - 1] - 1] += valA[tt - 1] * local_v[i];
    }
  }
}


x86 assembly (clang, -O0):
<computeATvAndAddAtIdx_CFP64_INT64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    0x10(%rbp),%rax
jge    12ad <computeATvAndAddAtIdx_CFP64_INT64+0x1ad>
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rsi
mov    (%rdx,%rsi,8),%rdx
mov    (%rcx,%rdx,8),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jg     1297 <computeATvAndAddAtIdx_CFP64_INT64+0x197>
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    $0x1,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm1
movsd  %xmm1,-0x80(%rbp)
movsd  0x8(%rax),%xmm2
movsd  %xmm2,-0x78(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm4
movsd  %xmm4,-0x70(%rbp)
movsd  0x8(%rax),%xmm5
movsd  %xmm5,-0x68(%rbp)
movaps %xmm1,%xmm0
mulsd  %xmm4,%xmm0
movaps %xmm2,%xmm3
mulsd  %xmm5,%xmm3
mulsd  %xmm5,%xmm1
mulsd  %xmm4,%xmm2
subsd  %xmm3,%xmm0
movsd  %xmm0,-0x60(%rbp)
addsd  %xmm2,%xmm1
movsd  %xmm1,-0x58(%rbp)
ucomisd %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  %xmm1,-0x48(%rbp)
jnp    1243 <computeATvAndAddAtIdx_CFP64_INT64+0x143>
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
ucomisd %xmm1,%xmm1
movsd  %xmm0,-0x50(%rbp)
movsd  %xmm1,-0x48(%rbp)
jnp    1243 <computeATvAndAddAtIdx_CFP64_INT64+0x143>
movsd  -0x68(%rbp),%xmm3
movsd  -0x70(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
call   12c0 <__muldc3>
movsd  %xmm0,-0x50(%rbp)
movsd  %xmm1,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm3
movsd  -0x48(%rbp),%xmm2
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    -0x40(%rbp),%rdx
sub    $0x1,%rdx
mov    (%rcx,%rdx,8),%rcx
sub    $0x1,%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm1
movsd  0x8(%rax),%xmm0
addsd  %xmm3,%xmm1
addsd  %xmm2,%xmm0
movsd  %xmm1,(%rax)
movsd  %xmm0,0x8(%rax)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1159 <computeATvAndAddAtIdx_CFP64_INT64+0x59>
jmp    129c <computeATvAndAddAtIdx_CFP64_INT64+0x19c>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    112f <computeATvAndAddAtIdx_CFP64_INT64+0x2f>
add    $0x80,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<computeATvAndAddAtIdx_CFP64_INT64>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%rbx
mov    0x60(%rsp),%r8
test   %r8,%r8
jle    1244 <computeATvAndAddAtIdx_CFP64_INT64+0x144>
add    $0xfffffffffffffff0,%rsi
xor    %r13d,%r13d
jmp    113d <computeATvAndAddAtIdx_CFP64_INT64+0x3d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13
cmp    %r8,%r13
je     1244 <computeATvAndAddAtIdx_CFP64_INT64+0x144>
mov    (%r9,%r13,8),%rax
mov    -0x8(%rdi,%rax,8),%r15
cmp    (%rdi,%rax,8),%r15
jge    1130 <computeATvAndAddAtIdx_CFP64_INT64+0x30>
mov    %r13,%rax
shl    $0x4,%rax
lea    (%rcx,%rax,1),%r12
lea    (%rcx,%rax,1),%r14
add    $0x8,%r14
mov    %r15,%rbp
shl    $0x4,%rbp
add    %rsi,%rbp
nopl   0x0(%rax)
movupd 0x0(%rbp),%xmm0
movsd  (%r12),%xmm2
movsd  (%r14),%xmm3
movapd %xmm3,%xmm1
unpcklpd %xmm3,%xmm1
movapd %xmm0,%xmm4
shufpd $0x1,%xmm0,%xmm4
mulpd  %xmm1,%xmm4
movapd %xmm2,%xmm1
unpcklpd %xmm2,%xmm1
mulpd  %xmm0,%xmm1
movapd %xmm1,%xmm5
subpd  %xmm4,%xmm5
addpd  %xmm4,%xmm1
movapd %xmm1,%xmm4
movsd  %xmm5,%xmm4
ucomisd %xmm5,%xmm5
jp     11eb <computeATvAndAddAtIdx_CFP64_INT64+0xeb>
mov    -0x8(%rdx,%r15,8),%rax
shl    $0x4,%rax
movupd -0x10(%rax,%rbx,1),%xmm0
addpd  %xmm4,%xmm0
movupd %xmm0,-0x10(%rax,%rbx,1)
add    $0x1,%r15
mov    (%r9,%r13,8),%rax
add    $0x10,%rbp
cmp    (%rdi,%rax,8),%r15
jl     1170 <computeATvAndAddAtIdx_CFP64_INT64+0x70>
jmp    1130 <computeATvAndAddAtIdx_CFP64_INT64+0x30>
unpckhpd %xmm1,%xmm1
ucomisd %xmm1,%xmm1
jnp    11bb <computeATvAndAddAtIdx_CFP64_INT64+0xbb>
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
mov    %r9,0x20(%rsp)
mov    %rcx,0x18(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdi,(%rsp)
call   1260 <__muldc3>
mov    0x60(%rsp),%r8
mov    (%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    0x10(%rsp),%rdx
mov    0x18(%rsp),%rcx
mov    0x20(%rsp),%r9
movapd %xmm0,%xmm4
unpcklpd %xmm1,%xmm4
jmp    11bb <computeATvAndAddAtIdx_CFP64_INT64+0xbb>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)

LLVM IR (-O0):
define void @computeATvAndAddAtIdx_CFP64_INT64(i64* %0, { double, double }* %1, i64* %2, { double, double }* %3, { double, double }* %4, i64* %5, i64 %6) {
%8 = alloca i64*
%9 = alloca { double, double }*
%10 = alloca i64*
%11 = alloca { double, double }*
%12 = alloca { double, double }*
%13 = alloca i64*
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
store i64* %0, i64** %8
store { double, double }* %1, { double, double }** %9
store i64* %2, i64** %10
store { double, double }* %3, { double, double }** %11
store { double, double }* %4, { double, double }** %12
store i64* %5, i64** %13
store i64 %6, i64* %14
store i64 0, i64* %15
br label %17
17: ; preds = %93, %7
%18 = load i64, i64* %15
%19 = load i64, i64* %14
%20 = icmp slt i64 %18, %19
br i1 %20, label %21, label %96
21: ; preds = %17
%22 = load i64*, i64** %8
%23 = load i64*, i64** %13
%24 = load i64, i64* %15
%25 = getelementptr inbounds i64, i64* %23, i64 %24
%26 = load i64, i64* %25
%27 = sub nsw i64 %26, 1
%28 = getelementptr inbounds i64, i64* %22, i64 %27
%29 = load i64, i64* %28
store i64 %29, i64* %16
br label %30
30: ; preds = %89, %21
%31 = load i64, i64* %16
%32 = load i64*, i64** %8
%33 = load i64*, i64** %13
%34 = load i64, i64* %15
%35 = getelementptr inbounds i64, i64* %33, i64 %34
%36 = load i64, i64* %35
%37 = getelementptr inbounds i64, i64* %32, i64 %36
%38 = load i64, i64* %37
%39 = sub nsw i64 %38, 1
%40 = icmp sle i64 %31, %39
br i1 %40, label %41, label %92
41: ; preds = %30
%42 = load { double, double }*, { double, double }** %9
%43 = load i64, i64* %16
%44 = sub nsw i64 %43, 1
%45 = getelementptr inbounds { double, double }, { double, double }* %42, i64 %44
%46 = getelementptr inbounds { double, double }, { double, double }* %45, i32 0, i32 0
%47 = load double, double* %46
%48 = getelementptr inbounds { double, double }, { double, double }* %45, i32 0, i32 1
%49 = load double, double* %48
%50 = load { double, double }*, { double, double }** %11
%51 = load i64, i64* %15
%52 = getelementptr inbounds { double, double }, { double, double }* %50, i64 %51
%53 = getelementptr inbounds { double, double }, { double, double }* %52, i32 0, i32 0
%54 = load double, double* %53
%55 = getelementptr inbounds { double, double }, { double, double }* %52, i32 0, i32 1
%56 = load double, double* %55
%57 = fmul double %47, %54
%58 = fmul double %49, %56
%59 = fmul double %47, %56
%60 = fmul double %49, %54
%61 = fsub double %57, %58
%62 = fadd double %59, %60
%63 = fcmp uno double %61, %61
br i1 %63, label %64, label %70
64: ; preds = %41
%65 = fcmp uno double %62, %62
br i1 %65, label %66, label %70
66: ; preds = %64
%67 = call { double, double } @__muldc3(double %47, double %49, double %54, double %56)
%68 = extractvalue { double, double } %67, 0
%69 = extractvalue { double, double } %67, 1
br label %70
70: ; preds = %66, %64, %41
%71 = phi double [ %61, %41 ], [ %61, %64 ], [ %68, %66 ]
%72 = phi double [ %62, %41 ], [ %62, %64 ], [ %69, %66 ]
%73 = load { double, double }*, { double, double }** %12
%74 = load i64*, i64** %10
%75 = load i64, i64* %16
%76 = sub nsw i64 %75, 1
%77 = getelementptr inbounds i64, i64* %74, i64 %76
%78 = load i64, i64* %77
%79 = sub nsw i64 %78, 1
%80 = getelementptr inbounds { double, double }, { double, double }* %73, i64 %79
%81 = getelementptr inbounds { double, double }, { double, double }* %80, i32 0, i32 0
%82 = load double, double* %81
%83 = getelementptr inbounds { double, double }, { double, double }* %80, i32 0, i32 1
%84 = load double, double* %83
%85 = fadd double %82, %71
%86 = fadd double %84, %72
%87 = getelementptr inbounds { double, double }, { double, double }* %80, i32 0, i32 0
%88 = getelementptr inbounds { double, double }, { double, double }* %80, i32 0, i32 1
store double %85, double* %87
store double %86, double* %88
br label %89
89: ; preds = %70
%90 = load i64, i64* %16
%91 = add nsw i64 %90, 1
store i64 %91, i64* %16
br label %30
92: ; preds = %30
br label %93
93: ; preds = %92
%94 = load i64, i64* %15
%95 = add nsw i64 %94, 1
store i64 %95, i64* %15
br label %17
96: ; preds = %17
ret void
}

LLVM IR (-O2):
define void @computeATvAndAddAtIdx_CFP64_INT64(i64* nocapture %0, { double, double }* nocapture %1, i64* nocapture %2, { double, double }* nocapture %3, { double, double }* nocapture %4, i64* nocapture %5, i64 %6) {
%8 = icmp sgt i64 %6, 0
br i1 %8, label %9, label %71
9: ; preds = %7, %68
%10 = phi i64 [ %69, %68 ], [ 0, %7 ]
%11 = getelementptr inbounds i64, i64* %5, i64 %10
%12 = load i64, i64* %11
%13 = add nsw i64 %12, -1
%14 = getelementptr inbounds i64, i64* %0, i64 %13
%15 = load i64, i64* %14
%16 = getelementptr inbounds i64, i64* %0, i64 %12
%17 = load i64, i64* %16
%18 = icmp slt i64 %15, %17
br i1 %18, label %19, label %68
19: ; preds = %9
%20 = getelementptr inbounds { double, double }, { double, double }* %3, i64 %10, i32 0
%21 = getelementptr inbounds { double, double }, { double, double }* %3, i64 %10, i32 1
br label %22
22: ; preds = %19, %53
%23 = phi i64 [ %15, %19 ], [ %63, %53 ]
%24 = add nsw i64 %23, -1
%25 = getelementptr inbounds { double, double }, { double, double }* %1, i64 %24, i32 0
%26 = bitcast double* %25 to <2 x double>*
%27 = load <2 x double>, <2 x double>* %26
%28 = load double, double* %20
%29 = load double, double* %21
%30 = insertelement <2 x double> poison, double %29, i64 0
%31 = shufflevector <2 x double> %30, <2 x double> poison, <2 x i32> zeroinitializer
%32 = fmul <2 x double> %27, %31
%33 = shufflevector <2 x double> %32, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%34 = insertelement <2 x double> poison, double %28, i64 0
%35 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> zeroinitializer
%36 = fmul <2 x double> %27, %35
%37 = fsub <2 x double> %36, %33
%38 = fadd <2 x double> %36, %33
%39 = shufflevector <2 x double> %37, <2 x double> %38, <2 x i32> <i32 0, i32 3>
%40 = extractelement <2 x double> %37, i64 0
%41 = fcmp uno double %40, 0.000000e+00
br i1 %41, label %42, label %53
42: ; preds = %22
%43 = extractelement <2 x double> %38, i64 1
%44 = fcmp uno double %43, 0.000000e+00
br i1 %44, label %45, label %53
45: ; preds = %42
%46 = extractelement <2 x double> %27, i64 0
%47 = extractelement <2 x double> %27, i64 1
%48 = tail call { double, double } @__muldc3(double %46, double %47, double %28, double %29)
%49 = extractvalue { double, double } %48, 0
%50 = extractvalue { double, double } %48, 1
%51 = insertelement <2 x double> poison, double %49, i64 0
%52 = insertelement <2 x double> %51, double %50, i64 1
br label %53
53: ; preds = %45, %42, %22
%54 = phi <2 x double> [ %39, %22 ], [ %39, %42 ], [ %52, %45 ]
%55 = getelementptr inbounds i64, i64* %2, i64 %24
%56 = load i64, i64* %55
%57 = add nsw i64 %56, -1
%58 = getelementptr inbounds { double, double }, { double, double }* %4, i64 %57, i32 0
%59 = bitcast double* %58 to <2 x double>*
%60 = load <2 x double>, <2 x double>* %59
%61 = fadd <2 x double> %54, %60
%62 = bitcast double* %58 to <2 x double>*
store <2 x double> %61, <2 x double>* %62
%63 = add nsw i64 %23, 1
%64 = load i64, i64* %11
%65 = getelementptr inbounds i64, i64* %0, i64 %64
%66 = load i64, i64* %65
%67 = icmp slt i64 %63, %66
br i1 %67, label %22, label %68
68: ; preds = %53, %9
%69 = add nuw nsw i64 %10, 1
%70 = icmp eq i64 %69, %6
br i1 %70, label %71, label %9
71: ; preds = %68, %7
ret void
}