// File: 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
subq $0x460, %rsp            # imm = 0x460
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x398(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x2f3f0
movsd -0x398(%rbp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jae 0x2d97a
movq -0x3a0(%rbp), %rdi
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x3a8(%rbp)
callq 0x1d4d0
movq -0x3a0(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x2f3f0
movsd -0x3a8(%rbp), %xmm0
ucomisd (%rax), %xmm0
jb 0x2db61
leaq -0x1a0(%rbp), %rdi
callq 0x4290
leaq -0x190(%rbp), %rdi
leaq 0xb517(%rip), %rsi      # 0x38eab
callq 0x43a0
movq %rax, -0x3b0(%rbp)
jmp 0x2d9a2
movq -0x3a0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2f3f0
movq %rax, -0x3b8(%rbp)
jmp 0x2d9bb
movq -0x3b0(%rbp), %rdi
movq -0x3b8(%rbp), %rax
movsd (%rax), %xmm0
callq 0x4640
movq %rax, -0x3c0(%rbp)
jmp 0x2d9db
movq -0x3c0(%rbp), %rdi
leaq 0xb16c(%rip), %rsi      # 0x38b55
callq 0x43a0
movq %rax, -0x3c8(%rbp)
jmp 0x2d9f7
movq -0x3c8(%rbp), %rdi
movsd -0x10(%rbp), %xmm0
callq 0x4640
movq %rax, -0x3d0(%rbp)
jmp 0x2da11
movq -0x3d0(%rbp), %rdi
leaq 0xb136(%rip), %rsi      # 0x38b55
callq 0x43a0
movq %rax, -0x3d8(%rbp)
jmp 0x2da2d
movq -0x3a0(%rbp), %rdi
callq 0x1d4d0
movq -0x3a0(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x2f3f0
movq %rax, -0x3e0(%rbp)
jmp 0x2da54
movq -0x3d8(%rbp), %rdi
movq -0x3e0(%rbp), %rax
movsd (%rax), %xmm0
callq 0x4640
movq %rax, -0x3e8(%rbp)
jmp 0x2da74
movq -0x3e8(%rbp), %rdi
leaq 0xaa77(%rip), %rsi      # 0x384f9
callq 0x43a0
jmp 0x2da89
movb $0x1, -0x1d1(%rbp)
movl $0x10, %edi
callq 0x41b0
movq %rax, -0x3f0(%rbp)
leaq -0x1d0(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x4390
jmp 0x2dab6
movq -0x3f0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x4570
jmp 0x2dacb
movq -0x3f0(%rbp), %rdi
movb $0x0, -0x1d1(%rbp)
movq 0x21510(%rip), %rsi     # 0x4eff0
movq 0x214b9(%rip), %rdx     # 0x4efa0
callq 0x45b0
jmp 0x2de25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x2db50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x2db37
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x4220
testb $0x1, -0x1d1(%rbp)
jne 0x2db42
jmp 0x2db4e
movq -0x3f0(%rbp), %rdi
callq 0x42b0
jmp 0x2db50
leaq -0x1a0(%rbp), %rdi
callq 0x42c0
jmp 0x2de19
movq -0x3a0(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x3f8(%rbp)
addq $0x18, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2f3f0
movsd -0x3f8(%rbp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jae 0x2dbe4
movq -0x3a0(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x400(%rbp)
movq %rdi, %rax
addq $0x18, %rax
movq %rax, -0x408(%rbp)
addq $0x18, %rdi
callq 0x1d4d0
movq -0x408(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x2f3f0
movsd -0x400(%rbp), %xmm0
ucomisd (%rax), %xmm0
jb 0x2ddd7
leaq -0x360(%rbp), %rdi
callq 0x4290
leaq -0x350(%rbp), %rdi
leaq 0xb2e9(%rip), %rsi      # 0x38ee7
callq 0x43a0
movq %rax, -0x410(%rbp)
jmp 0x2dc0c
movq -0x3a0(%rbp), %rdi
addq $0x18, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2f3f0
movq %rax, -0x418(%rbp)
jmp 0x2dc29
movq -0x410(%rbp), %rdi
movq -0x418(%rbp), %rax
movsd (%rax), %xmm0
callq 0x4640
movq %rax, -0x420(%rbp)
jmp 0x2dc49
movq -0x420(%rbp), %rdi
leaq 0xaefe(%rip), %rsi      # 0x38b55
callq 0x43a0
movq %rax, -0x428(%rbp)
jmp 0x2dc65
movq -0x428(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
callq 0x4640
movq %rax, -0x430(%rbp)
jmp 0x2dc7f
movq -0x430(%rbp), %rdi
leaq 0xaec8(%rip), %rsi      # 0x38b55
callq 0x43a0
movq %rax, -0x438(%rbp)
jmp 0x2dc9b
movq -0x3a0(%rbp), %rdi
addq $0x18, %rdi
movq %rdi, -0x448(%rbp)
callq 0x1d4d0
movq -0x448(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x2f3f0
movq %rax, -0x440(%rbp)
jmp 0x2dccd
movq -0x438(%rbp), %rdi
movq -0x440(%rbp), %rax
movsd (%rax), %xmm0
callq 0x4640
movq %rax, -0x450(%rbp)
jmp 0x2dced
movq -0x450(%rbp), %rdi
leaq 0xa7fe(%rip), %rsi      # 0x384f9
callq 0x43a0
jmp 0x2dd02
movb $0x1, -0x381(%rbp)
movl $0x10, %edi
callq 0x41b0
movq %rax, -0x458(%rbp)
leaq -0x380(%rbp), %rdi
leaq -0x360(%rbp), %rsi
callq 0x4390
jmp 0x2dd2f
movq -0x458(%rbp), %rdi
leaq -0x380(%rbp), %rsi
callq 0x4570
jmp 0x2dd44
movq -0x458(%rbp), %rdi
movb $0x0, -0x381(%rbp)
movq 0x21297(%rip), %rsi     # 0x4eff0
movq 0x21240(%rip), %rdx     # 0x4efa0
callq 0x45b0
jmp 0x2de25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x2ddc9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
jmp 0x2ddb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
leaq -0x380(%rbp), %rdi
callq 0x4220
testb $0x1, -0x381(%rbp)
jne 0x2ddbb
jmp 0x2ddc7
movq -0x458(%rbp), %rdi
callq 0x42b0
jmp 0x2ddc9
leaq -0x360(%rbp), %rdi
callq 0x42c0
jmp 0x2de19
movq -0x3a0(%rbp), %rdi
movq %rdi, %rsi
addq $0x48, %rsi
movq %rdi, %rdx
addq $0x60, %rdx
movq %rdi, %rcx
addq $0x78, %rcx
leaq -0x10(%rbp), %r8
leaq -0x18(%rbp), %r9
callq 0x2de30
movsd %xmm0, -0x390(%rbp)
movsd -0x390(%rbp), %xmm0
addq $0x460, %rsp            # imm = 0x460
popq %rbp
retq
movq -0x1a8(%rbp), %rdi
callq 0x45e0
nopw %cs:(%rax,%rax)