// File: /workspace/github_cpp_makefile_star2_O1/TBody[P]atomicpp/atomicpp/Spline/BivariateBSpline.cpp
// Function: atomicpp::BivariateBSpline::call0D(double, double)
double BivariateBSpline::call0D(const double eval_x, const double eval_y){
  
  // Bounds checking -- make sure you haven't dropped off the end of the array
  if ((eval_x <= x_values.at(0)) or (eval_x >= x_values.at(x_values.size()-1))){
    // An easy error to make is supplying the function arguments already having taken the log10
    std::stringstream errMsg;
    errMsg << "BivariateBSpline call0D error: X value off grid - require (" << x_values.at(0) << " < " << eval_x << " < " << x_values.at(x_values.size()-1) << ")";
    throw std::runtime_error(errMsg.str());
  };
  if ((eval_y <= y_values.at(0)) or (eval_y >= y_values.at(y_values.size()-1))){
    // An easy error to make is supplying the function arguments already having taken the log10
    std::stringstream errMsg;
    errMsg << "BivariateBSpline call0D error: Y value off grid - require (" << y_values.at(0) << " < " << eval_y << " < " << y_values.at(y_values.size()-1) << ")";
    throw std::runtime_error(errMsg.str());
  };

  // __CALL__ BBSpline
  double eval_coeff = bispeu(tx,ty,C,eval_x,eval_y);

  return eval_coeff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movsd %xmm0, -0x28(%rbp)
movq %rdi, %rbx
movsd %xmm0, -0x38(%rbp)
movsd %xmm1, -0x20(%rbp)
movsd %xmm1, -0x30(%rbp)
xorl %esi, %esi
callq 0x1d1be
movsd (%rax), %xmm0
movsd -0x28(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jae 0x1c2a4
movq %rbx, %rdi
callq 0x12b54
leaq -0x1(%rax), %rsi
movq %rbx, %rdi
callq 0x1d1be
movsd -0x28(%rbp), %xmm0
ucomisd (%rax), %xmm0
jae 0x1c2a4
leaq 0x18(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x1d1be
movsd (%rax), %xmm0
ucomisd -0x20(%rbp), %xmm0
jae 0x1c383
movq %r14, %rdi
callq 0x12b54
leaq -0x1(%rax), %rsi
movq %r14, %rdi
callq 0x1d1be
movsd -0x20(%rbp), %xmm0
ucomisd (%rax), %xmm0
jae 0x1c383
leaq 0x48(%rbx), %rsi
leaq 0x60(%rbx), %rdx
leaq 0x78(%rbx), %rcx
leaq -0x38(%rbp), %r8
leaq -0x30(%rbp), %r9
movq %rbx, %rdi
callq 0x1c49e
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x1e0(%rbp), %rdi
callq 0x4250
leaq -0x1d0(%rbp), %rdi
leaq 0x8a6d(%rip), %rsi      # 0x24d2b
callq 0x4360
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1d1be
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x45f0
leaq 0x86f2(%rip), %rsi      # 0x249d5
movq %rax, %rdi
callq 0x4360
movq %rax, %rdi
movsd -0x28(%rbp), %xmm0
callq 0x45f0
leaq 0x86d6(%rip), %rsi      # 0x249d5
movq %rax, %rdi
callq 0x4360
movq %rax, %r14
movq %rbx, %rdi
callq 0x12b54
leaq -0x1(%rax), %rsi
movq %rbx, %rdi
callq 0x1d1be
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x45f0
leaq 0x8048(%rip), %rsi      # 0x24379
movq %rax, %rdi
callq 0x4360
movl $0x10, %edi
callq 0x41b0
movq %rax, %r14
leaq -0x58(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x4350
movb $0x1, %r15b
leaq -0x58(%rbp), %rsi
movq %r14, %rdi
callq 0x4510
xorl %r15d, %r15d
movq 0x1ec81(%rip), %rsi     # 0x3aff0
movq 0x1ec2a(%rip), %rdx     # 0x3afa0
movq %r14, %rdi
callq 0x4560
jmp 0x1c45d
leaq -0x1e0(%rbp), %rdi
callq 0x4250
leaq -0x1d0(%rbp), %rdi
leaq 0x89ca(%rip), %rsi      # 0x24d67
callq 0x4360
movq %rax, %rbx
movq %r14, %rdi
xorl %esi, %esi
callq 0x1d1be
movsd (%rax), %xmm0
movq %rbx, %rdi
callq 0x45f0
leaq 0x8613(%rip), %rsi      # 0x249d5
movq %rax, %rdi
callq 0x4360
movq %rax, %rdi
movsd -0x20(%rbp), %xmm0
callq 0x45f0
leaq 0x85f7(%rip), %rsi      # 0x249d5
movq %rax, %rdi
callq 0x4360
movq %rax, %rbx
movq %r14, %rdi
callq 0x12b54
leaq -0x1(%rax), %rsi
movq %r14, %rdi
callq 0x1d1be
movsd (%rax), %xmm0
movq %rbx, %rdi
callq 0x45f0
leaq 0x7f69(%rip), %rsi      # 0x24379
movq %rax, %rdi
callq 0x4360
movl $0x10, %edi
callq 0x41b0
movq %rax, %r14
leaq -0x58(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x4350
movb $0x1, %r15b
leaq -0x58(%rbp), %rsi
movq %r14, %rdi
callq 0x4510
xorl %r15d, %r15d
movq 0x1eba2(%rip), %rsi     # 0x3aff0
movq 0x1eb4b(%rip), %rdx     # 0x3afa0
movq %r14, %rdi
callq 0x4560
jmp 0x1c461
jmp 0x1c46f
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x41a0
jmp 0x1c475
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x1c489
movq %r14, %rdi
callq 0x4270
jmp 0x1c489
jmp 0x1c486
movq %rax, %rbx
leaq -0x1e0(%rbp), %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x45a0
nop