void jachs48(double *p, double *jac, int m, int n, void *data) {
  register int i, j;
  double t1, t2, t3;
  t1 = p[0] - 1.0;
  t2 = p[1] - p[2];
  t3 = p[3] - p[4];
  for (i = j = 0; i < n; ++i) {
    jac[j++] = 2.0 * t1;
    jac[j++] = 2.0 * t2;
    jac[j++] = -2.0 * t2;
    jac[j++] = 2.0 * t3;
    jac[j++] = -2.0 * t3;
  }
}


x86 assembly (clang, -O0):
<jachs48>:
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)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xeda(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1239 <jachs48+0x139>
movsd  0xe91(%rip),%xmm0
mulsd  -0x30(%rbp),%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)
movsd  0xe6d(%rip),%xmm0
mulsd  -0x38(%rbp),%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)
movsd  0xe41(%rip),%xmm0
mulsd  -0x38(%rbp),%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)
movsd  0xe25(%rip),%xmm0
mulsd  -0x40(%rbp),%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)
movsd  0xdf9(%rip),%xmm0
mulsd  -0x40(%rbp),%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    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    116b <jachs48+0x6b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jachs48>:
test   %ecx,%ecx
jle    11a2 <jachs48+0xa2>
movsd  0x8(%rdi),%xmm0
movsd  0x10(%rdi),%xmm1
movhpd 0x18(%rdi),%xmm0
movhpd 0x20(%rdi),%xmm1
subpd  %xmm1,%xmm0
movsd  (%rdi),%xmm1
addsd  0xed4(%rip),%xmm1
unpcklpd %xmm0,%xmm1
addpd  %xmm1,%xmm1
movapd 0xed4(%rip),%xmm2
mulpd  %xmm0,%xmm2
unpckhpd %xmm0,%xmm0
mulsd  0xebc(%rip),%xmm0
cmp    $0x1,%ecx
jne    1155 <jachs48+0x55>
xor    %eax,%eax
jmp    118c <jachs48+0x8c>
mov    %ecx,%edx
and    $0xfffffffe,%edx
xor    %eax,%eax
nopl   0x0(%rax)
movupd %xmm1,(%rsi,%rax,8)
movupd %xmm2,0x10(%rsi,%rax,8)
movsd  %xmm0,0x20(%rsi,%rax,8)
movupd %xmm1,0x28(%rsi,%rax,8)
movupd %xmm2,0x38(%rsi,%rax,8)
movsd  %xmm0,0x48(%rsi,%rax,8)
add    $0xa,%rax
add    $0xfffffffe,%edx
jne    1160 <jachs48+0x60>
test   $0x1,%cl
je     11a2 <jachs48+0xa2>
movupd %xmm1,(%rsi,%rax,8)
movupd %xmm2,0x10(%rsi,%rax,8)
movsd  %xmm0,0x20(%rsi,%rax,8)
ret

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

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