user: Demonstrate the C code that generates the assembly output below:

```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    L72
  cmp    $0x1,%ebx
  je     L136
  mov    %ebx,%edx
  movapd D19(%rip),%xmm0
  shr    %edx
  shl    $0x4,%rdx
  add    %rax,%rdx
  nop
L52:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L52
  mov    %ebx,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%bl
  je     L70
L109:
  mov    D19(%rip),%rcx
  cltq
  mov    %rcx,(%r14,%rax,8)
L70:
  mov    0x28(%rsp),%edi
  imul   %ebx,%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    0x1c(%rsp),%edi
  mov    %rax,0x20(%rsp)
  test   %edi,%edi
  js     L122
  lea    0x40(%rsp),%rax
  movl   $0x0,0x18(%rsp)
  mov    %r14,%r15
  mov    %rax,0x10(%rsp)
  lea    0x38(%rsp),%rax
  mov    %rax,0x8(%rsp)
  mov    %ebx,%eax
  mov    %rax,(%rsp)
  nopl   0x0(%rax,%rax,1)
L91:
  xor    %r14d,%r14d
  mov    %r13,%rax
  mov    %r14,%r13
  mov    %r15,%r14
  mov    %rax,%r15
  nop
L4:
  push   0x10(%rsp)
  mov    %r13d,%esi
  mov    %rbp,%rcx
  mov    %r15,%r9
  push   0x10(%rsp)
  mov    %r12,%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,%r13,8)
  add    $0x1,%r13
  pop    %rcx
  pop    %rsi
  cmp    (%rsp),%r13
  jne    L4
  addl   $0x1,0x18(%rsp)
  mov    %r15,%r13
  mov    0x18(%rsp),%eax
  mov    %r14,%r15
  cmp    %eax,0x1c(%rsp)
  jge    L91
L122:
  mov    0x28(%rsp),%eax
  imul   0x90(%rsp),%eax
  movslq %ebx,%rdx
  movl   $0x0,0x18(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %eax,0x1c(%rsp)
  test   %eax,%eax
  js     L53
  mov    %r13,%rax
  mov    %r12,%r13
  mov    %rbp,%r12
  mov    %r14,%rbp
  mov    %rax,%r14
  nopl   (%rax)
L44:
  lea    0x40(%rsp),%rax
  xor    %r15d,%r15d
  mov    %rax,0x8(%rsp)
  lea    0x38(%rsp),%rax
  mov    %rax,(%rsp)
  test   %ebx,%ebx
  jle    L76
  mov    %r14,%rax
  mov    %r15,%r14
  mov    %rax,%r15
  nopl   0x0(%rax,%rax,1)
L85:
  push   0x8(%rsp)
  mov    %rbp,%rdx
  mov    %r14d,%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,0x0(%rbp,%r14,8)
  add    $0x1,%r14
  pop    %rax
  pop    %rdx
  cmp    %r14,0x10(%rsp)
  jne    L85
  mov    %r15,%r14
L76:
  mov    0x18(%rsp),%eax
  test   %eax,%eax
  je     L107
  cltd
  idivl  0x90(%rsp)
  test   %edx,%edx
  je     L166
L107:
  addl   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%eax
  cmp    0x1c(%rsp),%eax
  jle    L44
  mov    %rbp,%r14
L53:
  mov    %r14,%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L36
  mov    0x20(%rsp),%rax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L166:
  sub    $0x1,%eax
  mov    0x20(%rsp),%rdx
  mov    %rbp,%rsi
  imul   %ebx,%eax
  cltq
  lea    (%rdx,%rax,8),%rdi
  mov    0x2c(%rsp),%edx
  call   <memcpy@plt>
  jmp    L107
L72:
  mov    0x28(%rsp),%edi
  imul   %ebx,%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  jmp    L122
L136:
  xor    %eax,%eax
  jmp    L109
L36:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D19
datatype: byte[16]

tool: {"D19": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f,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;
}
```