#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*/ FKinBody(double **, int, double *, double *, double **);
int /*<<< orphan*/ JacobianBody(int, double *, double *, double *);
int /*<<< orphan*/ Matrix4Mult(double **, double **, double **);
int /*<<< orphan*/ MatrixCopy(double *, int, int, double *);
int /*<<< orphan*/ MatrixLog6(double **, double **);
int /*<<< orphan*/ MatrixMult(double *, int, int, double *, int, double *);
int /*<<< orphan*/ MatrixPinv(double *, int, int, double, double *);
int /*<<< orphan*/ TransInv(double **, double **);
double VecNorm2(int, double *);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ se3ToVec(double **, double *);
int IKinBodyNR(int JointNum, double *Blist, double M[4][4], double T[4][4],
               double *thetalist0, double eomg, double ev, int maxiter,
               double *thetalist) {
  int i, j;
  double Tsb[4][4];
  double iTsb[4][4];
  double Tbd[4][4];
  double se3Mat[4][4];
  double Vb[6];
  int ErrFlag;
  double *Jb = (double *)malloc(JointNum * 6 * sizeof(double));
  if (Jb == NULL) {
    return 2;
  }
  double *pJb = (double *)malloc(JointNum * 6 * sizeof(double));
  if (pJb == NULL) {
    free(Jb);
    return 2;
  }
  double *dtheta = (double *)malloc(JointNum * sizeof(double));
  if (dtheta == NULL) {
    free(Jb);
    free(pJb);
    return 2;
  }
  MatrixCopy(thetalist0, JointNum, 1, thetalist);
  FKinBody(M, JointNum, Blist, thetalist, Tsb);
  TransInv(Tsb, iTsb);
  Matrix4Mult(iTsb, T, Tbd);
  MatrixLog6(Tbd, se3Mat);
  se3ToVec(se3Mat, Vb);
  ErrFlag = VecNorm2(3, &Vb[0]) > eomg || VecNorm2(3, &Vb[3]) > ev;
  i = 0;
  printf("iteration:%4d  thetalist:  ", i);
  int k;
  for (k = 0; k < JointNum; k++) {
    printf("%4.6lf\t", thetalist[k]);
  }
  printf("\n");
  while (ErrFlag && i < maxiter) {
    JacobianBody(JointNum, Blist, thetalist, Jb);
    MatrixPinv(Jb, 6, JointNum, 2.2E-15, pJb);
    MatrixMult(pJb, JointNum, 6, Vb, 1, dtheta);
    for (j = 0; j < JointNum; j++) {
      thetalist[j] = thetalist[j] + dtheta[j];
    }
    i++;
    FKinBody(M, JointNum, Blist, thetalist, Tsb);
    TransInv(Tsb, iTsb);
    Matrix4Mult(iTsb, T, Tbd);
    MatrixLog6(Tbd, se3Mat);
    se3ToVec(se3Mat, Vb);
    ErrFlag = VecNorm2(3, &Vb[0]) > eomg || VecNorm2(3, &Vb[3]) > ev;
    printf("iteration:%4d  thetalist:  ", i);
    for (k = 0; k < JointNum; k++) {
      printf("%4.6lf\t", thetalist[k]);
    }
    printf("\n");
  }
  free(Jb);
  free(pJb);
  free(dtheta);
  return ErrFlag;
}


x86 assembly (clang, -O0):
<IKinBodyNR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2b0,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
mov    %r9d,-0x3c(%rbp)
imul   $0x6,-0x8(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x290(%rbp)
cmpq   $0x0,-0x290(%rbp)
jne    1232 <IKinBodyNR+0x62>
movl   $0x2,-0x4(%rbp)
jmp    164d <IKinBodyNR+0x47d>
imul   $0x6,-0x8(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x298(%rbp)
cmpq   $0x0,-0x298(%rbp)
jne    1270 <IKinBodyNR+0xa0>
mov    -0x290(%rbp),%rdi
call   1030 <free@plt>
movl   $0x2,-0x4(%rbp)
jmp    164d <IKinBodyNR+0x47d>
movslq -0x8(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x2a0(%rbp)
cmpq   $0x0,-0x2a0(%rbp)
jne    12b8 <IKinBodyNR+0xe8>
mov    -0x290(%rbp),%rdi
call   1030 <free@plt>
mov    -0x298(%rbp),%rdi
call   1030 <free@plt>
movl   $0x2,-0x4(%rbp)
jmp    164d <IKinBodyNR+0x47d>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    0x10(%rbp),%rcx
mov    $0x1,%edx
call   1060 <MatrixCopy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    0x10(%rbp),%rcx
lea    -0xd0(%rbp),%r8
call   1080 <FKinBody@plt>
lea    -0xd0(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   10b0 <TransInv@plt>
lea    -0x150(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x1d0(%rbp),%rdx
call   1040 <Matrix4Mult@plt>
lea    -0x1d0(%rbp),%rdi
lea    -0x250(%rbp),%rsi
call   10e0 <MatrixLog6@plt>
lea    -0x250(%rbp),%rdi
lea    -0x280(%rbp),%rsi
call   1070 <se3ToVec@plt>
lea    -0x280(%rbp),%rsi
mov    $0x3,%edi
call   10c0 <VecNorm2@plt>
mov    $0x1,%al
ucomisd -0x30(%rbp),%xmm0
mov    %al,-0x2a5(%rbp)
ja     137f <IKinBodyNR+0x1af>
lea    -0x280(%rbp),%rsi
add    $0x18,%rsi
mov    $0x3,%edi
call   10c0 <VecNorm2@plt>
ucomisd -0x38(%rbp),%xmm0
seta   %al
mov    %al,-0x2a5(%rbp)
mov    -0x2a5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x284(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%esi
lea    0xc67(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x2a4(%rbp)
mov    -0x2a4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13f3 <IKinBodyNR+0x223>
mov    0x10(%rbp),%rax
movslq -0x2a4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xc4c(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x2a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2a4(%rbp)
jmp    13b2 <IKinBodyNR+0x1e2>
lea    0xc32(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x284(%rbp)
mov    %al,-0x2a6(%rbp)
je     1425 <IKinBodyNR+0x255>
mov    -0x40(%rbp),%eax
cmp    -0x3c(%rbp),%eax
setl   %al
mov    %al,-0x2a6(%rbp)
mov    -0x2a6(%rbp),%al
test   $0x1,%al
jne    1438 <IKinBodyNR+0x268>
jmp    1620 <IKinBodyNR+0x450>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x10(%rbp),%rdx
mov    -0x290(%rbp),%rcx
call   10d0 <JacobianBody@plt>
mov    -0x290(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0x298(%rbp),%rcx
mov    $0x6,%esi
movsd  0xb93(%rip),%xmm0
call   10f0 <MatrixPinv@plt>
mov    -0x298(%rbp),%rdi
mov    -0x8(%rbp),%esi
lea    -0x280(%rbp),%rcx
mov    -0x2a0(%rbp),%r9
mov    $0x6,%edx
mov    $0x1,%r8d
call   1090 <MatrixMult@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14e5 <IKinBodyNR+0x315>
mov    0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x2a0(%rbp),%rax
movslq -0x44(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    14a1 <IKinBodyNR+0x2d1>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    0x10(%rbp),%rcx
lea    -0xd0(%rbp),%r8
call   1080 <FKinBody@plt>
lea    -0xd0(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   10b0 <TransInv@plt>
lea    -0x150(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x1d0(%rbp),%rdx
call   1040 <Matrix4Mult@plt>
lea    -0x1d0(%rbp),%rdi
lea    -0x250(%rbp),%rsi
call   10e0 <MatrixLog6@plt>
lea    -0x250(%rbp),%rdi
lea    -0x280(%rbp),%rsi
call   1070 <se3ToVec@plt>
lea    -0x280(%rbp),%rsi
mov    $0x3,%edi
call   10c0 <VecNorm2@plt>
mov    $0x1,%al
ucomisd -0x30(%rbp),%xmm0
mov    %al,-0x2a7(%rbp)
ja     15a0 <IKinBodyNR+0x3d0>
lea    -0x280(%rbp),%rsi
add    $0x18,%rsi
mov    $0x3,%edi
call   10c0 <VecNorm2@plt>
ucomisd -0x38(%rbp),%xmm0
seta   %al
mov    %al,-0x2a7(%rbp)
mov    -0x2a7(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x284(%rbp)
mov    -0x40(%rbp),%esi
lea    0xa4d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x2a4(%rbp)
mov    -0x2a4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    160d <IKinBodyNR+0x43d>
mov    0x10(%rbp),%rax
movslq -0x2a4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xa32(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x2a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2a4(%rbp)
jmp    15cc <IKinBodyNR+0x3fc>
lea    0xa18(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1401 <IKinBodyNR+0x231>
mov    -0x290(%rbp),%rdi
call   1030 <free@plt>
mov    -0x298(%rbp),%rdi
call   1030 <free@plt>
mov    -0x2a0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x284(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IKinBodyNR>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2b8,%rsp
mov    %r9d,0x14(%rsp)
movsd  %xmm1,0x30(%rsp)
movsd  %xmm0,0x48(%rsp)
mov    %r8,%r13
mov    %rcx,0x40(%rsp)
mov    %rdx,0x38(%rsp)
mov    %rsi,0x20(%rsp)
mov    %rdi,0x50(%rsp)
mov    %edi,%eax
shl    $0x4,%eax
lea    (%rax,%rax,2),%ebp
mov    %ebp,%edi
call   10b0 <malloc@plt>
mov    $0x2,%r14d
mov    %rax,0x18(%rsp)
test   %rax,%rax
je     176a <IKinBodyNR+0x58a>
mov    %ebp,%edi
call   10b0 <malloc@plt>
mov    %rax,0x28(%rsp)
test   %rax,%rax
je     1730 <IKinBodyNR+0x550>
mov    0x50(%rsp),%rbx
lea    0x0(,%rbx,8),%edi
call   10b0 <malloc@plt>
test   %rax,%rax
je     1737 <IKinBodyNR+0x557>
mov    %rax,%r15
mov    0x2f0(%rsp),%r12
movl   $0x1,0x10(%rsp)
mov    %r13,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <MatrixCopy@plt>
lea    0x230(%rsp),%r13
mov    0x38(%rsp),%rdi
mov    %ebx,%esi
mov    0x20(%rsp),%rdx
mov    %r12,%rcx
mov    %r13,%r8
call   1090 <FKinBody@plt>
mov    %rbx,%r14
lea    0x1b0(%rsp),%rbp
mov    %r13,%rdi
mov    %rbp,%rsi
call   10c0 <TransInv@plt>
lea    0x130(%rsp),%r13
mov    %rbp,%rdi
mov    0x40(%rsp),%rsi
mov    %r13,%rdx
call   1050 <Matrix4Mult@plt>
lea    0xb0(%rsp),%rbp
mov    %r13,%rdi
mov    %rbp,%rsi
call   10f0 <MatrixLog6@plt>
lea    0x80(%rsp),%r13
mov    %rbp,%rdi
mov    %r13,%rsi
call   1080 <se3ToVec@plt>
mov    $0x3,%edi
mov    %r13,%rsi
call   10d0 <VecNorm2@plt>
ucomisd 0x48(%rsp),%xmm0
ja     1339 <IKinBodyNR+0x159>
lea    0x98(%rsp),%rsi
mov    $0x3,%edi
call   10d0 <VecNorm2@plt>
xor    %eax,%eax
ucomisd 0x30(%rsp),%xmm0
seta   %al
mov    %eax,0x10(%rsp)
lea    0xcc8(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14d,%ebx
test   %r14d,%r14d
jle    1379 <IKinBodyNR+0x199>
xor    %ebp,%ebp
lea    0xcca(%rip),%r13
nopw   0x0(%rax,%rax,1)
movsd  (%r12,%rbp,8),%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1360 <IKinBodyNR+0x180>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x10(%rsp),%r14d
test   %r14d,%r14d
je     174e <IKinBodyNR+0x56e>
cmpl   $0x0,0x14(%rsp)
jle    174e <IKinBodyNR+0x56e>
lea    (%r12,%rbx,8),%rax
lea    (%r15,%rbx,8),%rcx
mov    %ebx,%edx
and    $0xfffffffc,%edx
mov    %rdx,0x70(%rsp)
add    $0xfffffffffffffffc,%rdx
mov    %rdx,0x68(%rsp)
shr    $0x2,%rdx
add    $0x1,%rdx
cmp    %r12,%rcx
seta   %cl
cmp    %rax,%r15
setb   %al
and    %cl,%al
mov    %al,0xf(%rsp)
mov    %rdx,%rax
mov    %rdx,0x60(%rsp)
and    $0xfffffffffffffffe,%rdx
mov    %rdx,0x58(%rsp)
mov    %ebx,%eax
and    $0x3,%eax
mov    %rax,0x78(%rsp)
xor    %r13d,%r13d
mov    0x20(%rsp),%rsi
jmp    1423 <IKinBodyNR+0x243>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1040 <putchar@plt>
cmp    0x14(%rsp),%r13d
setl   %al
mov    0x10(%rsp),%cl
test   %al,%cl
mov    0x20(%rsp),%rsi
je     1748 <IKinBodyNR+0x568>
mov    %r13d,0x10(%rsp)
mov    0x50(%rsp),%r13
mov    %r13d,%edi
mov    %r12,%rdx
mov    0x18(%rsp),%rbp
mov    %rbp,%rcx
call   10e0 <JacobianBody@plt>
mov    %rbp,%rdi
mov    $0x6,%esi
mov    %r13d,%edx
movsd  0xbad(%rip),%xmm0
mov    0x28(%rsp),%rbp
mov    %rbp,%rcx
call   1100 <MatrixPinv@plt>
mov    %rbp,%rdi
mov    %r13d,%esi
mov    $0x6,%edx
lea    0x80(%rsp),%rcx
mov    $0x1,%r8d
mov    %r15,%r9
call   10a0 <MatrixMult@plt>
test   %r13d,%r13d
jle    161a <IKinBodyNR+0x43a>
cmp    $0x4,%r13d
setb   %al
or     0xf(%rsp),%al
je     14a0 <IKinBodyNR+0x2c0>
xor    %eax,%eax
jmp    1572 <IKinBodyNR+0x392>
xchg   %ax,%ax
cmpq   $0x0,0x68(%rsp)
je     171e <IKinBodyNR+0x53e>
mov    0x58(%rsp),%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd (%r15,%rax,8),%xmm0
movupd 0x10(%r15,%rax,8),%xmm1
movupd (%r12,%rax,8),%xmm2
addpd  %xmm0,%xmm2
movupd 0x10(%r12,%rax,8),%xmm0
addpd  %xmm1,%xmm0
movupd 0x20(%r12,%rax,8),%xmm1
movupd 0x30(%r12,%rax,8),%xmm3
movupd %xmm2,(%r12,%rax,8)
movupd %xmm0,0x10(%r12,%rax,8)
movupd 0x20(%r15,%rax,8),%xmm0
addpd  %xmm1,%xmm0
movupd 0x30(%r15,%rax,8),%xmm1
addpd  %xmm3,%xmm1
movupd %xmm0,0x20(%r12,%rax,8)
movupd %xmm1,0x30(%r12,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%rcx
jne    14c0 <IKinBodyNR+0x2e0>
testb  $0x1,0x60(%rsp)
je     1561 <IKinBodyNR+0x381>
movupd (%r12,%rax,8),%xmm0
movupd 0x10(%r12,%rax,8),%xmm1
movupd (%r15,%rax,8),%xmm2
addpd  %xmm0,%xmm2
movupd 0x10(%r15,%rax,8),%xmm0
addpd  %xmm1,%xmm0
movupd %xmm2,(%r12,%rax,8)
movupd %xmm0,0x10(%r12,%rax,8)
mov    0x70(%rsp),%rcx
mov    %rcx,%rax
cmp    %rbx,%rcx
je     161a <IKinBodyNR+0x43a>
mov    %rax,%rcx
not    %rcx
add    %rbx,%rcx
mov    0x78(%rsp),%rdx
test   %rdx,%rdx
je     15ac <IKinBodyNR+0x3cc>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r12,%rax,8),%xmm0
addsd  (%r15,%rax,8),%xmm0
movsd  %xmm0,(%r12,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1590 <IKinBodyNR+0x3b0>
cmp    $0x3,%rcx
jb     161a <IKinBodyNR+0x43a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%r12,%rax,8),%xmm0
addsd  (%r15,%rax,8),%xmm0
movsd  0x8(%r12,%rax,8),%xmm1
movsd  %xmm0,(%r12,%rax,8)
addsd  0x8(%r15,%rax,8),%xmm1
movsd  %xmm1,0x8(%r12,%rax,8)
movsd  0x10(%r12,%rax,8),%xmm0
addsd  0x10(%r15,%rax,8),%xmm0
movsd  %xmm0,0x10(%r12,%rax,8)
movsd  0x18(%r12,%rax,8),%xmm0
addsd  0x18(%r15,%rax,8),%xmm0
movsd  %xmm0,0x18(%r12,%rax,8)
add    $0x4,%rax
cmp    %rax,%rbx
jne    15c0 <IKinBodyNR+0x3e0>
mov    0x10(%rsp),%r14d
add    $0x1,%r14d
mov    0x38(%rsp),%rdi
mov    %r13d,%esi
mov    0x20(%rsp),%rdx
mov    %r12,%rcx
lea    0x230(%rsp),%rbp
mov    %rbp,%r8
call   1090 <FKinBody@plt>
mov    %rbp,%rdi
lea    0x1b0(%rsp),%rbp
mov    %rbp,%rsi
call   10c0 <TransInv@plt>
mov    %rbp,%rdi
mov    0x40(%rsp),%rsi
lea    0x130(%rsp),%rbp
mov    %rbp,%rdx
call   1050 <Matrix4Mult@plt>
mov    %rbp,%rdi
lea    0xb0(%rsp),%rbp
mov    %rbp,%rsi
call   10f0 <MatrixLog6@plt>
mov    %rbp,%rdi
lea    0x80(%rsp),%rbp
mov    %rbp,%rsi
call   1080 <se3ToVec@plt>
mov    $0x3,%edi
mov    %rbp,%rsi
call   10d0 <VecNorm2@plt>
mov    %r13,%rbp
mov    $0x1,%al
ucomisd 0x48(%rsp),%xmm0
ja     16c9 <IKinBodyNR+0x4e9>
mov    $0x3,%edi
lea    0x98(%rsp),%rsi
call   10d0 <VecNorm2@plt>
ucomisd 0x30(%rsp),%xmm0
seta   %al
mov    %al,0x10(%rsp)
lea    0x934(%rip),%rdi
mov    %r14d,%r13d
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
test   %ebp,%ebp
lea    0x93a(%rip),%rbp
jle    1400 <IKinBodyNR+0x220>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%r12,%r14,8),%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
add    $0x1,%r14
cmp    %r14,%rbx
jne    1700 <IKinBodyNR+0x520>
jmp    1400 <IKinBodyNR+0x220>
xor    %eax,%eax
testb  $0x1,0x60(%rsp)
jne    1532 <IKinBodyNR+0x352>
jmp    1561 <IKinBodyNR+0x381>
mov    0x18(%rsp),%rdi
jmp    1765 <IKinBodyNR+0x585>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
jmp    1765 <IKinBodyNR+0x585>
mov    %ecx,%eax
movzbl %cl,%r14d
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14d,%eax
add    $0x2b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"iteration:%4d thetalist: \00"
@.str.1 = [8 x i8] c"%4.6lf\09\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @IKinBodyNR(i32 %0, double* %1, [4 x double]* %2, [4 x double]* %3, double* %4, double %5, double %6, i32 %7, double* %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca [4 x double]*
%14 = alloca [4 x double]*
%15 = alloca double*
%16 = alloca double
%17 = alloca double
%18 = alloca i32
%19 = alloca double*
%20 = alloca i32
%21 = alloca i32
%22 = alloca [4 x [4 x double]]
%23 = alloca [4 x [4 x double]]
%24 = alloca [4 x [4 x double]]
%25 = alloca [4 x [4 x double]]
%26 = alloca [6 x double]
%27 = alloca i32
%28 = alloca double*
%29 = alloca double*
%30 = alloca double*
%31 = alloca i32
store i32 %0, i32* %11
store double* %1, double** %12
store [4 x double]* %2, [4 x double]** %13
store [4 x double]* %3, [4 x double]** %14
store double* %4, double** %15
store double %5, double* %16
store double %6, double* %17
store i32 %7, i32* %18
store double* %8, double** %19
%32 = load i32, i32* %11
%33 = mul nsw i32 %32, 6
%34 = sext i32 %33 to i64
%35 = mul i64 %34, 8
%36 = trunc i64 %35 to i32
%37 = call i64 @malloc(i32 %36)
%38 = inttoptr i64 %37 to double*
store double* %38, double** %28
%39 = load double*, double** %28
%40 = icmp eq double* %39, null
br i1 %40, label %41, label %42
41: ; preds = %9
store i32 2, i32* %10
br label %250
42: ; preds = %9
%43 = load i32, i32* %11
%44 = mul nsw i32 %43, 6
%45 = sext i32 %44 to i64
%46 = mul i64 %45, 8
%47 = trunc i64 %46 to i32
%48 = call i64 @malloc(i32 %47)
%49 = inttoptr i64 %48 to double*
store double* %49, double** %29
%50 = load double*, double** %29
%51 = icmp eq double* %50, null
br i1 %51, label %52, label %55
52: ; preds = %42
%53 = load double*, double** %28
%54 = call i32 @free(double* %53)
store i32 2, i32* %10
br label %250
55: ; preds = %42
%56 = load i32, i32* %11
%57 = sext i32 %56 to i64
%58 = mul i64 %57, 8
%59 = trunc i64 %58 to i32
%60 = call i64 @malloc(i32 %59)
%61 = inttoptr i64 %60 to double*
store double* %61, double** %30
%62 = load double*, double** %30
%63 = icmp eq double* %62, null
br i1 %63, label %64, label %69
64: ; preds = %55
%65 = load double*, double** %28
%66 = call i32 @free(double* %65)
%67 = load double*, double** %29
%68 = call i32 @free(double* %67)
store i32 2, i32* %10
br label %250
69: ; preds = %55
%70 = load double*, double** %15
%71 = load i32, i32* %11
%72 = load double*, double** %19
%73 = call i32 @MatrixCopy(double* %70, i32 %71, i32 1, double* %72)
%74 = load [4 x double]*, [4 x double]** %13
%75 = bitcast [4 x double]* %74 to double**
%76 = load i32, i32* %11
%77 = load double*, double** %12
%78 = load double*, double** %19
%79 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %22, i64 0, i64 0
%80 = bitcast [4 x double]* %79 to double**
%81 = call i32 @FKinBody(double** %75, i32 %76, double* %77, double* %78, double** %80)
%82 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %22, i64 0, i64 0
%83 = bitcast [4 x double]* %82 to double**
%84 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %23, i64 0, i64 0
%85 = bitcast [4 x double]* %84 to double**
%86 = call i32 @TransInv(double** %83, double** %85)
%87 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %23, i64 0, i64 0
%88 = bitcast [4 x double]* %87 to double**
%89 = load [4 x double]*, [4 x double]** %14
%90 = bitcast [4 x double]* %89 to double**
%91 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %24, i64 0, i64 0
%92 = bitcast [4 x double]* %91 to double**
%93 = call i32 @Matrix4Mult(double** %88, double** %90, double** %92)
%94 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %24, i64 0, i64 0
%95 = bitcast [4 x double]* %94 to double**
%96 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %25, i64 0, i64 0
%97 = bitcast [4 x double]* %96 to double**
%98 = call i32 @MatrixLog6(double** %95, double** %97)
%99 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %25, i64 0, i64 0
%100 = bitcast [4 x double]* %99 to double**
%101 = getelementptr inbounds [6 x double], [6 x double]* %26, i64 0, i64 0
%102 = call i32 @se3ToVec(double** %100, double* %101)
%103 = getelementptr inbounds [6 x double], [6 x double]* %26, i64 0, i64 0
%104 = call double @VecNorm2(i32 3, double* %103)
%105 = load double, double* %16
%106 = fcmp ogt double %104, %105
br i1 %106, label %112, label %107
107: ; preds = %69
%108 = getelementptr inbounds [6 x double], [6 x double]* %26, i64 0, i64 3
%109 = call double @VecNorm2(i32 3, double* %108)
%110 = load double, double* %17
%111 = fcmp ogt double %109, %110
br label %112
112: ; preds = %107, %69
%113 = phi i1 [ true, %69 ], [ %111, %107 ]
%114 = zext i1 %113 to i32
store i32 %114, i32* %27
store i32 0, i32* %20
%115 = load i32, i32* %20
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %115)
store i32 0, i32* %31
br label %117
117: ; preds = %128, %112
%118 = load i32, i32* %31
%119 = load i32, i32* %11
%120 = icmp slt i32 %118, %119
br i1 %120, label %121, label %131
121: ; preds = %117
%122 = load double*, double** %19
%123 = load i32, i32* %31
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds double, double* %122, i64 %124
%126 = load double, double* %125
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %126)
br label %128
128: ; preds = %121
%129 = load i32, i32* %31
%130 = add nsw i32 %129, 1
store i32 %130, i32* %31
br label %117
131: ; preds = %117
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %133
133: ; preds = %240, %131
%134 = load i32, i32* %27
%135 = icmp ne i32 %134, 0
br i1 %135, label %136, label %140
136: ; preds = %133
%137 = load i32, i32* %20
%138 = load i32, i32* %18
%139 = icmp slt i32 %137, %138
br label %140
140: ; preds = %136, %133
%141 = phi i1 [ false, %133 ], [ %139, %136 ]
br i1 %141, label %142, label %242
142: ; preds = %140
%143 = load i32, i32* %11
%144 = load double*, double** %12
%145 = load double*, double** %19
%146 = load double*, double** %28
%147 = call i32 @JacobianBody(i32 %143, double* %144, double* %145, double* %146)
%148 = load double*, double** %28
%149 = load i32, i32* %11
%150 = load double*, double** %29
%151 = call i32 @MatrixPinv(double* %148, i32 6, i32 %149, double 2.200000e-15, double* %150)
%152 = load double*, double** %29
%153 = load i32, i32* %11
%154 = getelementptr inbounds [6 x double], [6 x double]* %26, i64 0, i64 0
%155 = load double*, double** %30
%156 = call i32 @MatrixMult(double* %152, i32 %153, i32 6, double* %154, i32 1, double* %155)
store i32 0, i32* %21
br label %157
157: ; preds = %177, %142
%158 = load i32, i32* %21
%159 = load i32, i32* %11
%160 = icmp slt i32 %158, %159
br i1 %160, label %161, label %180
161: ; preds = %157
%162 = load double*, double** %19
%163 = load i32, i32* %21
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %162, i64 %164
%166 = load double, double* %165
%167 = load double*, double** %30
%168 = load i32, i32* %21
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %167, i64 %169
%171 = load double, double* %170
%172 = fadd double %166, %171
%173 = load double*, double** %19
%174 = load i32, i32* %21
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds double, double* %173, i64 %175
store double %172, double* %176
br label %177
177: ; preds = %161
%178 = load i32, i32* %21
%179 = add nsw i32 %178, 1
store i32 %179, i32* %21
br label %157
180: ; preds = %157
%181 = load i32, i32* %20
%182 = add nsw i32 %181, 1
store i32 %182, i32* %20
%183 = load [4 x double]*, [4 x double]** %13
%184 = bitcast [4 x double]* %183 to double**
%185 = load i32, i32* %11
%186 = load double*, double** %12
%187 = load double*, double** %19
%188 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %22, i64 0, i64 0
%189 = bitcast [4 x double]* %188 to double**
%190 = call i32 @FKinBody(double** %184, i32 %185, double* %186, double* %187, double** %189)
%191 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %22, i64 0, i64 0
%192 = bitcast [4 x double]* %191 to double**
%193 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %23, i64 0, i64 0
%194 = bitcast [4 x double]* %193 to double**
%195 = call i32 @TransInv(double** %192, double** %194)
%196 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %23, i64 0, i64 0
%197 = bitcast [4 x double]* %196 to double**
%198 = load [4 x double]*, [4 x double]** %14
%199 = bitcast [4 x double]* %198 to double**
%200 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %24, i64 0, i64 0
%201 = bitcast [4 x double]* %200 to double**
%202 = call i32 @Matrix4Mult(double** %197, double** %199, double** %201)
%203 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %24, i64 0, i64 0
%204 = bitcast [4 x double]* %203 to double**
%205 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %25, i64 0, i64 0
%206 = bitcast [4 x double]* %205 to double**
%207 = call i32 @MatrixLog6(double** %204, double** %206)
%208 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %25, i64 0, i64 0
%209 = bitcast [4 x double]* %208 to double**
%210 = getelementptr inbounds [6 x double], [6 x double]* %26, i64 0, i64 0
%211 = call i32 @se3ToVec(double** %209, double* %210)
%212 = getelementptr inbounds [6 x double], [6 x double]* %26, i64 0, i64 0
%213 = call double @VecNorm2(i32 3, double* %212)
%214 = load double, double* %16
%215 = fcmp ogt double %213, %214
br i1 %215, label %221, label %216
216: ; preds = %180
%217 = getelementptr inbounds [6 x double], [6 x double]* %26, i64 0, i64 3
%218 = call double @VecNorm2(i32 3, double* %217)
%219 = load double, double* %17
%220 = fcmp ogt double %218, %219
br label %221
221: ; preds = %216, %180
%222 = phi i1 [ true, %180 ], [ %220, %216 ]
%223 = zext i1 %222 to i32
store i32 %223, i32* %27
%224 = load i32, i32* %20
%225 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %224)
store i32 0, i32* %31
br label %226
226: ; preds = %237, %221
%227 = load i32, i32* %31
%228 = load i32, i32* %11
%229 = icmp slt i32 %227, %228
br i1 %229, label %230, label %240
230: ; preds = %226
%231 = load double*, double** %19
%232 = load i32, i32* %31
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds double, double* %231, i64 %233
%235 = load double, double* %234
%236 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %235)
br label %237
237: ; preds = %230
%238 = load i32, i32* %31
%239 = add nsw i32 %238, 1
store i32 %239, i32* %31
br label %226
240: ; preds = %226
%241 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %133
242: ; preds = %140
%243 = load double*, double** %28
%244 = call i32 @free(double* %243)
%245 = load double*, double** %29
%246 = call i32 @free(double* %245)
%247 = load double*, double** %30
%248 = call i32 @free(double* %247)
%249 = load i32, i32* %27
store i32 %249, i32* %10
br label %250
250: ; preds = %242, %64, %52, %41
%251 = load i32, i32* %10
ret i32 %251
}

LLVM IR (-O2):
@.str = [28 x i8] c"iteration:%4d thetalist: \00"
@.str.1 = [8 x i8] c"%4.6lf\09\00"
define i32 @IKinBodyNR(i32 %0, double* %1, [4 x double]* %2, [4 x double]* %3, double* %4, double %5, double %6, i32 %7, double* %8) {
%10 = alloca [4 x [4 x double]]
%11 = alloca [4 x [4 x double]]
%12 = alloca [4 x [4 x double]]
%13 = alloca [4 x [4 x double]]
%14 = alloca [6 x double]
%15 = bitcast [4 x [4 x double]]* %10 to i8*
%16 = bitcast [4 x [4 x double]]* %11 to i8*
%17 = bitcast [4 x [4 x double]]* %12 to i8*
%18 = bitcast [4 x [4 x double]]* %13 to i8*
%19 = bitcast [6 x double]* %14 to i8*
%20 = mul i32 %0, 48
%21 = tail call i64 @malloc(i32 %20)
%22 = inttoptr i64 %21 to double*
%23 = icmp eq i64 %21, 0
br i1 %23, label %246, label %24
24: ; preds = %9
%25 = tail call i64 @malloc(i32 %20)
%26 = inttoptr i64 %25 to double*
%27 = icmp eq i64 %25, 0
br i1 %27, label %28, label %30
28: ; preds = %24
%29 = tail call i32 @free(double* %22)
br label %246
30: ; preds = %24
%31 = shl i32 %0, 3
%32 = tail call i64 @malloc(i32 %31)
%33 = inttoptr i64 %32 to double*
%34 = inttoptr i64 %32 to i8*
%35 = icmp eq i64 %32, 0
br i1 %35, label %36, label %39
36: ; preds = %30
%37 = tail call i32 @free(double* %22)
%38 = tail call i32 @free(double* %26)
br label %246
39: ; preds = %30
%40 = tail call i32 @MatrixCopy(double* %4, i32 %0, i32 1, double* %8)
%41 = bitcast [4 x double]* %2 to double**
%42 = bitcast [4 x [4 x double]]* %10 to double**
%43 = call i32 @FKinBody(double** %41, i32 %0, double* %1, double* %8, double** %42)
%44 = bitcast [4 x [4 x double]]* %11 to double**
%45 = call i32 @TransInv(double** %42, double** %44)
%46 = bitcast [4 x double]* %3 to double**
%47 = bitcast [4 x [4 x double]]* %12 to double**
%48 = call i32 @Matrix4Mult(double** %44, double** %46, double** %47)
%49 = bitcast [4 x [4 x double]]* %13 to double**
%50 = call i32 @MatrixLog6(double** %47, double** %49)
%51 = getelementptr inbounds [6 x double], [6 x double]* %14, i64 0, i64 0
%52 = call i32 @se3ToVec(double** %49, double* %51)
%53 = call double @VecNorm2(i32 3, double* %51)
%54 = fcmp ogt double %53, %5
br i1 %54, label %60, label %55
55: ; preds = %39
%56 = getelementptr inbounds [6 x double], [6 x double]* %14, i64 0, i64 3
%57 = call double @VecNorm2(i32 3, double* %56)
%58 = fcmp ogt double %57, %6
%59 = zext i1 %58 to i32
br label %60
60: ; preds = %55, %39
%61 = phi i32 [ 1, %39 ], [ %59, %55 ]
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 0)
%63 = icmp sgt i32 %0, 0
br i1 %63, label %64, label %73
64: ; preds = %60
%65 = zext i32 %0 to i64
br label %66
66: ; preds = %64, %66
%67 = phi i64 [ 0, %64 ], [ %71, %66 ]
%68 = getelementptr inbounds double, double* %8, i64 %67
%69 = load double, double* %68
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %69)
%71 = add nuw nsw i64 %67, 1
%72 = icmp eq i64 %71, %65
br i1 %72, label %73, label %66
73: ; preds = %66, %60
%74 = call i32 @putchar(i32 10)
%75 = icmp ne i32 %61, 0
%76 = icmp sgt i32 %7, 0
%77 = and i1 %75, %76
br i1 %77, label %78, label %241
78: ; preds = %73
%79 = getelementptr inbounds [6 x double], [6 x double]* %14, i64 0, i64 3
%80 = zext i32 %0 to i64
%81 = zext i32 %0 to i64
%82 = getelementptr double, double* %8, i64 %80
%83 = bitcast double* %82 to i8*
%84 = getelementptr double, double* %33, i64 %80
%85 = and i64 %80, 4294967292
%86 = add nsw i64 %85, -4
%87 = lshr exact i64 %86, 2
%88 = add nuw nsw i64 %87, 1
%89 = icmp ult i32 %0, 4
%90 = icmp ugt double* %84, %8
%91 = icmp ult i8* %34, %83
%92 = and i1 %90, %91
%93 = and i64 %80, 4294967292
%94 = and i64 %88, 1
%95 = icmp eq i64 %86, 0
%96 = and i64 %88, 9223372036854775806
%97 = icmp eq i64 %94, 0
%98 = icmp eq i64 %93, %80
%99 = and i64 %80, 3
%100 = icmp eq i64 %99, 0
br label %101
101: ; preds = %78, %235
%102 = phi i32 [ 0, %78 ], [ %214, %235 ]
%103 = call i32 @JacobianBody(i32 %0, double* %1, double* %8, double* %22)
%104 = call i32 @MatrixPinv(double* %22, i32 6, i32 %0, double 2.200000e-15, double* %26)
%105 = call i32 @MatrixMult(double* %26, i32 %0, i32 6, double* %51, i32 1, double* %33)
br i1 %63, label %106, label %213
106: ; preds = %101
%107 = select i1 %89, i1 true, i1 %92
br i1 %107, label %168, label %108
108: ; preds = %106
br i1 %95, label %148, label %109
109: ; preds = %108, %109
%110 = phi i64 [ %145, %109 ], [ 0, %108 ]
%111 = phi i64 [ %146, %109 ], [ 0, %108 ]
%112 = getelementptr inbounds double, double* %8, i64 %110
%113 = bitcast double* %112 to <2 x double>*
%114 = load <2 x double>, <2 x double>* %113
%115 = getelementptr inbounds double, double* %112, i64 2
%116 = bitcast double* %115 to <2 x double>*
%117 = load <2 x double>, <2 x double>* %116
%118 = getelementptr inbounds double, double* %33, i64 %110
%119 = bitcast double* %118 to <2 x double>*
%120 = load <2 x double>, <2 x double>* %119
%121 = getelementptr inbounds double, double* %118, i64 2
%122 = bitcast double* %121 to <2 x double>*
%123 = load <2 x double>, <2 x double>* %122
%124 = fadd <2 x double> %114, %120
%125 = fadd <2 x double> %117, %123
%126 = bitcast double* %112 to <2 x double>*
store <2 x double> %124, <2 x double>* %126
%127 = bitcast double* %115 to <2 x double>*
store <2 x double> %125, <2 x double>* %127
%128 = or i64 %110, 4
%129 = getelementptr inbounds double, double* %8, i64 %128
%130 = bitcast double* %129 to <2 x double>*
%131 = load <2 x double>, <2 x double>* %130
%132 = getelementptr inbounds double, double* %129, i64 2
%133 = bitcast double* %132 to <2 x double>*
%134 = load <2 x double>, <2 x double>* %133
%135 = getelementptr inbounds double, double* %33, i64 %128
%136 = bitcast double* %135 to <2 x double>*
%137 = load <2 x double>, <2 x double>* %136
%138 = getelementptr inbounds double, double* %135, i64 2
%139 = bitcast double* %138 to <2 x double>*
%140 = load <2 x double>, <2 x double>* %139
%141 = fadd <2 x double> %131, %137
%142 = fadd <2 x double> %134, %140
%143 = bitcast double* %129 to <2 x double>*
store <2 x double> %141, <2 x double>* %143
%144 = bitcast double* %132 to <2 x double>*
store <2 x double> %142, <2 x double>* %144
%145 = add nuw i64 %110, 8
%146 = add i64 %111, 2
%147 = icmp eq i64 %146, %96
br i1 %147, label %148, label %109
148: ; preds = %109, %108
%149 = phi i64 [ 0, %108 ], [ %145, %109 ]
br i1 %97, label %167, label %150
150: ; preds = %148
%151 = getelementptr inbounds double, double* %8, i64 %149
%152 = bitcast double* %151 to <2 x double>*
%153 = load <2 x double>, <2 x double>* %152
%154 = getelementptr inbounds double, double* %151, i64 2
%155 = bitcast double* %154 to <2 x double>*
%156 = load <2 x double>, <2 x double>* %155
%157 = getelementptr inbounds double, double* %33, i64 %149
%158 = bitcast double* %157 to <2 x double>*
%159 = load <2 x double>, <2 x double>* %158
%160 = getelementptr inbounds double, double* %157, i64 2
%161 = bitcast double* %160 to <2 x double>*
%162 = load <2 x double>, <2 x double>* %161
%163 = fadd <2 x double> %153, %159
%164 = fadd <2 x double> %156, %162
%165 = bitcast double* %151 to <2 x double>*
store <2 x double> %163, <2 x double>* %165
%166 = bitcast double* %154 to <2 x double>*
store <2 x double> %164, <2 x double>* %166
br label %167
167: ; preds = %148, %150
br i1 %98, label %213, label %168
168: ; preds = %106, %167
%169 = phi i64 [ 0, %106 ], [ %93, %167 ]
%170 = xor i64 %169, -1
%171 = add nsw i64 %170, %80
br i1 %100, label %183, label %172
172: ; preds = %168, %172
%173 = phi i64 [ %180, %172 ], [ %169, %168 ]
%174 = phi i64 [ %181, %172 ], [ 0, %168 ]
%175 = getelementptr inbounds double, double* %8, i64 %173
%176 = load double, double* %175
%177 = getelementptr inbounds double, double* %33, i64 %173
%178 = load double, double* %177
%179 = fadd double %176, %178
store double %179, double* %175
%180 = add nuw nsw i64 %173, 1
%181 = add i64 %174, 1
%182 = icmp eq i64 %181, %99
br i1 %182, label %183, label %172
183: ; preds = %172, %168
%184 = phi i64 [ %169, %168 ], [ %180, %172 ]
%185 = icmp ult i64 %171, 3
br i1 %185, label %213, label %186
186: ; preds = %183, %186
%187 = phi i64 [ %211, %186 ], [ %184, %183 ]
%188 = getelementptr inbounds double, double* %8, i64 %187
%189 = load double, double* %188
%190 = getelementptr inbounds double, double* %33, i64 %187
%191 = load double, double* %190
%192 = fadd double %189, %191
store double %192, double* %188
%193 = add nuw nsw i64 %187, 1
%194 = getelementptr inbounds double, double* %8, i64 %193
%195 = load double, double* %194
%196 = getelementptr inbounds double, double* %33, i64 %193
%197 = load double, double* %196
%198 = fadd double %195, %197
store double %198, double* %194
%199 = add nuw nsw i64 %187, 2
%200 = getelementptr inbounds double, double* %8, i64 %199
%201 = load double, double* %200
%202 = getelementptr inbounds double, double* %33, i64 %199
%203 = load double, double* %202
%204 = fadd double %201, %203
store double %204, double* %200
%205 = add nuw nsw i64 %187, 3
%206 = getelementptr inbounds double, double* %8, i64 %205
%207 = load double, double* %206
%208 = getelementptr inbounds double, double* %33, i64 %205
%209 = load double, double* %208
%210 = fadd double %207, %209
store double %210, double* %206
%211 = add nuw nsw i64 %187, 4
%212 = icmp eq i64 %211, %80
br i1 %212, label %213, label %186
213: ; preds = %183, %186, %167, %101
%214 = add nuw nsw i32 %102, 1
%215 = call i32 @FKinBody(double** %41, i32 %0, double* %1, double* %8, double** %42)
%216 = call i32 @TransInv(double** %42, double** %44)
%217 = call i32 @Matrix4Mult(double** %44, double** %46, double** %47)
%218 = call i32 @MatrixLog6(double** %47, double** %49)
%219 = call i32 @se3ToVec(double** %49, double* %51)
%220 = call double @VecNorm2(i32 3, double* %51)
%221 = fcmp ogt double %220, %5
br i1 %221, label %225, label %222
222: ; preds = %213
%223 = call double @VecNorm2(i32 3, double* %79)
%224 = fcmp ogt double %223, %6
br label %225
225: ; preds = %222, %213
%226 = phi i1 [ true, %213 ], [ %224, %222 ]
%227 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %214)
br i1 %63, label %228, label %235
228: ; preds = %225, %228
%229 = phi i64 [ %233, %228 ], [ 0, %225 ]
%230 = getelementptr inbounds double, double* %8, i64 %229
%231 = load double, double* %230
%232 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %231)
%233 = add nuw nsw i64 %229, 1
%234 = icmp eq i64 %233, %81
br i1 %234, label %235, label %228
235: ; preds = %228, %225
%236 = call i32 @putchar(i32 10)
%237 = icmp slt i32 %214, %7
%238 = select i1 %226, i1 %237, i1 false
br i1 %238, label %101, label %239
239: ; preds = %235
%240 = zext i1 %226 to i32
br label %241
241: ; preds = %239, %73
%242 = phi i32 [ %61, %73 ], [ %240, %239 ]
%243 = call i32 @free(double* %22)
%244 = call i32 @free(double* %26)
%245 = call i32 @free(double* %33)
br label %246
246: ; preds = %28, %241, %36, %9
%247 = phi i32 [ 2, %9 ], [ 2, %28 ], [ 2, %36 ], [ %242, %241 ]
ret i32 %247
}