#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 */
double get_A(int, int, double *, double const *);
double get_C(double *, double const *);
double get_dA(int, int, int, double const *);
double get_dC(int, int, int, double *, double const *);
double sqrt(double const);
void get_derivative_nac(double *ddnac, double *dnac, const int num_patom,
                        const double *lattice, const double *mass,
                        const double *q, const double *born,
                        const double *dielectric, const double *q_direction,
                        const double factor) {
  int i, j, k, l, m;
  double a, b, c, da, db, dc, volume, mass_sqrt;
  double q_cart[3], rec_lat[9];
  volume = lattice[0] * (lattice[4] * lattice[8] - lattice[5] * lattice[7]) +
           lattice[1] * (lattice[5] * lattice[6] - lattice[3] * lattice[8]) +
           lattice[2] * (lattice[3] * lattice[7] - lattice[4] * lattice[6]);
  rec_lat[0] = (lattice[4] * lattice[8] - lattice[5] * lattice[7]) / volume;
  rec_lat[1] = (lattice[5] * lattice[6] - lattice[3] * lattice[8]) / volume;
  rec_lat[2] = (lattice[3] * lattice[7] - lattice[4] * lattice[6]) / volume;
  rec_lat[3] = (lattice[7] * lattice[2] - lattice[8] * lattice[1]) / volume;
  rec_lat[4] = (lattice[8] * lattice[0] - lattice[6] * lattice[2]) / volume;
  rec_lat[5] = (lattice[6] * lattice[1] - lattice[7] * lattice[0]) / volume;
  rec_lat[6] = (lattice[1] * lattice[5] - lattice[2] * lattice[4]) / volume;
  rec_lat[7] = (lattice[2] * lattice[3] - lattice[0] * lattice[5]) / volume;
  rec_lat[8] = (lattice[0] * lattice[4] - lattice[1] * lattice[3]) / volume;
  for (i = 0; i < 3; i++) {
    q_cart[i] = 0;
    for (j = 0; j < 3; j++) {
      if (q_direction) {
        q_cart[i] += rec_lat[i * 3 + j] * q_direction[j];
      } else {
        q_cart[i] += rec_lat[i * 3 + j] * q[j];
      }
    }
  }
  c = get_C(q_cart, dielectric);
  for (i = 0; i < num_patom; i++) {
    for (j = 0; j < num_patom; j++) {
      mass_sqrt = sqrt(mass[i] * mass[j]);
      for (k = 0; k < 3; k++) {
        for (l = 0; l < 3; l++) {
          a = get_A(i, l, q_cart, born);
          da = get_dA(i, l, k, born);
          for (m = 0; m < 3; m++) {
            b = get_A(j, m, q_cart, born);
            db = get_dA(j, m, k, born);
            dc = get_dC(l, m, k, q_cart, dielectric);
            ddnac[k * num_patom * num_patom * 9 + i * 9 * num_patom + j * 9 +
                  l * 3 + m] =
                (da * b + db * a - a * b * dc / c) / (c * mass_sqrt) * factor;
            if (k == 0) {
              dnac[i * 9 * num_patom + j * 9 + l * 3 + m] =
                  a * b / (c * mass_sqrt) * factor;
            }
          }
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<get_derivative_nac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x40(%rax),%xmm3
mov    -0x20(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x20(%rbp),%rax
mulsd  0x38(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x28(%rax),%xmm3
mov    -0x20(%rbp),%rax
movsd  0x30(%rax),%xmm5
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm4
mov    -0x20(%rbp),%rax
mulsd  0x40(%rax),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x38(%rax),%xmm4
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm3
mov    -0x20(%rbp),%rax
mulsd  0x30(%rax),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x40(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x28(%rax),%xmm1
mov    -0x20(%rbp),%rax
mulsd  0x38(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x30(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x20(%rbp),%rax
mulsd  0x40(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x38(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm1
mov    -0x20(%rbp),%rax
mulsd  0x30(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x40(%rax),%xmm1
mov    -0x20(%rbp),%rax
mulsd  0x8(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  0x40(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x30(%rax),%xmm1
mov    -0x20(%rbp),%rax
mulsd  0x10(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x38(%rax),%xmm1
mov    -0x20(%rbp),%rax
mulsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x28(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x20(%rbp),%rax
mulsd  0x20(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x20(%rbp),%rax
mulsd  0x28(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x20(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x20(%rbp),%rax
mulsd  0x18(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movl   $0x0,-0x3c(%rbp)
cmpl   $0x3,-0x3c(%rbp)
jge    164b <get_derivative_nac+0x4fb>
movslq -0x3c(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
movl   $0x0,-0x40(%rbp)
cmpl   $0x3,-0x40(%rbp)
jge    1638 <get_derivative_nac+0x4e8>
cmpq   $0x0,0x20(%rbp)
je     15e8 <get_derivative_nac+0x498>
imul   $0x3,-0x3c(%rbp),%eax
add    -0x40(%rbp),%eax
cltq
movsd  -0x100(%rbp,%rax,8),%xmm0
ff ff
mov    0x20(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movslq -0x3c(%rbp),%rax
movsd  -0xb0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
jmp    1625 <get_derivative_nac+0x4d5>
imul   $0x3,-0x3c(%rbp),%eax
add    -0x40(%rbp),%eax
cltq
movsd  -0x100(%rbp,%rax,8),%xmm0
ff ff
mov    -0x30(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movslq -0x3c(%rbp),%rax
movsd  -0xb0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
jmp    162a <get_derivative_nac+0x4da>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1591 <get_derivative_nac+0x441>
jmp    163d <get_derivative_nac+0x4ed>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1570 <get_derivative_nac+0x420>
lea    -0xb0(%rbp),%rdi
mov    0x18(%rbp),%rsi
call   1040 <get_C@plt>
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    188b <get_derivative_nac+0x73b>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1878 <get_derivative_nac+0x728>
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x0,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    1865 <get_derivative_nac+0x715>
movl   $0x0,-0x48(%rbp)
cmpl   $0x3,-0x48(%rbp)
jge    1852 <get_derivative_nac+0x702>
mov    -0x3c(%rbp),%edi
mov    -0x48(%rbp),%esi
lea    -0xb0(%rbp),%rdx
mov    0x10(%rbp),%rcx
call   1030 <get_A@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x3c(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    -0x44(%rbp),%edx
mov    0x10(%rbp),%rcx
call   1070 <get_dA@plt>
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x3,-0x4c(%rbp)
jge    183f <get_derivative_nac+0x6ef>
mov    -0x40(%rbp),%edi
mov    -0x4c(%rbp),%esi
lea    -0xb0(%rbp),%rdx
mov    0x10(%rbp),%rcx
call   1030 <get_A@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x40(%rbp),%edi
mov    -0x4c(%rbp),%esi
mov    -0x44(%rbp),%edx
mov    0x10(%rbp),%rcx
call   1070 <get_dA@plt>
movsd  %xmm0,-0x78(%rbp)
mov    -0x48(%rbp),%edi
mov    -0x4c(%rbp),%esi
mov    -0x44(%rbp),%edx
lea    -0xb0(%rbp),%rcx
mov    0x18(%rbp),%r8
call   1060 <get_dC@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  -0x80(%rbp),%xmm1
divsd  -0x68(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  -0x90(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
mulsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
imul   $0x9,%ecx,%ecx
imul   $0x9,-0x3c(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
imul   $0x9,-0x40(%rbp),%edx
add    %edx,%ecx
imul   $0x3,-0x48(%rbp),%edx
add    %edx,%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
cmpl   $0x0,-0x44(%rbp)
jne    182c <get_derivative_nac+0x6dc>
movsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  -0x90(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
mulsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x9,-0x3c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
imul   $0x9,-0x40(%rbp),%edx
add    %edx,%ecx
imul   $0x3,-0x48(%rbp),%edx
add    %edx,%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1831 <get_derivative_nac+0x6e1>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1708 <get_derivative_nac+0x5b8>
jmp    1844 <get_derivative_nac+0x6f4>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    16c5 <get_derivative_nac+0x575>
jmp    1857 <get_derivative_nac+0x707>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    16b4 <get_derivative_nac+0x564>
jmp    186a <get_derivative_nac+0x71a>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    167a <get_derivative_nac+0x52a>
jmp    187d <get_derivative_nac+0x72d>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1667 <get_derivative_nac+0x517>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_derivative_nac>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
movsd  %xmm0,0x30(%rsp)
mov    %r8,0xa8(%rsp)
mov    %edx,%ebp
mov    %rsi,0x60(%rsp)
mov    %rdi,%r14
mov    0xf8(%rsp),%rsi
mov    0x100(%rsp),%rax
movsd  0x20(%rcx),%xmm9
movsd  0x28(%rcx),%xmm11
movsd  (%rcx),%xmm0
movsd  0x8(%rcx),%xmm8
movsd  0x18(%rcx),%xmm13
movsd  0x10(%rcx),%xmm1
movsd  0x30(%rcx),%xmm14
movapd %xmm13,%xmm10
unpcklpd %xmm14,%xmm10
movsd  0x40(%rcx),%xmm5
movapd %xmm11,%xmm2
unpcklpd %xmm5,%xmm2
unpcklpd %xmm1,%xmm5
movapd %xmm5,%xmm3
mulpd  %xmm10,%xmm3
unpcklpd %xmm0,%xmm14
movapd %xmm2,%xmm4
mulpd  %xmm14,%xmm4
subpd  %xmm3,%xmm4
movsd  0x38(%rcx),%xmm12
movapd %xmm0,%xmm3
movapd %xmm9,%xmm7
movapd %xmm8,%xmm6
mulsd  %xmm11,%xmm6
mulsd  %xmm0,%xmm11
mulsd  %xmm9,%xmm0
unpcklpd %xmm12,%xmm9
unpcklpd %xmm8,%xmm12
mulpd  %xmm12,%xmm2
mulpd  %xmm9,%xmm5
subpd  %xmm2,%xmm5
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm7
mulsd  %xmm13,%xmm1
mulsd  %xmm8,%xmm13
mulsd  %xmm4,%xmm8
mulsd  %xmm5,%xmm3
addsd  %xmm8,%xmm3
mulpd  %xmm14,%xmm9
mulpd  %xmm10,%xmm12
subpd  %xmm9,%xmm12
mulsd  %xmm12,%xmm2
addsd  %xmm3,%xmm2
subsd  %xmm7,%xmm6
divsd  %xmm2,%xmm6
subsd  %xmm11,%xmm1
divsd  %xmm2,%xmm1
subsd  %xmm13,%xmm0
divsd  %xmm2,%xmm0
unpcklpd %xmm2,%xmm2
divpd  %xmm2,%xmm5
divpd  %xmm2,%xmm4
divpd  %xmm2,%xmm12
test   %rax,%rax
cmovne %rax,%r9
movsd  (%r9),%xmm2
movsd  0x8(%r9),%xmm3
movsd  0x10(%r9),%xmm7
unpcklpd %xmm2,%xmm2
mulpd  %xmm5,%xmm2
xorpd  %xmm5,%xmm5
addpd  %xmm2,%xmm5
unpcklpd %xmm3,%xmm3
mulpd  %xmm4,%xmm3
addpd  %xmm5,%xmm3
unpcklpd %xmm7,%xmm7
mulpd  %xmm12,%xmm7
addpd  %xmm3,%xmm7
movapd %xmm7,0x80(%rsp)
mulsd  (%r9),%xmm6
xorpd  %xmm2,%xmm2
addsd  %xmm2,%xmm6
mulsd  0x8(%r9),%xmm1
addsd  %xmm6,%xmm1
mulsd  0x10(%r9),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x90(%rsp)
lea    0x80(%rsp),%rdi
call   1040 <get_C@plt>
movsd  %xmm0,0x18(%rsp)
test   %ebp,%ebp
jle    16f1 <get_derivative_nac+0x5a1>
mov    0xf0(%rsp),%r15
lea    0x0(%rbp,%rbp,8),%eax
mov    %eax,0x50(%rsp)
mov    %ebp,%eax
mov    %rax,0x68(%rsp)
addq   $0x10,0x60(%rsp)
imul   %ebp,%ebp
lea    0x0(%rbp,%rbp,8),%eax
mov    %eax,0x58(%rsp)
xor    %eax,%eax
xor    %ecx,%ecx
mov    %rcx,0x20(%rsp)
mov    %r14,0xb0(%rsp)
jmp    1378 <get_derivative_nac+0x228>
nop
mov    0x20(%rsp),%rdx
add    $0x1,%rdx
mov    0xa0(%rsp),%rax
add    0x50(%rsp),%eax
mov    %rdx,%rcx
mov    %rdx,0x20(%rsp)
cmp    0x68(%rsp),%rdx
je     16f1 <get_derivative_nac+0x5a1>
mov    %rax,%rdx
movslq %edx,%rax
mov    0x60(%rsp),%rcx
lea    (%rcx,%rax,8),%rax
mov    %rax,0x70(%rsp)
mov    %rdx,0xa0(%rsp)
mov    %edx,%r14d
xor    %edx,%edx
jmp    13bf <get_derivative_nac+0x26f>
nopl   0x0(%rax,%rax,1)
mov    0x78(%rsp),%rdx
add    $0x1,%rdx
addq   $0x48,0x70(%rsp)
mov    0x54(%rsp),%r14d
add    $0x9,%r14d
cmp    0x68(%rsp),%rdx
je     1350 <get_derivative_nac+0x200>
mov    0xa8(%rsp),%rax
mov    0x20(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  (%rax,%rdx,8),%xmm0
ucomisd 0xc22(%rip),%xmm0
mov    %rdx,0x78(%rsp)
jb     13f0 <get_derivative_nac+0x2a0>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    13f9 <get_derivative_nac+0x2a9>
xchg   %ax,%ax
call   1050 <sqrt@plt>
movapd %xmm0,%xmm1
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm1
xor    %r12d,%r12d
mov    %r14d,0x54(%rsp)
movsd  %xmm1,0x38(%rsp)
jmp    1438 <get_derivative_nac+0x2e8>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r12d
mov    0x5c(%rsp),%r14d
add    0x58(%rsp),%r14d
cmp    $0x3,%r12d
je     13a0 <get_derivative_nac+0x250>
mov    %r14d,0x5c(%rsp)
mov    %r14d,%r13d
mov    0x70(%rsp),%rax
mov    %rax,0x28(%rsp)
xor    %r14d,%r14d
jmp    146c <get_derivative_nac+0x31c>
nop
add    $0x1,%r14
addq   $0x18,0x28(%rsp)
add    $0x3,%r13d
cmp    $0x3,%r14
mov    0xf0(%rsp),%r15
je     1420 <get_derivative_nac+0x2d0>
mov    0x20(%rsp),%rbx
mov    %ebx,%edi
mov    %r14d,%esi
lea    0x80(%rsp),%rbp
mov    %rbp,%rdx
mov    %r15,%rcx
call   1030 <get_A@plt>
movsd  %xmm0,0x48(%rsp)
mov    %ebx,%edi
mov    %r14d,%esi
mov    %r12d,%edx
mov    %r15,%rcx
call   1070 <get_dA@plt>
movsd  %xmm0,0x40(%rsp)
mov    0x78(%rsp),%rbx
mov    %ebx,%edi
xor    %esi,%esi
mov    %rbp,%rdx
mov    %r15,%rcx
call   1030 <get_A@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
xor    %esi,%esi
mov    %r12d,%edx
mov    %r15,%rcx
call   1070 <get_dA@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r14d,%edi
xor    %esi,%esi
mov    %r12d,%edx
mov    %rbp,%rcx
mov    0xf8(%rsp),%r8
call   1060 <get_dC@plt>
movsd  0x10(%rsp),%xmm3
movsd  0x38(%rsp),%xmm2
movsd  0x48(%rsp),%xmm4
movsd  0x8(%rsp),%xmm5
mulsd  %xmm4,%xmm5
movsd  0x40(%rsp),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm5,%xmm1
mulsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
divsd  0x18(%rsp),%xmm0
subsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
movsd  0x30(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movslq %r13d,%rax
mov    %r15,%rbp
mov    0xb0(%rsp),%r15
movsd  %xmm1,(%r15,%rax,8)
test   %r12d,%r12d
jne    1561 <get_derivative_nac+0x411>
divsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
mov    0x28(%rsp),%rax
movsd  %xmm3,-0x10(%rax)
mov    %ebx,%edi
mov    $0x1,%esi
lea    0x80(%rsp),%rdx
mov    %rbp,%rcx
call   1030 <get_A@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
mov    $0x1,%esi
mov    %r12d,%edx
mov    %rbp,%rcx
call   1070 <get_dA@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r14d,%edi
mov    $0x1,%esi
mov    %r12d,%edx
lea    0x80(%rsp),%rcx
mov    0xf8(%rsp),%r8
call   1060 <get_dC@plt>
movsd  0x38(%rsp),%xmm2
lea    0x1(%r13),%eax
movsd  0x48(%rsp),%xmm3
movsd  0x8(%rsp),%xmm5
mulsd  %xmm3,%xmm5
movsd  0x40(%rsp),%xmm1
movsd  0x10(%rsp),%xmm4
mulsd  %xmm4,%xmm1
addsd  %xmm5,%xmm1
mulsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm0
divsd  0x18(%rsp),%xmm0
subsd  %xmm0,%xmm1
movsd  0x30(%rsp),%xmm0
divsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
cltq
movsd  %xmm1,(%r15,%rax,8)
test   %r12d,%r12d
jne    1627 <get_derivative_nac+0x4d7>
movapd %xmm4,%xmm3
divsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
mov    0x28(%rsp),%rax
movsd  %xmm3,-0x8(%rax)
mov    %ebx,%edi
mov    $0x2,%esi
lea    0x80(%rsp),%rdx
mov    %rbp,%rcx
call   1030 <get_A@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
mov    $0x2,%esi
mov    %r12d,%edx
mov    %rbp,%rcx
call   1070 <get_dA@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r14d,%edi
mov    $0x2,%esi
mov    %r12d,%edx
lea    0x80(%rsp),%rcx
mov    0xf8(%rsp),%r8
call   1060 <get_dC@plt>
movsd  0x38(%rsp),%xmm1
lea    0x2(%r13),%eax
movsd  0x48(%rsp),%xmm2
movsd  0x8(%rsp),%xmm5
mulsd  %xmm2,%xmm5
movsd  0x40(%rsp),%xmm3
movsd  0x10(%rsp),%xmm4
mulsd  %xmm4,%xmm3
addsd  %xmm5,%xmm3
mulsd  %xmm4,%xmm2
mulsd  %xmm2,%xmm0
divsd  0x18(%rsp),%xmm0
subsd  %xmm0,%xmm3
movsd  0x30(%rsp),%xmm0
divsd  %xmm1,%xmm3
mulsd  %xmm0,%xmm3
cltq
movsd  %xmm3,(%r15,%rax,8)
test   %r12d,%r12d
jne    1450 <get_derivative_nac+0x300>
divsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
mov    0x28(%rsp),%rax
movsd  %xmm2,(%rax)
jmp    1450 <get_derivative_nac+0x300>
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @get_derivative_nac(double* %0, double* %1, i32 %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8, double %9) {
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca [3 x double]
%35 = alloca [9 x double]
store double* %0, double** %11
store double* %1, double** %12
store i32 %2, i32* %13
store double* %3, double** %14
store double* %4, double** %15
store double* %5, double** %16
store double* %6, double** %17
store double* %7, double** %18
store double* %8, double** %19
store double %9, double* %20
%36 = load double*, double** %14
%37 = getelementptr inbounds double, double* %36, i64 0
%38 = load double, double* %37
%39 = load double*, double** %14
%40 = getelementptr inbounds double, double* %39, i64 4
%41 = load double, double* %40
%42 = load double*, double** %14
%43 = getelementptr inbounds double, double* %42, i64 8
%44 = load double, double* %43
%45 = load double*, double** %14
%46 = getelementptr inbounds double, double* %45, i64 5
%47 = load double, double* %46
%48 = load double*, double** %14
%49 = getelementptr inbounds double, double* %48, i64 7
%50 = load double, double* %49
%51 = fmul double %47, %50
%52 = fneg double %51
%53 = call double @llvm.fmuladd.f64(double %41, double %44, double %52)
%54 = load double*, double** %14
%55 = getelementptr inbounds double, double* %54, i64 1
%56 = load double, double* %55
%57 = load double*, double** %14
%58 = getelementptr inbounds double, double* %57, i64 5
%59 = load double, double* %58
%60 = load double*, double** %14
%61 = getelementptr inbounds double, double* %60, i64 6
%62 = load double, double* %61
%63 = load double*, double** %14
%64 = getelementptr inbounds double, double* %63, i64 3
%65 = load double, double* %64
%66 = load double*, double** %14
%67 = getelementptr inbounds double, double* %66, i64 8
%68 = load double, double* %67
%69 = fmul double %65, %68
%70 = fneg double %69
%71 = call double @llvm.fmuladd.f64(double %59, double %62, double %70)
%72 = fmul double %56, %71
%73 = call double @llvm.fmuladd.f64(double %38, double %53, double %72)
%74 = load double*, double** %14
%75 = getelementptr inbounds double, double* %74, i64 2
%76 = load double, double* %75
%77 = load double*, double** %14
%78 = getelementptr inbounds double, double* %77, i64 3
%79 = load double, double* %78
%80 = load double*, double** %14
%81 = getelementptr inbounds double, double* %80, i64 7
%82 = load double, double* %81
%83 = load double*, double** %14
%84 = getelementptr inbounds double, double* %83, i64 4
%85 = load double, double* %84
%86 = load double*, double** %14
%87 = getelementptr inbounds double, double* %86, i64 6
%88 = load double, double* %87
%89 = fmul double %85, %88
%90 = fneg double %89
%91 = call double @llvm.fmuladd.f64(double %79, double %82, double %90)
%92 = call double @llvm.fmuladd.f64(double %76, double %91, double %73)
store double %92, double* %32
%93 = load double*, double** %14
%94 = getelementptr inbounds double, double* %93, i64 4
%95 = load double, double* %94
%96 = load double*, double** %14
%97 = getelementptr inbounds double, double* %96, i64 8
%98 = load double, double* %97
%99 = load double*, double** %14
%100 = getelementptr inbounds double, double* %99, i64 5
%101 = load double, double* %100
%102 = load double*, double** %14
%103 = getelementptr inbounds double, double* %102, i64 7
%104 = load double, double* %103
%105 = fmul double %101, %104
%106 = fneg double %105
%107 = call double @llvm.fmuladd.f64(double %95, double %98, double %106)
%108 = load double, double* %32
%109 = fdiv double %107, %108
%110 = getelementptr inbounds [9 x double], [9 x double]* %35, i64 0, i64 0
store double %109, double* %110
%111 = load double*, double** %14
%112 = getelementptr inbounds double, double* %111, i64 5
%113 = load double, double* %112
%114 = load double*, double** %14
%115 = getelementptr inbounds double, double* %114, i64 6
%116 = load double, double* %115
%117 = load double*, double** %14
%118 = getelementptr inbounds double, double* %117, i64 3
%119 = load double, double* %118
%120 = load double*, double** %14
%121 = getelementptr inbounds double, double* %120, i64 8
%122 = load double, double* %121
%123 = fmul double %119, %122
%124 = fneg double %123
%125 = call double @llvm.fmuladd.f64(double %113, double %116, double %124)
%126 = load double, double* %32
%127 = fdiv double %125, %126
%128 = getelementptr inbounds [9 x double], [9 x double]* %35, i64 0, i64 1
store double %127, double* %128
%129 = load double*, double** %14
%130 = getelementptr inbounds double, double* %129, i64 3
%131 = load double, double* %130
%132 = load double*, double** %14
%133 = getelementptr inbounds double, double* %132, i64 7
%134 = load double, double* %133
%135 = load double*, double** %14
%136 = getelementptr inbounds double, double* %135, i64 4
%137 = load double, double* %136
%138 = load double*, double** %14
%139 = getelementptr inbounds double, double* %138, i64 6
%140 = load double, double* %139
%141 = fmul double %137, %140
%142 = fneg double %141
%143 = call double @llvm.fmuladd.f64(double %131, double %134, double %142)
%144 = load double, double* %32
%145 = fdiv double %143, %144
%146 = getelementptr inbounds [9 x double], [9 x double]* %35, i64 0, i64 2
store double %145, double* %146
%147 = load double*, double** %14
%148 = getelementptr inbounds double, double* %147, i64 7
%149 = load double, double* %148
%150 = load double*, double** %14
%151 = getelementptr inbounds double, double* %150, i64 2
%152 = load double, double* %151
%153 = load double*, double** %14
%154 = getelementptr inbounds double, double* %153, i64 8
%155 = load double, double* %154
%156 = load double*, double** %14
%157 = getelementptr inbounds double, double* %156, i64 1
%158 = load double, double* %157
%159 = fmul double %155, %158
%160 = fneg double %159
%161 = call double @llvm.fmuladd.f64(double %149, double %152, double %160)
%162 = load double, double* %32
%163 = fdiv double %161, %162
%164 = getelementptr inbounds [9 x double], [9 x double]* %35, i64 0, i64 3
store double %163, double* %164
%165 = load double*, double** %14
%166 = getelementptr inbounds double, double* %165, i64 8
%167 = load double, double* %166
%168 = load double*, double** %14
%169 = getelementptr inbounds double, double* %168, i64 0
%170 = load double, double* %169
%171 = load double*, double** %14
%172 = getelementptr inbounds double, double* %171, i64 6
%173 = load double, double* %172
%174 = load double*, double** %14
%175 = getelementptr inbounds double, double* %174, i64 2
%176 = load double, double* %175
%177 = fmul double %173, %176
%178 = fneg double %177
%179 = call double @llvm.fmuladd.f64(double %167, double %170, double %178)
%180 = load double, double* %32
%181 = fdiv double %179, %180
%182 = getelementptr inbounds [9 x double], [9 x double]* %35, i64 0, i64 4
store double %181, double* %182
%183 = load double*, double** %14
%184 = getelementptr inbounds double, double* %183, i64 6
%185 = load double, double* %184
%186 = load double*, double** %14
%187 = getelementptr inbounds double, double* %186, i64 1
%188 = load double, double* %187
%189 = load double*, double** %14
%190 = getelementptr inbounds double, double* %189, i64 7
%191 = load double, double* %190
%192 = load double*, double** %14
%193 = getelementptr inbounds double, double* %192, i64 0
%194 = load double, double* %193
%195 = fmul double %191, %194
%196 = fneg double %195
%197 = call double @llvm.fmuladd.f64(double %185, double %188, double %196)
%198 = load double, double* %32
%199 = fdiv double %197, %198
%200 = getelementptr inbounds [9 x double], [9 x double]* %35, i64 0, i64 5
store double %199, double* %200
%201 = load double*, double** %14
%202 = getelementptr inbounds double, double* %201, i64 1
%203 = load double, double* %202
%204 = load double*, double** %14
%205 = getelementptr inbounds double, double* %204, i64 5
%206 = load double, double* %205
%207 = load double*, double** %14
%208 = getelementptr inbounds double, double* %207, i64 2
%209 = load double, double* %208
%210 = load double*, double** %14
%211 = getelementptr inbounds double, double* %210, i64 4
%212 = load double, double* %211
%213 = fmul double %209, %212
%214 = fneg double %213
%215 = call double @llvm.fmuladd.f64(double %203, double %206, double %214)
%216 = load double, double* %32
%217 = fdiv double %215, %216
%218 = getelementptr inbounds [9 x double], [9 x double]* %35, i64 0, i64 6
store double %217, double* %218
%219 = load double*, double** %14
%220 = getelementptr inbounds double, double* %219, i64 2
%221 = load double, double* %220
%222 = load double*, double** %14
%223 = getelementptr inbounds double, double* %222, i64 3
%224 = load double, double* %223
%225 = load double*, double** %14
%226 = getelementptr inbounds double, double* %225, i64 0
%227 = load double, double* %226
%228 = load double*, double** %14
%229 = getelementptr inbounds double, double* %228, i64 5
%230 = load double, double* %229
%231 = fmul double %227, %230
%232 = fneg double %231
%233 = call double @llvm.fmuladd.f64(double %221, double %224, double %232)
%234 = load double, double* %32
%235 = fdiv double %233, %234
%236 = getelementptr inbounds [9 x double], [9 x double]* %35, i64 0, i64 7
store double %235, double* %236
%237 = load double*, double** %14
%238 = getelementptr inbounds double, double* %237, i64 0
%239 = load double, double* %238
%240 = load double*, double** %14
%241 = getelementptr inbounds double, double* %240, i64 4
%242 = load double, double* %241
%243 = load double*, double** %14
%244 = getelementptr inbounds double, double* %243, i64 1
%245 = load double, double* %244
%246 = load double*, double** %14
%247 = getelementptr inbounds double, double* %246, i64 3
%248 = load double, double* %247
%249 = fmul double %245, %248
%250 = fneg double %249
%251 = call double @llvm.fmuladd.f64(double %239, double %242, double %250)
%252 = load double, double* %32
%253 = fdiv double %251, %252
%254 = getelementptr inbounds [9 x double], [9 x double]* %35, i64 0, i64 8
store double %253, double* %254
store i32 0, i32* %21
br label %255
255: ; preds = %309, %10
%256 = load i32, i32* %21
%257 = icmp slt i32 %256, 3
br i1 %257, label %258, label %312
258: ; preds = %255
%259 = load i32, i32* %21
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 0, i64 %260
store double 0.000000e+00, double* %261
store i32 0, i32* %22
br label %262
262: ; preds = %305, %258
%263 = load i32, i32* %22
%264 = icmp slt i32 %263, 3
br i1 %264, label %265, label %308
265: ; preds = %262
%266 = load double*, double** %19
%267 = icmp ne double* %266, null
br i1 %267, label %268, label %286
268: ; preds = %265
%269 = load i32, i32* %21
%270 = mul nsw i32 %269, 3
%271 = load i32, i32* %22
%272 = add nsw i32 %270, %271
%273 = sext i32 %272 to i64
%274 = getelementptr inbounds [9 x double], [9 x double]* %35, i64 0, i64 %273
%275 = load double, double* %274
%276 = load double*, double** %19
%277 = load i32, i32* %22
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds double, double* %276, i64 %278
%280 = load double, double* %279
%281 = load i32, i32* %21
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 0, i64 %282
%284 = load double, double* %283
%285 = call double @llvm.fmuladd.f64(double %275, double %280, double %284)
store double %285, double* %283
br label %304
286: ; preds = %265
%287 = load i32, i32* %21
%288 = mul nsw i32 %287, 3
%289 = load i32, i32* %22
%290 = add nsw i32 %288, %289
%291 = sext i32 %290 to i64
%292 = getelementptr inbounds [9 x double], [9 x double]* %35, i64 0, i64 %291
%293 = load double, double* %292
%294 = load double*, double** %16
%295 = load i32, i32* %22
%296 = sext i32 %295 to i64
%297 = getelementptr inbounds double, double* %294, i64 %296
%298 = load double, double* %297
%299 = load i32, i32* %21
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 0, i64 %300
%302 = load double, double* %301
%303 = call double @llvm.fmuladd.f64(double %293, double %298, double %302)
store double %303, double* %301
br label %304
304: ; preds = %286, %268
br label %305
305: ; preds = %304
%306 = load i32, i32* %22
%307 = add nsw i32 %306, 1
store i32 %307, i32* %22
br label %262
308: ; preds = %262
br label %309
309: ; preds = %308
%310 = load i32, i32* %21
%311 = add nsw i32 %310, 1
store i32 %311, i32* %21
br label %255
312: ; preds = %255
%313 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 0, i64 0
%314 = load double*, double** %18
%315 = call double @get_C(double* %313, double* %314)
store double %315, double* %28
store i32 0, i32* %21
br label %316
316: ; preds = %462, %312
%317 = load i32, i32* %21
%318 = load i32, i32* %13
%319 = icmp slt i32 %317, %318
br i1 %319, label %320, label %465
320: ; preds = %316
store i32 0, i32* %22
br label %321
321: ; preds = %458, %320
%322 = load i32, i32* %22
%323 = load i32, i32* %13
%324 = icmp slt i32 %322, %323
br i1 %324, label %325, label %461
325: ; preds = %321
%326 = load double*, double** %15
%327 = load i32, i32* %21
%328 = sext i32 %327 to i64
%329 = getelementptr inbounds double, double* %326, i64 %328
%330 = load double, double* %329
%331 = load double*, double** %15
%332 = load i32, i32* %22
%333 = sext i32 %332 to i64
%334 = getelementptr inbounds double, double* %331, i64 %333
%335 = load double, double* %334
%336 = fmul double %330, %335
%337 = call double @sqrt(double %336)
store double %337, double* %33
store i32 0, i32* %23
br label %338
338: ; preds = %454, %325
%339 = load i32, i32* %23
%340 = icmp slt i32 %339, 3
br i1 %340, label %341, label %457
341: ; preds = %338
store i32 0, i32* %24
br label %342
342: ; preds = %450, %341
%343 = load i32, i32* %24
%344 = icmp slt i32 %343, 3
br i1 %344, label %345, label %453
345: ; preds = %342
%346 = load i32, i32* %21
%347 = load i32, i32* %24
%348 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 0, i64 0
%349 = load double*, double** %17
%350 = call double @get_A(i32 %346, i32 %347, double* %348, double* %349)
store double %350, double* %26
%351 = load i32, i32* %21
%352 = load i32, i32* %24
%353 = load i32, i32* %23
%354 = load double*, double** %17
%355 = call double @get_dA(i32 %351, i32 %352, i32 %353, double* %354)
store double %355, double* %29
store i32 0, i32* %25
br label %356
356: ; preds = %446, %345
%357 = load i32, i32* %25
%358 = icmp slt i32 %357, 3
br i1 %358, label %359, label %449
359: ; preds = %356
%360 = load i32, i32* %22
%361 = load i32, i32* %25
%362 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 0, i64 0
%363 = load double*, double** %17
%364 = call double @get_A(i32 %360, i32 %361, double* %362, double* %363)
store double %364, double* %27
%365 = load i32, i32* %22
%366 = load i32, i32* %25
%367 = load i32, i32* %23
%368 = load double*, double** %17
%369 = call double @get_dA(i32 %365, i32 %366, i32 %367, double* %368)
store double %369, double* %30
%370 = load i32, i32* %24
%371 = load i32, i32* %25
%372 = load i32, i32* %23
%373 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 0, i64 0
%374 = load double*, double** %18
%375 = call double @get_dC(i32 %370, i32 %371, i32 %372, double* %373, double* %374)
store double %375, double* %31
%376 = load double, double* %29
%377 = load double, double* %27
%378 = load double, double* %30
%379 = load double, double* %26
%380 = fmul double %378, %379
%381 = call double @llvm.fmuladd.f64(double %376, double %377, double %380)
%382 = load double, double* %26
%383 = load double, double* %27
%384 = fmul double %382, %383
%385 = load double, double* %31
%386 = fmul double %384, %385
%387 = load double, double* %28
%388 = fdiv double %386, %387
%389 = fsub double %381, %388
%390 = load double, double* %28
%391 = load double, double* %33
%392 = fmul double %390, %391
%393 = fdiv double %389, %392
%394 = load double, double* %20
%395 = fmul double %393, %394
%396 = load double*, double** %11
%397 = load i32, i32* %23
%398 = load i32, i32* %13
%399 = mul nsw i32 %397, %398
%400 = load i32, i32* %13
%401 = mul nsw i32 %399, %400
%402 = mul nsw i32 %401, 9
%403 = load i32, i32* %21
%404 = mul nsw i32 %403, 9
%405 = load i32, i32* %13
%406 = mul nsw i32 %404, %405
%407 = add nsw i32 %402, %406
%408 = load i32, i32* %22
%409 = mul nsw i32 %408, 9
%410 = add nsw i32 %407, %409
%411 = load i32, i32* %24
%412 = mul nsw i32 %411, 3
%413 = add nsw i32 %410, %412
%414 = load i32, i32* %25
%415 = add nsw i32 %413, %414
%416 = sext i32 %415 to i64
%417 = getelementptr inbounds double, double* %396, i64 %416
store double %395, double* %417
%418 = load i32, i32* %23
%419 = icmp eq i32 %418, 0
br i1 %419, label %420, label %445
420: ; preds = %359
%421 = load double, double* %26
%422 = load double, double* %27
%423 = fmul double %421, %422
%424 = load double, double* %28
%425 = load double, double* %33
%426 = fmul double %424, %425
%427 = fdiv double %423, %426
%428 = load double, double* %20
%429 = fmul double %427, %428
%430 = load double*, double** %12
%431 = load i32, i32* %21
%432 = mul nsw i32 %431, 9
%433 = load i32, i32* %13
%434 = mul nsw i32 %432, %433
%435 = load i32, i32* %22
%436 = mul nsw i32 %435, 9
%437 = add nsw i32 %434, %436
%438 = load i32, i32* %24
%439 = mul nsw i32 %438, 3
%440 = add nsw i32 %437, %439
%441 = load i32, i32* %25
%442 = add nsw i32 %440, %441
%443 = sext i32 %442 to i64
%444 = getelementptr inbounds double, double* %430, i64 %443
store double %429, double* %444
br label %445
445: ; preds = %420, %359
br label %446
446: ; preds = %445
%447 = load i32, i32* %25
%448 = add nsw i32 %447, 1
store i32 %448, i32* %25
br label %356
449: ; preds = %356
br label %450
450: ; preds = %449
%451 = load i32, i32* %24
%452 = add nsw i32 %451, 1
store i32 %452, i32* %24
br label %342
453: ; preds = %342
br label %454
454: ; preds = %453
%455 = load i32, i32* %23
%456 = add nsw i32 %455, 1
store i32 %456, i32* %23
br label %338
457: ; preds = %338
br label %458
458: ; preds = %457
%459 = load i32, i32* %22
%460 = add nsw i32 %459, 1
store i32 %460, i32* %22
br label %321
461: ; preds = %321
br label %462
462: ; preds = %461
%463 = load i32, i32* %21
%464 = add nsw i32 %463, 1
store i32 %464, i32* %21
br label %316
465: ; preds = %316
ret void
}

LLVM IR (-O2):
define void @get_derivative_nac(double* nocapture writeonly %0, double* nocapture writeonly %1, i32 %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, double* %6, double* %7, double* %8, double %9) {
%11 = alloca [3 x double]
%12 = bitcast [3 x double]* %11 to i8*
%13 = load double, double* %3
%14 = getelementptr inbounds double, double* %3, i64 4
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %3, i64 8
%17 = load double, double* %16
%18 = getelementptr inbounds double, double* %3, i64 5
%19 = load double, double* %18
%20 = getelementptr inbounds double, double* %3, i64 7
%21 = load double, double* %20
%22 = getelementptr inbounds double, double* %3, i64 1
%23 = load double, double* %22
%24 = getelementptr inbounds double, double* %3, i64 6
%25 = load double, double* %24
%26 = getelementptr inbounds double, double* %3, i64 3
%27 = load double, double* %26
%28 = getelementptr inbounds double, double* %3, i64 2
%29 = load double, double* %28
%30 = insertelement <2 x double> poison, double %27, i64 0
%31 = insertelement <2 x double> %30, double %25, i64 1
%32 = fneg <2 x double> %31
%33 = insertelement <2 x double> poison, double %17, i64 0
%34 = insertelement <2 x double> %33, double %29, i64 1
%35 = fmul <2 x double> %34, %32
%36 = insertelement <2 x double> poison, double %19, i64 0
%37 = insertelement <2 x double> %36, double %17, i64 1
%38 = insertelement <2 x double> poison, double %25, i64 0
%39 = insertelement <2 x double> %38, double %13, i64 1
%40 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %37, <2 x double> %39, <2 x double> %35)
%41 = extractelement <2 x double> %40, i64 0
%42 = fmul double %23, %41
%43 = fneg <2 x double> %37
%44 = insertelement <2 x double> poison, double %21, i64 0
%45 = insertelement <2 x double> %44, double %23, i64 1
%46 = fmul <2 x double> %45, %43
%47 = insertelement <2 x double> poison, double %15, i64 0
%48 = insertelement <2 x double> %47, double %21, i64 1
%49 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %48, <2 x double> %34, <2 x double> %46)
%50 = extractelement <2 x double> %49, i64 0
%51 = tail call double @llvm.fmuladd.f64(double %13, double %50, double %42)
%52 = fneg <2 x double> %48
%53 = fmul <2 x double> %39, %52
%54 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %31, <2 x double> %45, <2 x double> %53)
%55 = extractelement <2 x double> %54, i64 0
%56 = tail call double @llvm.fmuladd.f64(double %29, double %55, double %51)
%57 = insertelement <2 x double> poison, double %56, i64 0
%58 = shufflevector <2 x double> %57, <2 x double> poison, <2 x i32> zeroinitializer
%59 = fdiv <2 x double> %49, %58
%60 = fdiv <2 x double> %40, %58
%61 = fdiv <2 x double> %54, %58
%62 = fneg double %29
%63 = fmul double %15, %62
%64 = tail call double @llvm.fmuladd.f64(double %23, double %19, double %63)
%65 = fdiv double %64, %56
%66 = fneg double %13
%67 = fmul double %19, %66
%68 = tail call double @llvm.fmuladd.f64(double %29, double %27, double %67)
%69 = fdiv double %68, %56
%70 = fneg double %23
%71 = fmul double %27, %70
%72 = tail call double @llvm.fmuladd.f64(double %13, double %15, double %71)
%73 = fdiv double %72, %56
%74 = icmp eq double* %8, null
%75 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%76 = select i1 %74, double* %5, double* %8
%77 = load double, double* %76
%78 = getelementptr inbounds double, double* %76, i64 1
%79 = load double, double* %78
%80 = getelementptr inbounds double, double* %76, i64 2
%81 = load double, double* %80
%82 = insertelement <2 x double> poison, double %77, i64 0
%83 = shufflevector <2 x double> %82, <2 x double> poison, <2 x i32> zeroinitializer
%84 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %59, <2 x double> %83, <2 x double> zeroinitializer)
%85 = getelementptr inbounds double, double* %76, i64 1
%86 = load double, double* %85
%87 = insertelement <2 x double> poison, double %79, i64 0
%88 = insertelement <2 x double> %87, double %86, i64 1
%89 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %60, <2 x double> %88, <2 x double> %84)
%90 = getelementptr inbounds double, double* %76, i64 2
%91 = load double, double* %90
%92 = insertelement <2 x double> poison, double %81, i64 0
%93 = insertelement <2 x double> %92, double %91, i64 1
%94 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %61, <2 x double> %93, <2 x double> %89)
%95 = bitcast [3 x double]* %11 to <2 x double>*
store <2 x double> %94, <2 x double>* %95
%96 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 2
%97 = load double, double* %76
%98 = tail call double @llvm.fmuladd.f64(double %65, double %97, double 0.000000e+00)
%99 = getelementptr inbounds double, double* %76, i64 1
%100 = load double, double* %99
%101 = tail call double @llvm.fmuladd.f64(double %69, double %100, double %98)
%102 = getelementptr inbounds double, double* %76, i64 2
%103 = load double, double* %102
%104 = tail call double @llvm.fmuladd.f64(double %73, double %103, double %101)
store double %104, double* %96
%105 = call double @get_C(double* %75, double* %7)
%106 = icmp sgt i32 %2, 0
br i1 %106, label %107, label %213
107: ; preds = %10
%108 = mul i32 %2, 9
%109 = mul i32 %108, %2
%110 = zext i32 %2 to i64
br label %111
111: ; preds = %210, %107
%112 = phi i64 [ 0, %107 ], [ %211, %210 ]
%113 = getelementptr inbounds double, double* %4, i64 %112
%114 = trunc i64 %112 to i32
%115 = mul i32 %108, %114
%116 = sext i32 %115 to i64
br label %117
117: ; preds = %111, %207
%118 = phi i64 [ 0, %111 ], [ %208, %207 ]
%119 = load double, double* %113
%120 = getelementptr inbounds double, double* %4, i64 %118
%121 = load double, double* %120
%122 = fmul double %119, %121
%123 = call double @sqrt(double %122)
%124 = fmul double %105, %123
%125 = mul nuw nsw i64 %118, 9
%126 = trunc i64 %125 to i32
%127 = add i32 %115, %126
%128 = add nsw i64 %125, %116
%129 = trunc i64 %118 to i32
br label %130
130: ; preds = %117, %204
%131 = phi i32 [ 0, %117 ], [ %205, %204 ]
%132 = mul i32 %109, %131
%133 = add i32 %127, %132
%134 = icmp eq i32 %131, 0
br label %135
135: ; preds = %130, %201
%136 = phi i64 [ 0, %130 ], [ %202, %201 ]
%137 = trunc i64 %136 to i32
%138 = call double @get_A(i32 %114, i32 %137, double* %75, double* %6)
%139 = call double @get_dA(i32 %114, i32 %137, i32 %131, double* %6)
%140 = mul nuw nsw i64 %136, 3
%141 = trunc i64 %140 to i32
%142 = add i32 %133, %141
%143 = add nsw i64 %128, %140
%144 = call double @get_A(i32 %129, i32 0, double* %75, double* %6)
%145 = call double @get_dA(i32 %129, i32 0, i32 %131, double* %6)
%146 = call double @get_dC(i32 %137, i32 0, i32 %131, double* %75, double* %7)
%147 = fmul double %138, %145
%148 = call double @llvm.fmuladd.f64(double %139, double %144, double %147)
%149 = fmul double %138, %144
%150 = fmul double %149, %146
%151 = fdiv double %150, %105
%152 = fsub double %148, %151
%153 = fdiv double %152, %124
%154 = fmul double %153, %9
%155 = sext i32 %142 to i64
%156 = getelementptr inbounds double, double* %0, i64 %155
store double %154, double* %156
br i1 %134, label %157, label %161
157: ; preds = %135
%158 = fdiv double %149, %124
%159 = fmul double %158, %9
%160 = getelementptr inbounds double, double* %1, i64 %143
store double %159, double* %160
br label %161
161: ; preds = %135, %157
%162 = call double @get_A(i32 %129, i32 1, double* %75, double* %6)
%163 = call double @get_dA(i32 %129, i32 1, i32 %131, double* %6)
%164 = call double @get_dC(i32 %137, i32 1, i32 %131, double* %75, double* %7)
%165 = fmul double %138, %163
%166 = call double @llvm.fmuladd.f64(double %139, double %162, double %165)
%167 = fmul double %138, %162
%168 = fmul double %167, %164
%169 = fdiv double %168, %105
%170 = fsub double %166, %169
%171 = fdiv double %170, %124
%172 = fmul double %171, %9
%173 = add i32 %142, 1
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds double, double* %0, i64 %174
store double %172, double* %175
br i1 %134, label %176, label %181
176: ; preds = %161
%177 = fdiv double %167, %124
%178 = fmul double %177, %9
%179 = add nsw i64 %143, 1
%180 = getelementptr inbounds double, double* %1, i64 %179
store double %178, double* %180
br label %181
181: ; preds = %176, %161
%182 = call double @get_A(i32 %129, i32 2, double* %75, double* %6)
%183 = call double @get_dA(i32 %129, i32 2, i32 %131, double* %6)
%184 = call double @get_dC(i32 %137, i32 2, i32 %131, double* %75, double* %7)
%185 = fmul double %138, %183
%186 = call double @llvm.fmuladd.f64(double %139, double %182, double %185)
%187 = fmul double %138, %182
%188 = fmul double %187, %184
%189 = fdiv double %188, %105
%190 = fsub double %186, %189
%191 = fdiv double %190, %124
%192 = fmul double %191, %9
%193 = add i32 %142, 2
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds double, double* %0, i64 %194
store double %192, double* %195
br i1 %134, label %196, label %201
196: ; preds = %181
%197 = fdiv double %187, %124
%198 = fmul double %197, %9
%199 = add nsw i64 %143, 2
%200 = getelementptr inbounds double, double* %1, i64 %199
store double %198, double* %200
br label %201
201: ; preds = %196, %181
%202 = add nuw nsw i64 %136, 1
%203 = icmp eq i64 %202, 3
br i1 %203, label %204, label %135
204: ; preds = %201
%205 = add nuw nsw i32 %131, 1
%206 = icmp eq i32 %205, 3
br i1 %206, label %207, label %130
207: ; preds = %204
%208 = add nuw nsw i64 %118, 1
%209 = icmp eq i64 %208, %110
br i1 %209, label %210, label %117
210: ; preds = %207
%211 = add nuw nsw i64 %112, 1
%212 = icmp eq i64 %211, %110
br i1 %212, label %213, label %111
213: ; preds = %210, %10
ret void
}