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

```asm
<Mastrfu>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x178,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x168(%rsp)
  xor    %eax,%eax
  call   <cdoInitialize@plt>
  xor    %edi,%edi
  xor    %eax,%eax
  call   <cdoStreamName@plt>
  mov    %eax,%edi
  xor    %eax,%eax
  call   <pstreamOpenRead@plt>
  mov    %eax,%edi
  mov    %eax,%ebp
  xor    %eax,%eax
  call   <pstreamInqVlist@plt>
  mov    %eax,%r12d
  mov    %eax,%edi
  xor    %eax,%eax
  call   <vlistNvars@plt>
  cmp    $0x1,%eax
  je     L141
  lea    D101(%rip),%rdi
  xor    %eax,%eax
  call   <cdoAbort@plt>
L141:
  xor    %esi,%esi
  xor    %eax,%eax
  mov    %r12d,%edi
  call   <vlistInqVarCode@plt>
  test   %eax,%eax
  jle    L100
  cmp    $0x84,%eax
  jne    L37
L100:
  xor    %esi,%esi
  mov    %r12d,%edi
  xor    %eax,%eax
  call   <vlistInqVarMissval@plt>
  pxor   %xmm1,%xmm1
  xor    %esi,%esi
  mov    %r12d,%edi
  cvtsi2sd %eax,%xmm1
  xor    %eax,%eax
  movsd  %xmm1,0x38(%rsp)
  call   <vlistInqVarZaxis@plt>
  mov    %eax,0x28(%rsp)
  mov    %eax,%ebx
  mov    %eax,%edi
  xor    %eax,%eax
  call   <zaxisInqType@plt>
  cmp    $0x4,%eax
  jne    L180
L77:
  xor    %esi,%esi
  mov    %r12d,%edi
  xor    %eax,%eax
  call   <vlistInqVarGrid@plt>
  mov    %eax,0x2c(%rsp)
  mov    %eax,%edi
  xor    %eax,%eax
  call   <gridInqXsize@plt>
  cmp    $0x1,%eax
  jle    L26
  lea    D148(%rip),%rdi
  xor    %eax,%eax
  call   <cdoAbort@plt>
L26:
  mov    0x2c(%rsp),%edi
  xor    %eax,%eax
  call   <gridInqSize@plt>
  mov    0x28(%rsp),%edi
  mov    %eax,%r14d
  xor    %eax,%eax
  call   <zaxisInqSize@plt>
  mov    %r12d,%edi
  mov    %eax,%ebx
  xor    %eax,%eax
  call   <vlistDuplicate@plt>
  mov    %r12d,%edi
  mov    %eax,%r13d
  xor    %eax,%eax
  call   <vlistInqTaxis@plt>
  mov    %eax,%edi
  mov    %eax,0x30(%rsp)
  xor    %eax,%eax
  call   <taxisDuplicate@plt>
  mov    %r13d,%edi
  mov    %eax,%esi
  mov    %eax,0x34(%rsp)
  xor    %eax,%eax
  call   <vlistDefTaxis@plt>
  xor    %esi,%esi
  mov    %r13d,%edi
  mov    $0x110,%edx
  xor    %eax,%eax
  call   <vlistDefVarCode@plt>
  xor    %esi,%esi
  mov    %r13d,%edi
  xor    %eax,%eax
  lea    D70(%rip),%rdx
  call   <vlistDefVarName@plt>
  xor    %esi,%esi
  mov    %r13d,%edi
  xor    %eax,%eax
  lea    D86(%rip),%rdx
  call   <vlistDefVarLongname@plt>
  xor    %esi,%esi
  mov    %r13d,%edi
  xor    %eax,%eax
  lea    D67(%rip),%rdx
  call   <vlistDefVarUnits@plt>
  mov    $0x84,%edx
  xor    %esi,%esi
  mov    %r13d,%edi
  xor    %eax,%eax
  call   <vlistDefVarDatatype@plt>
  xor    %eax,%eax
  call   <cdoFiletype@plt>
  mov    $0x1,%edi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <cdoStreamName@plt>
  mov    %r12d,%esi
  mov    %eax,%edi
  xor    %eax,%eax
  call   <pstreamOpenWrite@plt>
  imul   %r14d,%ebx
  mov    %r13d,%esi
  mov    %eax,%edi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <pstreamDefVlist@plt>
  mov    $0xaa,%edx
  lea    D72(%rip),%rsi
  xor    %eax,%eax
  movslq %ebx,%r13
  lea    D0(%rip),%rdi
  shl    $0x3,%r13
  mov    %r13,%rcx
  call   <Malloc@plt>
  mov    %r13,%rcx
  mov    $0xab,%edx
  lea    D72(%rip),%rsi
  mov    %eax,0x48(%rsp)
  cltq
  lea    D0(%rip),%rdi
  mov    %rax,0x10(%rsp)
  xor    %eax,%eax
  call   <Malloc@plt>
  movl   $0x0,0x20(%rsp)
  mov    %eax,0x4c(%rsp)
  cltq
  mov    %rax,0x18(%rsp)
  lea    0x58(%rsp),%rax
  mov    %rax,0x40(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L178:
  mov    0x20(%rsp),%esi
  mov    %ebp,%edi
  xor    %eax,%eax
  call   <pstreamInqTimestep@plt>
  mov    %eax,0x8(%rsp)
  test   %eax,%eax
  je     L86
  mov    0x30(%rsp),%esi
  mov    0x34(%rsp),%edi
  xor    %eax,%eax
  call   <taxisCopyTimestep@plt>
  mov    0x20(%rsp),%esi
  mov    %r12d,%edi
  xor    %eax,%eax
  call   <pstreamDefTimestep@plt>
  mov    0x8(%rsp),%ecx
  test   %ecx,%ecx
  jle    L9
  xor    %r13d,%r13d
  mov    %r12d,0x24(%rsp)
  xor    %ecx,%ecx
  lea    0x54(%rsp),%r15
  mov    %r13d,%r12d
  mov    0x40(%rsp),%r13
  mov    %r14d,0xc(%rsp)
  mov    %ecx,%r14d
  lea    0x5c(%rsp),%rbx
  cs nopw 0x0(%rax,%rax,1)
L158:
  mov    %r13,%rdx
  mov    %r15,%rsi
  mov    %ebp,%edi
  xor    %eax,%eax
  call   <pstreamInqRecord@plt>
  mov    0xc(%rsp),%eax
  imul   0x58(%rsp),%eax
  mov    %ebp,%edi
  mov    0x10(%rsp),%rcx
  mov    %rbx,%rdx
  cltq
  lea    (%rcx,%rax,8),%rsi
  xor    %eax,%eax
  call   <pstreamReadRecord@plt>
  mov    0x5c(%rsp),%edx
  mov    %r14d,%eax
  lea    0x1(%r14),%r14d
  add    %r12d,%edx
  mov    %edx,%r12d
  cmp    %r14d,0x8(%rsp)
  jne    L158
  mov    %edx,%ebx
  mov    %edx,%r8d
  movsd  0x38(%rsp),%xmm0
  mov    0x18(%rsp),%rcx
  mov    0x10(%rsp),%rdx
  mov    0x28(%rsp),%esi
  xor    %r13d,%r13d
  mov    %eax,%r15d
  mov    0x2c(%rsp),%edi
  mov    $0x1,%eax
  mov    0xc(%rsp),%r14d
  mov    0x24(%rsp),%r12d
  call   <mastrfu@plt>
  mov    %ebp,0x8(%rsp)
  mov    %r13d,%ebp
  mov    %ebx,%r13d
  mov    0x18(%rsp),%rbx
  nopl   (%rax)
L51:
  mov    %ebp,%edx
  xor    %esi,%esi
  mov    %r12d,%edi
  xor    %eax,%eax
  mov    %ebp,0x58(%rsp)
  movl   $0x0,0x54(%rsp)
  call   <pstreamDefRecord@plt>
  mov    0x58(%rsp),%eax
  mov    %r13d,%edx
  mov    %r12d,%edi
  imul   %r14d,%eax
  cltq
  lea    (%rbx,%rax,8),%rsi
  xor    %eax,%eax
  call   <pstreamWriteRecord@plt>
  mov    %ebp,%eax
  add    $0x1,%ebp
  cmp    %r15d,%eax
  jne    L51
  mov    0x8(%rsp),%ebp
L142:
  addl   $0x1,0x20(%rsp)
  jmp    L178
  nopl   (%rax)
L86:
  mov    %r12d,%edi
  call   <pstreamClose@plt>
  mov    %ebp,%edi
  xor    %eax,%eax
  call   <pstreamClose@plt>
  mov    0x48(%rsp),%edx
  test   %edx,%edx
  jne    L109
L66:
  mov    0x4c(%rsp),%eax
  test   %eax,%eax
  jne    L17
L170:
  xor    %eax,%eax
  call   <cdoFinish@plt>
  mov    0x168(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L149
  add    $0x178,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L9:
  mov    0x28(%rsp),%esi
  mov    0x2c(%rsp),%edi
  xor    %r8d,%r8d
  mov    $0x1,%eax
  movsd  0x38(%rsp),%xmm0
  mov    0x18(%rsp),%rcx
  mov    0x10(%rsp),%rdx
  call   <mastrfu@plt>
  jmp    L142
L37:
  mov    %eax,%esi
  lea    D134(%rip),%rdi
  xor    %eax,%eax
  call   <cdoWarning@plt>
  jmp    L100
L180:
  xor    %eax,%eax
  mov    %ebx,%edi
  call   <zaxisInqType@plt>
  cmp    $0x1,%eax
  je     L77
  lea    0x60(%rsp),%r13
  mov    %ebx,%edi
  xor    %eax,%eax
  mov    %r13,%rsi
  call   <zaxisInqLongname@plt>
  mov    %r13,%rsi
  lea    D141(%rip),%rdi
  xor    %eax,%eax
  call   <cdoWarning@plt>
  jmp    L77
L17:
  mov    0x18(%rsp),%rcx
  mov    $0xce,%edx
  lea    D72(%rip),%rsi
  xor    %eax,%eax
  lea    D0(%rip),%rdi
  call   <Free@plt>
  jmp    L170
L109:
  mov    0x10(%rsp),%rcx
  mov    $0xcd,%edx
  lea    D72(%rip),%rsi
  xor    %eax,%eax
  lea    D0(%rip),%rdi
  call   <Free@plt>
  jmp    L66
L149:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D101
type_guessed: string
name: retrieve_data
arguments: data_tag: D148
type_guessed: string
name: retrieve_data
arguments: data_tag: D70
type_guessed: string
name: retrieve_data
arguments: data_tag: D86
type_guessed: string
name: retrieve_data
arguments: data_tag: D67
type_guessed: string
name: retrieve_data
arguments: data_tag: D72
type_guessed: string
name: retrieve_data
arguments: data_tag: D0
type_guessed: string
name: retrieve_data
arguments: data_tag: D134
type_guessed: string
name: retrieve_data
arguments: data_tag: D141
type_guessed: string

tool: D101: This operator works only with one variable!

tool: D148: Grid must be a zonal mean!

tool: D70: mastrfu

tool: D86: mass stream function

tool: D67: kg/s

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

tool: D0: Mastrfu

tool: D134: Unexpected code %d!

tool: D141: Unexpected vertical grid %s!

assistant: ```c
void *Mastrfu(void *argument) {
  int streamID1, streamID2;
  int nrecs;
  int tsID, recID, varID, levelID;
  int gridsize;
  int nvars, code, gridID, zaxisID, nlev;
  int vlistID1, vlistID2;
  int offset;
  int nmiss, nmiss1;
  double missval;
  double *array1, *array2;
  int taxisID1, taxisID2;
  cdoInitialize(argument);
  streamID1 = pstreamOpenRead(cdoStreamName(0));
  vlistID1 = pstreamInqVlist(streamID1);
  nvars = vlistNvars(vlistID1);
  if (nvars != 1)
    cdoAbort("This operator works only with one variable!");
  code = vlistInqVarCode(vlistID1, 0);
  if (code > 0 && code != 132)
    cdoWarning("Unexpected code %d!", code);
  missval = vlistInqVarMissval(vlistID1, 0);
  zaxisID = vlistInqVarZaxis(vlistID1, 0);
  if (zaxisInqType(zaxisID) != 4 && zaxisInqType(zaxisID) != 1) {
    char longname[256];
    zaxisInqLongname(zaxisID, longname);
    cdoWarning("Unexpected vertical grid %s!", longname);
  }
  gridID = vlistInqVarGrid(vlistID1, 0);
  if (gridInqXsize(gridID) > 1)
    cdoAbort("Grid must be a zonal mean!");
  gridsize = gridInqSize(gridID);
  nlev = zaxisInqSize(zaxisID);
  vlistID2 = vlistDuplicate(vlistID1);
  taxisID1 = vlistInqTaxis(vlistID1);
  taxisID2 = taxisDuplicate(taxisID1);
  vlistDefTaxis(vlistID2, taxisID2);
  vlistDefVarCode(vlistID2, 0, 272);
  vlistDefVarName(vlistID2, 0, "mastrfu");
  vlistDefVarLongname(vlistID2, 0, "mass stream function");
  vlistDefVarUnits(vlistID2, 0, "kg/s");
  vlistDefVarDatatype(vlistID2, 0, 132);
  streamID2 = pstreamOpenWrite(cdoStreamName(1), cdoFiletype());
  pstreamDefVlist(streamID2, vlistID2);
  array1 = (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/Mastrfu.c", 170, (gridsize * nlev * sizeof(double)));
  array2 = (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/Mastrfu.c", 171, (gridsize * nlev * sizeof(double)));
  tsID = 0;
  while ((nrecs = pstreamInqTimestep(streamID1, tsID))) {
    taxisCopyTimestep(taxisID2, taxisID1);
    pstreamDefTimestep(streamID2, tsID);
    nmiss = 0;
    for (recID = 0; recID < nrecs; recID++) {
      pstreamInqRecord(streamID1, &varID, &levelID);
      offset = gridsize * levelID;
      pstreamReadRecord(streamID1, array1 + offset, &nmiss1);
      nmiss += nmiss1;
    }
    mastrfu(gridID, zaxisID, array1, array2, nmiss, missval);
    for (recID = 0; recID < nrecs; recID++) {
      varID = 0;
      levelID = recID;
      pstreamDefRecord(streamID2, varID, levelID);
      offset = gridsize * levelID;
      pstreamWriteRecord(streamID2, array2 + offset, nmiss);
    }
    tsID++;
  }
  pstreamClose(streamID2);
  pstreamClose(streamID1);
  if (array1)
    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/Mastrfu.c", 205, (array1));
  if (array2)
    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/Mastrfu.c", 206, (array2));
  cdoFinish();
  return (0);
}
```