user: Translate the below assembly code into C programming language:

```asm
<c_single_scat>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  movq   %xmm0,%rbx
  mov    %edi,%r12d
  mov    %esi,%r15d
  mov    %rdx,%r13
  mov    %rcx,%r14
  mov    %r8,%rbp
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm3,0x20(%rsp)
  movsd  %xmm4,0x28(%rsp)
  xorpd  D54(%rip),%xmm3
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x18(%rsp)
  divsd  %xmm2,%xmm0
  call   <exp@plt>
  movapd %xmm0,%xmm1
  movsd  0x18(%rsp),%xmm0
  addsd  0x10(%rsp),%xmm0
  andpd  D20(%rip),%xmm0
  movq   %rbx,%xmm5
  comisd %xmm0,%xmm5
  jae    L36
  movsd  0x10(%rsp),%xmm6
  comisd D48(%rip),%xmm6
  jbe    L101
  cmp    %r15d,%r12d
  jg     L47
  movslq %r12d,%rax
  lea    -0x8(,%rax,8),%rbx
  sub    %r12d,%r15d
  add    %rax,%r15
  shl    $0x3,%r15
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x8(%rsp)
L31:
  movsd  0x8(%rbp,%rbx,1),%xmm2
  movq   %xmm1,%r12
  movapd %xmm2,%xmm0
  subsd  0x20(%rsp),%xmm0
  divsd  0x10(%rsp),%xmm0
  divsd  0x18(%rsp),%xmm2
  addsd  %xmm2,%xmm0
  xorpd  D54(%rip),%xmm0
  call   <exp@plt>
  movapd %xmm0,%xmm1
  movsd  (%r14,%rbx,1),%xmm0
  mulsd  0x0(%r13,%rbx,1),%xmm0
  movq   %r12,%xmm2
  subsd  %xmm1,%xmm2
  mulsd  %xmm2,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  add    $0x8,%rbx
  cmp    %r15,%rbx
  jne    L31
L102:
  movsd  0x10(%rsp),%xmm1
  divsd  0x18(%rsp),%xmm1
  addsd  D50(%rip),%xmm1
  mulsd  D9(%rip),%xmm1
  movsd  0x28(%rsp),%xmm0
  divsd  %xmm1,%xmm0
  mulsd  0x8(%rsp),%xmm0
L9:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L36:
  cmp    $0x1,%r12d
  jle    L93
  lea    -0x1(%r12),%edx
  mov    $0x0,%eax
  pxor   %xmm3,%xmm3
L57:
  movsd  (%r14,%rax,8),%xmm0
  mulsd  0x0(%r13,%rax,8),%xmm0
  movsd  0x8(%rbp,%rax,8),%xmm2
  subsd  0x0(%rbp,%rax,8),%xmm2
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm3
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L57
L74:
  movslq %r12d,%r12
  shl    $0x3,%r12
  movsd  -0x8(%r14,%r12,1),%xmm2
  mulsd  -0x8(%r13,%r12,1),%xmm2
  movsd  0x20(%rsp),%xmm0
  subsd  -0x8(%rbp,%r12,1),%xmm0
  mulsd  %xmm0,%xmm2
  addsd  %xmm3,%xmm2
  movsd  0x18(%rsp),%xmm3
  mulsd  D9(%rip),%xmm3
  movsd  0x28(%rsp),%xmm0
  divsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  jmp    L9
L93:
  pxor   %xmm3,%xmm3
  jmp    L74
L101:
  movslq %r12d,%rbx
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x8(%rsp)
  test   %r12d,%r12d
  jle    L102
L80:
  movsd  -0x8(%rbp,%rbx,8),%xmm2
  movq   %xmm1,%r12
  movapd %xmm2,%xmm0
  subsd  0x20(%rsp),%xmm0
  divsd  0x10(%rsp),%xmm0
  divsd  0x18(%rsp),%xmm2
  addsd  %xmm2,%xmm0
  xorpd  D54(%rip),%xmm0
  call   <exp@plt>
  movapd %xmm0,%xmm1
  movsd  -0x8(%r14,%rbx,8),%xmm0
  mulsd  -0x8(%r13,%rbx,8),%xmm0
  movq   %r12,%xmm2
  subsd  %xmm1,%xmm2
  mulsd  %xmm2,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  sub    $0x1,%rbx
  test   %ebx,%ebx
  jg     L80
  jmp    L102
L47:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x8(%rsp)
  jmp    L102
```

tool_calls: name: read_data
arguments: label: D54
type_infered: f32[4]
name: read_data
arguments: label: D20
type_infered: qword[2]
name: read_data
arguments: label: D48
type_infered: f32[4]
name: read_data
arguments: label: D50
type_infered: f64
name: read_data
arguments: label: D9
type_infered: byte[8]

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

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

tool: {"D48": [0.0,0.0,null,null]}

tool: D50: 1

tool: {"D9": [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;
}
```