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

```asm
<mc_poisson_large>:
  endbr64
  push   %r12
  sub    $0x40,%rsp
  movsd  %xmm0,0x8(%rsp)
  call   <log@plt>
  movsd  0x8(%rsp),%xmm1
  pxor   %xmm5,%xmm5
  movsd  D16(%rip),%xmm3
  movsd  %xmm0,0x30(%rsp)
  movsd  D49(%rip),%xmm0
  divsd  %xmm1,%xmm3
  movapd %xmm0,%xmm2
  movsd  D21(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm5
  subsd  %xmm3,%xmm2
  ja     L39
  sqrtsd %xmm0,%xmm0
L25:
  movsd  D23(%rip),%xmm3
  movsd  %xmm1,0x10(%rsp)
  divsd  %xmm0,%xmm3
  movapd %xmm2,%xmm0
  movapd %xmm3,%xmm5
  movsd  %xmm3,0x8(%rsp)
  mulsd  %xmm1,%xmm5
  movsd  %xmm5,0x18(%rsp)
  call   <log@plt>
  movq   %xmm0,%r12
  movsd  0x8(%rsp),%xmm0
  call   <log@plt>
  movsd  0x10(%rsp),%xmm1
  pxor   %xmm7,%xmm7
  movapd %xmm0,%xmm2
  movq   %r12,%xmm0
  movsd  %xmm7,0x28(%rsp)
  subsd  %xmm1,%xmm0
  movsd  %xmm7,0x10(%rsp)
  subsd  %xmm2,%xmm0
  movsd  %xmm0,0x38(%rsp)
  nopw   0x0(%rax,%rax,1)
L32:
  xor    %eax,%eax
  call   <mc_randf@plt>
  movapd %xmm0,%xmm1
  movsd  D4(%rip),%xmm0
  subsd  %xmm1,%xmm0
  divsd  %xmm1,%xmm0
  call   <log@plt>
  movsd  D15(%rip),%xmm4
  movapd %xmm0,%xmm1
  movsd  0x18(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  divsd  0x8(%rsp),%xmm0
  addsd  %xmm0,%xmm4
  movsd  %xmm0,0x20(%rsp)
  movapd %xmm4,%xmm0
  call   <floor@plt>
  mov    %rax,%r12
  test   %rax,%rax
  js     L49
  xor    %eax,%eax
  call   <mc_randf@plt>
  movsd  0x20(%rsp),%xmm1
  mulsd  0x8(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm3
  movsd  %xmm0,0x28(%rsp)
  subsd  %xmm1,%xmm3
  movapd %xmm3,%xmm0
  movsd  %xmm3,0x10(%rsp)
  call   <exp@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  D4(%rip),%xmm0
  cvttsd2si %xmm0,%rdi
  call   <_sqr@plt>
  movsd  0x28(%rsp),%xmm2
  divsd  %xmm0,%xmm2
  movapd %xmm2,%xmm0
  call   <log@plt>
  movsd  0x10(%rsp),%xmm3
  pxor   %xmm1,%xmm1
  mov    %r12,%rdi
  cvtsi2sd %r12,%xmm1
  mulsd  0x30(%rsp),%xmm1
  addsd  0x38(%rsp),%xmm1
  addsd  %xmm3,%xmm0
  movsd  %xmm1,0x20(%rsp)
  movsd  %xmm0,0x10(%rsp)
  call   <_log_factorial@plt>
  movsd  0x20(%rsp),%xmm1
  movapd %xmm1,%xmm6
  subsd  %xmm0,%xmm6
  movsd  0x10(%rsp),%xmm0
  comisd %xmm6,%xmm0
  movsd  %xmm6,0x28(%rsp)
  ja     L32
  add    $0x40,%rsp
  mov    %r12,%rax
  pop    %r12
  ret
  nopl   0x0(%rax)
L49:
  movsd  0x10(%rsp),%xmm7
  comisd 0x28(%rsp),%xmm7
  ja     L32
  add    $0x40,%rsp
  mov    %r12,%rax
  pop    %r12
  ret
L39:
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm2
  jmp    L25
```

tool_calls: name: disassemble_data
arguments: data_label: D16
type: f64
name: disassemble_data
arguments: data_label: D49
type: f64
name: disassemble_data
arguments: data_label: D21
type: f64
name: disassemble_data
arguments: data_label: D23
type: f64
name: disassemble_data
arguments: data_label: D4
type: f64
name: disassemble_data
arguments: data_label: D15
type: f64

tool: D16: 3.36

tool: D49: 0.767

tool: D21: 3

tool: D23: 3.141592653589793

tool: D4: 1

tool: D15: 0.5

assistant: ```c
long mc_poisson_large(double lambda) {
  double loglam, c, beta, alpha, k, u, v, x, y, lhs = 0, rhs = 0;
  long n = 0;
  loglam = log(lambda);
  c = 0.767 - 3.36 / lambda;
  beta = 3.14159265358979323846 / sqrt(3.0 * lambda);
  alpha = beta * lambda;
  k = log(c) - lambda - log(beta);
  do {
    u = mc_randf();
    x = (alpha - log((1.0 - u) / u)) / beta;
    n = (long)floor(x + 0.5);
    if (n < 0) {
      continue;
    }
    v = mc_randf();
    y = alpha - beta * x;
    lhs = y + log(v / _sqr(1.0 + exp(y)));
    rhs = k + n * loglam - _log_factorial(n);
  } while (lhs > rhs);
  return n;
}
```