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

```asm
<layer_cloud>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x58(%rbp)
  movsd  D12(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movq   $0x0,-0x28(%rbp)
  jmp    L18
L26:
  mov    -0x48(%rbp),%rax
  imul   -0x58(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  D48(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x28(%rbp)
L18:
  mov    -0x28(%rbp),%rax
  cmp    -0x58(%rbp),%rax
  jl     L26
  mov    -0x48(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x20(%rbp)
  jmp    L41
L71:
  movq   $0x0,-0x28(%rbp)
  jmp    L2
L59:
  mov    -0x20(%rbp),%rax
  sub    $0x1,%rax
  imul   -0x58(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%rax
  imul   -0x58(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  jbe    L78
  mov    -0x20(%rbp),%rax
  sub    $0x1,%rax
  imul   -0x58(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  jmp    L10
L78:
  mov    -0x20(%rbp),%rax
  imul   -0x58(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
L10:
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  sub    $0x1,%rax
  imul   -0x58(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x18(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L48
  mov    -0x20(%rbp),%rax
  sub    $0x1,%rax
  imul   -0x58(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  jmp    L69
L48:
  movsd  -0x18(%rbp),%xmm0
L69:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  movsd  D48(%rip),%xmm0
  subsd  -0x10(%rbp),%xmm0
  movsd  D48(%rip),%xmm1
  subsd  -0x8(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x28(%rbp)
L2:
  mov    -0x28(%rbp),%rax
  cmp    -0x58(%rbp),%rax
  jl     L59
  addq   $0x1,-0x20(%rbp)
L41:
  mov    -0x20(%rbp),%rax
  cmp    -0x50(%rbp),%rax
  jle    L71
  movq   $0x0,-0x28(%rbp)
  jmp    L28
L109:
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  D48(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x28(%rbp)
L28:
  mov    -0x28(%rbp),%rax
  cmp    -0x58(%rbp),%rax
  jl     L109
  nop
  nop
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D12
type_infered: byte[8]
name: retrieve_data
arguments: tag: D48
type_infered: f64

tool: {"D12": [0xd1,0xdc,0xff,0xff,0xff,0xff,0xef,0x3f]}

tool: D48: 1

assistant: ```c
void layer_cloud(const double *cc, double *ll, long MaxLev, long MinLev, long dimgp) {
  long i, k;
  double maxval, minval;
  double ZEPSEC;
  ZEPSEC = 1. - 1.0e-12;
  for (i = 0; i < dimgp; i++)
    ll[i] = 1. - cc[i + MaxLev * dimgp];
  for (k = MaxLev + 1; k <= MinLev; k++) {
    for (i = 0; i < dimgp; i++) {
      maxval = ((cc[i + (k - 1) * dimgp]) > (cc[i + k * dimgp]) ? (cc[i + (k - 1) * dimgp]) : (cc[i + k * dimgp]));
      minval = ((cc[i + (k - 1) * dimgp]) < (ZEPSEC) ? (cc[i + (k - 1) * dimgp]) : (ZEPSEC));
      ll[i] *= (1. - maxval) / (1. - minval);
    }
  }
  for (i = 0; i < dimgp; i++)
    ll[i] = 1. - ll[i];
}
```