user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<gammaDev>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x44(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpl   $0x5,-0x44(%rbp)
  jg     L69
  movsd  D36(%rip),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L49
L4:
  mov    $0x0,%eax
  call   <uniformRandom@plt>
  movsd  -0x38(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  addl   $0x1,-0x3c(%rbp)
L49:
  mov    -0x3c(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jle    L4
  mov    -0x38(%rbp),%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movq   %xmm0,%rax
  movq   D0(%rip),%xmm0
  movq   %rax,%xmm2
  xorpd  %xmm0,%xmm2
  movapd %xmm2,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  jmp    L51
L69:
  mov    $0x0,%eax
  call   <uniformRandom@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x30(%rbp)
  mov    $0x0,%eax
  call   <uniformRandom@plt>
  addsd  %xmm0,%xmm0
  movsd  D36(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  -0x28(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  %xmm1,%xmm0
  movsd  D36(%rip),%xmm1
  comisd %xmm1,%xmm0
  ja     L69
  movsd  -0x28(%rbp),%xmm0
  divsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x44(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  movsd  D36(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  movsd  -0x18(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  comisd -0x38(%rbp),%xmm0
  jae    L69
  movsd  -0x20(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  D36(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm1,-0x50(%rbp)
  movsd  -0x38(%rbp),%xmm0
  divsd  -0x18(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  mulsd  -0x18(%rbp),%xmm0
  movsd  -0x10(%rbp),%xmm1
  mulsd  -0x20(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  mulsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    $0x0,%eax
  call   <uniformRandom@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm3
  comisd -0x8(%rbp),%xmm3
  ja     L69
L51:
  movsd  -0x38(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D36
type: f64
name: parse_data
arguments: label: D0
type: f32[2]

tool: D36: 1

tool: {"D0": [0.0,-0.0]}

assistant: ```c
double gammaDev(int shape) {
  double am, e, s, v1, v2, y;
  double gamma;
  assert(shape >= 1);
  if (shape < 6) {
    gamma = 1.0;
    for (int i = 0; i <= shape; i++)
      gamma *= uniformRandom();
    gamma = -(log(gamma));
  } else {
    do {
      do {
        do {
          v1 = uniformRandom();
          v2 = 2.0 * uniformRandom() - 1.0;
        } while (v1 * v1 + v2 * v2 > 1.0);
        y = v2 / v1;
        am = shape - 1;
        s = sqrt(2.0 * am + 1.0);
        gamma = s * y + am;
      } while (gamma <= 0.0);
      e = (1.0 + y * y) * exp(am * log(gamma / am) - s * y);
    } while (uniformRandom() > e);
  }
  return gamma;
}
```