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

```asm
<get_all_radar_pts>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x118,%rsp
  mov    %rdi,-0x130(%rbp)
  mov    %rdx,%rsi
  mov    %ecx,-0x108(%rbp)
  mov    %r9,-0xd8(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0x138(%rbp)
  mov    0x38(%rbp),%r13
  mov    0x58(%rbp),%rax
  mov    %rax,-0x110(%rbp)
  mov    0x68(%rbp),%rax
  mov    %rax,-0x118(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movslq 0x40(%rbp),%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L36:
  cmp    %rdx,%rsp
  je     L95
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L36
L95:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L132
  orq    $0x0,-0x8(%rsp,%rax,1)
L132:
  mov    %rsp,%r14
  mov    -0x108(%rbp),%ecx
  test   %ecx,%ecx
  jle    L156
  mov    0x40(%rbp),%eax
  sub    $0x1,%eax
  mov    0x48(%rbp),%edx
  imul   0x50(%rbp),%edx
  mov    %eax,%edi
  imul   %edx,%edi
  mov    %edi,-0xcc(%rbp)
  movslq %r8d,%r8
  lea    0x0(,%r8,4),%rdi
  mov    %rdi,-0x120(%rbp)
  mov    %rsi,-0xf8(%rbp)
  lea    -0x1(%rcx),%esi
  mov    %esi,-0x104(%rbp)
  mov    %ecx,%esi
  mov    %rsi,-0x128(%rbp)
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rsi
  mov    %rsi,-0xc8(%rbp)
  mov    %eax,%eax
  lea    0x4(%r14,%rax,4),%r12
  mov    -0x130(%rbp),%rax
  mov    %rax,-0x100(%rbp)
  mov    $0x0,%r15d
  jmp    L125
L102:
  mov    $0x0,%ebx
  lea    -0x5c(%rbp),%rax
  mov    %rax,-0xf0(%rbp)
  mov    %r15,-0xe0(%rbp)
  mov    -0x138(%rbp),%r15
  mov    %r13,-0xe8(%rbp)
  jmp    L214
L21:
  mov    -0xe0(%rbp),%r15
  mov    -0xe8(%rbp),%r13
  cmp    %r15d,-0x108(%rbp)
  jle    L117
  mov    -0x104(%rbp),%eax
  add    %r15,%rax
  mov    -0x130(%rbp),%rsi
  lea    0x4(%rsi,%rax,4),%rdx
  mov    -0x100(%rbp),%rax
L215:
  movss  D9(%rip),%xmm7
  movss  %xmm7,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L215
  jmp    L117
L138:
  mov    0x40(%rbp),%eax
  sub    $0x3,%eax
  mov    0x40(%rbp),%esi
  lea    -0x2(%rsi),%edx
L209:
  movslq %eax,%rcx
  movss  (%r14,%rcx,4),%xmm0
  movss  %xmm0,-0xa0(%rbp,%rbx,1)
  movslq %edx,%rcx
  movss  (%r14,%rcx,4),%xmm0
  movss  %xmm0,-0x9c(%rbp,%rbx,1)
  imul   0x30(%rbp),%r13d
  imul   0x30(%rbp),%eax
  imul   0x28(%rbp),%eax
  add    %r13d,%eax
  mov    -0xd0(%rbp),%esi
  add    %esi,%eax
  cltq
  movss  (%r15,%rax,4),%xmm0
  movss  %xmm0,-0x80(%rbp,%rbx,1)
  mov    %edx,%eax
  imul   0x30(%rbp),%eax
  imul   0x28(%rbp),%eax
  add    %r13d,%eax
  add    %esi,%eax
  cltq
  movss  (%r15,%rax,4),%xmm0
  movss  %xmm0,-0x7c(%rbp,%rbx,1)
  add    $0x8,%rbx
  cmp    $0x20,%rbx
  je     L213
L214:
  mov    -0x60(%rbp,%rbx,1),%r13d
  mov    -0xf0(%rbp),%rax
  mov    (%rax,%rbx,1),%edi
  mov    %edi,-0xd0(%rbp)
  cmpl   $0x0,0x40(%rbp)
  jle    L173
  mov    %r13d,%eax
  imul   0x50(%rbp),%eax
  cltq
  movslq %edi,%rdx
  add    %rdx,%rax
  mov    -0xe8(%rbp),%rdi
  lea    (%rdi,%rax,4),%rdx
  mov    %r14,%rax
L86:
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
  add    -0xc8(%rbp),%rdx
  add    $0x4,%rax
  cmp    %r12,%rax
  jne    L86
L173:
  mov    -0xd8(%rbp),%rax
  mov    -0xe0(%rbp),%rsi
  movss  (%rax,%rsi,4),%xmm0
  mov    0x40(%rbp),%esi
  mov    %r14,%rdi
  call   <binary_search@plt>
  cmp    $0xffffffff,%eax
  je     L21
  cmp    $0xfffffffe,%eax
  je     L138
  mov    0x40(%rbp),%edi
  lea    -0x2(%rdi),%edx
  cmp    %eax,%edx
  sete   %dl
  movzbl %dl,%edx
  sub    %edx,%eax
  lea    0x1(%rax),%edx
  jmp    L209
L213:
  mov    -0xe0(%rbp),%r15
  mov    -0xe8(%rbp),%r13
  mov    -0xd8(%rbp),%rax
  movss  (%rax,%r15,4),%xmm0
  lea    -0x80(%rbp),%rdx
  lea    -0xa0(%rbp),%rdi
  mov    $0x2,%r9d
  lea    -0xb8(%rbp),%r8
  mov    $0x8,%ecx
  mov    $0x8,%esi
  call   <trilinear_interp@plt>
  mov    -0x100(%rbp),%rax
  movss  %xmm0,(%rax)
L117:
  add    $0x1,%r15
  mov    -0x120(%rbp),%rdi
  add    %rdi,-0xf8(%rbp)
  addq   $0x4,-0x100(%rbp)
  subl   $0x1,-0x104(%rbp)
  cmp    -0x128(%rbp),%r15
  je     L156
L125:
  mov    -0xf8(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x110(%rbp),%rsi
  subss  (%rsi),%xmm0
  mov    -0x118(%rbp),%rcx
  divss  (%rcx),%xmm0
  movss  %xmm0,-0xb8(%rbp)
  movss  0x4(%rax),%xmm0
  subss  0x4(%rsi),%xmm0
  divss  0x4(%rcx),%xmm0
  movss  %xmm0,-0xb4(%rbp)
  call   <floor@plt>
  mov    %eax,%ebx
  movss  -0xb8(%rbp),%xmm0
  call   <floor@plt>
  mov    %ebx,-0x60(%rbp)
  mov    %eax,-0x5c(%rbp)
  mov    %ebx,-0x58(%rbp)
  lea    0x1(%rax),%edx
  mov    %edx,-0x54(%rbp)
  add    $0x1,%ebx
  mov    %ebx,-0x50(%rbp)
  mov    %eax,-0x4c(%rbp)
  mov    %ebx,-0x48(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    D43(%rip),%rax
  movq   %rax,%xmm1
  movss  -0xb4(%rbp),%xmm0
  call   <fmod@plt>
  movss  %xmm0,-0xd0(%rbp)
  mov    D43(%rip),%rax
  movq   %rax,%xmm1
  movss  -0xb8(%rbp),%xmm0
  call   <fmod@plt>
  movaps %xmm0,%xmm2
  movss  D42(%rip),%xmm1
  subss  -0xd0(%rbp),%xmm1
  movss  D42(%rip),%xmm4
  subss  %xmm0,%xmm4
  lea    -0x60(%rbp),%rdx
  lea    -0xb0(%rbp),%rcx
  lea    -0x40(%rbp),%rsi
  mov    0x50(%rbp),%edi
L44:
  mov    %edi,%eax
  imul   (%rdx),%eax
  add    -0xcc(%rbp),%eax
  add    0x4(%rdx),%eax
  cltq
  movss  0x0(%r13,%rax,4),%xmm0
  movss  %xmm0,(%rcx)
  add    $0x8,%rdx
  add    $0x4,%rcx
  cmp    %rsi,%rdx
  jne    L44
  movaps %xmm1,%xmm0
  mulss  %xmm4,%xmm0
  mulss  -0xb0(%rbp),%xmm0
  movss  -0xd0(%rbp),%xmm5
  movaps %xmm5,%xmm3
  mulss  -0xa8(%rbp),%xmm3
  mulss  %xmm4,%xmm3
  addss  %xmm3,%xmm0
  mulss  -0xac(%rbp),%xmm1
  mulss  %xmm2,%xmm1
  addss  %xmm1,%xmm0
  mulss  %xmm2,%xmm5
  movaps %xmm5,%xmm1
  mulss  -0xa4(%rbp),%xmm1
  addss  %xmm1,%xmm0
  mov    -0xd8(%rbp),%rax
  movss  (%rax,%r15,4),%xmm1
  comiss %xmm0,%xmm1
  ja     L102
  cmp    %r15d,-0x108(%rbp)
  jle    L117
  pxor   %xmm0,%xmm0
  divss  %xmm0,%xmm0
  mov    -0x104(%rbp),%eax
  add    %r15,%rax
  mov    -0x130(%rbp),%rcx
  lea    0x4(%rcx,%rax,4),%rdx
  mov    -0x100(%rbp),%rax
L15:
  movss  %xmm0,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L15
  jmp    L117
L156:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L99
  mov    -0x130(%rbp),%rax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L99:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D9
type_guessed: byte[4]
name: retrieve_data
arguments: data_tag: D43
type_guessed: f64
name: retrieve_data
arguments: data_tag: D42
type_guessed: byte[4]

tool: {"D9": [0x00,0x3c,0x1c,0xc6]}

tool: D43: 1

tool: {"D42": [0x00,0x00,0x80,0x3f]}

assistant: ```c
float *get_all_radar_pts(float *output, int len, float *coords_rad_pts, int crp_x, int crp_y, float *radar_heights, int rh_x, float *model_data, int md_x, int md_y, int md_z, float *model_heights, int mh_x, int mh_y, int mh_z, float *llc_cosmo, int llc_cosmo_x, float *res_cosmo, int res_cosmo_x) {
  float radar_pts[crp_x];
  int i = 0;
  int llc_i = 0;
  int llc_j = 0;
  int current_llc_i = 0;
  int current_llc_j = 0;
  int flag = 1;
  float interp_topo = 0.0;
  float diff_i = 0;
  float diff_j = 0;
  float v[4];
  float pos_i = 0.0;
  float pos_j = 0.0;
  float pos_radar_bin[2];
  float coords_neighbours[8];
  float val_neighbours[8];
  int j = 0;
  float slice_vert[mh_x];
  int k = 0;
  int idx = 0;
  int closest_1, closest_2;
  for (i = 0; i < crp_x; i++) {
    pos_radar_bin[0] = (coords_rad_pts[i * crp_y + 0] - llc_cosmo[0]) / res_cosmo[0];
    pos_radar_bin[1] = (coords_rad_pts[i * crp_y + 1] - llc_cosmo[1]) / res_cosmo[1];
    llc_i = floor(pos_radar_bin[1]);
    llc_j = floor(pos_radar_bin[0]);
    current_llc_i = llc_i;
    current_llc_j = llc_j;
    int neighb[4][2] = {{llc_i, llc_j}, {llc_i, llc_j + 1}, {llc_i + 1, llc_j}, {llc_i + 1, llc_j + 1}};
    flag = 1;
    pos_i = fmod(pos_radar_bin[1], 1.0);
    pos_j = fmod(pos_radar_bin[0], 1.0);
    diff_i = 1.0 - pos_i;
    diff_j = 1.0 - pos_j;
    for (k = 0; k < 4; k++) {
      v[k] = model_heights[(mh_x - 1) * mh_y * mh_z + neighb[k][0] * mh_z + neighb[k][1]];
    }
    interp_topo = diff_i * diff_j * v[0] + pos_i * v[2] * diff_j + diff_i * v[1] * pos_j + pos_i * pos_j * v[3];
    if (interp_topo < radar_heights[i]) {
      for (j = 0; j < 4; j++) {
        int n[2] = {neighb[j][0], neighb[j][1]};
        slice_vert[mh_x];
        for (k = 0; k < mh_x; k++) {
          slice_vert[k] = model_heights[k * mh_y * mh_z + n[0] * mh_z + n[1]];
        }
        idx = binary_search(slice_vert, mh_x, radar_heights[i]);
        if (idx == -1) {
          flag = 2;
          break;
        }
        if (idx == -2) {
          closest_1 = mh_x - 3;
          closest_2 = mh_x - 2;
        } else {
          if (idx == (mh_x - 2)) {
            idx--;
          }
          closest_1 = idx;
          closest_2 = idx + 1;
        }
        coords_neighbours[2 * j] = slice_vert[closest_1];
        coords_neighbours[2 * j + 1] = slice_vert[closest_2];
        val_neighbours[2 * j] = model_data[closest_1 * md_z * md_y + n[0] * md_z + n[1]];
        val_neighbours[2 * j + 1] = model_data[closest_2 * md_z * md_y + n[0] * md_z + n[1]];
      }
      if (flag == 2) {
        for (k = i; k < crp_x; k++) {
          output[k] = -9999;
        }
      } else {
        output[i] = trilinear_interp(coords_neighbours, 8, val_neighbours, 8, pos_radar_bin, 2, radar_heights[i]);
      }
    } else {
      for (k = i; k < crp_x; k++) {
        output[k] = 0.0 / 0.0;
      }
    }
  }
  return output;
}
```