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

```asm
<ELoss>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x24(%rbp)
  movsd  %xmm0,-0x30(%rbp)
  mov    %rsi,-0x38(%rbp)
  mov    %rdx,-0x40(%rbp)
  mov    %rcx,-0x48(%rbp)
  mov    %r8d,-0x28(%rbp)
  mov    %r9d,-0x4c(%rbp)
  movsd  %xmm1,-0x58(%rbp)
  movsd  %xmm2,-0x60(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  mov    -0x4c(%rbp),%r9d
  mov    -0x28(%rbp),%r8d
  mov    -0x48(%rbp),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rsi
  mov    -0x30(%rbp),%rdi
  mov    -0x24(%rbp),%eax
  movapd %xmm0,%xmm1
  movq   %rdi,%xmm0
  mov    %eax,%edi
  call   <dEdX@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  movsd  D5(%rip),%xmm0
  divsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x60(%rbp),%xmm0
  mov    -0x4c(%rbp),%r9d
  mov    -0x28(%rbp),%r8d
  mov    -0x48(%rbp),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rsi
  mov    -0x30(%rbp),%rdi
  mov    -0x24(%rbp),%eax
  movapd %xmm0,%xmm1
  movq   %rdi,%xmm0
  mov    %eax,%edi
  call   <Range@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  subsd  -0x58(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L25
  jmp    L41
L24:
  movsd  -0x20(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x8(%rbp),%xmm1
  movsd  -0x60(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  pxor   %xmm0,%xmm0
  comisd -0x60(%rbp),%xmm0
  jbe    L11
  movsd  -0x10(%rbp),%xmm0
  jmp    L39
L11:
  movsd  -0x18(%rbp),%xmm0
  addsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x60(%rbp),%xmm0
  mov    -0x4c(%rbp),%r9d
  mov    -0x28(%rbp),%r8d
  mov    -0x48(%rbp),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rsi
  mov    -0x30(%rbp),%rdi
  mov    -0x24(%rbp),%eax
  movapd %xmm0,%xmm1
  movq   %rdi,%xmm0
  mov    %eax,%edi
  call   <dEdX@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
L41:
  movsd  -0x58(%rbp),%xmm0
  subsd  -0x18(%rbp),%xmm0
  subsd  -0x8(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jae    L24
  movsd  -0x58(%rbp),%xmm0
  subsd  -0x18(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x20(%rbp),%xmm1
  movsd  -0x60(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x10(%rbp),%xmm0
  subsd  -0x60(%rbp),%xmm0
  jmp    L39
L25:
  movsd  -0x10(%rbp),%xmm0
L39:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D5
type: f64

tool: D5: 0.1

assistant: ```c
double ELoss(int ZP, double MP, int ZT[], double MT[], double CT[], int NTarEl, int IsGas, double TT, double E) {
  double EIn = 0.0, dEdX_ = 0.0, dX = 0.0, X = 0.0;
  EIn = E;
  dEdX_ = dEdX(ZP, MP, ZT, MT, CT, NTarEl, IsGas, EIn);
  dX = 0.1 / dEdX_;
  if ((Range(ZP, MP, ZT, MT, CT, NTarEl, IsGas, E) - TT) > 0) {
    while ((TT - X - dX) >= 0) {
      if ((E = E - (dEdX_ * dX)) < 0)
        return EIn;
      X = X + dX;
      dEdX_ = dEdX(ZP, MP, ZT, MT, CT, NTarEl, IsGas, E);
    };
    E = E - (TT - X) * dEdX_;
    return (EIn - E);
  } else
    return EIn;
}
```