user: 请从给定的汇编指令推导出C源代码：

```asm
<sample_H>:
  endbr64
  push   %r15
  mov    %edi,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %esi,0x1c(%rsp)
  mov    %rdx,0x28(%rsp)
  mov    %rcx,0x30(%rsp)
  mov    %r8,0x38(%rsp)
  movsd  %xmm0,0x20(%rsp)
  test   %edi,%edi
  jle    L6
  test   %esi,%esi
  jle    L6
  sub    $0x1,%eax
  mov    0x90(%rsp),%r14
  mov    %r9,%r15
  lea    0x8(%r9,%rax,8),%rax
  mov    %rax,0x48(%rsp)
  movslq %esi,%rax
  mov    %rax,0x40(%rsp)
  nopl   (%rax)
L57:
  movq   $0x0,0x8(%rsp)
  nopl   0x0(%rax)
L84:
  mov    0x8(%rsp),%rax
  lea    0x0(,%rax,8),%r12
  mov    %eax,%ebx
  shl    $0x2,%rax
  mov    %rax,%r13
  mov    %rax,0x10(%rsp)
  mov    %r15,%rax
  mov    %r12,%rbp
  mov    %r13,%r15
  mov    %rax,%r13
  jmp    L27
  nopl   0x0(%rax)
L79:
  mov    (%rax,%rbp,1),%rcx
  mov    0x28(%rsp),%rax
  add    %r12,%rcx
  mov    %rcx,(%rsp)
L36:
  movsd  0x8(%rax),%xmm1
  movsd  (%rax),%xmm0
  add    $0x1,%ebx
  call   <rgamma@plt>
  mov    (%rsp),%rax
  mov    0x10(%rsp),%rdx
  movsd  %xmm0,(%rax)
  mov    0x0(%r13),%rax
  mov    (%rax,%rbp,1),%r9
  mov    (%rax,%r12,1),%rax
  mov    (%r9,%r15,1),%r9d
  add    $0x4,%r15
  mov    %r9d,(%rax,%rdx,1)
  mov    (%r14),%rax
  mov    (%rax,%rbp,1),%r9
  mov    (%rax,%r12,1),%rax
  movsd  (%r9,%r12,1),%xmm0
  movsd  %xmm0,(%rax,%rbp,1)
  cmp    %ebx,0x1c(%rsp)
  jle    L91
L27:
  lea    (%r15,%r15,1),%r12
  cmp    0x8(%rsp),%ebx
  je     L75
  mov    0x0(%r13),%rax
  movsd  0x20(%rsp),%xmm0
  mov    (%rax,%rbp,1),%r9
  add    %r15,%r9
  mov    %r9,(%rsp)
  call   <rbernoulli@plt>
  mov    (%rsp),%r9
  mov    %eax,(%r9)
  mov    0x0(%r13),%rax
  mov    (%rax,%rbp,1),%rax
  cmpl   $0x1,(%rax,%r15,1)
  mov    (%r14),%rax
  jne    L79
  mov    (%rax,%rbp,1),%rsi
  mov    0x30(%rsp),%rax
  add    %r12,%rsi
  mov    %rsi,(%rsp)
  jmp    L36
  nopl   0x0(%rax)
L75:
  mov    (%r14),%rax
  add    $0x1,%ebx
  add    $0x4,%r15
  add    (%rax,%rbp,1),%r12
  mov    0x38(%rsp),%rax
  movsd  0x8(%rax),%xmm1
  movsd  (%rax),%xmm0
  call   <rgamma@plt>
  mov    0x0(%r13),%rax
  mov    0x10(%rsp),%rdi
  movsd  %xmm0,(%r12)
  mov    (%rax,%rbp,1),%rax
  movl   $0xffffffff,(%rax,%rdi,1)
  cmp    %ebx,0x1c(%rsp)
  jg     L27
L91:
  addq   $0x1,0x8(%rsp)
  mov    %r13,%r15
  mov    0x8(%rsp),%rax
  cmp    %rax,0x40(%rsp)
  jne    L84
  add    $0x8,%r14
  add    $0x8,%r15
  cmp    %r15,0x48(%rsp)
  jne    L57
L6:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void sample_H(int D, int p, double *par_0, double *par_1, double *par_2, double par_p_t, int ***L, double ***Lambda) {
  for (int d = 0; d < D; d++) {
    for (int i = 0; i < p; i++) {
      for (int j = i; j < p; j++) {
        if (j == i) {
          Lambda[d][i][j] = rgamma(par_2[0], par_2[1]);
          L[d][i][i] = -1;
        } else {
          L[d][i][j] = rbernoulli(par_p_t);
          if (L[d][i][j] == 1) {
            Lambda[d][i][j] = rgamma(par_1[0], par_1[1]);
          } else {
            Lambda[d][i][j] = rgamma(par_0[0], par_0[1]);
          }
          L[d][j][i] = L[d][i][j];
          Lambda[d][j][i] = Lambda[d][i][j];
        }
      }
    }
  }
}
```