LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/ExternalModules/json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>::iter_impl<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer> const>::operator++()
iter_impl& operator++()
        {
            assert(m_object != nullptr);

            switch (m_object->m_type)
            {
                case basic_json::value_t::object:
                {
                    std::advance(m_it.object_iterator, 1);
                    break;
                }

                case basic_json::value_t::array:
                {
                    std::advance(m_it.array_iterator, 1);
                    break;
                }

                default:
                {
                    ++m_it.primitive_iterator;
                    break;
                }
            }

            return *this;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq (%rdi), %rax
testq %rax, %rax
je 0x11fa7
movq %rdi, %rbx
movzbl (%rax), %eax
cmpl $0x2, %eax
je 0x11f84
cmpl $0x1, %eax
jne 0x11f94
leaq 0x8(%rbx), %rdi
movl $0x1, %esi
callq 0x140b3
jmp 0x11f9d
leaq 0x10(%rbx), %rdi
movl $0x1, %esi
callq 0x140d4
jmp 0x11f9d
leaq 0x18(%rbx), %rdi
callq 0x140f6
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x11962(%rip), %rdi     # 0x23910
leaq 0x10240(%rip), %rsi     # 0x221f5
leaq 0x12406(%rip), %rcx     # 0x243c2
movl $0x2391, %edx           # imm = 0x2391
callq 0x4210
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/ExternalModules/json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>::iter_impl<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer> const>::set_begin()
void set_begin() noexcept
        {
            assert(m_object != nullptr);

            switch (m_object->m_type)
            {
                case basic_json::value_t::object:
                {
                    m_it.object_iterator = m_object->m_value.object->begin();
                    break;
                }

                case basic_json::value_t::array:
                {
                    m_it.array_iterator = m_object->m_value.array->begin();
                    break;
                }

                case basic_json::value_t::null:
                {
                    // set to end so begin()==end() is true: null is empty
                    m_it.primitive_iterator.set_end();
                    break;
                }

                default:
                {
                    m_it.primitive_iterator.set_begin();
                    break;
                }
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq (%rdi), %rax
testq %rax, %rax
je 0x14285
movq %rdi, %rbx
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x14261
cmpl $0x2, %ecx
je 0x1424d
cmpl $0x1, %ecx
jne 0x14273
movq 0x8(%rax), %rdi
callq 0x142a4
movq %rax, 0x8(%rbx)
jmp 0x1425a
movq 0x8(%rax), %rdi
callq 0xaa16
movq %rax, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
addq $0x18, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe81a
addq $0x18, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x142ae
leaq 0xf684(%rip), %rdi      # 0x23910
leaq 0xdf62(%rip), %rsi      # 0x221f5
leaq 0x10438(%rip), %rcx     # 0x246d2
movl $0x22f9, %edx           # imm = 0x22F9
callq 0x4210
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/Spline/BilinearSpline.cpp
// Function: atomicpp::BilinearSpline::BilinearSpline(std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&, std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&)
BilinearSpline::BilinearSpline(
	std::vector<double>& _x_values,
	std::vector<double>& _y_values,
	std::vector< std::vector<double> > & _z_values
	){
	x_values = _x_values;
	y_values = _y_values;
	z_values = _z_values;

	//Doesn't require initialisation
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, -0x30(%rbp)
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
callq 0x127b6
leaq 0x18(%rbx), %r14
movq %r14, %rdi
callq 0x127b6
leaq 0x30(%rbx), %r12
movq %r12, %rdi
callq 0x120c0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1599a
movq %r14, %rdi
movq %r13, %rsi
callq 0x1599a
movq %r12, %rdi
movq -0x30(%rbp), %rsi
callq 0x15b00
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq %r12, %rdi
callq 0x1048a
movq %r14, %rdi
callq 0x53c6
movq %rbx, %rdi
callq 0x53c6
movq %r15, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/Spline/BilinearSpline.cpp
// Function: atomicpp::BilinearSpline::call0D_shared(std::pair<int, double>, std::pair<int, double>)
double BilinearSpline::call0D_shared(const std::pair<int, double> x_interp, const std::pair<int, double> y_interp){

	int low_x = x_interp.first;
	int low_y = y_interp.first;

	double x = x_interp.second;
	double y = y_interp.second;

	// // Construct the simple interpolation grid
	// // Find weightings based on linear distance
	// // w01 ------ w11    y
	// //  | \     / |      |
	// //  |  w(x,y) |    --/--x
	// //  | /     \ |      |
	// // w00 ------ w10

	double eval_coeff =
	 (z_values[low_x+0][low_y+0]*(1-y) + z_values[low_x+0][low_y+1]*y)*(1-x)
	+(z_values[low_x+1][low_y+0]*(1-y) + z_values[low_x+1][low_y+1]*y)*x;

	return eval_coeff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movsd %xmm1, -0x38(%rbp)
movl %edx, %r14d
movsd %xmm0, -0x40(%rbp)
movq %rdi, %rbx
addq $0x30, %rbx
movslq %esi, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x15cb4
movslq %r14d, %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x539c
movsd 0xc823(%rip), %xmm0     # 0x22008
subsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd (%rax), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x28(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x15cb4
leal 0x1(%r14), %ecx
movslq %ecx, %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x539c
movsd (%rax), %xmm0
mulsd -0x38(%rbp), %xmm0
addsd -0x28(%rbp), %xmm0
movsd 0xc7d9(%rip), %xmm1     # 0x22008
subsd -0x40(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x28(%rbp)
incl %r15d
movslq %r15d, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x15cb4
movq %rax, %rdi
movq %r14, %rsi
callq 0x539c
movsd -0x30(%rbp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x15cb4
movq %rax, %rdi
movq %r12, %rsi
callq 0x539c
movsd -0x38(%rbp), %xmm0
mulsd (%rax), %xmm0
addsd -0x30(%rbp), %xmm0
mulsd -0x40(%rbp), %xmm0
addsd -0x28(%rbp), %xmm0
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/Spline/BicubicSpline.cpp
// Function: atomicpp::BicubicSpline::call0D_shared(std::pair<int, double>, std::pair<int, double>)
double BicubicSpline::call0D_shared(const std::pair<int, double> x_interp, const std::pair<int, double> y_interp){

	int low_x = x_interp.first;
	int low_y = y_interp.first;

	double x = x_interp.second;
	double y = y_interp.second;

	// // Construct the simple interpolation grid
	// // Find weightings based on linear distance
	// // w01 ------ w11    y
	// //  | \     / |      |
	// //  |  w(x,y) |    --/--x
	// //  | /     \ |      |
	// // w00 ------ w10

	grid_matrix alpha_sub = alpha_coeff[low_x][low_y];

	double x_vector[4] = {1, x, x*x, x*x*x}; //Row vector
	double y_vector[4] = {1, y, y*y, y*y*y}; //Column vector

	double return_value = 0.0;
	for(int i=0; i<4; ++i){
		for(int j=0; j<4; ++j){
			return_value += x_vector[i] * alpha_sub[i][j] * y_vector[j];
		}
	}

	return return_value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movsd %xmm1, -0x20(%rbp)
movl %edx, %ebx
movsd %xmm0, -0x28(%rbp)
addq $0x48, %rdi
movslq %esi, %rsi
callq 0x18374
movslq %ebx, %rsi
movq %rax, %rdi
callq 0x114b6
leaq -0x88(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x14dca
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x70(%rbp)
movsd -0x28(%rbp), %xmm1
movsd %xmm1, -0x68(%rbp)
movapd %xmm1, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
mulsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movq %rax, -0x50(%rbp)
movsd -0x20(%rbp), %xmm1
movsd %xmm1, -0x48(%rbp)
movapd %xmm1, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
mulsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
xorpd %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
xorl %r14d, %r14d
movsd -0x70(%rbp,%r14,8), %xmm0
movsd %xmm0, -0x28(%rbp)
xorl %r15d, %r15d
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x15cb4
movq %rax, %rdi
movq %r15, %rsi
callq 0x539c
movsd (%rax), %xmm0
mulsd -0x28(%rbp), %xmm0
mulsd -0x50(%rbp,%r15,8), %xmm0
movsd -0x20(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
incq %r15
cmpq $0x4, %r15
jne 0x178a8
incq %r14
cmpq $0x4, %r14
jne 0x17894
leaq -0x88(%rbp), %rdi
callq 0x1048a
movsd -0x20(%rbp), %xmm0
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/Spline/BivariateBSpline.cpp
// Function: atomicpp::BivariateBSpline::bispeu(std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>> const&, double const&, double const&)
double BivariateBSpline::bispeu(const std::vector<double>& tx,const std::vector<double>& ty,const std::vector<double>& c,const double& x,const double& y){
  // z = bispeu(tx,ty,c,kx,ky,x,y)

  int nx = tx.size();
  int ny = ty.size();
  int kx = 3;
  int ky = 3;

  double z = fpbisp(tx, nx, ty, ny, c, kx, ky, x, y);

  return z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r14
movq %r8, -0x30(%rbp)
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rsi, %rdi
callq 0x12b54
leaq -0x40(%rbp), %rbx
movl %eax, (%rbx)
movq %r12, %rdi
callq 0x12b54
leaq -0x3c(%rbp), %r8
movl %eax, (%r8)
movl $0x3, %eax
leaq -0x38(%rbp), %rdi
movl %eax, (%rdi)
leaq -0x34(%rbp), %r10
movl %eax, (%r10)
movq %r13, %rsi
movq %rbx, %rdx
movq %r12, %rcx
movq %r15, %r9
pushq %r14
pushq -0x30(%rbp)
pushq %r10
pushq %rdi
callq 0x1ccf4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/Spline/BivariateBSpline.cpp
// Function: atomicpp::BivariateBSpline::fprota(double, double, double&, double&)
void BivariateBSpline::fprota(const double cos, const double sin, double& a, double& b){
  //  subroutine fprota applies a given rotation to a and b.
  double stor1 = a;
  double stor2 = b;

  b = cos * stor2 + sin * stor1;
  a = cos * stor1 - sin * stor2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd (%rsi), %xmm2
movsd (%rdx), %xmm3
movapd %xmm0, %xmm4
mulsd %xmm2, %xmm0
mulsd %xmm1, %xmm2
mulsd %xmm3, %xmm4
addsd %xmm2, %xmm4
movsd %xmm4, (%rdx)
mulsd %xmm1, %xmm3
subsd %xmm3, %xmm0
movsd %xmm0, (%rsi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/Spline/BivariateBSpline.cpp
// Function: atomicpp::BivariateBSpline::fpgivs(double, double&, double&, double&)
void BivariateBSpline::fpgivs(const double piv, double& ww, double& cos, double& sin){
  //  subroutine fpgivs calculates the parameters of a given
  //  transformation .

  double dd;
  if(abs(piv)>=ww){
    dd = abs(piv)*sqrt(1+(ww/piv)*(ww/piv));
  } else {
    dd = ww*sqrt(1+(piv/ww)*(piv/ww));
  }
  cos = ww/dd;
  sin = piv/dd;
  ww = dd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movsd %xmm0, -0x20(%rbp)
callq 0x1d20d
movsd (%r14), %xmm3
ucomisd %xmm3, %xmm0
jae 0x1c67a
movsd -0x20(%rbp), %xmm2
movapd %xmm2, %xmm0
divsd %xmm3, %xmm0
jmp 0x1c696
movsd -0x20(%rbp), %xmm0
callq 0x1d20d
movapd %xmm0, %xmm3
movsd (%r14), %xmm0
movsd -0x20(%rbp), %xmm2
divsd %xmm2, %xmm0
mulsd %xmm0, %xmm0
addsd 0x5966(%rip), %xmm0     # 0x22008
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1c6b2
sqrtsd %xmm0, %xmm0
jmp 0x1c6c6
movsd %xmm3, -0x28(%rbp)
callq 0x42b0
movsd -0x28(%rbp), %xmm3
movsd -0x20(%rbp), %xmm2
mulsd %xmm0, %xmm3
movsd (%r14), %xmm0
divsd %xmm3, %xmm0
movsd %xmm0, (%r15)
divsd %xmm3, %xmm2
movsd %xmm2, (%rbx)
movsd %xmm3, (%r14)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/Spline/BivariateBSpline.cpp
// Function: atomicpp::BivariateBSpline::fpback(std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>> const&, std::vector<double, std::allocator<double>> const&, int, int, std::vector<double, std::allocator<double>>&, int)
void BivariateBSpline::fpback(const std::vector<std::vector<double>>& a, const std::vector<double>& z, const int n, const int k, std::vector<double>& C, const int nest){
  //No shift version of fpback - overloaded

  // std::cout << "fpback called" << std::endl;

  C.at(n-1) = z.at(n-1)/a.at(n-1).at(0);
  
  int i = n-1;
  double store;

  if(i!=0){
    for(int j=2; j <= n; ++j){
      store = z.at(i-1);
      int i1 = k-1;

      if(j <= k-1){
        i1 = j-1;
      }
      int m = i;
      for(int l=1; l <= i1; ++l){
        m = m+1;
        store = store - C.at(m-1)*a.at(i-1).at(l);
      }
      C.at(i-1) = store/a.at(i-1).at(0);
      i -= 1;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %r15
movl %r8d, %ebx
movl %ecx, %r12d
movq %rdx, %rdi
movq %rsi, %r13
leal -0x1(%r12), %eax
movslq %eax, %r14
movq %rdx, -0x58(%rbp)
movq %r14, %rsi
callq 0x1d21a
movsd (%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x1d23c
movq %rax, %rdi
xorl %esi, %esi
callq 0x1d21a
movsd -0x30(%rbp), %xmm0
divsd (%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1d1be
movsd -0x30(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %r12, -0x48(%rbp)
cmpl $0x2, %r12d
jl 0x1ca35
movl -0x48(%rbp), %r12d
decq %r12
movl $0x2, %r14d
movl %ebx, -0x34(%rbp)
movq %r13, -0x40(%rbp)
movq %r15, -0x50(%rbp)
leaq -0x1(%r12), %rsi
movq -0x58(%rbp), %rdi
movq %rsi, %r15
callq 0x1d21a
movsd (%rax), %xmm0
cmpl $0x2, %ebx
movq %r14, -0x60(%rbp)
movsd %xmm0, -0x30(%rbp)
jl 0x1c9e0
cmpl %ebx, %r14d
cmovll %r14d, %ebx
movslq %ebx, %rax
movq %rax, -0x68(%rbp)
movl $0x1, %r14d
movq -0x40(%rbp), %rbx
leaq 0x1(%r12), %r13
movq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x1d1be
movsd (%rax), %xmm0
movsd %xmm0, -0x70(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1d23c
movq %rax, %rdi
movq %r14, %rsi
callq 0x1d21a
movsd -0x70(%rbp), %xmm1
mulsd (%rax), %xmm1
movsd -0x30(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
incq %r14
movq %r13, %r12
cmpq -0x68(%rbp), %r14
jl 0x1c98b
jmp 0x1c9e4
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %r12
movq %r15, %rsi
callq 0x1d23c
movq %rax, %rdi
xorl %esi, %esi
callq 0x1d21a
movsd -0x30(%rbp), %xmm0
divsd (%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x1d1be
movsd -0x30(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x60(%rbp), %rcx
leal 0x1(%rcx), %eax
cmpl -0x48(%rbp), %ecx
movl %eax, %r14d
movl -0x34(%rbp), %ebx
jne 0x1c950
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/RateEquations.cpp
// Function: atomicpp::RateEquations::calculateStoppingTimeConstantFactor(double)
void RateEquations::calculateStoppingTimeConstantFactor(const double coulomb_logarithm){
	//Stangeby "The Plasma Boundary of Magnetic Fusion Devices" (2000), eqn 6.35
	tau_s_ii_CF = ( 1.47e13 * mz * sqrt(1/mi) ) / ( (1 + mi/mz) * coulomb_logarithm );
	//s is 'stopping'
	//ii is 'ion ion'
	//CF stands for 'Constant Factor'
	collision_frequency_s_ii_CF = 1/tau_s_ii_CF;
	//Use the collision frequency instead of the characteristic time, since multiplication is faster than division
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movsd 0x38(%rdi), %xmm2
mulsd 0x62b1(%rip), %xmm2     # 0x25060
movsd 0x3251(%rip), %xmm3     # 0x22008
movapd %xmm3, %xmm1
divsd 0x48(%rdi), %xmm1
movapd %xmm0, %xmm4
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0x1edd7
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
jmp 0x1edfc
movapd %xmm1, %xmm0
movsd %xmm2, -0x18(%rbp)
movsd %xmm4, -0x10(%rbp)
callq 0x42b0
movsd -0x10(%rbp), %xmm4
movsd 0x3211(%rip), %xmm3     # 0x22008
movsd -0x18(%rbp), %xmm2
mulsd %xmm0, %xmm2
movsd 0x48(%rbx), %xmm0
divsd 0x38(%rbx), %xmm0
addsd %xmm3, %xmm0
mulsd %xmm4, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x50(%rbx)
divsd %xmm2, %xmm3
movsd %xmm3, 0x58(%rbx)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/RateEquations.cpp
// Function: atomicpp::RateEquations::calculateIonIonDragFactor(double, double)
double RateEquations::calculateIonIonDragFactor(const double Ti, const double Ni){
	//Stangeby "The Plasma Boundary of Magnetic Fusion Devices" (2000), eqn 6.35
	double collision_frequency_ii_PF = collision_frequency_s_ii_CF * Ni/(Ti*sqrt(Ti));
	//ii is 'ion ion'
	//PF stands for 'Point Factor' -- i.e. this factor is constant for a single location point at a single time
	return collision_frequency_ii_PF;
	//collision_frequency_s_ii on Impurity^k+ = collision_frequency_ii_PF * k*k where k is the impurity change
}

// Assembly:
mulsd 0x58(%rdi), %xmm1
movapd %xmm0, %xmm2
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jb 0x1ee6c
xorps %xmm0, %xmm0
sqrtsd %xmm2, %xmm0
jmp 0x1ee96
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movapd %xmm2, %xmm0
movsd %xmm1, -0x10(%rbp)
movsd %xmm2, -0x8(%rbp)
callq 0x42b0
movsd -0x8(%rbp), %xmm2
movsd -0x10(%rbp), %xmm1
addq $0x10, %rsp
popq %rbp
mulsd %xmm2, %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/RateEquations.cpp
// Function: atomicpp::RateEquations::resetDerivatives()
void RateEquations::resetDerivatives(){
	Pcool                    = 0.0;
	Prad                     = 0.0;
	dNe                      = 0.0;
	F_i                      = 0.0;
	dNn                      = 0.0;
	F_n                      = 0.0;
	
	for(int k = 0; k<= Z; ++k){
		dNzk[k] = 0.0;
		F_zk[k] = 0.0;
		dNzk_correction[k] = 0.0;
		F_zk_correction[k] = 0.0;
	};
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rdi)
movups %xmm0, 0xd0(%rdi)
movups %xmm0, 0xe0(%rdi)
cmpl $0x0, 0x34(%rdi)
js 0x1f122
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x70(%rdi), %rax
movq %rax, -0x38(%rbp)
leaq 0x88(%rdi), %rax
movq %rax, -0x30(%rbp)
leaq 0xa0(%rdi), %r12
leaq 0xb8(%rdi), %r13
movq $-0x1, %r14
xorl %r15d, %r15d
incq %r14
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x539c
movq %r15, (%rax)
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x539c
movq %r15, (%rax)
movq %r12, %rdi
movq %r14, %rsi
callq 0x539c
movq %r15, (%rax)
movq %r13, %rdi
movq %r14, %rsi
callq 0x539c
movq %r15, (%rax)
movslq 0x34(%rbx), %rax
cmpq %rax, %r14
jl 0x1f0ce
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/RateEquations.cpp
// Function: atomicpp::RateEquations::calculateIonIonDrag(double, double, double, std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>> const&)
void RateEquations::calculateIonIonDrag(
	const double Ne,
	const double Te,
	const double Vi,
	const std::vector<double>& Nzk,
	const std::vector<double>& Vzk
	){
	
	//Assume that Te = Ti (isothermal), Ne = Ni (quasi-neutrality for Z=1 dominant ion)
	double collision_frequency_ii_PF = calculateIonIonDragFactor(Te, Ne);
	//ii is 'ion ion'
	//PF is 'Point Factor' -- i.e. a constant value shared for this point

	for(int k=1; k <= Z; ++k){//Don't consider the ground state -- not an ion so must be treated separately
		if(Nzk[k] > Nthres){
			double collision_frequency_s_ii = collision_frequency_ii_PF * k*k;
			double IonIonDrag_FF = mz * amu_to_kg * ((Vi+1) - Vzk[k]) * collision_frequency_s_ii;
			F_zk[k] += IonIonDrag_FF; //Calculate the force on the impurity ion due to ion-ion drag
			F_i     -= IonIonDrag_FF; //Calculate the force on the dominant ion due to ion-ion drag
		};
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movsd %xmm2, -0x30(%rbp)
movapd %xmm0, %xmm2
movq %rdi, %r15
movapd %xmm1, %xmm0
movapd %xmm2, %xmm1
callq 0x1ee50
movsd %xmm0, -0x40(%rbp)
cmpl $0x0, 0x34(%r15)
jle 0x2090a
movsd -0x30(%rbp), %xmm0
addsd 0x17c1(%rip), %xmm0     # 0x22008
movsd %xmm0, -0x30(%rbp)
leaq 0x88(%r15), %r12
movl $0x1, %r13d
movq %r14, %rdi
movq %r13, %rsi
callq 0x18510
movsd (%rax), %xmm0
ucomisd 0x40(%r15), %xmm0
jbe 0x208f6
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x38(%rbp)
movsd 0x38(%r15), %xmm0
mulsd 0x47d4(%rip), %xmm0     # 0x25070
movsd %xmm0, -0x48(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x18510
movsd -0x30(%rbp), %xmm0
subsd (%rax), %xmm0
mulsd -0x48(%rbp), %xmm0
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x539c
movsd (%rax), %xmm0
movsd -0x38(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movsd 0xd8(%r15), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0xd8(%r15)
leaq 0x1(%r13), %rax
movslq 0x34(%r15), %rcx
cmpq %rcx, %r13
movq %rax, %r13
jl 0x20859
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/RateEquations.cpp
// Function: atomicpp::RateEquations::calculateIonNeutralDrag(double, double, std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>> const&)
void RateEquations::calculateIonNeutralDrag(
	const double Nn,
	const double Vn,
	const std::vector<double>& Nzk,
	const std::vector<double>& Vzk
	){

	// Hard sphere's approximation
	// Radius of Carbon and Hydrogen atoms are ~ 50pm
	// a12 radius = a1+a2 = 100pm = 100e-12 = 1e-10
	// a12^2 = 1e-20
	// The cross-section (from Lieberman & Lichtenberg, 1994, Principles of Plasma Discharges & Materials Processing, eqn 3.1.4) is
	double sigma = M_PI * 1e-20;

	for(int k=0; k <= Z; ++k){//Don't consider the ground state -- not an ion so must be treated separately
		if(Nzk[k] > Nthres){
			double velocity_shear = Vn - Vzk[k];
			double IonNeutralDrag_FF = mz * amu_to_kg * Nn * sigma * (velocity_shear*velocity_shear);
			F_zk[k] += IonNeutralDrag_FF; //Calculate the force on the impurity ion due to ion-neutral drag
			F_n     -= IonNeutralDrag_FF; //Calculate the force on the dominant neutral due to ion-neutral drag
		};
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm1, -0x38(%rbp)
movsd %xmm0, -0x30(%rbp)
cmpl $0x0, 0x34(%rdi)
js 0x209eb
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x88(%rdi), %r12
movq $-0x1, %r13
incq %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x18510
movsd (%rax), %xmm0
ucomisd 0x40(%r15), %xmm0
jbe 0x209de
movq %rbx, %rdi
movq %r13, %rsi
callq 0x18510
movsd -0x38(%rbp), %xmm1
subsd (%rax), %xmm1
movsd 0x38(%r15), %xmm0
mulsd 0x46de(%rip), %xmm0     # 0x25070
mulsd -0x30(%rbp), %xmm0
mulsd 0x46e1(%rip), %xmm0     # 0x25080
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x40(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x539c
movsd (%rax), %xmm0
movsd -0x40(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movsd 0xe8(%r15), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0xe8(%r15)
movslq 0x34(%r15), %rax
cmpq %rax, %r13
jl 0x20956
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/RateEquations.cpp
// Function: atomicpp::RateEquations::calculateChargeExchangePowerEquation(double, std::vector<double, std::allocator<double>> const&, double, double)
void RateEquations::calculateChargeExchangePowerEquation(
	const double Nn,
	const std::vector<double>& Nzk,
	const double Te,
	const double Ne
	){
	//Calculate the power - doesn't need as high precision since everything is positive
	
	std::shared_ptr<RateCoefficient> cx_power_coefficient = rate_coefficients["cx_power"];
	for(int k=0; k < Z; ++k){
		double cx_power_coefficient_evaluated = cx_power_coefficient->call0D(k, Te, Ne);
		double cx_power_rate = cx_power_coefficient_evaluated * Nn * Nzk[k+1];
		Prad  += cx_power_rate;
		Pcool += cx_power_rate;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movsd %xmm2, -0x40(%rbp)
movsd %xmm1, -0x38(%rbp)
movq %rsi, %rbx
movsd %xmm0, -0x30(%rbp)
movq %rdi, %r14
leaq -0x21(%rbp), %r15
movq %r15, %rdi
callq 0x4540
leaq 0x2b98(%rip), %rsi      # 0x237d7
leaq -0x78(%rbp), %rdi
movq %r15, %rdx
callq 0x4160
leaq -0x78(%rbp), %rsi
movq %r14, %rdi
callq 0xd1fc
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0xd1f2
leaq -0x78(%rbp), %rdi
callq 0x41a0
leaq -0x21(%rbp), %rdi
callq 0x58c6
cmpl $0x0, 0x34(%r14)
jle 0x20ce6
xorl %r15d, %r15d
leaq -0x58(%rbp), %r12
movq %r12, %rdi
callq 0x53ae
movq %rax, %rdi
movl %r15d, %esi
movsd -0x38(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
callq 0x1136e
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
incq %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18510
movsd -0x48(%rbp), %xmm1
mulsd (%rax), %xmm1
movsd 0x68(%r14), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x68(%r14)
addsd 0x60(%r14), %xmm1
movsd %xmm1, 0x60(%r14)
movslq 0x34(%r14), %rax
cmpq %rax, %r15
jl 0x20c83
leaq -0x58(%rbp), %rdi
callq 0x53b8
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x41a0
jmp 0x20d0d
movq %rax, %rbx
leaq -0x21(%rbp), %rdi
callq 0x58c6
jmp 0x20d24
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x53b8
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/RateEquations.cpp
// Function: atomicpp::RateEquations::makeDerivativeStruct()
DerivStruct RateEquations::makeDerivativeStruct(){
	DerivStruct derivative_struct;

	derivative_struct.Pcool = Pcool;
	derivative_struct.Prad  = Prad;
	derivative_struct.dNzk  = dNzk;
	derivative_struct.F_zk  = F_zk;
	derivative_struct.dNe   = dNe;
	derivative_struct.F_i   = F_i;
	derivative_struct.dNn   = dNn;
	derivative_struct.F_n   = F_n;

	return derivative_struct;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x211c2
movsd 0x60(%r14), %xmm0
movsd %xmm0, (%rbx)
movsd 0x68(%r14), %xmm0
movsd %xmm0, 0x8(%rbx)
leaq 0x70(%r14), %rsi
leaq 0x10(%rbx), %rdi
callq 0x1599a
leaq 0x88(%r14), %rsi
leaq 0x28(%rbx), %rdi
callq 0x1599a
movsd 0xd0(%r14), %xmm0
movsd %xmm0, 0x40(%rbx)
movsd 0xd8(%r14), %xmm0
movsd %xmm0, 0x48(%rbx)
movsd 0xe0(%r14), %xmm0
movsd %xmm0, 0x50(%rbx)
movsd 0xe8(%r14), %xmm0
movsd %xmm0, 0x58(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x5408
movq %r14, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/RateEquations.cpp
// Function: atomicpp::RateEquations::computeDerivsHydrogen(double, double, std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>> const&)
DerivStruct RateEquations::computeDerivsHydrogen(
	const double Te,
	const double Ne,
	const std::vector<double>& Nhk,
	const std::vector<double>& Vhk){

	resetDerivatives(); //Reset all the derivatives to zero, since the object has a memory of the previous step

	calculateElectronImpactPopulationEquation(Ne, Nhk, Vhk, Te);

	//Apply neumairSum corrections
	for(int k=0; k<=Z; ++k){
		dNzk[k] += dNzk_correction[k]; //Uses 'z' notation since these are the attributes stored in RateEquations object
		F_zk[k] += F_zk_correction[k]; //
	}

	verifyNeumaierSummation(Te, Ne);
	
	calculateElectronImpactPowerEquation(Ne, Nhk, Te);

	// auto derivative_tuple = makeDerivativeTuple();
	// return derivative_tuple;
	DerivStruct derivative_struct = makeDerivativeStruct();
	return derivative_struct;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movsd %xmm1, -0x30(%rbp)
movsd %xmm0, -0x38(%rbp)
movq %rsi, %r14
movq %rdi, -0x58(%rbp)
movq %rsi, %rdi
callq 0x1f070
movq %r14, %rdi
movsd -0x30(%rbp), %xmm0
movq %r15, -0x50(%rbp)
movq %r15, %rsi
movq %rbx, %rdx
movsd -0x38(%rbp), %xmm1
callq 0x1f124
movq %r14, -0x40(%rbp)
cmpl $0x0, 0x34(%r14)
js 0x20eab
movq -0x40(%rbp), %rax
leaq 0xa0(%rax), %r12
leaq 0x70(%rax), %r13
leaq 0xb8(%rax), %rbx
leaq 0x88(%rax), %r15
movq $-0x1, %r14
incq %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x539c
movsd (%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x539c
movsd -0x48(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x539c
movsd (%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x539c
movsd -0x48(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq -0x40(%rbp), %rax
movslq 0x34(%rax), %rax
cmpq %rax, %r14
jl 0x20e43
movsd 0x1155(%rip), %xmm2     # 0x22008
movq -0x40(%rbp), %r14
movq %r14, %rdi
movsd -0x38(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
callq 0x20518
movq %r14, %rdi
movsd -0x30(%rbp), %xmm0
movq -0x50(%rbp), %rsi
movsd -0x38(%rbp), %xmm1
callq 0x209fa
movq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20d2c
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/RateEquations.cpp
// Function: atomicpp::neumaierSum(std::vector<double, std::allocator<double>> const&, double)
std::pair<double, double> atomicpp::neumaierSum(const std::vector<double>& list_to_sum, const double previous_correction /* = 0.0*/){
    double sum = 0.0;

    double correction = previous_correction;                 // A running compensation for lost low-order bits. Use previous result to restart summation

    for(int i=0; i < (int)(list_to_sum.size()); ++i){
        double temporary_sum = sum + list_to_sum[i];
        if (std::fabs(sum) >= std::fabs(list_to_sum[i])){
            correction += (sum - temporary_sum) + list_to_sum[i]; // If sum is bigger, low-order digits of list_to_sum[i] are lost.
        } else {
            correction += (list_to_sum[i] - temporary_sum) + sum; // Else low-order digits of sum are lost
        }
        sum = temporary_sum;
	}

	std::pair<double, double> neumaier_pair(sum, correction);

	return neumaier_pair;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movq $0x0, -0x18(%rbp)
movsd %xmm0, -0x28(%rbp)
callq 0x12b54
testl %eax, %eax
jle 0x20fef
xorl %r14d, %r14d
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18510
movsd -0x20(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x18(%rbp), %xmm1
movaps 0x3b96(%rip), %xmm0     # 0x24af0
andps %xmm0, %xmm1
movaps %xmm1, -0x40(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18510
movsd (%rax), %xmm0
andpd 0x3b78(%rip), %xmm0     # 0x24af0
movapd -0x40(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jae 0x20fa2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18510
movsd (%rax), %xmm1
movsd -0x20(%rbp), %xmm0
subsd %xmm0, %xmm1
addsd -0x18(%rbp), %xmm1
jmp 0x20fca
movsd -0x18(%rbp), %xmm0
subsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18510
movsd -0x40(%rbp), %xmm1
movsd -0x20(%rbp), %xmm0
addsd (%rax), %xmm1
addsd -0x28(%rbp), %xmm1
movsd %xmm1, -0x28(%rbp)
movsd %xmm0, -0x18(%rbp)
incq %r14
movq %rbx, %rdi
callq 0x12b54
cltq
cmpq %rax, %r14
jl 0x20f2b
leaq -0x50(%rbp), %rbx
leaq -0x18(%rbp), %rsi
leaq -0x28(%rbp), %rdx
movq %rbx, %rdi
callq 0x1863c
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/RateEquations.cpp
// Function: atomicpp::RateEquations::printDerivativeStruct(atomicpp::DerivStruct&)
void RateEquations::printDerivativeStruct(DerivStruct& derivative_struct){
	double Pcool             = derivative_struct.Pcool;
	double Prad              = derivative_struct.Prad;
	std::vector<double> dNzk = derivative_struct.dNzk;
	std::vector<double> F_zk = derivative_struct.F_zk;
	double dNe               = derivative_struct.dNe;
	double F_i               = derivative_struct.F_i;
	double dNn               = derivative_struct.dNn;
	double F_n               = derivative_struct.F_n;

	//Print-verifying the return from computeDerivs
	std::printf("Pcool:       %+.2e [J m^-3 s^-1]\n", Pcool);
	std::printf("Prad:        %+.2e [J m^-3 s^-1]\n" , Prad);
	for(int k=0; k<=Z; ++k){
	std::printf("dNz^(%i)/dt:  %+.2e [p m^-3 s^-1]\n",k ,dNzk[k]);
	}
	for(int k=0; k<=Z; ++k){
	std::printf("Fz^(%i):      %+.2e [N]\n",k ,F_zk[k]);
	}
	std::printf("dNe/dt:      %+.2e [p m^-3 s^-1]\n",dNe);
	std::printf("F_i:         %+.2e [N]\n",F_i);
	std::printf("dNn/dt:      %+.2e [p m^-3 s^-1]\n",dNn);
	std::printf("F_n:         %+.2e [N]\n",F_n);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movsd (%rsi), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x8(%rsi), %xmm0
movsd %xmm0, -0x50(%rbp)
addq $0x10, %rsi
leaq -0x68(%rbp), %rdi
callq 0x14d18
leaq 0x28(%r14), %rsi
leaq -0x80(%rbp), %rdi
callq 0x14d18
movsd 0x40(%r14), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x48(%r14), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x50(%r14), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x58(%r14), %xmm0
movsd %xmm0, -0x40(%rbp)
leaq 0x4171(%rip), %rdi      # 0x251fc
movsd -0x48(%rbp), %xmm0
movb $0x1, %al
callq 0x4080
leaq 0x4180(%rip), %rdi      # 0x2521e
movsd -0x50(%rbp), %xmm0
movb $0x1, %al
callq 0x4080
cmpl $0x0, 0x34(%rbx)
js 0x210ea
xorl %r14d, %r14d
leaq -0x68(%rbp), %r15
leaq 0x4182(%rip), %r12      # 0x25240
movq %r15, %rdi
movq %r14, %rsi
callq 0x539c
movsd (%rax), %xmm0
movq %r12, %rdi
movl %r14d, %esi
movb $0x1, %al
callq 0x4080
leaq 0x1(%r14), %rax
movslq 0x34(%rbx), %rcx
cmpq %rcx, %r14
movq %rax, %r14
jl 0x210be
cmpl $0x0, 0x34(%rbx)
js 0x2112a
xorl %r14d, %r14d
leaq -0x80(%rbp), %r15
leaq 0x4165(%rip), %r12      # 0x25263
movq %r15, %rdi
movq %r14, %rsi
callq 0x539c
movsd (%rax), %xmm0
movq %r12, %rdi
movl %r14d, %esi
movb $0x1, %al
callq 0x4080
leaq 0x1(%r14), %rax
movslq 0x34(%rbx), %rcx
cmpq %rcx, %r14
movq %rax, %r14
jl 0x210fe
leaq 0x414b(%rip), %rdi      # 0x2527c
movsd -0x28(%rbp), %xmm0
movb $0x1, %al
callq 0x4080
leaq 0x415a(%rip), %rdi      # 0x2529e
movsd -0x30(%rbp), %xmm0
movb $0x1, %al
callq 0x4080
leaq 0x415f(%rip), %rdi      # 0x252b6
movsd -0x38(%rbp), %xmm0
movb $0x1, %al
callq 0x4080
leaq 0x416e(%rip), %rdi      # 0x252d8
movsd -0x40(%rbp), %xmm0
movb $0x1, %al
callq 0x4080
leaq -0x80(%rbp), %rdi
callq 0x53c6
leaq -0x68(%rbp), %rdi
callq 0x53c6
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x53c6
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/gkosae[P]ArduinoNeuralNet/neuron.cpp
// Function: Neuron::initialiseWeights()
void Neuron::initialiseWeights() {
 // Initialise all weights with a random number between -1 and 1
  for (double& weight : weights) {
      weight = -1 + 2*randomize();
  }

  threshold = -1 + 2*randomize();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %r14
movq 0x28(%rdi), %r15
cmpq %r15, %r14
je 0x256d
callq 0x2589
addsd %xmm0, %xmm0
addsd 0x4aa6(%rip), %xmm0     # 0x7008
movsd %xmm0, (%r14)
addq $0x8, %r14
jmp 0x254c
callq 0x2589
addsd %xmm0, %xmm0
addsd 0x4a8a(%rip), %xmm0     # 0x7008
movsd %xmm0, 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/gkosae[P]ArduinoNeuralNet/neuron.cpp
// Function: Neuron::activate(std::vector<double, std::allocator<double>>)
void Neuron::activate(std::vector<double> inputs) {
    unsigned int number_of_inputs = inputs.size();
    action_potential = 0;

    for (unsigned int i = 0; i < number_of_inputs; ++i) {
      action_potential += (weights.at(i) * inputs.at(i));
    }

    // Add weighted bias
    action_potential += (bias * threshold);

    output = sigmoid(action_potential);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rcx
movq 0x8(%rsi), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movq $0x0, 0x8(%rdi)
testl %edx, %edx
je 0x26fa
movsd 0x8(%rbx), %xmm0
movq 0x28(%rbx), %rax
movq 0x20(%rbx), %rdi
subq %rdi, %rax
sarq $0x3, %rax
xorl %esi, %esi
cmpq %rsi, %rax
jbe 0x273a
cmpq %rsi, %rdx
jbe 0x2731
movsd (%rdi,%rsi,8), %xmm1
mulsd (%rcx,%rsi,8), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rbx)
incq %rsi
cmpl %esi, %edx
jne 0x26d6
movsd 0x10(%rbx), %xmm0
mulsd 0x18(%rbx), %xmm0
addsd 0x8(%rbx), %xmm0
movsd %xmm0, 0x8(%rbx)
xorpd 0x492a(%rip), %xmm0     # 0x7040
callq 0x2270
movsd 0x48f5(%rip), %xmm1     # 0x7018
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
popq %rbx
retq
leaq 0x497b(%rip), %rdi      # 0x70b3
jmp 0x2744
leaq 0x4972(%rip), %rdi      # 0x70b3
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/gkosae[P]ArduinoNeuralNet/layer.cpp
// Function: Layer::Layer(unsigned short, unsigned short)
Layer::Layer(unsigned short number_of_neurons, unsigned short number_of_inputs) {

  neurons = std::vector<Neuron>(number_of_neurons);
  inputs = std::vector<double>(number_of_inputs);

  for (Neuron& neuron : neurons) {
      neuron.reshape(number_of_inputs);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movl %edx, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movl %esi, %esi
leaq 0x28(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2da2
leaq 0x10(%rsp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x18(%rbx), %rax
movups 0x20(%rbx), %xmm0
leaq 0x28(%rsp), %r14
movq (%r14), %rcx
movq %rcx, 0x18(%rbx)
movq 0x8(%r14), %rcx
movq %rcx, 0x20(%rbx)
movq 0x10(%r14), %rcx
movq %rcx, 0x28(%rbx)
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rsi
movq %rax, (%rdi)
movups %xmm0, 0x8(%rdi)
movq %rcx, (%r14)
movq %rdx, 0x8(%r14)
movq %rsi, 0x10(%r14)
callq 0x2e38
movq %r14, %rdi
callq 0x2e38
movzwl %bp, %r14d
leaq 0x10(%rsp), %rdi
leaq 0x28(%rsp), %rdx
movq %r14, %rsi
callq 0x274c
leaq 0x10(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2908
movq (%r15), %rdi
testq %rdi, %rdi
je 0x2c50
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq 0x18(%rbx), %r15
movq 0x20(%rbx), %r12
cmpq %r12, %r15
je 0x2c6e
movq %r15, %rdi
movl %r14d, %esi
callq 0x24ec
addq $0x40, %r15
jmp 0x2c58
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c7f
jmp 0x2c7f
movq %rax, %r14
leaq 0x18(%rbx), %rdi
callq 0x2e38
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2c9f
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2180
movq %r14, %rdi
callq 0x2260
nop
// File: /workspace/github_cpp_makefile_star2_O1/gkosae[P]ArduinoNeuralNet/layer.cpp
// Function: Layer::getOutputs()
std::vector<double> Layer::getOutputs() {
    std::vector<double> outputs{};
    for (Neuron& neuron : neurons){
        outputs.push_back(neuron.output);
    }

    return outputs;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x18(%rsi), %r14
movq 0x20(%rsi), %r15
cmpq %r15, %r14
je 0x2d79
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2d68
movsd (%r14), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x2d73
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2f22
addq $0x40, %r14
jmp 0x2d46
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2d99
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2180
movq %r14, %rdi
callq 0x2260
nop
// File: /workspace/github_cpp_makefile_star2_O1/gkosae[P]ArduinoNeuralNet/neuralnet.cpp
// Function: NeuralNet::calculateOverallError()
double NeuralNet::calculateOverallError() {
    double error = 0;

    // Quadratic Cost Function
    for(auto i = 0; i < current_sample; ++i) {
        unsigned short output_layer_size = layers.back().size();
        for(auto j = 0; j < output_layer_size; ++j) {
            error += (0.5*pow(expected_output[i][j] - actual_output[i][j], 2));
        }
    }

    unsigned short number_of_samples = input_data.size();

    error = error/number_of_samples + lambda/2*getRegularizationTerm();
    return error;
}

// Assembly:
subq $0x18, %rsp
movl 0x78(%rdi), %eax
testq %rax, %rax
je 0x3677
movq 0x20(%rdi), %rdx
movq 0x30(%rdi), %rcx
movl -0x10(%rdx), %esi
subl -0x18(%rdx), %esi
shrl $0x6, %esi
movzwl %si, %edx
movq 0x48(%rdi), %rsi
xorpd %xmm2, %xmm2
xorl %r8d, %r8d
movsd 0x3aff(%rip), %xmm0     # 0x7130
testq %rdx, %rdx
je 0x366d
leaq (,%r8,8), %r9
leaq (%r9,%r9,2), %r10
movq (%rsi,%r10), %r9
movq (%rcx,%r10), %r10
xorl %r11d, %r11d
movsd (%r9,%r11,8), %xmm1
subsd (%r10,%r11,8), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm1
addsd %xmm1, %xmm2
incq %r11
cmpq %r11, %rdx
jne 0x364d
incq %r8
cmpq %rax, %r8
jne 0x3631
jmp 0x367b
xorpd %xmm2, %xmm2
movl 0x68(%rdi), %eax
subl 0x60(%rdi), %eax
shrl $0x3, %eax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
movsd 0x80(%rdi), %xmm0
mulsd 0x3a82(%rip), %xmm0     # 0x7130
movsd %xmm0, 0x8(%rsp)
callq 0x3c8e
mulsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gkosae[P]ArduinoNeuralNet/neuralnet.cpp
// Function: NeuralNet::getRegularizationTerm()
double NeuralNet::getRegularizationTerm() {
    double term = 0;

    // sum the square of all weights
    unsigned short count = layers.size();

    for(auto i = 1; i < count; ++i) {
        unsigned short current_layer_size = layers.at(i).size();

        for(auto j = 0; j < current_layer_size; ++j) {
            std::vector<double> weights = layers.at(i).neurons.at(j).weights;

            for(auto weight : weights) {
                term += pow(weight,2);
            }
        }
    }

    term = term/input_data.size();
    return term;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x20(%rdi), %rax
subq 0x18(%rdi), %rax
sarq $0x4, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
testl $0xfffe, %eax           # imm = 0xFFFE
je 0x3de5
movzwl %ax, %eax
movq %rax, 0x8(%rsp)
xorpd %xmm0, %xmm0
movl $0x1, %r14d
leaq 0x10(%rsp), %r15
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq %r14, %rdx
jbe 0x3e37
leaq (%r14,%r14,2), %rbp
shlq $0x4, %rbp
movl 0x20(%rax,%rbp), %ecx
subl 0x18(%rax,%rbp), %ecx
shrl $0x6, %ecx
andl $0xffff, %ecx           # imm = 0xFFFF
je 0x3dd5
movl %ecx, %r13d
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq %r14, %rdx
jbe 0x3e37
movq 0x18(%rax,%rbp), %rcx
movq 0x20(%rax,%rbp), %rdx
subq %rcx, %rdx
sarq $0x6, %rdx
cmpq %r12, %rdx
jbe 0x3e43
movq %r12, %rax
shlq $0x6, %rax
leaq (%rcx,%rax), %rsi
addq $0x20, %rsi
movq %r15, %rdi
movsd %xmm0, (%rsp)
callq 0x2e86
movsd (%rsp), %xmm0
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
cmpq %rcx, %rax
je 0x3da8
movsd (%rax), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
addq $0x8, %rax
jmp 0x3d91
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3dc9
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
movsd %xmm0, (%rsp)
callq 0x2180
movsd (%rsp), %xmm0
incq %r12
cmpq %r13, %r12
jne 0x3d26
incq %r14
cmpq 0x8(%rsp), %r14
jne 0x3cdb
jmp 0x3de9
xorpd %xmm0, %xmm0
movq 0x68(%rbx), %rax
subq 0x60(%rbx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movq %rax, %xmm2
punpckldq 0x3210(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x3218(%rip), %xmm2     # 0x7030
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3275(%rip), %rdi      # 0x70b3
movq %r14, %rsi
jmp 0x3e4d
leaq 0x3269(%rip), %rdi      # 0x70b3
movq %r12, %rsi
xorl %eax, %eax
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O1/gkosae[P]ArduinoNeuralNet/neuralnet.cpp
// Function: NeuralNet::buildInfoString[abi:cxx11]()
std::string NeuralNet::buildInfoString() {
  stringstream ss{};
  getNetworkInfo(ss);
  getLayerInfo(ss);
  getNeuronInfo(ss);
  return ss.str();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x20e0
movq %r14, %rdi
movq %r15, %rsi
callq 0x3fc0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x40dc
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x4222
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x21f0
movq 0x7048(%rip), %rsi      # 0xafb8
leaq 0x8(%rsp), %rdi
callq 0x2100
leaq 0x88(%rsp), %rdi
callq 0x2060
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x7017(%rip), %rsi      # 0xafb8
leaq 0x8(%rsp), %rdi
callq 0x2100
leaq 0x88(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2260
// File: /workspace/github_cpp_makefile_star2_O1/gkosae[P]ArduinoNeuralNet/neuralnet.cpp
// Function: NeuralNet::getNetworkInfo(std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&)
void NeuralNet::getNetworkInfo(stringstream& ss) {
  ss << "NETWORK INFO\n";
  ss << "Number of inputs: " << layers.front().size() << '\n';
  ss << "Number of outputs: " << layers.back().size() << '\n';
  ss << "Number of hidden layers: " << layers.size() - 2 << '\n';
  ss << '\n';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x10(%rsi), %rbx
leaq 0x31b3(%rip), %rsi      # 0x7188
movl $0xd, %edx
movq %rbx, %rdi
callq 0x2190
leaq 0x31ad(%rip), %rsi      # 0x7196
movl $0x12, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x18(%r14), %rax
movl 0x20(%rax), %esi
subl 0x18(%rax), %esi
shrl $0x6, %esi
movl $0xffff, %r15d          # imm = 0xFFFF
andl %r15d, %esi
movq %rbx, %rdi
callq 0x20c0
movb $0xa, %bpl
leaq 0x4(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2190
leaq 0x3176(%rip), %rsi      # 0x71a9
movl $0x13, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x20(%r14), %rax
movl -0x10(%rax), %esi
subl -0x18(%rax), %esi
shrl $0x6, %esi
andl %r15d, %esi
movq %rbx, %rdi
callq 0x20c0
leaq 0x5(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2190
leaq 0x3149(%rip), %rsi      # 0x71bd
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2190
movq 0x20(%r14), %rax
subq 0x18(%r14), %rax
sarq $0x4, %rax
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
addq $-0x2, %rsi
movq %rbx, %rdi
callq 0x20c0
leaq 0x6(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2190
leaq 0x7(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2190
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq