void jacmodros(double *p, double *jac, int m, int n, void *data) {
  register int i, j;
  for (i = j = 0; i < n; i += 3) {
    jac[j++] = -20.0 * p[0];
    jac[j++] = 10.0;
    jac[j++] = -1.0;
    jac[j++] = 0.0;
    jac[j++] = 0.0;
    jac[j++] = 0.0;
  }
}


x86 assembly (clang, -O0):
<jacmodros>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11f1 <jacmodros+0xf1>
mov    -0x8(%rbp),%rax
movsd  0xed4(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
movslq %ecx,%rcx
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
movslq %ecx,%rcx
movsd  0xe70(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x24(%rbp)
jmp    1124 <jacmodros+0x24>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jacmodros>:
test   %ecx,%ecx
jle    1194 <jacmodros+0x94>
lea    -0x1(%rcx),%r10d
cmp    $0x3,%r10d
jb     113f <jacmodros+0x3f>
mov    $0xaaaaaaab,%eax
lea    0x8(%rdi),%rdx
cmp    %rsi,%rdx
jbe    1195 <jacmodros+0x95>
mov    %r10,%rdx
imul   %rax,%rdx
shr    $0x21,%rdx
lea    (%rdx,%rdx,2),%rdx
shl    $0x4,%rdx
add    %rsi,%rdx
add    $0x30,%rdx
cmp    %rdi,%rdx
jbe    1195 <jacmodros+0x95>
xor    %edx,%edx
xor    %eax,%eax
lea    (%rsi,%rdx,8),%rdx
add    $0x20,%rdx
movsd  0xead(%rip),%xmm0
movabs $0x4024000000000000,%rsi
movsd  0xea3(%rip),%xmm1
xorps  %xmm2,%xmm2
nopl   0x0(%rax,%rax,1)
movsd  (%rdi),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,-0x20(%rdx)
mov    %rsi,-0x18(%rdx)
movupd %xmm1,-0x10(%rdx)
movups %xmm2,(%rdx)
add    $0x3,%eax
add    $0x30,%rdx
cmp    %ecx,%eax
jl     1170 <jacmodros+0x70>
ret
imul   %rax,%r10
shr    $0x21,%r10
add    $0x1,%r10d
mov    %r10d,%r8d
and    $0x7ffffffe,%r8d
lea    -0x2(%r8),%rax
mov    %rax,%r9
shr    %r9
add    $0x1,%r9
test   %rax,%rax
je     12c7 <jacmodros+0x1c7>
mov    %r9,%rax
and    $0xfffffffffffffffe,%rax
xor    %edx,%edx
movsd  0xe2d(%rip),%xmm0
movapd 0xe35(%rip),%xmm1
xorps  %xmm2,%xmm2
movsd  0xe22(%rip),%xmm3
cs nopw 0x0(%rax,%rax,1)
movsd  (%rdi),%xmm4
mulsd  %xmm0,%xmm4
shufpd $0x2,%xmm1,%xmm4
movups %xmm2,0x50(%rsi,%rdx,8)
movupd %xmm3,0x40(%rsi,%rdx,8)
movups %xmm2,0x20(%rsi,%rdx,8)
movupd %xmm3,0x10(%rsi,%rdx,8)
movupd %xmm4,0x30(%rsi,%rdx,8)
movupd %xmm4,(%rsi,%rdx,8)
movsd  (%rdi),%xmm4
mulsd  %xmm0,%xmm4
shufpd $0x2,%xmm1,%xmm4
movups %xmm2,0xb0(%rsi,%rdx,8)
movupd %xmm3,0xa0(%rsi,%rdx,8)
movups %xmm2,0x80(%rsi,%rdx,8)
movupd %xmm3,0x70(%rsi,%rdx,8)
movupd %xmm4,0x90(%rsi,%rdx,8)
movupd %xmm4,0x60(%rsi,%rdx,8)
add    $0x18,%rdx
add    $0xfffffffffffffffe,%rax
jne    11f0 <jacmodros+0xf0>
test   $0x1,%r9b
je     12ab <jacmodros+0x1ab>
movsd  (%rdi),%xmm0
mulsd  0xd8b(%rip),%xmm0
shufpd $0x2,0xd92(%rip),%xmm0
xorpd  %xmm1,%xmm1
movsd  0xd7e(%rip),%xmm2
movupd %xmm1,0x50(%rsi,%rdx,8)
movups %xmm2,0x40(%rsi,%rdx,8)
movupd %xmm1,0x20(%rsi,%rdx,8)
movups %xmm2,0x10(%rsi,%rdx,8)
movupd %xmm0,0x30(%rsi,%rdx,8)
movupd %xmm0,(%rsi,%rdx,8)
cmp    %r10,%r8
je     1194 <jacmodros+0x94>
mov    %r8,%rax
add    %r8,%rax
lea    (%rax,%rax,2),%rdx
lea    (%r8,%r8,2),%eax
jmp    1143 <jacmodros+0x43>
xor    %edx,%edx
test   $0x1,%r9b
jne    1269 <jacmodros+0x169>
jmp    12ab <jacmodros+0x1ab>

LLVM IR (-O0):
define void @jacmodros(double* %0, double* %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
store i32 0, i32* %12
store i32 0, i32* %11
br label %13
13: ; preds = %52, %5
%14 = load i32, i32* %11
%15 = load i32, i32* %9
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %55
17: ; preds = %13
%18 = load double*, double** %6
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = fmul double -2.000000e+01, %20
%22 = load double*, double** %7
%23 = load i32, i32* %12
%24 = add nsw i32 %23, 1
store i32 %24, i32* %12
%25 = sext i32 %23 to i64
%26 = getelementptr inbounds double, double* %22, i64 %25
store double %21, double* %26
%27 = load double*, double** %7
%28 = load i32, i32* %12
%29 = add nsw i32 %28, 1
store i32 %29, i32* %12
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds double, double* %27, i64 %30
store double 1.000000e+01, double* %31
%32 = load double*, double** %7
%33 = load i32, i32* %12
%34 = add nsw i32 %33, 1
store i32 %34, i32* %12
%35 = sext i32 %33 to i64
%36 = getelementptr inbounds double, double* %32, i64 %35
store double -1.000000e+00, double* %36
%37 = load double*, double** %7
%38 = load i32, i32* %12
%39 = add nsw i32 %38, 1
store i32 %39, i32* %12
%40 = sext i32 %38 to i64
%41 = getelementptr inbounds double, double* %37, i64 %40
store double 0.000000e+00, double* %41
%42 = load double*, double** %7
%43 = load i32, i32* %12
%44 = add nsw i32 %43, 1
store i32 %44, i32* %12
%45 = sext i32 %43 to i64
%46 = getelementptr inbounds double, double* %42, i64 %45
store double 0.000000e+00, double* %46
%47 = load double*, double** %7
%48 = load i32, i32* %12
%49 = add nsw i32 %48, 1
store i32 %49, i32* %12
%50 = sext i32 %48 to i64
%51 = getelementptr inbounds double, double* %47, i64 %50
store double 0.000000e+00, double* %51
br label %52
52: ; preds = %17
%53 = load i32, i32* %11
%54 = add nsw i32 %53, 3
store i32 %54, i32* %11
br label %13
55: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @jacmodros(double* nocapture %0, double* nocapture writeonly %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %100
7: ; preds = %5
%8 = add i32 %3, -1
%9 = udiv i32 %8, 3
%10 = add nuw nsw i32 %9, 1
%11 = zext i32 %10 to i64
%12 = icmp ult i32 %8, 3
br i1 %12, label %80, label %13
13: ; preds = %7
%14 = add i32 %3, -1
%15 = udiv i32 %14, 3
%16 = zext i32 %15 to i64
%17 = mul nuw nsw i64 %16, 6
%18 = add nuw nsw i64 %17, 6
%19 = getelementptr double, double* %1, i64 %18
%20 = getelementptr double, double* %0, i64 1
%21 = icmp ugt double* %20, %1
%22 = icmp ugt double* %19, %0
%23 = and i1 %21, %22
br i1 %23, label %80, label %24
24: ; preds = %13
%25 = and i64 %11, 2147483646
%26 = mul nuw nsw i64 %25, 6
%27 = trunc i64 %25 to i32
%28 = mul i32 %27, 3
%29 = add nsw i64 %25, -2
%30 = lshr exact i64 %29, 1
%31 = add nuw i64 %30, 1
%32 = and i64 %31, 1
%33 = icmp eq i64 %29, 0
br i1 %33, label %65, label %34
34: ; preds = %24
%35 = and i64 %31, -2
br label %36
36: ; preds = %36, %34
%37 = phi i64 [ 0, %34 ], [ %60, %36 ]
%38 = phi i64 [ 0, %34 ], [ %61, %36 ]
%39 = mul i64 %37, 6
%40 = load double, double* %0
%41 = insertelement <2 x double> poison, double %40, i64 0
%42 = fmul <2 x double> %41, <double -2.000000e+01, double poison>
%43 = shufflevector <2 x double> %42, <2 x double> poison, <2 x i32> zeroinitializer
%44 = getelementptr inbounds double, double* %1, i64 %39
%45 = bitcast double* %44 to <12 x double>*
%46 = shufflevector <2 x double> %43, <2 x double> <double 1.000000e+01, double 1.000000e+01>, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%47 = shufflevector <4 x double> %46, <4 x double> <double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double 0.000000e+00>, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%48 = shufflevector <8 x double> %47, <8 x double> <double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double poison, double poison, double poison, double poison>, <12 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 1, i32 3, i32 5, i32 7, i32 9, i32 11>
store <12 x double> %48, <12 x double>* %45
%49 = or i64 %37, 2
%50 = mul i64 %49, 6
%51 = load double, double* %0
%52 = insertelement <2 x double> poison, double %51, i64 0
%53 = fmul <2 x double> %52, <double -2.000000e+01, double poison>
%54 = shufflevector <2 x double> %53, <2 x double> poison, <2 x i32> zeroinitializer
%55 = getelementptr inbounds double, double* %1, i64 %50
%56 = bitcast double* %55 to <12 x double>*
%57 = shufflevector <2 x double> %54, <2 x double> <double 1.000000e+01, double 1.000000e+01>, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%58 = shufflevector <4 x double> %57, <4 x double> <double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double 0.000000e+00>, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%59 = shufflevector <8 x double> %58, <8 x double> <double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double poison, double poison, double poison, double poison>, <12 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 1, i32 3, i32 5, i32 7, i32 9, i32 11>
store <12 x double> %59, <12 x double>* %56
%60 = add nuw i64 %37, 4
%61 = add nuw i64 %38, 2
%62 = icmp eq i64 %61, %35
br i1 %62, label %63, label %36
63: ; preds = %36
%64 = mul i64 %60, 6
br label %65
65: ; preds = %63, %24
%66 = phi i64 [ 0, %24 ], [ %64, %63 ]
%67 = icmp eq i64 %32, 0
br i1 %67, label %78, label %68
68: ; preds = %65
%69 = load double, double* %0
%70 = insertelement <2 x double> poison, double %69, i64 0
%71 = fmul <2 x double> %70, <double -2.000000e+01, double poison>
%72 = shufflevector <2 x double> %71, <2 x double> poison, <2 x i32> zeroinitializer
%73 = getelementptr inbounds double, double* %1, i64 %66
%74 = bitcast double* %73 to <12 x double>*
%75 = shufflevector <2 x double> %72, <2 x double> <double 1.000000e+01, double 1.000000e+01>, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%76 = shufflevector <4 x double> %75, <4 x double> <double -1.000000e+00, double -1.000000e+00, double 0.000000e+00, double 0.000000e+00>, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%77 = shufflevector <8 x double> %76, <8 x double> <double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double poison, double poison, double poison, double poison>, <12 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 1, i32 3, i32 5, i32 7, i32 9, i32 11>
store <12 x double> %77, <12 x double>* %74
br label %78
78: ; preds = %65, %68
%79 = icmp eq i64 %25, %11
br i1 %79, label %100, label %80
80: ; preds = %13, %7, %78
%81 = phi i64 [ 0, %13 ], [ 0, %7 ], [ %26, %78 ]
%82 = phi i32 [ 0, %13 ], [ 0, %7 ], [ %28, %78 ]
br label %83
83: ; preds = %80, %83
%84 = phi i64 [ %96, %83 ], [ %81, %80 ]
%85 = phi i32 [ %98, %83 ], [ %82, %80 ]
%86 = load double, double* %0
%87 = fmul double %86, -2.000000e+01
%88 = or i64 %84, 1
%89 = getelementptr inbounds double, double* %1, i64 %84
store double %87, double* %89
%90 = add nuw nsw i64 %84, 2
%91 = getelementptr inbounds double, double* %1, i64 %88
store double 1.000000e+01, double* %91
%92 = getelementptr inbounds double, double* %1, i64 %90
%93 = add nuw nsw i64 %84, 4
%94 = bitcast double* %92 to <2 x double>*
store <2 x double> <double -1.000000e+00, double 0.000000e+00>, <2 x double>* %94
%95 = getelementptr inbounds double, double* %1, i64 %93
%96 = add nuw nsw i64 %84, 6
%97 = bitcast double* %95 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %97
%98 = add nuw nsw i32 %85, 3
%99 = icmp slt i32 %98, %3
br i1 %99, label %83, label %100
100: ; preds = %83, %78, %5
ret void
}