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

```asm
<update_map>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x58(%rbp)
  mov    %r9d,-0x5c(%rbp)
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x60(%rbp)
  movss  -0x60(%rbp),%xmm0
  movaps %xmm0,%xmm1
  mulss  %xmm0,%xmm1
  movss  D3(%rip),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x10(%rbp)
  movl   $0x1,-0x20(%rbp)
  jmp    L117
L67:
  movl   $0x1,-0x1c(%rbp)
  jmp    L56
L76:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x1c(%rbp)
L56:
  mov    -0x1c(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jle    L76
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x14(%rbp)
  movl   $0x1,-0x24(%rbp)
  jmp    L30
L116:
  movl   $0x0,-0x18(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L98
L94:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x20(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x48(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    (%rdx),%edx
  sub    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  imul   %eax,%eax
  add    %eax,-0x18(%rbp)
  addl   $0x1,-0x1c(%rbp)
L98:
  mov    -0x1c(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jle    L94
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x18(%rbp),%xmm0
  mulss  -0x10(%rbp),%xmm0
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm0,%xmm2
  movq   %xmm2,%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x8(%rbp)
  movss  -0x14(%rbp),%xmm0
  addss  -0x8(%rbp),%xmm0
  movss  %xmm0,-0x14(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L13
L89:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  -0x8(%rbp),%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x1c(%rbp)
L13:
  mov    -0x1c(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jle    L89
  addl   $0x1,-0x24(%rbp)
L30:
  mov    -0x24(%rbp),%eax
  cmp    0x20(%rbp),%eax
  jle    L116
  movss  D9(%rip),%xmm0
  divss  -0x14(%rbp),%xmm0
  movss  %xmm0,-0x14(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L105
L53:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mulss  -0x14(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x1c(%rbp)
L105:
  mov    -0x1c(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jle    L53
  addl   $0x1,-0x20(%rbp)
L117:
  mov    -0x20(%rbp),%eax
  cmp    0x18(%rbp),%eax
  jle    L67
  nop
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D3
type_guessed: byte[4]
name: retrieve_data
arguments: tag: D9
type_guessed: f32

tool: {"D3": [0x00,0x00,0x00,0xbf]}

tool: D9: 1

assistant: ```c
void update_map(map, a, coords, data, win_list, sigmax, dim, ivars, total_units, samples) float **map, **data, **a, sigmax;
int **coords, *win_list;
int dim, ivars, total_units, samples;
{
  int i, j, k, winner, dist, diff, time_count;
  float factorx, c, distf, sum, ypred, d, weight_sumx;
  float weightx, tot_error, tot_error2, rms_error, rms_data_weights();
  factorx = -.5 / (sigmax * sigmax);
  for (j = 1; j <= total_units; j++) {
    for (k = 1; k <= ivars; k++)
      map[j][k] = 0;
    weight_sumx = 0;
    for (i = 1; i <= samples; i++) {
      dist = 0;
      winner = win_list[i];
      for (k = 1; k <= dim; k++) {
        diff = coords[winner][k] - coords[j][k];
        dist = dist + diff * diff;
      }
      weightx = exp(dist * factorx);
      weight_sumx += weightx;
      for (k = 1; k <= ivars; k++)
        map[j][k] += data[i][k] * weightx;
    }
    weight_sumx = 1.0 / weight_sumx;
    for (k = 1; k <= ivars; k++)
      map[j][k] = map[j][k] * weight_sumx;
  }
}
```