// File: TBody[P]atomicpp/atomicpp/Spline/BivariateBSpline.cpp
// Function: atomicpp::BivariateBSpline::fpbisp(std::vector<double, std::allocator<double>> const&, int const&, std::vector<double, std::allocator<double>> const&, int const&, std::vector<double, std::allocator<double>> const&, int const&, int const&, double const&, double const&)
double BivariateBSpline::fpbisp(const std::vector<double>& tx, const int& nx, const std::vector<double>& ty, const int& ny, const std::vector<double>& c, const int& kx, const int& ky, const double& x, const double& y){

  std::vector<double> h(6, 0.0);
  int lx = 0;
  int ly = 0;
  std::vector<double> wx(kx+1, 0.0);
  std::vector<double> wy(ky+1, 0.0);

  // int (kx+1) = kx+1;
  int nkx1 = nx-(kx+1);
  double tb = tx.at(kx);
  double te = tx.at(nkx1);
  int l = (kx+1);
  int l1 = l+1;

  double arg = x;
  if(arg < tb){
    arg = tb;
  }
  if(arg > te){
    arg = te;
  }

  while(not(arg < tx.at(l1-1) or l==nkx1)){
    l = l1;
    l1 = l+1;
  }
  fpbspl(tx,nx,kx,arg,l,h);
  lx = l-(kx+1);

  for(int j=1; j <= (kx+1); ++j){
    wx.at(j-1) = h.at(j-1);
  }

  tb = ty.at(ky);
  te = ty.at((ny-(ky+1)));
  l = (ky+1);
  l1 = l+1;

  arg = y;
  if(arg < tb){
    arg = tb;
  }
  if(arg > te){
    arg = te;
  }
  while(not(arg<ty.at(l1-1) or l==(ny-(ky+1)))){
    l = l1;
    l1 = l+1;
  }
  fpbspl(ty,ny,ky,arg,l,h);
  ly = l-(ky+1);

  for(int j=1; j<=(ky+1); ++j){
    wy.at(j-1) = h.at(j-1);
  }

  int m = 0;

  l = lx*(ny-(ky+1));
  for(int i1=1; i1<= (kx+1); ++i1){
    h.at(i1-1) = wx.at(i1-1);
  }
  l1 = l+ly;
  double sp = 0.;
  for(int i1=1; i1<= (kx+1); ++i1){
    int l2 = l1;
    for(int j1=1; j1<= (ky+1); ++j1){
      l2 = l2+1;
      sp = sp+c.at(l2-1)*h.at(i1-1)*wy.at(j1-1);
    }
    l1 = l1+(ny-(ky+1));
  }
  m = m+1;
  double z = sp;
  return z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x120(%rbp)
movq $0x0, -0x50(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x58a0
movq -0x118(%rbp), %rcx
leaq -0x48(%rbp), %rdi
movl $0x6, %esi
leaq -0x50(%rbp), %rdx
callq 0x26390
jmp 0x2eb01
leaq -0x51(%rbp), %rdi
callq 0x5930
movl $0x0, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movq 0x10(%rbp), %rax
movl (%rax), %eax
incl %eax
cltq
movq %rax, -0x130(%rbp)
movq $0x0, -0x90(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x58a0
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rcx
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x26390
jmp 0x2eb6a
leaq -0x91(%rbp), %rdi
callq 0x5930
movq 0x18(%rbp), %rax
movl (%rax), %eax
incl %eax
cltq
movq %rax, -0x140(%rbp)
movq $0x0, -0xb8(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x58a0
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rcx
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x26390
jmp 0x2ebc8
leaq -0xb9(%rbp), %rdi
callq 0x5930
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq 0x10(%rbp), %rax
movl (%rax), %eax
notl %eax
addl %ecx, %eax
movl %eax, -0xc0(%rbp)
movq -0x10(%rbp), %rdi
movq 0x10(%rbp), %rax
movslq (%rax), %rsi
callq 0x2f490
movq %rax, -0x148(%rbp)
jmp 0x2ec03
movq -0x148(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0x10(%rbp), %rdi
movslq -0xc0(%rbp), %rsi
callq 0x2f490
movq %rax, -0x150(%rbp)
jmp 0x2ec2f
movq -0x150(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0xd0(%rbp)
movq 0x10(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
movq 0x20(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0xe0(%rbp), %xmm1
movsd -0xc8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2ed0d
movsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0xe0(%rbp)
jmp 0x2ed0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x5930
jmp 0x2f3a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x5930
jmp 0x2f39a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xb9(%rbp), %rdi
callq 0x5930
jmp 0x2f38e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x59b0
jmp 0x2f38e
movsd -0xe0(%rbp), %xmm0
ucomisd -0xd0(%rbp), %xmm0
jbe 0x2ed2f
movsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0xe0(%rbp)
jmp 0x2ed31
movsd -0xe0(%rbp), %xmm0
movsd %xmm0, -0x160(%rbp)
movq -0x10(%rbp), %rdi
movl -0xd8(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x2f490
movq %rax, -0x158(%rbp)
jmp 0x2ed5e
movsd -0x160(%rbp), %xmm1
movq -0x158(%rbp), %rax
movsd (%rax), %xmm0
movb $0x1, %al
ucomisd %xmm1, %xmm0
movb %al, -0x161(%rbp)
ja 0x2ed94
movl -0xd4(%rbp), %eax
cmpl -0xc0(%rbp), %eax
sete %al
movb %al, -0x161(%rbp)
movb -0x161(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x2eda2
jmp 0x2edc2
movl -0xd8(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
jmp 0x2ed31
movq -0x120(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movl (%rax), %edx
movq 0x10(%rbp), %rax
movl (%rax), %ecx
movsd -0xe0(%rbp), %xmm0
movl -0xd4(%rbp), %r8d
leaq -0x48(%rbp), %r9
callq 0x2e650
jmp 0x2edf3
movl -0xd4(%rbp), %eax
movq 0x10(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
subl %ecx, %eax
movl %eax, -0x68(%rbp)
movl $0x1, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
movq 0x10(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x2ee9b
movl -0xe4(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x2f3f0
movq %rax, -0x170(%rbp)
jmp 0x2ee41
movq -0x170(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x180(%rbp)
movl -0xe4(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0x88(%rbp), %rdi
callq 0x2f3f0
movq %rax, -0x178(%rbp)
jmp 0x2ee74
movq -0x178(%rbp), %rax
movsd -0x180(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x2ee11
movq -0x20(%rbp), %rdi
movq 0x18(%rbp), %rax
movslq (%rax), %rsi
callq 0x2f490
movq %rax, -0x188(%rbp)
jmp 0x2eeb4
movq -0x188(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movl (%rax), %ecx
movq 0x18(%rbp), %rax
movl (%rax), %eax
notl %eax
addl %ecx, %eax
movslq %eax, %rsi
callq 0x2f490
movq %rax, -0x190(%rbp)
jmp 0x2eeec
movq -0x190(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0xd0(%rbp)
movq 0x18(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
movq 0x28(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0xe0(%rbp), %xmm1
movsd -0xc8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2ef53
movsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0xe0(%rbp), %xmm0
ucomisd -0xd0(%rbp), %xmm0
jbe 0x2ef75
movsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0xe0(%rbp)
jmp 0x2ef77
movsd -0xe0(%rbp), %xmm0
movsd %xmm0, -0x1a0(%rbp)
movq -0x20(%rbp), %rdi
movl -0xd8(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x2f490
movq %rax, -0x198(%rbp)
jmp 0x2efa4
movsd -0x1a0(%rbp), %xmm1
movq -0x198(%rbp), %rax
movsd (%rax), %xmm0
movb $0x1, %al
ucomisd %xmm1, %xmm0
movb %al, -0x1a1(%rbp)
ja 0x2efe7
movl -0xd4(%rbp), %eax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
movq 0x18(%rbp), %rdx
movl (%rdx), %edx
addl $0x1, %edx
subl %edx, %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x1a1(%rbp)
movb -0x1a1(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x2eff5
jmp 0x2f015
movl -0xd8(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
jmp 0x2ef77
movq -0x120(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rax
movl (%rax), %edx
movq 0x18(%rbp), %rax
movl (%rax), %ecx
movsd -0xe0(%rbp), %xmm0
movl -0xd4(%rbp), %r8d
leaq -0x48(%rbp), %r9
callq 0x2e650
jmp 0x2f046
movl -0xd4(%rbp), %eax
movq 0x18(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
subl %ecx, %eax
movl %eax, -0x6c(%rbp)
movl $0x1, -0xe8(%rbp)
movl -0xe8(%rbp), %eax
movq 0x18(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x2f0ee
movl -0xe8(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x2f3f0
movq %rax, -0x1b0(%rbp)
jmp 0x2f094
movq -0x1b0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x1c0(%rbp)
movl -0xe8(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0xb0(%rbp), %rdi
callq 0x2f3f0
movq %rax, -0x1b8(%rbp)
jmp 0x2f0c7
movq -0x1b8(%rbp), %rax
movsd -0x1c0(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0xe8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe8(%rbp)
jmp 0x2f064
movl $0x0, -0xec(%rbp)
movl -0x68(%rbp), %eax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
movq 0x18(%rbp), %rdx
movl (%rdx), %edx
addl $0x1, %edx
subl %edx, %ecx
imull %ecx, %eax
movl %eax, -0xd4(%rbp)
movl $0x1, -0xf0(%rbp)
movl -0xf0(%rbp), %eax
movq 0x10(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x2f1a9
movl -0xf0(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0x88(%rbp), %rdi
callq 0x2f3f0
movq %rax, -0x1c8(%rbp)
jmp 0x2f152
movq -0x1c8(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x1d8(%rbp)
movl -0xf0(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x2f3f0
movq %rax, -0x1d0(%rbp)
jmp 0x2f182
movq -0x1d0(%rbp), %rax
movsd -0x1d8(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0xf0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf0(%rbp)
jmp 0x2f11f
movl -0xd4(%rbp), %eax
addl -0x6c(%rbp), %eax
movl %eax, -0xd8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xf8(%rbp)
movl $0x1, -0xfc(%rbp)
movl -0xfc(%rbp), %eax
movq 0x10(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x2f32d
movl -0xd8(%rbp), %eax
movl %eax, -0x100(%rbp)
movl $0x1, -0x104(%rbp)
movl -0x104(%rbp), %eax
movq 0x18(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x2f2fa
movl -0x100(%rbp), %eax
incl %eax
movl %eax, -0x100(%rbp)
movsd -0xf8(%rbp), %xmm0
movsd %xmm0, -0x1e8(%rbp)
movq -0x30(%rbp), %rdi
movl -0x100(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x2f490
movq %rax, -0x1e0(%rbp)
jmp 0x2f24c
movq -0x1e0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x1f8(%rbp)
movl -0xfc(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x2f3f0
movq %rax, -0x1f0(%rbp)
jmp 0x2f27c
movsd -0x1f8(%rbp), %xmm0
movq -0x1f0(%rbp), %rax
movsd (%rax), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x208(%rbp)
movl -0x104(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0xb0(%rbp), %rdi
callq 0x2f3f0
movq %rax, -0x200(%rbp)
jmp 0x2f2bb
movsd -0x1e8(%rbp), %xmm1
movsd -0x208(%rbp), %xmm0
movq -0x200(%rbp), %rax
movsd (%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xf8(%rbp)
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
jmp 0x2f1fa
movl -0xd8(%rbp), %eax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
movq 0x18(%rbp), %rdx
movl (%rdx), %edx
addl $0x1, %edx
subl %edx, %ecx
addl %ecx, %eax
movl %eax, -0xd8(%rbp)
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x2f1cd
movl -0xec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xec(%rbp)
movsd -0xf8(%rbp), %xmm0
movsd %xmm0, -0x110(%rbp)
movsd -0x110(%rbp), %xmm0
movsd %xmm0, -0x210(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x59b0
leaq -0x88(%rbp), %rdi
callq 0x59b0
leaq -0x48(%rbp), %rdi
callq 0x59b0
movsd -0x210(%rbp), %xmm0
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
leaq -0x88(%rbp), %rdi
callq 0x59b0
leaq -0x48(%rbp), %rdi
callq 0x59b0
movq -0x60(%rbp), %rdi
callq 0x45e0
nopl (%rax)