user: Converte this assembly snippet into its equivalent C code:

```asm
<rndgamma>:
  endbr64
  push   %rbx
  sub    $0x30,%rsp
  movapd %xmm0,%xmm7
  movsd  %xmm0,0x28(%rsp)
  movsd  D13(%rip),%xmm0
  comisd %xmm7,%xmm0
  ja     L63
  movsd  0x28(%rsp),%xmm0
L70:
  subsd  D44(%rip),%xmm0
  movapd %xmm0,%xmm7
  movsd  %xmm0,0x20(%rsp)
  pxor   %xmm0,%xmm0
  ucomisd %xmm7,%xmm0
  ja     L95
  sqrtsd %xmm7,%xmm7
  movapd %xmm7,%xmm0
L1:
  movsd  D44(%rip),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%rsp)
L7:
  mov    $0x0,%eax
  call   <rndNormal@plt>
  movsd  %xmm0,0x8(%rsp)
  movsd  0x10(%rsp),%xmm3
  mulsd  %xmm0,%xmm3
  movapd %xmm3,%xmm0
  addsd  D13(%rip),%xmm0
  pxor   %xmm5,%xmm5
  comisd %xmm0,%xmm5
  jae    L7
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,0x18(%rsp)
  mov    $0x0,%eax
  call   <rndu@plt>
  movsd  D61(%rip),%xmm2
  movsd  0x8(%rsp),%xmm6
  mulsd  %xmm6,%xmm2
  movapd %xmm2,%xmm1
  mulsd  %xmm6,%xmm1
  mulsd  %xmm6,%xmm1
  mulsd  %xmm6,%xmm1
  movsd  D13(%rip),%xmm2
  subsd  %xmm1,%xmm2
  comisd %xmm0,%xmm2
  ja     L54
  call   <log@plt>
  mov    %eax,%ebx
  movsd  0x8(%rsp),%xmm6
  movapd %xmm6,%xmm0
  mulsd  D119(%rip),%xmm0
  mulsd  %xmm6,%xmm0
  movsd  %xmm0,0x8(%rsp)
  movsd  0x18(%rsp),%xmm0
  call   <log@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movsd  D13(%rip),%xmm0
  subsd  0x18(%rsp),%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  addsd  %xmm2,%xmm0
  mulsd  0x20(%rsp),%xmm0
  addsd  0x8(%rsp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L7
L54:
  movsd  0x20(%rsp),%xmm7
  mulsd  0x18(%rsp),%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  D13(%rip),%xmm0
  comisd 0x28(%rsp),%xmm0
  ja     L88
L21:
  movsd  0x8(%rsp),%xmm7
  ucomisd D9(%rip),%xmm7
  jp     L24
  je     L11
L24:
  movsd  0x8(%rsp),%xmm0
  add    $0x30,%rsp
  pop    %rbx
  ret
L63:
  addsd  %xmm0,%xmm7
  movapd %xmm7,%xmm0
  jmp    L70
L95:
  movsd  0x20(%rsp),%xmm0
  call   <sqrt@plt>
  jmp    L1
L88:
  mov    $0x0,%eax
  call   <rndu@plt>
  movsd  D13(%rip),%xmm1
  divsd  0x28(%rsp),%xmm1
  cvttsd2si %xmm1,%edi
  call   <pow@plt>
  mulsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  jmp    L21
L11:
  lea    D23(%rip),%rdi
  call   <printf@plt>
  jmp    L24
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D13
type_infered: f64
name: extract_symbolic_data
arguments: data_tag: D44
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_tag: D61
type_infered: f64
name: extract_symbolic_data
arguments: data_tag: D119
type_infered: f64
name: extract_symbolic_data
arguments: data_tag: D9
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_tag: D23
type_infered: string

tool: D13: 1

tool: {"D44": [0x55,0x55,0x55,0x55,0x55,0x55,0xd5,0x3f]}

tool: D61: 0.0331

tool: D119: 0.5

tool: {"D9": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D23: 
rndgamma returning 0.


assistant: ```c
double rndgamma(double a) {
  double a0 = a, c, d, u, v, x;
  if (a < 1)
    a++;
  d = a - 1.0 / 3.0;
  c = (1.0 / 3.0) / sqrt(d);
  for (;;) {
    do {
      x = rndNormal();
      v = 1.0 + c * x;
    } while (v <= 0);
    v *= v * v;
    u = rndu();
    if (u < 1 - 0.0331 * x * x * x * x)
      break;
    if (log(u) < 0.5 * x * x + d * (1 - v + log(v)))
      break;
  }
  v *= d;
  if (a0 < 1)
    v *= pow(rndu(), 1 / a0);
  if (v == 0)
    printf("\nrndgamma returning 0.\n");
  return v;
}
```