user: 请将以下的汇编代码转换成C语言代码:

```asm
<ATM_Spectrum>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %rdx,%r12
  mov    %rcx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rdx
  mov    %r12,%rsi
  call   <ATM_Dos@plt>
  movsd  0x8(%rbx),%xmm10
  movsd  (%rbx),%xmm1
  movsd  0x10(%rbx),%xmm15
  movsd  0x18(%rbx),%xmm2
  movsd  0x8(%rbp),%xmm8
  movsd  0x0(%rbp),%xmm14
  movsd  0x10(%rbp),%xmm9
  movsd  0x18(%rbp),%xmm3
  movsd  (%r12),%xmm0
  comisd %xmm0,%xmm1
  jbe    L28
  movq   $0x0,0x0(%r13)
L67:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L87
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L28:
  movapd %xmm10,%xmm11
  subsd  %xmm1,%xmm11
  movapd %xmm15,%xmm12
  subsd  %xmm1,%xmm12
  movapd %xmm2,%xmm7
  subsd  %xmm1,%xmm7
  movapd %xmm8,%xmm13
  subsd  %xmm14,%xmm13
  movapd %xmm9,%xmm4
  subsd  %xmm14,%xmm4
  movapd %xmm3,%xmm5
  subsd  %xmm14,%xmm5
  comisd %xmm1,%xmm0
  jbe    L122
  comisd %xmm0,%xmm10
  jbe    L122
  divsd  %xmm11,%xmm13
  divsd  %xmm12,%xmm4
  addsd  %xmm4,%xmm13
  divsd  %xmm7,%xmm5
  addsd  %xmm5,%xmm13
  subsd  %xmm1,%xmm0
  mulsd  D12(%rip),%xmm0
  mulsd  %xmm13,%xmm0
  addsd  %xmm14,%xmm0
  mulsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x0(%r13)
  jmp    L67
L122:
  movapd %xmm2,%xmm6
  subsd  %xmm10,%xmm6
  movsd  %xmm6,(%rsp)
  movapd %xmm2,%xmm6
  subsd  %xmm15,%xmm6
  movapd %xmm3,%xmm1
  subsd  %xmm8,%xmm1
  movsd  %xmm1,0x8(%rsp)
  movapd %xmm3,%xmm8
  subsd  %xmm9,%xmm8
  comisd %xmm10,%xmm0
  jbe    L116
  comisd %xmm0,%xmm15
  jbe    L116
  movapd %xmm15,%xmm2
  subsd  %xmm10,%xmm2
  mulsd  %xmm11,%xmm4
  divsd  %xmm12,%xmm4
  addsd  %xmm13,%xmm4
  mulsd  %xmm5,%xmm11
  divsd  %xmm7,%xmm11
  addsd  %xmm11,%xmm4
  movapd %xmm4,%xmm1
  movsd  D12(%rip),%xmm3
  mulsd  %xmm3,%xmm1
  subsd  %xmm0,%xmm15
  mulsd  %xmm15,%xmm1
  divsd  %xmm2,%xmm1
  addsd  %xmm14,%xmm1
  movapd %xmm6,%xmm4
  mulsd  %xmm5,%xmm4
  divsd  %xmm7,%xmm4
  mulsd  0x8(%rsp),%xmm6
  divsd  (%rsp),%xmm6
  addsd  %xmm4,%xmm6
  addsd  %xmm8,%xmm6
  mulsd  %xmm6,%xmm3
  subsd  %xmm3,%xmm5
  subsd  %xmm10,%xmm0
  mulsd  %xmm0,%xmm5
  divsd  %xmm2,%xmm5
  addsd  %xmm5,%xmm1
  mulsd  0x10(%rsp),%xmm1
  movsd  %xmm1,0x0(%r13)
  jmp    L67
L116:
  comisd %xmm15,%xmm0
  jbe    L6
  comisd %xmm0,%xmm2
  jbe    L6
  divsd  %xmm7,%xmm5
  movsd  0x8(%rsp),%xmm9
  divsd  (%rsp),%xmm9
  addsd  %xmm9,%xmm5
  divsd  %xmm6,%xmm8
  addsd  %xmm8,%xmm5
  subsd  %xmm2,%xmm0
  mulsd  D12(%rip),%xmm0
  mulsd  %xmm5,%xmm0
  addsd  %xmm3,%xmm0
  mulsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x0(%r13)
  jmp    L67
L6:
  comisd %xmm2,%xmm0
  jbe    L67
  movq   $0x0,0x0(%r13)
  jmp    L67
L87:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D12
datatype: byte[8]

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

assistant: ```c
void ATM_Spectrum(double *et, double *at, double *e, double *spectrum) {
  double a21, a31, a32, a41;
  double e21, e31, e32, e41, e42, e43;
  double a42, a43;
  double dos;
  --at;
  ATM_Dos(et, e, &dos);
  --et;
  e21 = et[2] - et[1];
  e31 = et[3] - et[1];
  e32 = et[3] - et[2];
  e41 = et[4] - et[1];
  e42 = et[4] - et[2];
  e43 = et[4] - et[3];
  a21 = at[2] - at[1];
  a31 = at[3] - at[1];
  a32 = at[3] - at[2];
  a41 = at[4] - at[1];
  a42 = at[4] - at[2];
  a43 = at[4] - at[3];
  if (*e < et[1]) {
    *spectrum = 0.;
  } else if (*e > et[1] && *e < et[2]) {
    *spectrum = dos * (at[1] + (*e - et[1]) * .33333333333333331 * (a21 / e21 + a31 / e31 + a41 / e41));
  } else if (*e > et[2] && *e < et[3]) {
    *spectrum = dos * (at[1] + (a21 + e21 * a31 / e31 + e21 * a41 / e41) * .33333333333333331 * (et[3] - *e) / e32 + (at[4] - at[1] - (e43 * a41 / e41 + e43 * a42 / e42 + a43) * .33333333333333331) * (*e - et[2]) / e32);
  } else if (*e > et[3] && *e < et[4]) {
    *spectrum = dos * (at[4] + (*e - et[4]) * .33333333333333331 * (a41 / e41 + a42 / e42 + a43 / e43));
  } else if (*e > et[4]) {
    *spectrum = 0.;
  }
}
```