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

```asm
<invertLatData>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <gridInqXsize@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <gridInqYsize@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jle    L40
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,%rcx
  mov    $0x125,%edx
  lea    D47(%rip),%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Malloc@plt>
  cltq
  mov    %rax,-0x10(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,%rcx
  mov    $0x126,%edx
  lea    D47(%rip),%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Malloc@plt>
  cltq
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L31
L74:
  mov    -0x1c(%rbp),%eax
  imul   -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rdx,(%rax)
  mov    -0x1c(%rbp),%eax
  imul   -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rdx,(%rax)
  addl   $0x1,-0x1c(%rbp)
L31:
  mov    -0x1c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L74
  movl   $0x0,-0x1c(%rbp)
  jmp    L63
L54:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x14(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rsi
  mov    -0x8(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  addl   $0x1,-0x1c(%rbp)
L63:
  mov    -0x1c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L54
  cmpq   $0x0,-0x10(%rbp)
  je     L19
  mov    -0x10(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x131,%edx
  lea    D47(%rip),%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Free@plt>
L19:
  cmpq   $0x0,-0x8(%rbp)
  je     L56
  mov    -0x8(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x132,%edx
  lea    D47(%rip),%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Free@plt>
  jmp    L56
L40:
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  movsd  %xmm0,(%rax)
L56:
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D47
type: string
name: retrieve_data
arguments: label: D9
type: string

tool: D47: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/Invert.c

tool: D9: invertLatData

assistant: ```c
void invertLatData(double *array1, double *array2, int gridID1) {
  int nlat, nlon;
  int ilat;
  double **field1, **field2;
  nlon = gridInqXsize(gridID1);
  nlat = gridInqYsize(gridID1);
  if (nlat > 0) {
    field1 = (double **)Malloc(__func__, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/Invert.c", 293, (nlat * sizeof(double *)));
    field2 = (double **)Malloc(__func__, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/Invert.c", 294, (nlat * sizeof(double *)));
    for (ilat = 0; ilat < nlat; ilat++) {
      field1[ilat] = array1 + ilat * nlon;
      field2[ilat] = array2 + ilat * nlon;
    }
    for (ilat = 0; ilat < nlat; ilat++)
      memcpy(field2[nlat - ilat - 1], field1[ilat], nlon * sizeof(double));
    if (field1)
      Free(__func__, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/Invert.c", 305, (field1));
    if (field2)
      Free(__func__, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/Invert.c", 306, (field2));
  } else {
    array2[0] = array1[0];
  }
}
```