void jacmodbt7(double *p, double *jac, int m, int n, void *data) {
  register int i, j;
  for (i = j = 0; i < m; ++i) {
    jac[j++] = -400.0 * (p[1] - p[0] * p[0]) * p[0] + 2.0 * p[0] - 2.0;
    jac[j++] = 200.0 * (p[1] - p[0] * p[0]);
    jac[j++] = 0.0;
    jac[j++] = 0.0;
    jac[j++] = 0.0;
  }
}


x86 assembly (clang, -O0):
<jacmodbt7>:
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    -0x14(%rbp),%eax
jge    126e <jacmodbt7+0x16e>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xea0(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0xe80(%rip),%xmm1
mulsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6c(%rip),%xmm1
subsd  %xmm1,%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    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe09(%rip),%xmm0
mulsd  %xmm1,%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
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    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1124 <jacmodbt7+0x24>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jacmodbt7>:
test   %edx,%edx
jle    11bc <jacmodbt7+0xbc>
mov    %edx,%r10d
add    $0xffffffff,%r10d
je     1133 <jacmodbt7+0x33>
lea    0x10(%rdi),%rax
cmp    %rsi,%rax
jbe    11bd <jacmodbt7+0xbd>
lea    (%r10,%r10,4),%rax
lea    (%rsi,%rax,8),%rax
add    $0x28,%rax
cmp    %rdi,%rax
jbe    11bd <jacmodbt7+0xbd>
xor    %r8d,%r8d
xor    %r9d,%r9d
lea    (%rsi,%r8,8),%rax
add    $0x20,%rax
sub    %r9d,%edx
movsd  0xeb4(%rip),%xmm0
movsd  0xeb4(%rip),%xmm1
movsd  0xeb4(%rip),%xmm2
xorps  %xmm3,%xmm3
nop
movsd  (%rdi),%xmm4
movsd  0x8(%rdi),%xmm5
movapd %xmm4,%xmm6
mulsd  %xmm4,%xmm6
subsd  %xmm6,%xmm5
mulsd  %xmm0,%xmm5
mulsd  %xmm4,%xmm5
addsd  %xmm4,%xmm4
addsd  %xmm5,%xmm4
addsd  %xmm1,%xmm4
movsd  %xmm4,-0x20(%rax)
movsd  (%rdi),%xmm4
movsd  0x8(%rdi),%xmm5
mulsd  %xmm4,%xmm4
subsd  %xmm4,%xmm5
mulsd  %xmm2,%xmm5
movsd  %xmm5,-0x18(%rax)
movups %xmm3,-0x10(%rax)
movq   $0x0,(%rax)
add    $0x28,%rax
add    $0xffffffff,%edx
jne    1160 <jacmodbt7+0x60>
ret
add    $0x1,%r10
mov    %r10,%r9
and    $0xfffffffffffffffe,%r9
lea    (%r9,%r9,4),%r8
movsd  0xe2c(%rip),%xmm0
movsd  0xe2c(%rip),%xmm1
movsd  0xe2c(%rip),%xmm2
xorps  %xmm3,%xmm3
mov    %rsi,%rcx
mov    %r9,%rax
nopl   (%rax)
movsd  (%rdi),%xmm4
movsd  0x8(%rdi),%xmm5
movapd %xmm4,%xmm6
mulsd  %xmm4,%xmm6
subsd  %xmm6,%xmm5
movapd %xmm5,%xmm6
mulsd  %xmm0,%xmm6
mulsd  %xmm4,%xmm6
addsd  %xmm4,%xmm4
addsd  %xmm6,%xmm4
addsd  %xmm1,%xmm4
mulsd  %xmm2,%xmm5
xorpd  %xmm6,%xmm6
unpcklpd %xmm4,%xmm6
unpcklpd %xmm5,%xmm4
movq   %xmm5,%xmm5
movups %xmm3,0x40(%rcx)
movups %xmm3,0x10(%rcx)
movdqu %xmm5,0x30(%rcx)
movupd %xmm6,0x20(%rcx)
movupd %xmm4,(%rcx)
add    $0x50,%rcx
add    $0xfffffffffffffffe,%rax
jne    11f0 <jacmodbt7+0xf0>
cmp    %r9,%r10
jne    1139 <jacmodbt7+0x39>
jmp    11bc <jacmodbt7+0xbc>

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

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