int update_null_reactions(double **s_locked, double *lock_v, int n_null,
                          int n_null_final, int n_locked, double **s_null) {
  double **dummy_s, **dummy_s2, *dummy_v;
  dummy_s2 = s_locked + n_locked;
  dummy_v = lock_v + n_locked;
  for (dummy_s = s_null + n_null; dummy_s < s_null + n_null_final; dummy_s++) {
    *dummy_s2 = *dummy_s;
    *dummy_v = 0.;
    dummy_s2++;
    dummy_v++;
  }
  return n_locked - n_null + n_null_final;
}


x86 assembly (clang, -O0):
<update_null_reactions>:
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)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x18(%rbp),%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    11b1 <update_null_reactions+0xb1>
mov    -0x30(%rbp),%rax
mov    (%rax),%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
jmp    1153 <update_null_reactions+0x53>
mov    -0x1c(%rbp),%eax
sub    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_null_reactions>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %ecx,%eax
sub    %edx,%eax
jle    12a1 <update_null_reactions+0x1a1>
movslq %r8d,%r15
movslq %ecx,%rcx
lea    (%r9,%rcx,8),%rcx
movslq %edx,%r12
lea    (%r9,%r12,8),%rdx
lea    (%rsi,%r15,8),%r10
lea    (%rdi,%r15,8),%r11
lea    0x0(,%r12,8),%r14
lea    (%r9,%r12,8),%rbp
add    $0x8,%rbp
cmp    %rcx,%rbp
mov    %rcx,%r13
cmova  %rbp,%r13
mov    %r9,%rbx
not    %rbx
add    %rbx,%r13
sub    %r14,%r13
cmp    $0x18,%r13
jb     1271 <update_null_reactions+0x171>
cmp    %rcx,%rbp
cmovbe %rcx,%rbp
add    %rbx,%rbp
sub    %r14,%rbp
shr    $0x3,%rbp
lea    (%r12,%rbp,1),%rbx
lea    (%r9,%rbx,8),%rbx
add    $0x8,%rbx
cmp    %rbx,%r11
jae    1193 <update_null_reactions+0x93>
add    %r15,%rbp
lea    (%rdi,%rbp,8),%rbx
add    $0x8,%rbx
cmp    %rbx,%rdx
jb     1271 <update_null_reactions+0x171>
shr    $0x3,%r13
add    $0x1,%r13
mov    %r13,%rbx
and    $0xfffffffffffffffc,%rbx
mov    %rbx,-0x10(%rsp)
add    $0xfffffffffffffffc,%rbx
mov    %rbx,%rbp
shr    $0x2,%rbp
add    $0x1,%rbp
test   %rbx,%rbx
mov    %rbp,-0x8(%rsp)
je     12af <update_null_reactions+0x1af>
and    $0xfffffffffffffffe,%rbp
lea    (%rsi,%r15,8),%r14
add    $0x30,%r14
lea    (%rdi,%r15,8),%rdi
add    $0x30,%rdi
lea    (%r9,%r12,8),%rbx
add    $0x30,%rbx
xor    %esi,%esi
xorps  %xmm0,%xmm0
mov    -0x10(%rsp),%r9
nopw   0x0(%rax,%rax,1)
movups -0x30(%rbx,%rsi,8),%xmm1
movups -0x20(%rbx,%rsi,8),%xmm2
movups %xmm1,-0x30(%rdi,%rsi,8)
movups %xmm2,-0x20(%rdi,%rsi,8)
movups %xmm0,-0x30(%r14,%rsi,8)
movups %xmm0,-0x20(%r14,%rsi,8)
movups -0x10(%rbx,%rsi,8),%xmm1
movups (%rbx,%rsi,8),%xmm2
movups %xmm1,-0x10(%rdi,%rsi,8)
movups %xmm2,(%rdi,%rsi,8)
movups %xmm0,-0x10(%r14,%rsi,8)
movups %xmm0,(%r14,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rbp
jne    11f0 <update_null_reactions+0xf0>
testb  $0x1,-0x8(%rsp)
je     1260 <update_null_reactions+0x160>
movups (%rdx,%rsi,8),%xmm0
movups 0x10(%rdx,%rsi,8),%xmm1
movups %xmm0,(%r11,%rsi,8)
movups %xmm1,0x10(%r11,%rsi,8)
xorps  %xmm0,%xmm0
movups %xmm0,(%r10,%rsi,8)
movups %xmm0,0x10(%r10,%rsi,8)
cmp    %r9,%r13
je     12a1 <update_null_reactions+0x1a1>
lea    (%r10,%r9,8),%r10
lea    (%r11,%r9,8),%r11
lea    (%rdx,%r9,8),%rdx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rdx,%rsi,1),%rdi
mov    %rdi,(%r11,%rsi,1)
movq   $0x0,(%r10,%rsi,1)
lea    (%rdx,%rsi,1),%rdi
add    $0x8,%rdi
add    $0x8,%rsi
cmp    %rcx,%rdi
jb     1280 <update_null_reactions+0x180>
add    %r8d,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %esi,%esi
mov    -0x10(%rsp),%r9
testb  $0x1,-0x8(%rsp)
jne    123e <update_null_reactions+0x13e>
jmp    1260 <update_null_reactions+0x160>

LLVM IR (-O0):
define i32 @update_null_reactions(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 double**
%14 = alloca double**
%15 = 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
%16 = load double**, double*** %7
%17 = load i32, i32* %11
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double*, double** %16, i64 %18
store double** %19, double*** %14
%20 = load double*, double** %8
%21 = load i32, i32* %11
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
store double* %23, double** %15
%24 = load double**, double*** %12
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double*, double** %24, i64 %26
store double** %27, double*** %13
br label %28
28: ; preds = %44, %6
%29 = load double**, double*** %13
%30 = load double**, double*** %12
%31 = load i32, i32* %10
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double*, double** %30, i64 %32
%34 = icmp ult double** %29, %33
br i1 %34, label %35, label %47
35: ; preds = %28
%36 = load double**, double*** %13
%37 = load double*, double** %36
%38 = load double**, double*** %14
store double* %37, double** %38
%39 = load double*, double** %15
store double 0.000000e+00, double* %39
%40 = load double**, double*** %14
%41 = getelementptr inbounds double*, double** %40, i32 1
store double** %41, double*** %14
%42 = load double*, double** %15
%43 = getelementptr inbounds double, double* %42, i32 1
store double* %43, double** %15
br label %44
44: ; preds = %35
%45 = load double**, double*** %13
%46 = getelementptr inbounds double*, double** %45, i32 1
store double** %46, double*** %13
br label %28
47: ; preds = %28
%48 = load i32, i32* %11
%49 = load i32, i32* %9
%50 = sub nsw i32 %48, %49
%51 = load i32, i32* %10
%52 = add nsw i32 %50, %51
ret i32 %52
}

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