user: 请从给定的汇编指令推导出C源代码：

```asm
<c_single_scat>:
  endbr64
  push   %r15
  movslq %edi,%r15
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %r8,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  movq   %xmm0,%rbx
  sub    $0x38,%rsp
  movsd  %xmm3,0x10(%rsp)
  xorpd  D24(%rip),%xmm3
  movsd  %xmm1,(%rsp)
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x8(%rsp)
  divsd  %xmm2,%xmm0
  movsd  %xmm4,0x28(%rsp)
  call   <exp@plt>
  movsd  0x8(%rsp),%xmm2
  addsd  (%rsp),%xmm2
  movq   %rbx,%xmm7
  andpd  D10(%rip),%xmm2
  movapd %xmm0,%xmm1
  comisd %xmm2,%xmm7
  jae    L12
  movsd  (%rsp),%xmm5
  pxor   %xmm6,%xmm6
  comisd %xmm6,%xmm5
  jbe    L58
  cmp    %ebp,%r15d
  jg     L66
  movslq %r15d,%rax
  sub    %r15d,%ebp
  pxor   %xmm3,%xmm3
  add    %rax,%rbp
  lea    -0x8(,%rax,8),%rbx
  shl    $0x3,%rbp
  nopl   0x0(%rax)
L130:
  movsd  0x8(%r12,%rbx,1),%xmm2
  movsd  %xmm3,0x20(%rsp)
  movsd  %xmm1,0x18(%rsp)
  movapd %xmm2,%xmm0
  divsd  0x8(%rsp),%xmm2
  subsd  0x10(%rsp),%xmm0
  divsd  (%rsp),%xmm0
  addsd  %xmm2,%xmm0
  xorpd  D24(%rip),%xmm0
  call   <exp@plt>
  movsd  (%r14,%rbx,1),%xmm2
  movsd  0x18(%rsp),%xmm4
  mulsd  0x0(%r13,%rbx,1),%xmm2
  movsd  0x20(%rsp),%xmm3
  add    $0x8,%rbx
  movapd %xmm0,%xmm1
  subsd  %xmm0,%xmm4
  mulsd  %xmm4,%xmm2
  addsd  %xmm2,%xmm3
  cmp    %rbp,%rbx
  jne    L130
L69:
  movsd  (%rsp),%xmm1
  divsd  0x8(%rsp),%xmm1
  addsd  D54(%rip),%xmm1
  mulsd  D34(%rip),%xmm1
  movsd  0x28(%rsp),%xmm0
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  divsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  ret
  nopl   0x0(%rax,%rax,1)
L58:
  movslq %r15d,%rbx
  pxor   %xmm3,%xmm3
  test   %r15d,%r15d
  jle    L69
  nopl   0x0(%rax)
L112:
  movsd  -0x8(%r12,%rbx,8),%xmm2
  movq   %xmm1,%rbp
  movsd  %xmm3,0x18(%rsp)
  movapd %xmm2,%xmm0
  divsd  0x8(%rsp),%xmm2
  subsd  0x10(%rsp),%xmm0
  divsd  (%rsp),%xmm0
  addsd  %xmm2,%xmm0
  xorpd  D24(%rip),%xmm0
  call   <exp@plt>
  movq   %rbp,%xmm2
  movsd  0x18(%rsp),%xmm3
  movapd %xmm0,%xmm1
  movsd  -0x8(%r14,%rbx,8),%xmm0
  mulsd  -0x8(%r13,%rbx,8),%xmm0
  subsd  %xmm1,%xmm2
  sub    $0x1,%rbx
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm3
  test   %ebx,%ebx
  jg     L112
  jmp    L69
  cs nopw 0x0(%rax,%rax,1)
L12:
  cmp    $0x1,%r15d
  jle    L102
  lea    -0x1(%r15),%ecx
  cmp    $0x2,%r15d
  je     L39
  mov    %ecx,%edx
  xor    %eax,%eax
  pxor   %xmm2,%xmm2
  shr    %edx
  shl    $0x4,%rdx
  cs nopw 0x0(%rax,%rax,1)
L70:
  movupd 0x0(%r13,%rax,1),%xmm3
  movupd (%r14,%rax,1),%xmm6
  movupd 0x8(%r12,%rax,1),%xmm0
  movupd (%r12,%rax,1),%xmm5
  add    $0x10,%rax
  mulpd  %xmm6,%xmm3
  subpd  %xmm5,%xmm0
  mulpd  %xmm3,%xmm0
  addsd  %xmm0,%xmm2
  unpckhpd %xmm0,%xmm0
  addsd  %xmm0,%xmm2
  cmp    %rax,%rdx
  jne    L70
  mov    %ecx,%eax
  or     $0x1,%eax
  and    $0x1,%ecx
  je     L57
L84:
  cltq
  movsd  -0x8(%r13,%rax,8),%xmm3
  mulsd  -0x8(%r14,%rax,8),%xmm3
  movsd  (%r12,%rax,8),%xmm0
  subsd  -0x8(%r12,%rax,8),%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm0,%xmm2
L57:
  shl    $0x3,%r15
  movsd  0x10(%rsp),%xmm3
  movsd  -0x8(%r14,%r15,1),%xmm0
  mulsd  -0x8(%r13,%r15,1),%xmm0
  subsd  -0x8(%r12,%r15,1),%xmm3
  mulsd  %xmm3,%xmm0
  movsd  0x8(%rsp),%xmm3
  mulsd  D34(%rip),%xmm3
  addsd  %xmm0,%xmm2
  movsd  0x28(%rsp),%xmm0
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  divsd  %xmm3,%xmm0
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  mulsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  ret
L66:
  pxor   %xmm3,%xmm3
  jmp    L69
  nopl   0x0(%rax)
L102:
  pxor   %xmm2,%xmm2
  jmp    L57
L39:
  pxor   %xmm2,%xmm2
  mov    $0x1,%eax
  jmp    L84
```

tool_calls: name: retrieve_data
arguments: label: D24
data_type: f32[4]
name: retrieve_data
arguments: label: D10
data_type: qword[2]
name: retrieve_data
arguments: label: D54
data_type: f64
name: retrieve_data
arguments: label: D34
data_type: byte[8]

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

tool: {"D10": [0x7fffffffffffffff,0x0000000000000000]}

tool: D54: 1

tool: {"D34": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x29,0x40]}

assistant: ```c
double c_single_scat(double dither, int layru, int nlyr, double *phase, double *omega, double *tau, double umu, double umu0, double utau, double fbeam) {
  register int lyr;
  double ans, exp0, exp1;
  ans = 0.;
  exp0 = exp(-utau / umu0);
  if (fabs(umu + umu0) <= dither) {
    for (lyr = 1; lyr <= layru - 1; lyr++) {
      ans += omega[lyr - 1] * phase[lyr - 1] * (tau[lyr] - tau[lyr - 1]);
    }
    ans = fbeam / (4. * 3.14159265358979323846 * umu0) * exp0 * (ans + omega[layru - 1] * phase[layru - 1] * (utau - tau[layru - 1]));
    return ans;
  }
  if (umu > 0.) {
    for (lyr = layru; lyr <= nlyr; lyr++) {
      exp1 = exp(-((tau[lyr] - utau) / umu + tau[lyr] / umu0));
      ans += omega[lyr - 1] * phase[lyr - 1] * (exp0 - exp1);
      exp0 = exp1;
    }
  } else {
    for (lyr = layru; lyr >= 1; lyr--) {
      exp1 = exp(-((tau[lyr - 1] - utau) / umu + tau[lyr - 1] / umu0));
      ans += omega[lyr - 1] * phase[lyr - 1] * (exp0 - exp1);
      exp0 = exp1;
    }
  }
  ans *= fbeam / (4. * 3.14159265358979323846 * (1. + umu / umu0));
  return ans;
}
```