void ContactJacobian(CJ, q) double CJ[12];
double q[2];
{
  double t1;
  double t11;
  double t2;
  double t3;
  double t4;
  double t5;
  double t7;
  double t8;
  double t9;
  {
    CJ[0] = 0.0;
    t1 = q[0];
    t2 = sin(t1);
    t3 = q[1];
    t4 = cos(t3);
    t5 = t4 + 1.0;
    t7 = cos(t1);
    t8 = sin(t3);
    t9 = t7 * t8;
    CJ[1] = -t2 * t5 - t9;
    CJ[2] = 0.0;
    t11 = t2 * t8;
    CJ[3] = t7 * t5 - t11;
    CJ[4] = 0.0;
    CJ[5] = 0.0;
    CJ[6] = 0.0;
    CJ[7] = -t9 - t2 * t4;
    CJ[8] = 0.0;
    CJ[9] = -t11 + t7 * t4;
    CJ[10] = 0.0;
    CJ[11] = 0.0;
    return;
  }
}


x86 assembly (clang, -O0):
<ContactJacobian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xe84(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x30(%rax)
movsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x38(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x40(%rax)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x48(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x50(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x58(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ContactJacobian>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movq   $0x0,(%rdi)
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
movaps %xmm0,0x30(%rsp)
movsd  0x8(%r14),%xmm0
movsd  %xmm0,0x18(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0xe9a(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0xe7f(%rip),%xmm1
movapd 0x30(%rsp),%xmm4
movapd %xmm4,%xmm2
xorpd  %xmm1,%xmm2
movapd (%rsp),%xmm6
xorpd  %xmm6,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm4,%xmm3
movapd %xmm4,%xmm5
movsd  0x20(%rsp),%xmm7
mulsd  %xmm7,%xmm3
movapd %xmm1,%xmm4
subsd  %xmm3,%xmm4
movsd  %xmm4,0x8(%rbx)
movq   $0x0,0x10(%rbx)
mulsd  %xmm0,%xmm2
movapd %xmm7,%xmm0
mulsd  %xmm6,%xmm0
movapd %xmm6,%xmm4
addsd  %xmm2,%xmm0
movsd  %xmm0,0x18(%rbx)
movsd  0x28(%rsp),%xmm3
mulsd  %xmm3,%xmm5
subsd  %xmm5,%xmm1
xorpd  %xmm0,%xmm0
movupd %xmm0,0x20(%rbx)
movq   $0x0,0x30(%rbx)
movsd  %xmm1,0x38(%rbx)
movq   $0x0,0x40(%rbx)
movapd %xmm4,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x48(%rbx)
movupd %xmm0,0x50(%rbx)
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ContactJacobian(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%14 = load double*, double** %3
%15 = getelementptr inbounds double, double* %14, i64 0
store double 0.000000e+00, double* %15
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
store double %18, double* %5
%19 = load double, double* %5
%20 = call double @sin(double %19)
store double %20, double* %7
%21 = load double*, double** %4
%22 = getelementptr inbounds double, double* %21, i64 1
%23 = load double, double* %22
store double %23, double* %8
%24 = load double, double* %8
%25 = call double @cos(double %24)
store double %25, double* %9
%26 = load double, double* %9
%27 = fadd double %26, 1.000000e+00
store double %27, double* %10
%28 = load double, double* %5
%29 = call double @cos(double %28)
store double %29, double* %11
%30 = load double, double* %8
%31 = call double @sin(double %30)
store double %31, double* %12
%32 = load double, double* %11
%33 = load double, double* %12
%34 = fmul double %32, %33
store double %34, double* %13
%35 = load double, double* %7
%36 = fneg double %35
%37 = load double, double* %10
%38 = load double, double* %13
%39 = fneg double %38
%40 = call double @llvm.fmuladd.f64(double %36, double %37, double %39)
%41 = load double*, double** %3
%42 = getelementptr inbounds double, double* %41, i64 1
store double %40, double* %42
%43 = load double*, double** %3
%44 = getelementptr inbounds double, double* %43, i64 2
store double 0.000000e+00, double* %44
%45 = load double, double* %7
%46 = load double, double* %12
%47 = fmul double %45, %46
store double %47, double* %6
%48 = load double, double* %11
%49 = load double, double* %10
%50 = load double, double* %6
%51 = fneg double %50
%52 = call double @llvm.fmuladd.f64(double %48, double %49, double %51)
%53 = load double*, double** %3
%54 = getelementptr inbounds double, double* %53, i64 3
store double %52, double* %54
%55 = load double*, double** %3
%56 = getelementptr inbounds double, double* %55, i64 4
store double 0.000000e+00, double* %56
%57 = load double*, double** %3
%58 = getelementptr inbounds double, double* %57, i64 5
store double 0.000000e+00, double* %58
%59 = load double*, double** %3
%60 = getelementptr inbounds double, double* %59, i64 6
store double 0.000000e+00, double* %60
%61 = load double, double* %13
%62 = fneg double %61
%63 = load double, double* %7
%64 = load double, double* %9
%65 = fneg double %63
%66 = call double @llvm.fmuladd.f64(double %65, double %64, double %62)
%67 = load double*, double** %3
%68 = getelementptr inbounds double, double* %67, i64 7
store double %66, double* %68
%69 = load double*, double** %3
%70 = getelementptr inbounds double, double* %69, i64 8
store double 0.000000e+00, double* %70
%71 = load double, double* %6
%72 = fneg double %71
%73 = load double, double* %11
%74 = load double, double* %9
%75 = call double @llvm.fmuladd.f64(double %73, double %74, double %72)
%76 = load double*, double** %3
%77 = getelementptr inbounds double, double* %76, i64 9
store double %75, double* %77
%78 = load double*, double** %3
%79 = getelementptr inbounds double, double* %78, i64 10
store double 0.000000e+00, double* %79
%80 = load double*, double** %3
%81 = getelementptr inbounds double, double* %80, i64 11
store double 0.000000e+00, double* %81
ret void
}

LLVM IR (-O2):
define void @ContactJacobian(double* nocapture writeonly %0, double* nocapture %1) {
store double 0.000000e+00, double* %0
%3 = load double, double* %1
%4 = tail call double @sin(double %3)
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = tail call double @cos(double %6)
%8 = fadd double %7, 1.000000e+00
%9 = tail call double @cos(double %3)
%10 = tail call double @sin(double %6)
%11 = fneg double %4
%12 = fneg double %9
%13 = fmul double %10, %12
%14 = tail call double @llvm.fmuladd.f64(double %11, double %8, double %13)
%15 = getelementptr inbounds double, double* %0, i64 1
store double %14, double* %15
%16 = getelementptr inbounds double, double* %0, i64 2
store double 0.000000e+00, double* %16
%17 = fmul double %10, %11
%18 = tail call double @llvm.fmuladd.f64(double %9, double %8, double %17)
%19 = getelementptr inbounds double, double* %0, i64 3
store double %18, double* %19
%20 = getelementptr inbounds double, double* %0, i64 4
%21 = tail call double @llvm.fmuladd.f64(double %11, double %7, double %13)
%22 = getelementptr inbounds double, double* %0, i64 7
%23 = bitcast double* %20 to i8*
store double %21, double* %22
%24 = getelementptr inbounds double, double* %0, i64 8
store double 0.000000e+00, double* %24
%25 = tail call double @llvm.fmuladd.f64(double %9, double %7, double %17)
%26 = getelementptr inbounds double, double* %0, i64 9
store double %25, double* %26
%27 = getelementptr inbounds double, double* %0, i64 10
%28 = bitcast double* %27 to i8*
ret void
}