user: Please show me the C implementation that matches the assembly code listed below:

```asm
<calcpathv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  movq   $0x0,-0x10(%rbp)
  jmp    L9
L25:
  movq   $0x0,-0x8(%rbp)
  jmp    L63
L19:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    -0x10(%rbp),%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x8(%rbp),%rdx
  shl    $0x3,%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  cmpq   $0x0,-0x10(%rbp)
  jne    L3
  cmpq   $0x0,-0x8(%rbp)
  je     L33
L3:
  cmpq   $0x0,-0x10(%rbp)
  jne    L111
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  sub    $0x8,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rsi
  mov    -0x20(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rsi
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  add    %rsi,%rax
  add    %rcx,%rdx
  mov    %rdx,(%rax)
  jmp    L33
L111:
  cmpq   $0x0,-0x8(%rbp)
  jne    L23
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x10(%rbp),%rax
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rsi
  mov    -0x20(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rsi
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  add    %rsi,%rax
  add    %rcx,%rdx
  mov    %rdx,(%rax)
  jmp    L33
L23:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  sub    $0x8,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  shl    $0x3,%rax
  lea    -0x8(%rax),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jbe    L102
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  sub    $0x8,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rsi
  mov    -0x20(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rsi
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  add    %rsi,%rax
  add    %rcx,%rdx
  mov    %rdx,(%rax)
  jmp    L33
L102:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x10(%rbp),%rax
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rsi
  mov    -0x20(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rsi
  mov    -0x8(%rbp),%rax
  shl    $0x3,%rax
  add    %rsi,%rax
  add    %rcx,%rdx
  mov    %rdx,(%rax)
L33:
  addq   $0x1,-0x8(%rbp)
L63:
  mov    -0x8(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jb     L19
  addq   $0x1,-0x10(%rbp)
L9:
  mov    -0x10(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jb     L25
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void calcpathv(int32_t **map, int32_t **path, int32_t n, int32_t m) {
  int32_t i, j;
  i = 0;
  while (i < n) {
    j = 0;
    while (j < m) {
      path[i][j] = map[i][j];
      if (i == 0 && j == 0)
        ;
      else if (i == 0)
        path[i][j] += path[i][j - 1];
      else if (j == 0)
        path[i][j] += path[i - 1][j];
      else if (path[i][j - 1] > path[i - 1][j]) {
        path[i][j] += path[i][j - 1];
      } else {
        path[i][j] += path[i - 1][j];
      }
      j++;
    }
    i++;
  }
}
```