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

```asm
<randev0>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  movsd  %xmm0,-0x48(%rbp)
  movsd  D49(%rip),%xmm0
  subsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x28(%rbp),%xmm0
  movq   D2(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  mulsd  -0x48(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x28(%rbp),%xmm1
  movsd  -0x28(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  D49(%rip),%xmm0
  divsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
L90:
  mov    $0x0,%eax
  call   <drand2@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  movsd  -0x20(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jb     L87
  movsd  -0x10(%rbp),%xmm0
  divsd  -0x20(%rbp),%xmm0
  movq   %xmm0,%rax
  movsd  -0x18(%rbp),%xmm0
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <pow@plt>
  movsd  -0x28(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  jmp    L64
L87:
  movsd  D49(%rip),%xmm0
  subsd  -0x20(%rbp),%xmm0
  movsd  D49(%rip),%xmm1
  subsd  -0x10(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x38(%rbp),%xmm0
  divsd  -0x28(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movsd  -0x28(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
L64:
  mov    $0x0,%eax
  call   <drand2@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  D49(%rip),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x8(%rbp),%xmm1
  movsd  -0x30(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jb     L10
  movsd  D49(%rip),%xmm0
  divsd  -0x8(%rbp),%xmm0
  movsd  D49(%rip),%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  -0x30(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jae    L92
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movq   %xmm0,%rax
  movq   D2(%rip),%xmm0
  movq   %rax,%xmm1
  xorpd  %xmm0,%xmm1
  movsd  -0x30(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jae    L85
L10:
  pxor   %xmm0,%xmm0
  ucomisd -0x38(%rbp),%xmm0
  jp     L39
  pxor   %xmm0,%xmm0
  ucomisd -0x38(%rbp),%xmm0
  jne    L39
  movsd  D17(%rip),%xmm0
  movsd  %xmm0,-0x38(%rbp)
L39:
  movsd  -0x38(%rbp),%xmm0
  jmp    L63
L92:
  nop
  jmp    L90
L85:
  nop
  jmp    L90
L63:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D49
type: f64
name: read_data
arguments: data_label: D2
type: f32[2]
name: read_data
arguments: data_label: D17
type: byte[8]

tool: D49: 1

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

tool: {"D17": [0x23,0x42,0x92,0x0c,0xa1,0x9c,0xc7,0x3b]}

assistant: ```c
double randev0(double a) {
  double r1, r2, x, w;
  double t = 1.0 - a;
  double p = t / (t + a * exp(-t));
  double s = 1.0 / a;
  for (;;) {
    r1 = (drand2());
    if (r1 <= p) {
      x = t * pow(r1 / p, s);
      w = x;
    } else {
      x = t + log((1.0 - p) / (1.0 - r1));
      w = t * log(x / t);
    }
    r2 = (drand2());
    if ((1.0 - r2) <= w) {
      if ((1.0 / r2 - 1.0) <= w)
        continue;
      if (-log(r2) <= w)
        continue;
    }
    if (x == 0.0)
      x = 1.0e-20;
    return x;
  }
}
```