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

```asm
<fnMH_C>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x88,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    %rcx,-0x80(%rbp)
  mov    %r8,-0x88(%rbp)
  mov    %r9,-0x90(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x98(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x78(%rbp),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x38(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L38:
  cmp    %rdx,%rsp
  je     L84
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L38
L84:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L43
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L43:
  mov    %rsp,%rax
  add    $0x7,%rax
  shr    $0x3,%rax
  shl    $0x3,%rax
  mov    %rax,-0x30(%rbp)
  movl   $0x0,-0x54(%rbp)
  jmp    L40
L114:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  mov    -0x54(%rbp),%edx
  movslq %edx,%rdx
  movsd  %xmm0,(%rax,%rdx,8)
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rax,%rdx
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x90(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x54(%rbp)
L40:
  mov    -0x78(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x54(%rbp)
  jl     L114
  movl   $0x0,-0x58(%rbp)
  movl   $0x1,-0x50(%rbp)
  jmp    L98
L53:
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x40(%rbp)
  movsd  -0x40(%rbp),%xmm0
  movsd  D4(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L134
  movsd  D4(%rip),%xmm0
  movsd  %xmm0,-0x40(%rbp)
L134:
  mov    -0x78(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x50(%rbp),%edx
  imul   %edx,%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x40(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jb     L90
  movl   $0x0,-0x4c(%rbp)
  jmp    L135
L60:
  mov    -0x44(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  mov    -0x4c(%rbp),%edx
  movslq %edx,%rdx
  movsd  %xmm0,(%rax,%rdx,8)
  addl   $0x1,-0x4c(%rbp)
L135:
  mov    -0x78(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L60
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x58(%rbp)
  mov    -0x98(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x98(%rbp),%rax
  mov    %edx,(%rax)
L90:
  movl   $0x0,-0x48(%rbp)
  jmp    L57
L87:
  mov    -0x44(%rbp),%edx
  mov    -0x48(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x30(%rbp),%rax
  mov    -0x48(%rbp),%edx
  movslq %edx,%rdx
  movsd  (%rax,%rdx,8),%xmm0
  movsd  %xmm0,(%rcx)
  addl   $0x1,-0x48(%rbp)
L57:
  mov    -0x78(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x48(%rbp)
  jl     L87
  addl   $0x1,-0x50(%rbp)
L98:
  mov    -0x70(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x50(%rbp)
  jl     L53
  mov    %rbx,%rsp
  nop
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L72
  call   <__stack_chk_fail@plt>
L72:
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D4
type_infered: byte[8]

tool: {"D4": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
void fnMH_C(double *theta, int *N, int *k, double *lnw, double *u, double *draws, int *ns) {
  int m, s;
  double e;
  double tmp[*k];
  for (int j = 0; j < *k; j++) {
    tmp[j] = theta[j];
    draws[j] = theta[j];
  }
  s = 0;
  for (int i = 1; i < *N; i++) {
    e = exp(lnw[i] - lnw[s]);
    if (e > 1) {
      e = 1;
    }
    m = i * (*k);
    if (u[i] <= e) {
      for (int j = 0; j < *k; j++) {
        tmp[j] = theta[m + j];
      }
      s = i;
      *ns = *ns + 1;
    }
    for (int j = 0; j < *k; j++)
      draws[m + j] = tmp[j];
  }
}
```