user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<mvvm_sampler_gibbs>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x58,%rsp
  mov    %edi,0x28(%rsp)
  mov    %r9d,0x1c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    0x0(,%rsi,8),%eax
  mov    %eax,%edi
  mov    %eax,0x2c(%rsp)
  call   <malloc@plt>
  mov    %rax,%r14
  test   %ebx,%ebx
  jle    L75
  mov    %ebx,%edx
  movsd  D2(%rip),%xmm0
  lea    (%rax,%rdx,8),%rdx
  nopl   (%rax)
L19:
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L19
L75:
  mov    0x28(%rsp),%edi
  imul   %ebx,%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    0x1c(%rsp),%edi
  movl   $0x0,0x18(%rsp)
  mov    %rax,0x20(%rsp)
  movslq %ebx,%rax
  mov    %rax,0x10(%rsp)
  test   %edi,%edi
  js     L43
  mov    %r13,%rax
  mov    %r12,%r13
  mov    %rbp,%r12
  mov    %rax,%rbp
  nopl   0x0(%rax)
L0:
  lea    0x40(%rsp),%rax
  xor    %r15d,%r15d
  mov    %rax,0x8(%rsp)
  lea    0x38(%rsp),%rax
  mov    %rax,(%rsp)
  test   %ebx,%ebx
  jle    L80
  mov    %rbp,%rax
  mov    %r15,%rbp
  mov    %rax,%r15
  nopl   0x0(%rax,%rax,1)
L137:
  push   0x8(%rsp)
  mov    %ebp,%esi
  mov    %r12,%rcx
  mov    %r15,%r9
  push   0x8(%rsp)
  mov    %r13,%r8
  mov    %r14,%rdx
  mov    %ebx,%edi
  call   <condKappaMu@plt>
  movsd  0x50(%rsp),%xmm1
  movsd  0x48(%rsp),%xmm0
  call   <rvm_s@plt>
  movsd  %xmm0,(%r14,%rbp,8)
  add    $0x1,%rbp
  pop    %rcx
  pop    %rsi
  cmp    %rbp,0x10(%rsp)
  jne    L137
  mov    %r15,%rbp
L80:
  addl   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%eax
  cmp    %eax,0x1c(%rsp)
  jge    L0
  mov    %rbp,%rax
  mov    %r12,%rbp
  mov    %r13,%r12
  mov    %rax,%r13
L43:
  mov    0x28(%rsp),%eax
  imul   0x90(%rsp),%eax
  movslq %ebx,%rcx
  movl   $0x0,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %eax,0x1c(%rsp)
  test   %eax,%eax
  js     L121
  mov    %r13,%rax
  mov    %r12,%r13
  mov    %rbp,%r12
  mov    %r14,%rbp
  mov    %rax,%r14
  xchg   %ax,%ax
L24:
  lea    0x40(%rsp),%rax
  xor    %r15d,%r15d
  mov    %rax,0x8(%rsp)
  lea    0x38(%rsp),%rax
  mov    %rax,(%rsp)
  test   %ebx,%ebx
  jle    L46
  mov    %r14,%rax
  mov    %rbp,%r14
  mov    %r15,%rbp
  mov    %rax,%r15
  cs nopw 0x0(%rax,%rax,1)
L15:
  push   0x8(%rsp)
  mov    %r14,%rdx
  mov    %ebp,%esi
  mov    %r15,%r9
  push   0x8(%rsp)
  mov    %r13,%r8
  mov    %r12,%rcx
  mov    %ebx,%edi
  call   <condKappaMu@plt>
  movsd  0x50(%rsp),%xmm1
  movsd  0x48(%rsp),%xmm0
  call   <rvm_s@plt>
  movsd  %xmm0,(%r14,%rbp,8)
  add    $0x1,%rbp
  pop    %rax
  pop    %rdx
  cmp    %rbp,0x10(%rsp)
  jne    L15
  mov    %r14,%rbp
  mov    %r15,%r14
L46:
  mov    0x18(%rsp),%eax
  test   %eax,%eax
  je     L69
  cltd
  idivl  0x90(%rsp)
  test   %edx,%edx
  je     L108
L69:
  addl   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%eax
  cmp    0x1c(%rsp),%eax
  jle    L24
  mov    %rbp,%r14
L121:
  mov    %r14,%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  mov    0x20(%rsp),%rax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L108:
  sub    $0x1,%eax
  mov    0x20(%rsp),%rcx
  mov    0x2c(%rsp),%edx
  mov    %rbp,%rsi
  imul   %ebx,%eax
  cltq
  lea    (%rcx,%rax,8),%rdi
  call   <memcpy@plt>
  jmp    L69
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D2
datatype: byte[8]

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

assistant: ```c
double *mvvm_sampler_gibbs(int n, int p, double *mu, double *kappa, double *lambda, int initk, int k) {
  double *theta;
  double *ret;
  double mu_c, kappa_c;
  int i, j;
  theta = malloc(sizeof(double) * p);
  for (i = 0; i < p; i++)
    theta[i] = 1;
  ret = malloc(sizeof(double) * n * p);
  for (i = 0; i <= initk; i++) {
    for (j = 0; j < p; j++) {
      condKappaMu(p, j, theta, mu, kappa, lambda, &mu_c, &kappa_c);
      theta[j] = rvm_s(mu_c, kappa_c);
    }
  }
  for (i = 0; i <= (k * n); i++) {
    for (j = 0; j < p; j++) {
      condKappaMu(p, j, theta, mu, kappa, lambda, &mu_c, &kappa_c);
      theta[j] = rvm_s(mu_c, kappa_c);
    }
    if (i != 0 && i % k == 0)
      memcpy(ret + ((i / k) - 1) * p, theta, sizeof(double) * p);
  }
  free(theta);
  return ret;
}
```