// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/kinetic_tnm.c
// Function: Internal_Jacobian
int Internal_Jacobian(// Output:
		      struct Jacobian J,
		      // Input:
		      struct Reference Ref,
		      atom *atoms, int N_atoms,
		      struct axe *axes, int N_axes)
{
  // Jacobian: derivatives with respect to torsions for all atoms
  // (only internal degrees of freedom)
  int i, j, k;
  for(k=0; k<N_axes; k++){
    float *Jacobian_a=J.Jacobian_ar[k]; int jj=0;
    struct axe *axe=axes+k;
    for(i=0; i<Ref.N_ref; i++){
      double *rot,  *shift;
      if((i>=axe->first_kin)&&(i<=axe->last_kin)){
	rot=axe->local_rot;  shift=axe->local_shift;
      }else{
	rot=axe->global_rot; shift=axe->global_shift;
      }
      double *ri=atoms[Ref.atom_num[i]].r;
      double r[3]; for(j=0; j<3; j++)r[j]=ri[j];
      double dk[3]; Vector_product_d(dk, rot, r);
      for(j=0; j<3; j++){
	Jacobian_a[jj]=(dk[j]+shift[j]); jj++;
      }
    }
  }

  return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
leaq 0x58(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x2f3c2
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x158, %rcx, %rcx      # imm = 0x158
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x20(%rbp)
movq -0xa0(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl (%rcx), %eax
jge 0x2f3b2
movl -0x20(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jl 0x2f2d5
movl -0x20(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jg 0x2f2d5
movq -0x40(%rbp), %rax
addq $0xd8, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq $0xc0, %rax
movq %rax, -0x50(%rbp)
jmp 0x2f2f1
movq -0x40(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq $0x90, %rax
movq %rax, -0x50(%rbp)
movq -0xa0(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x28(%rcx), %rcx
movslq -0x20(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x3, -0x24(%rbp)
jge 0x2f342
movq -0x58(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movslq -0x24(%rbp), %rax
movsd %xmm0, -0x70(%rbp,%rax,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2f31a
leaq -0x90(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x14aa0
movl $0x0, -0x24(%rbp)
cmpl $0x3, -0x24(%rbp)
jge 0x2f3a2
movslq -0x24(%rbp), %rax
movsd -0x90(%rbp,%rax,8), %xmm0
movq -0x50(%rbp), %rax
movslq -0x24(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2f35d
jmp 0x2f3a4
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x2f28d
jmp 0x2f3b4
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2f246
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)