user: Converte this assembly snippet into its equivalent C code:

```asm
<lagrange_interp_2Dfo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  mov    %edi,%r14d
  push   %r13
  mov    %r8,%r13
  push   %r12
  mov    %esi,%r12d
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x88,%rsp
  mov    %ecx,-0x50(%rbp)
  mov    0x10(%rbp),%r15
  mov    %esi,-0x44(%rbp)
  mov    %r9d,-0x54(%rbp)
  mov    %edi,-0x60(%rbp)
  not    %edi
  movsd  %xmm0,-0xa0(%rbp)
  and    $0x1,%edi
  movsd  %xmm1,-0xa8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <assert@plt>
  mov    %r12d,%edi
  not    %edi
  and    $0x1,%edi
  call   <assert@plt>
  mov    -0x50(%rbp),%eax
  xor    %edi,%edi
  cmp    %eax,%r14d
  setl   %dil
  call   <assert@plt>
  mov    -0x54(%rbp),%eax
  xor    %edi,%edi
  cmp    %eax,%r12d
  setl   %dil
  add    $0x1,%r14d
  call   <assert@plt>
  movslq %r14d,%rax
  mov    %rsp,%rcx
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L18
L41:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L41
L18:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L9
L151:
  mov    -0x44(%rbp),%eax
  mov    %rsp,%rcx
  mov    %rsp,-0x80(%rbp)
  lea    0x1(%rax),%r12d
  movslq %r12d,%rax
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L67
L148:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L148
L67:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L143
L64:
  mov    %r14d,%eax
  mov    %rsp,%rcx
  mov    %rsp,-0x68(%rbp)
  imul   %r12d,%eax
  cltq
  lea    0xf(,%rax,8),%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffff000,%rdx
  sub    %rdx,%rcx
  and    $0xfffffffffffffff0,%rax
  cmp    %rcx,%rsp
  je     L82
L37:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L37
L82:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L118
  orq    $0x0,-0x8(%rsp,%rax,1)
L118:
  mov    -0x60(%rbp),%ecx
  mov    -0x50(%rbp),%esi
  mov    %rbx,%rdi
  mov    %rsp,-0x70(%rbp)
  movsd  -0xa0(%rbp),%xmm0
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    %eax,-0x4c(%rbp)
  call   <find_xb@plt>
  mov    -0x44(%rbp),%esi
  movsd  -0xa8(%rbp),%xmm0
  mov    %r13,%rdi
  mov    %eax,-0x48(%rbp)
  mov    %esi,%eax
  shr    $0x1f,%eax
  add    %esi,%eax
  mov    -0x54(%rbp),%esi
  sar    %eax
  mov    %eax,%edx
  mov    %eax,-0x90(%rbp)
  call   <find_xb@plt>
  mov    -0x60(%rbp),%edx
  mov    %eax,-0x94(%rbp)
  mov    %eax,%edi
  test   %edx,%edx
  js     L72
  movslq -0x4c(%rbp),%rdx
  movslq -0x48(%rbp),%rax
  movq   $0x0,-0x78(%rbp)
  mov    %r14d,-0x58(%rbp)
  mov    %r15,%r14
  mov    %rdx,%r8
  mov    %rax,%rcx
  sub    %rdx,%rax
  movslq -0x90(%rbp),%rdx
  lea    (%rbx,%rax,8),%rsi
  sub    %r8d,%ecx
  movslq %edi,%rax
  mov    %r12d,-0x5c(%rbp)
  sub    %rdx,%rax
  mov    %rsi,-0x88(%rbp)
  mov    %ecx,-0x8c(%rbp)
  lea    0x0(%r13,%rax,8),%r9
  mov    %r9,%r12
  nopl   0x0(%rax,%rax,1)
L88:
  mov    -0x78(%rbp),%rax
  mov    -0x88(%rbp),%rcx
  mov    -0x8c(%rbp),%r15d
  mov    -0x80(%rbp),%rdi
  movsd  (%rcx,%rax,8),%xmm0
  mov    %eax,-0x48(%rbp)
  add    %eax,%r15d
  movsd  %xmm0,(%rdi,%rax,8)
  mov    -0x44(%rbp),%eax
  test   %eax,%eax
  js     L6
  mov    -0x94(%rbp),%eax
  sub    -0x90(%rbp),%eax
  xor    %r13d,%r13d
  mov    %eax,-0x4c(%rbp)
  mov    %r14,%rax
  mov    %r12,%r14
  mov    %r13,%r12
  mov    %rax,%r13
  nopl   0x0(%rax,%rax,1)
L25:
  movsd  (%r14,%r12,8),%xmm0
  mov    -0x68(%rbp),%rax
  mov    %r12d,%edx
  mov    -0x5c(%rbp),%ecx
  mov    -0x58(%rbp),%esi
  mov    -0x48(%rbp),%edi
  movsd  %xmm0,(%rax,%r12,8)
  call   <index_2D_to_1D@plt>
  mov    -0x54(%rbp),%ecx
  mov    -0x50(%rbp),%esi
  mov    %r15d,%edi
  movslq %eax,%rbx
  mov    -0x4c(%rbp),%eax
  lea    (%rax,%r12,1),%edx
  add    $0x1,%r12
  call   <index_2D_to_1D@plt>
  cltq
  movsd  0x0(%r13,%rax,8),%xmm0
  mov    -0x70(%rbp),%rax
  movsd  %xmm0,(%rax,%rbx,8)
  cmp    %r12d,-0x44(%rbp)
  jge    L25
  mov    %r14,%r12
  mov    %r13,%r14
L6:
  addq   $0x1,-0x78(%rbp)
  mov    -0x78(%rbp),%rax
  cmp    %eax,-0x60(%rbp)
  jge    L88
  mov    -0x58(%rbp),%r14d
  mov    -0x5c(%rbp),%r12d
L72:
  mov    -0x70(%rbp),%r8
  mov    -0x68(%rbp),%rdx
  mov    %r12d,%ecx
  mov    %r14d,%esi
  mov    -0x80(%rbp),%rdi
  movsd  -0xa8(%rbp),%xmm1
  movsd  -0xa0(%rbp),%xmm0
  call   <lagrange_interp_2D@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L69
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L9:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L151
L143:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L64
L69:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
double lagrange_interp_2Dfo(double x, double y, int order_x, int order_y, const double x_values[], int num_x, const double y_values[], int num_y, const double z_values[]) {
  assert(order_x % 2 == 0);
  assert(order_y % 2 == 0);
  assert(num_x > order_x);
  assert(num_y > order_y);
  double mx[order_x + 1];
  double my[order_y + 1];
  double mz[(order_x + 1) * (order_y + 1)];
  int ix = find_xb(x, x_values, num_x, order_x / 2);
  int iy = find_xb(y, y_values, num_y, order_y / 2);
  int iz_small, iz_big;
  for (int i = 0; i < order_x + 1; i++) {
    mx[i] = x_values[ix + i - order_x / 2];
    for (int j = 0; j < order_y + 1; j++) {
      my[j] = y_values[iy + j - order_y / 2];
      iz_small = index_2D_to_1D(i, order_x + 1, j, order_y + 1);
      iz_big = index_2D_to_1D(ix + i - order_x / 2, num_x, iy + j - order_y / 2, num_y);
      mz[iz_small] = z_values[iz_big];
    }
  }
  return lagrange_interp_2D(x, y, mx, order_x + 1, my, order_y + 1, mz);
}
```