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

```asm
<sample_Lambda_m>:
  endbr64
  push   %r15
  push   %r14
  movslq %edx,%r14
  push   %r13
  mov    %edi,%r13d
  lea    0x0(,%rdx,4),%edi
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x88,%rsp
  mov    0xd0(%rsp),%rax
  mov    0xe8(%rsp),%r8
  mov    %edx,0x18(%rsp)
  mov    %esi,0x14(%rsp)
  mov    0xc0(%rsp),%r15
  mov    %rax,0x50(%rsp)
  mov    0xd8(%rsp),%rax
  mov    %r8,0x20(%rsp)
  movslq 0xc8(%rsp),%r12
  mov    %rax,0x58(%rsp)
  mov    0xe0(%rsp),%rax
  mov    %ecx,0x10(%rsp)
  mov    %r9,0x8(%rsp)
  mov    %rax,0x70(%rsp)
  call   <malloc@plt>
  mov    0x18(%rsp),%edx
  mov    0x20(%rsp),%r8
  mov    %rax,%rbp
  test   %edx,%edx
  jle    L18
  lea    0x0(,%r14,4),%rdx
  mov    $0xff,%esi
  mov    %rax,%rdi
  mov    %r8,0x18(%rsp)
  call   <memset@plt>
  mov    0x18(%rsp),%r8
  xor    %eax,%eax
  xor    %r9d,%r9d
L14:
  cmp    %r12d,(%r15,%rax,4)
  jne    L89
  movslq %r9d,%rdx
  add    $0x1,%r9d
  mov    %eax,0x0(%rbp,%rdx,4)
L89:
  add    $0x1,%rax
  cmp    %r14,%rax
  jne    L14
L63:
  test   %r13d,%r13d
  jle    L165
  mov    0x8(%rsp),%rax
  mov    0x14(%rsp),%edi
  xor    %r14d,%r14d
  lea    (%rax,%r12,8),%rax
  mov    %rax,0x48(%rsp)
  mov    %edi,%eax
  imul   %r9d,%eax
  mov    %eax,0x64(%rsp)
  movslq %r13d,%rax
  mov    %rbp,%r13
  shl    $0x3,%rax
  mov    %rax,0x68(%rsp)
  lea    -0x1(%rdi),%eax
  lea    0x8(,%rax,8),%r10
  lea    -0x1(%r9),%eax
  lea    0x4(%rbp,%rax,4),%r15
  movslq 0x10(%rsp),%rax
  mov    %rbx,%rbp
  mov    %rax,0x78(%rsp)
L132:
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  jle    L48
  movq   $0x0,0x8(%rsp)
  pxor   %xmm2,%xmm2
  mov    %r13,%r12
  mov    %rbp,%r13
  cvtsi2sdl 0x64(%rsp),%xmm2
  movsd  %xmm2,0x40(%rsp)
L45:
  mov    0x8(%rsp),%rax
  lea    0x0(,%rax,8),%rbp
  mov    %eax,%r11d
  lea    0x0(,%rax,4),%rbx
  mov    %rbp,%rax
  mov    %r12,%rbp
  mov    %rax,%r12
  nopl   (%rax)
L7:
  mov    0x14(%rsp),%ecx
  xor    %esi,%esi
  xor    %edx,%edx
  pxor   %xmm0,%xmm0
  test   %ecx,%ecx
  jle    L93
  nopl   0x0(%rax,%rax,1)
L28:
  mov    %rbp,%rax
  test   %r9d,%r9d
  je     L118
  nopl   0x0(%rax,%rax,1)
L129:
  movslq (%rax),%rcx
  add    $0x4,%rax
  mov    0x0(%r13,%rcx,8),%rcx
  mov    (%rcx,%r14,1),%rcx
  mov    (%rcx,%rsi,1),%rcx
  mov    (%rcx,%r12,1),%rcx
  add    (%rcx,%rbx,1),%edx
  cmp    %r15,%rax
  jne    L129
L118:
  add    $0x8,%rsi
  cmp    %rsi,%r10
  jne    L28
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
L93:
  mov    (%r8,%r14,1),%rcx
  cmp    0x8(%rsp),%r11d
  je     L169
  mov    0x48(%rsp),%rdi
  mov    (%rcx,%r12,1),%rdx
  lea    (%rbx,%rbx,1),%rax
  mov    %r8,0x38(%rsp)
  mov    %r10,0x30(%rsp)
  mov    (%rdi),%rcx
  add    %rax,%rdx
  mov    %r11d,0x28(%rsp)
  mov    %r9d,0x60(%rsp)
  mov    (%rcx,%r14,1),%rcx
  mov    %rdx,0x20(%rsp)
  mov    %rax,0x18(%rsp)
  mov    (%rcx,%r12,1),%rcx
  cmpl   $0x1,(%rcx,%rbx,1)
  je     L57
  mov    0x50(%rsp),%rax
  movsd  0x40(%rsp),%xmm1
  addsd  (%rax),%xmm0
  addsd  0x8(%rax),%xmm1
  call   <rgamma@plt>
  mov    0x38(%rsp),%r8
  mov    0x30(%rsp),%r10
  mov    0x28(%rsp),%r11d
  mov    0x60(%rsp),%r9d
  mov    0x20(%rsp),%rdx
  mov    0x18(%rsp),%rax
L166:
  movsd  %xmm0,(%rdx)
  mov    (%r8,%r14,1),%rdx
  mov    (%rdx,%r12,1),%rcx
  movsd  (%rcx,%rax,1),%xmm0
  mov    (%rdx,%rax,1),%rax
  movsd  %xmm0,(%rax,%r12,1)
L11:
  add    $0x1,%r11d
  add    $0x4,%rbx
  cmp    %r11d,0x10(%rsp)
  jg     L7
  addq   $0x1,0x8(%rsp)
  mov    %rbp,%r12
  mov    0x8(%rsp),%rax
  cmp    %rax,0x78(%rsp)
  jne    L45
  mov    %r13,%rbp
  mov    %r12,%r13
L48:
  add    $0x8,%r14
  cmp    %r14,0x68(%rsp)
  jne    L132
  mov    %r13,%rbp
L165:
  add    $0x88,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <free@plt>
L57:
  mov    0x58(%rsp),%rax
  movsd  0x40(%rsp),%xmm1
  addsd  (%rax),%xmm0
  addsd  0x8(%rax),%xmm1
  call   <rgamma@plt>
  mov    0x18(%rsp),%rax
  mov    0x20(%rsp),%rdx
  mov    0x60(%rsp),%r9d
  mov    0x28(%rsp),%r11d
  mov    0x30(%rsp),%r10
  mov    0x38(%rsp),%r8
  jmp    L166
L169:
  mov    (%rcx,%r12,1),%rax
  pxor   %xmm0,%xmm0
  movsd  0x40(%rsp),%xmm1
  mov    %r8,0x30(%rsp)
  cvtsi2sd %edx,%xmm0
  mov    %r10,0x28(%rsp)
  add    %r12,%rax
  mov    %r11d,0x60(%rsp)
  mov    %rax,0x18(%rsp)
  mov    0x70(%rsp),%rax
  mov    %r9d,0x20(%rsp)
  addsd  (%rax),%xmm0
  addsd  0x8(%rax),%xmm1
  call   <rgamma@plt>
  mov    0x18(%rsp),%rax
  mov    0x20(%rsp),%r9d
  mov    0x60(%rsp),%r11d
  mov    0x28(%rsp),%r10
  mov    0x30(%rsp),%r8
  movsd  %xmm0,(%rax)
  jmp    L11
L18:
  xor    %r9d,%r9d
  jmp    L63
```

assistant: ```c
void sample_Lambda_m(int D, int R, int N, int p, int *****Y_t, int ****L_t, int *cla_t, int m, double *par_0, double *par_1, double *par_2, double ***Lambda_t) {
  int total = 0, tmp;
  int *ind;
  ind = (int *)malloc(N * sizeof(int));
  for (int i = 0; i < N; i++) {
    ind[i] = -1;
  }
  for (int i = 0; i < N; i++) {
    if (cla_t[i] == m) {
      ind[total] = i;
      total += 1;
    }
  }
  for (int d = 0; d < D; d++) {
    for (int i = 0; i < p; i++) {
      for (int j = i; j < p; j++) {
        tmp = 0;
        for (int r = 0; r < R; r++) {
          for (int k = 0; k < total; k++) {
            tmp += Y_t[ind[k]][d][r][i][j];
          }
        }
        if (j == i) {
          Lambda_t[d][i][i] = rgamma(par_2[0] + tmp, par_2[1] + total * R);
        } else {
          if (L_t[m][d][i][j] == 1) {
            Lambda_t[d][i][j] = rgamma(par_1[0] + tmp, par_1[1] + total * R);
          } else {
            Lambda_t[d][i][j] = rgamma(par_0[0] + tmp, par_0[1] + total * R);
          }
          Lambda_t[d][j][i] = Lambda_t[d][i][j];
        }
      }
    }
  }
  free(ind);
}
```