user: What would the C source look like for the assembly code provided here?

```asm
<DiscreteGammaMedian>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  movsd  %xmm0,-0x40(%rbp)
  movsd  %xmm1,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x4c(%rbp),%eax
  test   %rax,%rax
  js     L51
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L5
L51:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L5:
  movsd  D26(%rip),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm1
  movsd  D19(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  cmpl   $0x0,-0x4c(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  cmpq   $0x0,-0x38(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  movsd  -0x40(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  seta   %al
  movzbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  movsd  -0x48(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  seta   %al
  movzbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  cmpl   $0x1,-0x4c(%rbp)
  ja     L13
  mov    -0x38(%rbp),%rax
  movsd  D26(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L11
L13:
  movsd  -0x40(%rbp),%xmm1
  movsd  D26(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  mov    $0x1,%eax
  call   <LnGamma@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L12
L15:
  movsd  -0x40(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  mov    -0x18(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    $0x2,%eax
  call   <PointChi2@plt>
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  lea    0x0(,%rax,8),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x24(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x20(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x18(%rbp),%xmm0
  addsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  addl   $0x1,-0x24(%rbp)
L12:
  mov    -0x24(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jb     L15
  mov    -0x4c(%rbp),%eax
  test   %rax,%rax
  js     L8
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L43
L8:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L43:
  movsd  -0x20(%rbp),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,-0x20(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L62
L66:
  mov    -0x24(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x24(%rbp)
L62:
  mov    -0x24(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jb     L66
L11:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D26
type: f64
name: retrieve_data
arguments: tag: D19
type: f64

tool: D26: 1

tool: D19: 0.5

assistant: ```c
void DiscreteGammaMedian(double rates[], const double alpha, const double beta, unsigned n_cat) {
  unsigned i;
  double total = 0.0;
  const double cat_freq = 1.0 / ((double)n_cat);
  double prop = cat_freq * 0.5;
  double lnga1;
  assert(n_cat > 0);
  assert(rates != 0L);
  assert(alpha > 0.0);
  assert(beta > 0.0);
  if (n_cat < 2) {
    rates[0] = 1.0;
    return;
  }
  lnga1 = LnGamma(alpha + 1.0);
  for (i = 0; i < n_cat; ++i) {
    rates[i] = PointChi2(prop, 2.0 * alpha);
    total += rates[i];
    prop += cat_freq;
  }
  total /= (double)n_cat;
  for (i = 0; i < n_cat; ++i)
    rates[i] /= total;
}
```