user: Translate the below assembly code into C programming language:

```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     L114
  lea    D75(%rip),%rdi
  xor    %eax,%eax
  call   <cdoAbort@plt>
L114:
  xor    %esi,%esi
  xor    %eax,%eax
  mov    %r12d,%edi
  call   <vlistInqVarCode@plt>
  test   %eax,%eax
  jle    L185
  cmp    $0x84,%eax
  jne    L12
L185:
  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    L159
L147:
  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    L67
  lea    D137(%rip),%rdi
  xor    %eax,%eax
  call   <cdoAbort@plt>
L67:
  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    D59(%rip),%rdx
  call   <vlistDefVarName@plt>
  xor    %esi,%esi
  mov    %r13d,%edi
  xor    %eax,%eax
  lea    D55(%rip),%rdx
  call   <vlistDefVarLongname@plt>
  xor    %esi,%esi
  mov    %r13d,%edi
  xor    %eax,%eax
  lea    D34(%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    D61(%rip),%rsi
  xor    %eax,%eax
  movslq %ebx,%r13
  lea    D143(%rip),%rdi
  shl    $0x3,%r13
  mov    %r13,%rcx
  call   <Malloc@plt>
  mov    %r13,%rcx
  mov    $0xab,%edx
  lea    D61(%rip),%rsi
  mov    %eax,0x48(%rsp)
  cltq
  lea    D143(%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)
L79:
  mov    0x20(%rsp),%esi
  mov    %ebp,%edi
  xor    %eax,%eax
  call   <pstreamInqTimestep@plt>
  mov    %eax,0x8(%rsp)
  test   %eax,%eax
  je     L91
  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    L131
  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)
L180:
  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    L180
  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)
L113:
  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    L113
  mov    0x8(%rsp),%ebp
L19:
  addl   $0x1,0x20(%rsp)
  jmp    L79
  nopl   (%rax)
L91:
  mov    %r12d,%edi
  call   <pstreamClose@plt>
  mov    %ebp,%edi
  xor    %eax,%eax
  call   <pstreamClose@plt>
  mov    0x48(%rsp),%edx
  test   %edx,%edx
  jne    L106
L136:
  mov    0x4c(%rsp),%eax
  test   %eax,%eax
  jne    L155
L15:
  xor    %eax,%eax
  call   <cdoFinish@plt>
  mov    0x168(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L165
  add    $0x178,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L131:
  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    L19
L12:
  mov    %eax,%esi
  lea    D47(%rip),%rdi
  xor    %eax,%eax
  call   <cdoWarning@plt>
  jmp    L185
L159:
  xor    %eax,%eax
  mov    %ebx,%edi
  call   <zaxisInqType@plt>
  cmp    $0x1,%eax
  je     L147
  lea    0x60(%rsp),%r13
  mov    %ebx,%edi
  xor    %eax,%eax
  mov    %r13,%rsi
  call   <zaxisInqLongname@plt>
  mov    %r13,%rsi
  lea    D80(%rip),%rdi
  xor    %eax,%eax
  call   <cdoWarning@plt>
  jmp    L147
L155:
  mov    0x18(%rsp),%rcx
  mov    $0xce,%edx
  lea    D61(%rip),%rsi
  xor    %eax,%eax
  lea    D143(%rip),%rdi
  call   <Free@plt>
  jmp    L15
L106:
  mov    0x10(%rsp),%rcx
  mov    $0xcd,%edx
  lea    D61(%rip),%rsi
  xor    %eax,%eax
  lea    D143(%rip),%rdi
  call   <Free@plt>
  jmp    L136
L165:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D75
data_type: string
name: unpack_data
arguments: label: D137
data_type: string
name: unpack_data
arguments: label: D59
data_type: string
name: unpack_data
arguments: label: D55
data_type: string
name: unpack_data
arguments: label: D34
data_type: string
name: unpack_data
arguments: label: D61
data_type: string
name: unpack_data
arguments: label: D143
data_type: string
name: unpack_data
arguments: label: D47
data_type: string
name: unpack_data
arguments: label: D80
data_type: string

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

tool: D137: Grid must be a zonal mean!

tool: D59: mastrfu

tool: D55: mass stream function

tool: D34: kg/s

tool: D61: /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: D143: Mastrfu

tool: D47: Unexpected code %d!

tool: D80: 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);
}
```