user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<CalcFlow>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L17
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    $0x2,%ecx
  mov    $0x8,%edx
  mov    %rax,%rdi
  call   <Get2DRowColMem@plt>
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,(%rax)
L17:
  movq   $0x0,-0x10(%rbp)
  jmp    L31
L79:
  movq   $0x0,-0x8(%rbp)
  jmp    L45
L46:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  D15(%rip),%xmm1
  divsd  %xmm1,%xmm0
  pxor   %xmm2,%xmm2
  cvtsd2ss %xmm0,%xmm2
  movd   %xmm2,%eax
  movd   %eax,%xmm0
  call   <LRound@plt>
  mov    -0x20(%rbp),%rdx
  mov    (%rdx),%rcx
  mov    -0x10(%rbp),%rdx
  shl    $0x3,%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rdx,%rdx
  add    %rcx,%rdx
  mov    %ax,(%rdx)
  addq   $0x1,-0x8(%rbp)
L45:
  mov    -0x8(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jl     L46
  addq   $0x1,-0x10(%rbp)
L31:
  mov    -0x28(%rbp),%rax
  sub    $0x1,%rax
  cmp    %rax,-0x10(%rbp)
  jl     L79
  movq   $0x0,-0x10(%rbp)
  jmp    L18
L41:
  movq   $0x0,-0x8(%rbp)
  jmp    L72
L7:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  D15(%rip),%xmm1
  divsd  %xmm1,%xmm0
  pxor   %xmm3,%xmm3
  cvtsd2ss %xmm0,%xmm3
  movd   %xmm3,%eax
  movd   %eax,%xmm0
  call   <LRound@plt>
  mov    -0x20(%rbp),%rdx
  mov    (%rdx),%rcx
  mov    -0x28(%rbp),%rdx
  lea    -0x1(%rdx),%rsi
  mov    -0x10(%rbp),%rdx
  add    %rsi,%rdx
  shl    $0x3,%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rdx,%rdx
  add    %rcx,%rdx
  mov    %ax,(%rdx)
  addq   $0x1,-0x8(%rbp)
L72:
  mov    -0x30(%rbp),%rax
  sub    $0x1,%rax
  cmp    %rax,-0x8(%rbp)
  jl     L7
  addq   $0x1,-0x10(%rbp)
L18:
  mov    -0x10(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jl     L41
  nop
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D15
type_infered: f64

tool: D15: 6.283185307179586

assistant: ```c
void CalcFlow(float **phase, short ***flowsptr, long nrow, long ncol) {
  long row, col;
  if ((*flowsptr) == NULL) {
    (*flowsptr) = (short **)Get2DRowColMem(nrow, ncol, sizeof(short *), sizeof(short));
  }
  for (row = 0; row < nrow - 1; row++) {
    for (col = 0; col < ncol; col++) {
      (*flowsptr)[row][col] = (short)LRound((phase[row][col] - phase[row + 1][col]) / 6.28318530717958647692);
    }
  }
  for (row = 0; row < nrow; row++) {
    for (col = 0; col < ncol - 1; col++) {
      (*flowsptr)[nrow - 1 + row][col] = (short)LRound((phase[row][col + 1] - phase[row][col]) / 6.28318530717958647692);
    }
  }
}
```