#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ Adjoint(double **, double **);
int /*<<< orphan*/ Matrix4Equal(double **, double **);
int /*<<< orphan*/ Matrix4Mult(double **, double **, double **);
int /*<<< orphan*/ Matrix4MultValue(double **, double, double **);
int /*<<< orphan*/ MatrixExp6(double **, double **);
int /*<<< orphan*/ VecTose3(double *, double **);
void JacobianBody(int JointNum, double *Blist, double *thetalist, double *Jb) {
  int i;
  int j;
  int k;
  double T1[4][4];
  double T2[4][4];
  double se3mat[4][4];
  double V[6];
  double AdT[6][6];
  double T[4][4] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
  for (i = 0; i < 6; i++) {
    Jb[i * JointNum + JointNum - 1] = Blist[i * JointNum + JointNum - 1];
  }
  for (i = JointNum - 2; i >= 0; i--) {
    for (j = 0; j < 6; j++) {
      V[j] = -1.0 * Blist[j * JointNum + i + 1];
    }
    VecTose3(V, se3mat);
    Matrix4MultValue(se3mat, thetalist[i + 1], se3mat);
    MatrixExp6(se3mat, T1);
    Matrix4Mult(T, T1, T2);
    Matrix4Equal(T2, T);
    Adjoint(T, AdT);
    for (j = 0; j < 6; j++) {
      Jb[j * JointNum + i] = 0;
      for (k = 0; k < 6; k++) {
        Jb[j * JointNum + i] =
            Jb[j * JointNum + i] + AdT[j][k] * Blist[k * JointNum + i];
      }
    }
  }
  return;
}


x86 assembly (clang, -O0):
<JacobianBody>:
push   %rbp
mov    %rsp,%rbp
sub    $0x380,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x380(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
movsd  0xe5b(%rip),%xmm0
movsd  %xmm0,-0x380(%rbp)
ff
movsd  0xe4b(%rip),%xmm0
movsd  %xmm0,-0x358(%rbp)
ff
movsd  0xe3b(%rip),%xmm0
movsd  %xmm0,-0x330(%rbp)
ff
movsd  0xe2b(%rip),%xmm0
movsd  %xmm0,-0x308(%rbp)
ff
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    122e <JacobianBody+0xbe>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11e4 <JacobianBody+0x74>
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     13ed <JacobianBody+0x27d>
movl   $0x0,-0x28(%rbp)
cmpl   $0x6,-0x28(%rbp)
jge    128e <JacobianBody+0x11e>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xd9a(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movslq -0x28(%rbp),%rax
movsd  %xmm0,-0x1e0(%rbp,%rax,8)
ff ff
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1248 <JacobianBody+0xd8>
lea    -0x1e0(%rbp),%rdi
lea    -0x1b0(%rbp),%rsi
call   1090 <VecTose3@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    -0x1b0(%rbp),%rsi
call   1070 <Matrix4MultValue@plt>
lea    -0x1b0(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1030 <MatrixExp6@plt>
lea    -0x380(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
lea    -0x130(%rbp),%rdx
call   1040 <Matrix4Mult@plt>
lea    -0x130(%rbp),%rdi
lea    -0x380(%rbp),%rsi
call   1050 <Matrix4Equal@plt>
lea    -0x380(%rbp),%rdi
lea    -0x300(%rbp),%rsi
call   1080 <Adjoint@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x6,-0x28(%rbp)
jge    13da <JacobianBody+0x26a>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x6,-0x2c(%rbp)
jge    13c7 <JacobianBody+0x257>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movslq -0x28(%rbp),%rcx
lea    -0x300(%rbp),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    134a <JacobianBody+0x1da>
jmp    13cc <JacobianBody+0x25c>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1320 <JacobianBody+0x1b0>
jmp    13df <JacobianBody+0x26f>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1237 <JacobianBody+0xc7>
add    $0x380,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JacobianBody>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x398,%rsp
mov    %rdx,0x30(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x50(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x40(%rsp)
mov    %rax,0x68(%rsp)
mov    %rax,0x90(%rsp)
mov    %rax,0xb8(%rsp)
movslq %edi,%rdx
add    $0xffffffff,%edi
movslq %edi,%rax
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
lea    (%rdx,%rdx,1),%eax
add    $0xffffffff,%eax
cltq
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
lea    (%rdx,%rdx,1),%rax
mov    %rax,0x20(%rsp)
lea    -0x1(%rdx,%rax,1),%eax
cltq
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
lea    (%rdx,%rdx,2),%rax
mov    %rax,0x18(%rsp)
lea    -0x1(%rdx,%rax,1),%eax
cltq
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
lea    0x0(,%rdx,4),%rax
mov    %rax,0x10(%rsp)
lea    -0x1(%rdx,%rax,1),%eax
cltq
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
lea    (%rdx,%rdx,4),%rax
mov    %rax,0x28(%rsp)
lea    -0x1(%rdx,%rax,1),%eax
cltq
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
mov    %rdx,0x8(%rsp)
cmp    $0x2,%edx
jl     1485 <JacobianBody+0x325>
mov    %rsi,%rbx
mov    0x8(%rsp),%rax
lea    -0x2(%rax),%r15d
lea    (%rcx,%r15,8),%r9
lea    0x0(,%rax,8),%r13
mov    0x28(%rsp),%r14
nopl   0x0(%rax)
mov    %r9,0x38(%rsp)
lea    0x1(%r15),%eax
cltq
mov    0x8(%rsp),%rcx
add    %r15d,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rbx,%rax,8),%xmm0
movhps (%rbx,%rcx,8),%xmm0
movaps 0xd47(%rip),%xmm1
xorps  %xmm1,%xmm0
movaps %xmm0,0xc0(%rsp)
mov    0x20(%rsp),%rax
lea    0x1(%r15,%rax,1),%eax
cltq
mov    0x18(%rsp),%rcx
lea    0x1(%r15,%rcx,1),%ecx
movslq %ecx,%rcx
movsd  (%rbx,%rax,8),%xmm0
movhps (%rbx,%rcx,8),%xmm0
xorps  %xmm1,%xmm0
movaps %xmm0,0xd0(%rsp)
mov    0x10(%rsp),%rax
lea    0x1(%r15,%rax,1),%eax
cltq
lea    0x1(%r15,%r14,1),%ecx
movslq %ecx,%rcx
movsd  (%rbx,%rax,8),%xmm0
movhps (%rbx,%rcx,8),%xmm0
xorps  %xmm1,%xmm0
movaps %xmm0,0xe0(%rsp)
lea    0xc0(%rsp),%rdi
lea    0x210(%rsp),%r12
mov    %r12,%rsi
call   1080 <VecTose3@plt>
mov    0x30(%rsp),%rax
movsd  0x8(%rax,%r15,8),%xmm0
mov    %r12,%rdi
mov    %r12,%rsi
call   1060 <Matrix4MultValue@plt>
mov    %r12,%rdi
lea    0x310(%rsp),%r12
mov    %r12,%rsi
call   1030 <MatrixExp6@plt>
lea    0x40(%rsp),%rbp
mov    %rbp,%rdi
mov    %r12,%rsi
lea    0x290(%rsp),%r12
mov    %r12,%rdx
call   1040 <Matrix4Mult@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
call   1050 <Matrix4Equal@plt>
mov    %rbp,%rdi
lea    0xf0(%rsp),%rsi
call   1070 <Adjoint@plt>
xorpd  %xmm2,%xmm2
mov    0x38(%rsp),%r9
mov    0x8(%rsp),%rax
lea    (%r15,%rax,1),%r8
mov    0x20(%rsp),%rax
lea    (%rax,%r15,1),%rcx
mov    0x18(%rsp),%rax
lea    (%rax,%r15,1),%rdx
mov    0x10(%rsp),%rax
lea    (%rax,%r15,1),%rsi
lea    (%r14,%r15,1),%rdi
mov    $0x28,%ebp
mov    %r9,%rax
nopw   0x0(%rax,%rax,1)
movq   $0x0,(%rax)
movsd  0xc8(%rsp,%rbp,1),%xmm0
mulsd  (%rbx,%r15,8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rax)
movsd  0xd0(%rsp,%rbp,1),%xmm1
mulsd  (%rbx,%r8,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rax)
movsd  0xd8(%rsp,%rbp,1),%xmm0
mulsd  (%rbx,%rcx,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  0xe0(%rsp,%rbp,1),%xmm1
mulsd  (%rbx,%rdx,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rax)
movsd  0xe8(%rsp,%rbp,1),%xmm0
mulsd  (%rbx,%rsi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  0xf0(%rsp,%rbp,1),%xmm1
mulsd  (%rbx,%rdi,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rax)
add    %r13,%rax
add    $0x30,%rbp
cmp    $0x148,%rbp
jne    13d0 <JacobianBody+0x270>
lea    -0x1(%r15),%rax
add    $0xfffffffffffffff8,%r9
test   %r15,%r15
mov    %rax,%r15
jg     1290 <JacobianBody+0x130>
add    $0x398,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @JacobianBody(i32 %0, double* %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [4 x [4 x double]]
%13 = alloca [4 x [4 x double]]
%14 = alloca [4 x [4 x double]]
%15 = alloca [6 x double]
%16 = alloca [6 x [6 x double]]
%17 = alloca [4 x [4 x double]]
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%18 = bitcast [4 x [4 x double]]* %17 to i8*
%19 = bitcast i8* %18 to [4 x [4 x double]]*
%20 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %19, i32 0, i32 0
%21 = getelementptr inbounds [4 x double], [4 x double]* %20, i32 0, i32 0
store double 1.000000e+00, double* %21
%22 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %19, i32 0, i32 1
%23 = getelementptr inbounds [4 x double], [4 x double]* %22, i32 0, i32 1
store double 1.000000e+00, double* %23
%24 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %19, i32 0, i32 2
%25 = getelementptr inbounds [4 x double], [4 x double]* %24, i32 0, i32 2
store double 1.000000e+00, double* %25
%26 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %19, i32 0, i32 3
%27 = getelementptr inbounds [4 x double], [4 x double]* %26, i32 0, i32 3
store double 1.000000e+00, double* %27
store i32 0, i32* %9
br label %28
28: ; preds = %51, %4
%29 = load i32, i32* %9
%30 = icmp slt i32 %29, 6
br i1 %30, label %31, label %54
31: ; preds = %28
%32 = load double*, double** %6
%33 = load i32, i32* %9
%34 = load i32, i32* %5
%35 = mul nsw i32 %33, %34
%36 = load i32, i32* %5
%37 = add nsw i32 %35, %36
%38 = sub nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %32, i64 %39
%41 = load double, double* %40
%42 = load double*, double** %8
%43 = load i32, i32* %9
%44 = load i32, i32* %5
%45 = mul nsw i32 %43, %44
%46 = load i32, i32* %5
%47 = add nsw i32 %45, %46
%48 = sub nsw i32 %47, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %42, i64 %49
store double %41, double* %50
br label %51
51: ; preds = %31
%52 = load i32, i32* %9
%53 = add nsw i32 %52, 1
store i32 %53, i32* %9
br label %28
54: ; preds = %28
%55 = load i32, i32* %5
%56 = sub nsw i32 %55, 2
store i32 %56, i32* %9
br label %57
57: ; preds = %178, %54
%58 = load i32, i32* %9
%59 = icmp sge i32 %58, 0
br i1 %59, label %60, label %181
60: ; preds = %57
store i32 0, i32* %10
br label %61
61: ; preds = %79, %60
%62 = load i32, i32* %10
%63 = icmp slt i32 %62, 6
br i1 %63, label %64, label %82
64: ; preds = %61
%65 = load double*, double** %6
%66 = load i32, i32* %10
%67 = load i32, i32* %5
%68 = mul nsw i32 %66, %67
%69 = load i32, i32* %9
%70 = add nsw i32 %68, %69
%71 = add nsw i32 %70, 1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %65, i64 %72
%74 = load double, double* %73
%75 = fmul double -1.000000e+00, %74
%76 = load i32, i32* %10
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [6 x double], [6 x double]* %15, i64 0, i64 %77
store double %75, double* %78
br label %79
79: ; preds = %64
%80 = load i32, i32* %10
%81 = add nsw i32 %80, 1
store i32 %81, i32* %10
br label %61
82: ; preds = %61
%83 = getelementptr inbounds [6 x double], [6 x double]* %15, i64 0, i64 0
%84 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %14, i64 0, i64 0
%85 = bitcast [4 x double]* %84 to double**
%86 = call i32 @VecTose3(double* %83, double** %85)
%87 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %14, i64 0, i64 0
%88 = bitcast [4 x double]* %87 to double**
%89 = load double*, double** %7
%90 = load i32, i32* %9
%91 = add nsw i32 %90, 1
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds double, double* %89, i64 %92
%94 = load double, double* %93
%95 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %14, i64 0, i64 0
%96 = bitcast [4 x double]* %95 to double**
%97 = call i32 @Matrix4MultValue(double** %88, double %94, double** %96)
%98 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %14, i64 0, i64 0
%99 = bitcast [4 x double]* %98 to double**
%100 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %12, i64 0, i64 0
%101 = bitcast [4 x double]* %100 to double**
%102 = call i32 @MatrixExp6(double** %99, double** %101)
%103 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %17, i64 0, i64 0
%104 = bitcast [4 x double]* %103 to double**
%105 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %12, i64 0, i64 0
%106 = bitcast [4 x double]* %105 to double**
%107 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %13, i64 0, i64 0
%108 = bitcast [4 x double]* %107 to double**
%109 = call i32 @Matrix4Mult(double** %104, double** %106, double** %108)
%110 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %13, i64 0, i64 0
%111 = bitcast [4 x double]* %110 to double**
%112 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %17, i64 0, i64 0
%113 = bitcast [4 x double]* %112 to double**
%114 = call i32 @Matrix4Equal(double** %111, double** %113)
%115 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %17, i64 0, i64 0
%116 = bitcast [4 x double]* %115 to double**
%117 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %16, i64 0, i64 0
%118 = bitcast [6 x double]* %117 to double**
%119 = call i32 @Adjoint(double** %116, double** %118)
store i32 0, i32* %10
br label %120
120: ; preds = %174, %82
%121 = load i32, i32* %10
%122 = icmp slt i32 %121, 6
br i1 %122, label %123, label %177
123: ; preds = %120
%124 = load double*, double** %8
%125 = load i32, i32* %10
%126 = load i32, i32* %5
%127 = mul nsw i32 %125, %126
%128 = load i32, i32* %9
%129 = add nsw i32 %127, %128
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double, double* %124, i64 %130
store double 0.000000e+00, double* %131
store i32 0, i32* %11
br label %132
132: ; preds = %170, %123
%133 = load i32, i32* %11
%134 = icmp slt i32 %133, 6
br i1 %134, label %135, label %173
135: ; preds = %132
%136 = load double*, double** %8
%137 = load i32, i32* %10
%138 = load i32, i32* %5
%139 = mul nsw i32 %137, %138
%140 = load i32, i32* %9
%141 = add nsw i32 %139, %140
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds double, double* %136, i64 %142
%144 = load double, double* %143
%145 = load i32, i32* %10
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %16, i64 0, i64 %146
%148 = load i32, i32* %11
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [6 x double], [6 x double]* %147, i64 0, i64 %149
%151 = load double, double* %150
%152 = load double*, double** %6
%153 = load i32, i32* %11
%154 = load i32, i32* %5
%155 = mul nsw i32 %153, %154
%156 = load i32, i32* %9
%157 = add nsw i32 %155, %156
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds double, double* %152, i64 %158
%160 = load double, double* %159
%161 = call double @llvm.fmuladd.f64(double %151, double %160, double %144)
%162 = load double*, double** %8
%163 = load i32, i32* %10
%164 = load i32, i32* %5
%165 = mul nsw i32 %163, %164
%166 = load i32, i32* %9
%167 = add nsw i32 %165, %166
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds double, double* %162, i64 %168
store double %161, double* %169
br label %170
170: ; preds = %135
%171 = load i32, i32* %11
%172 = add nsw i32 %171, 1
store i32 %172, i32* %11
br label %132
173: ; preds = %132
br label %174
174: ; preds = %173
%175 = load i32, i32* %10
%176 = add nsw i32 %175, 1
store i32 %176, i32* %10
br label %120
177: ; preds = %120
br label %178
178: ; preds = %177
%179 = load i32, i32* %9
%180 = add nsw i32 %179, -1
store i32 %180, i32* %9
br label %57
181: ; preds = %57
ret void
}

LLVM IR (-O2):
define void @JacobianBody(i32 %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
%5 = alloca [4 x [4 x double]]
%6 = alloca [4 x [4 x double]]
%7 = alloca [4 x [4 x double]]
%8 = alloca [6 x double]
%9 = alloca [6 x [6 x double]]
%10 = alloca [4 x [4 x double]]
%11 = bitcast [4 x [4 x double]]* %5 to i8*
%12 = bitcast [4 x [4 x double]]* %6 to i8*
%13 = bitcast [4 x [4 x double]]* %7 to i8*
%14 = bitcast [6 x double]* %8 to i8*
%15 = bitcast [6 x [6 x double]]* %9 to i8*
%16 = bitcast [4 x [4 x double]]* %10 to i8*
%17 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %10, i64 0, i64 0, i64 0
store double 1.000000e+00, double* %17
%18 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %10, i64 0, i64 1, i64 1
store double 1.000000e+00, double* %18
%19 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %10, i64 0, i64 2, i64 2
store double 1.000000e+00, double* %19
%20 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %10, i64 0, i64 3, i64 3
store double 1.000000e+00, double* %20
%21 = add i32 %0, -1
%22 = sext i32 %0 to i64
%23 = sext i32 %21 to i64
%24 = getelementptr inbounds double, double* %1, i64 %23
%25 = load double, double* %24
%26 = getelementptr inbounds double, double* %3, i64 %23
store double %25, double* %26
%27 = add i32 %21, %0
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %1, i64 %28
%30 = load double, double* %29
%31 = getelementptr inbounds double, double* %3, i64 %28
store double %30, double* %31
%32 = shl nsw i64 %22, 1
%33 = trunc i64 %32 to i32
%34 = add i32 %21, %33
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %1, i64 %35
%37 = load double, double* %36
%38 = getelementptr inbounds double, double* %3, i64 %35
store double %37, double* %38
%39 = mul nsw i64 %22, 3
%40 = trunc i64 %39 to i32
%41 = add i32 %21, %40
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %1, i64 %42
%44 = load double, double* %43
%45 = getelementptr inbounds double, double* %3, i64 %42
store double %44, double* %45
%46 = shl nsw i64 %22, 2
%47 = trunc i64 %46 to i32
%48 = add i32 %21, %47
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %1, i64 %49
%51 = load double, double* %50
%52 = getelementptr inbounds double, double* %3, i64 %49
store double %51, double* %52
%53 = mul nsw i64 %22, 5
%54 = trunc i64 %53 to i32
%55 = add i32 %21, %54
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %1, i64 %56
%58 = load double, double* %57
%59 = getelementptr inbounds double, double* %3, i64 %56
store double %58, double* %59
%60 = icmp sgt i32 %0, 1
br i1 %60, label %61, label %165
61: ; preds = %4
%62 = add nsw i32 %0, -2
%63 = getelementptr inbounds [6 x double], [6 x double]* %8, i64 0, i64 0
%64 = bitcast [4 x [4 x double]]* %7 to double**
%65 = bitcast [4 x [4 x double]]* %5 to double**
%66 = bitcast [4 x [4 x double]]* %10 to double**
%67 = bitcast [4 x [4 x double]]* %6 to double**
%68 = bitcast [6 x [6 x double]]* %9 to double**
%69 = zext i32 %62 to i64
%70 = getelementptr inbounds [6 x double], [6 x double]* %8, i64 0, i64 2
%71 = getelementptr inbounds [6 x double], [6 x double]* %8, i64 0, i64 4
%72 = bitcast [6 x double]* %8 to <2 x double>*
%73 = bitcast double* %70 to <2 x double>*
%74 = bitcast double* %71 to <2 x double>*
br label %75
75: ; preds = %61, %162
%76 = phi i64 [ %69, %61 ], [ %163, %162 ]
%77 = trunc i64 %76 to i32
%78 = add i32 %77, 1
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double, double* %1, i64 %79
%81 = load double, double* %80
%82 = add i32 %78, %0
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %1, i64 %83
%85 = load double, double* %84
%86 = insertelement <2 x double> poison, double %81, i64 0
%87 = insertelement <2 x double> %86, double %85, i64 1
%88 = fneg <2 x double> %87
store <2 x double> %88, <2 x double>* %72
%89 = add i32 %78, %33
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %1, i64 %90
%92 = load double, double* %91
%93 = add i32 %78, %40
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds double, double* %1, i64 %94
%96 = load double, double* %95
%97 = insertelement <2 x double> poison, double %92, i64 0
%98 = insertelement <2 x double> %97, double %96, i64 1
%99 = fneg <2 x double> %98
store <2 x double> %99, <2 x double>* %73
%100 = add i32 %78, %47
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %1, i64 %101
%103 = load double, double* %102
%104 = add i32 %78, %54
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %1, i64 %105
%107 = load double, double* %106
%108 = insertelement <2 x double> poison, double %103, i64 0
%109 = insertelement <2 x double> %108, double %107, i64 1
%110 = fneg <2 x double> %109
store <2 x double> %110, <2 x double>* %74
%111 = call i32 @VecTose3(double* %63, double** %64)
%112 = add nuw nsw i64 %76, 1
%113 = getelementptr inbounds double, double* %2, i64 %112
%114 = load double, double* %113
%115 = call i32 @Matrix4MultValue(double** %64, double %114, double** %64)
%116 = call i32 @MatrixExp6(double** %64, double** %65)
%117 = call i32 @Matrix4Mult(double** %66, double** %65, double** %67)
%118 = call i32 @Matrix4Equal(double** %67, double** %66)
%119 = call i32 @Adjoint(double** %66, double** %68)
%120 = getelementptr inbounds double, double* %1, i64 %76
%121 = add nsw i64 %76, %22
%122 = getelementptr inbounds double, double* %1, i64 %121
%123 = add nsw i64 %32, %76
%124 = getelementptr inbounds double, double* %1, i64 %123
%125 = add nsw i64 %39, %76
%126 = getelementptr inbounds double, double* %1, i64 %125
%127 = add nsw i64 %46, %76
%128 = getelementptr inbounds double, double* %1, i64 %127
%129 = add nsw i64 %53, %76
%130 = getelementptr inbounds double, double* %1, i64 %129
br label %131
131: ; preds = %75, %131
%132 = phi i64 [ 0, %75 ], [ %160, %131 ]
%133 = mul nsw i64 %132, %22
%134 = add nsw i64 %133, %76
%135 = getelementptr inbounds double, double* %3, i64 %134
store double 0.000000e+00, double* %135
%136 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %9, i64 0, i64 %132, i64 0
%137 = load double, double* %136
%138 = load double, double* %120
%139 = call double @llvm.fmuladd.f64(double %137, double %138, double 0.000000e+00)
store double %139, double* %135
%140 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %9, i64 0, i64 %132, i64 1
%141 = load double, double* %140
%142 = load double, double* %122
%143 = call double @llvm.fmuladd.f64(double %141, double %142, double %139)
store double %143, double* %135
%144 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %9, i64 0, i64 %132, i64 2
%145 = load double, double* %144
%146 = load double, double* %124
%147 = call double @llvm.fmuladd.f64(double %145, double %146, double %143)
store double %147, double* %135
%148 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %9, i64 0, i64 %132, i64 3
%149 = load double, double* %148
%150 = load double, double* %126
%151 = call double @llvm.fmuladd.f64(double %149, double %150, double %147)
store double %151, double* %135
%152 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %9, i64 0, i64 %132, i64 4
%153 = load double, double* %152
%154 = load double, double* %128
%155 = call double @llvm.fmuladd.f64(double %153, double %154, double %151)
store double %155, double* %135
%156 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %9, i64 0, i64 %132, i64 5
%157 = load double, double* %156
%158 = load double, double* %130
%159 = call double @llvm.fmuladd.f64(double %157, double %158, double %155)
store double %159, double* %135
%160 = add nuw nsw i64 %132, 1
%161 = icmp eq i64 %160, 6
br i1 %161, label %162, label %131
162: ; preds = %131
%163 = add nsw i64 %76, -1
%164 = icmp sgt i64 %76, 0
br i1 %164, label %75, label %165
165: ; preds = %162, %4
ret void
}