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

```asm
<grib_get_reduced_row>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  movsd  %xmm0,-0x40(%rbp)
  movsd  %xmm1,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x48(%rbp),%xmm0
  subsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  comisd -0x20(%rbp),%xmm0
  jbe    L10
  movsd  -0x20(%rbp),%xmm1
  movsd  D103(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x40(%rbp),%xmm0
  movsd  D103(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
L10:
  pxor   %xmm0,%xmm0
  cvtsi2sdq -0x38(%rbp),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  movsd  D103(%rip),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D58(%rip),%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rdx
  mov    -0x50(%rbp),%rax
  mov    %rdx,(%rax)
  pxor   %xmm0,%xmm0
  cvtsi2sdq -0x38(%rbp),%xmm0
  mulsd  -0x40(%rbp),%xmm0
  movsd  D103(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,(%rax)
  pxor   %xmm0,%xmm0
  cvtsi2sdq -0x38(%rbp),%xmm0
  mulsd  -0x48(%rbp),%xmm0
  movsd  D103(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rdx
  mov    -0x60(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  add    $0x1,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x18(%rbp)
  je     L36
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x18(%rbp)
  jle    L112
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movsd  D103(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdq -0x38(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x40(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L85
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,(%rax)
  subq   $0x1,-0x18(%rbp)
L85:
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movsd  D103(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdq -0x38(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  comisd -0x48(%rbp),%xmm0
  jbe    L84
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x60(%rbp),%rax
  mov    %rdx,(%rax)
  subq   $0x1,-0x18(%rbp)
  jmp    L84
L112:
  movl   $0x0,-0x24(%rbp)
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  sub    $0x1,%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movsd  D103(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdq -0x38(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  comisd -0x40(%rbp),%xmm0
  jbe    L100
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,(%rax)
  addq   $0x1,-0x18(%rbp)
  movl   $0x1,-0x24(%rbp)
L100:
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  add    $0x1,%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movsd  D103(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdq -0x38(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x48(%rbp),%xmm0
  comisd -0x8(%rbp),%xmm0
  jbe    L68
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x60(%rbp),%rax
  mov    %rdx,(%rax)
  addq   $0x1,-0x18(%rbp)
  movl   $0x1,-0x24(%rbp)
L68:
  cmpl   $0x0,-0x24(%rbp)
  jne    L84
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x50(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L84
L36:
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movsd  D103(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdq -0x38(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x40(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L84
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x60(%rbp),%rax
  mov    %rdx,(%rax)
L84:
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jns    L61
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,(%rax)
  nop
L61:
  nop
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: label: D103
datatype: f64
name: retrieve_data
arguments: label: D58
datatype: f32[2]

tool: D103: 360

tool: {"D58": [0.0,1.875]}

assistant: ```c
void grib_get_reduced_row(long pl, double lon_first, double lon_last, long *npoints, long *ilon_first, long *ilon_last) {
  double range = 0, dlon_first = 0, dlon_last = 0;
  long irange;
  range = lon_last - lon_first;
  if (range < 0) {
    range += 360;
    lon_first -= 360;
  }
  *npoints = (range * pl) / 360.0 + 1;
  *ilon_first = (lon_first * pl) / 360.0;
  *ilon_last = (lon_last * pl) / 360.0;
  irange = *ilon_last - *ilon_first + 1;
  if (irange != *npoints) {
    if (irange > *npoints) {
      dlon_first = ((*ilon_first) * 360.0) / pl;
      if (dlon_first < lon_first) {
        (*ilon_first)++;
        irange--;
      }
      dlon_last = ((*ilon_last) * 360.0) / pl;
      if (dlon_last > lon_last) {
        (*ilon_last)--;
        irange--;
      }
    } else {
      int ok = 0;
      dlon_first = ((*ilon_first - 1) * 360.0) / pl;
      if (dlon_first > lon_first) {
        (*ilon_first)--;
        irange++;
        ok = 1;
      }
      dlon_last = ((*ilon_last + 1) * 360.0) / pl;
      if (dlon_last < lon_last) {
        (*ilon_last)++;
        irange++;
        ok = 1;
      }
      if (!ok) {
        (*npoints)--;
      }
    }
  } else {
    dlon_first = ((*ilon_first) * 360.0) / pl;
    if (dlon_first < lon_first) {
      (*ilon_first)++;
      (*ilon_last)++;
    }
  }
  if (*ilon_first < 0)
    *ilon_first += pl;
  return;
}
```