user: Converte this assembly snippet into its equivalent C code:

```asm
<longestIncreasingPath>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r14
  mov    %esi,%ebx
  mov    %esi,0x1c(%rsp)
  mov    %edx,%r12d
  movslq %esi,%rdi
  shl    $0x3,%rdi
  call   <malloc@plt>
  mov    %rax,(%rsp)
  test   %ebx,%ebx
  jle    L14
  movslq %r12d,%rax
  shl    $0x2,%rax
  mov    %rax,0x8(%rsp)
  mov    %ebx,%eax
  mov    %rax,0x10(%rsp)
  mov    $0x0,%ebp
  mov    $0x1,%ebx
  mov    $0x1,%r15d
  jmp    L146
L149:
  test   %ebp,%ebp
  jne    L113
  test   %eax,%eax
  jle    L113
  mov    (%r14),%r9
  mov    %r15d,%ecx
  mov    (%r9,%rdi,1),%r11d
  cmp    %r11d,(%r9,%rdx,1)
  jle    L114
  mov    (%rsi,%rdi,1),%ecx
  add    $0x1,%ecx
L114:
  mov    %ecx,(%rsi,%rdx,1)
L33:
  mov    (%rsi,%rdx,1),%ecx
  cmp    %ecx,%ebx
  cmovl  %ecx,%ebx
  add    $0x1,%eax
  add    $0x4,%rdi
  add    $0x4,%rdx
  cmp    %eax,%r12d
  je     L21
L121:
  mov    %r13d,%ecx
  or     %eax,%ecx
  jne    L149
  movl   $0x1,(%rsi)
  jmp    L33
L113:
  test   %r8d,%r8d
  jle    L96
  test   %eax,%eax
  jne    L96
  mov    (%r14),%r10
  mov    -0x8(%r14),%r9
  mov    %r15d,%ecx
  mov    (%r9),%r11d
  cmp    %r11d,(%r10)
  jle    L167
  mov    (%rsp),%rcx
  mov    -0x8(%rcx,%rbp,8),%rcx
  mov    (%rcx),%ecx
  add    $0x1,%ecx
L167:
  mov    %ecx,(%rsi)
  jmp    L33
L96:
  mov    (%r14),%r10
  mov    (%r10,%rdx,1),%r11d
  mov    -0x8(%r14),%r9
  mov    %r15d,%ecx
  cmp    (%r9,%rdx,1),%r11d
  jle    L27
  mov    (%rsp),%rcx
  mov    -0x8(%rcx,%rbp,8),%rcx
  mov    (%rcx,%rdx,1),%ecx
  add    $0x1,%ecx
L27:
  mov    %r15d,%r9d
  cmp    (%r10,%rdi,1),%r11d
  jle    L163
  mov    (%rsi,%rdi,1),%r10d
  lea    0x1(%r10),%r9d
L163:
  cmp    %r9d,%ecx
  cmovl  %r9d,%ecx
  mov    %ecx,(%rsi,%rdx,1)
  jmp    L33
L21:
  add    $0x1,%rbp
  add    $0x8,%r14
  cmp    0x10(%rsp),%rbp
  je     L93
L146:
  mov    %ebp,%r13d
  mov    0x8(%rsp),%rdi
  call   <malloc@plt>
  mov    %rax,%rsi
  mov    (%rsp),%rax
  mov    %rsi,(%rax,%rbp,8)
  test   %r12d,%r12d
  jle    L21
  mov    $0x0,%edx
  mov    $0xfffffffffffffffc,%rdi
  mov    $0x0,%eax
  mov    %ebp,%r8d
  jmp    L121
L93:
  mov    (%rsp),%rdi
  mov    %rdi,%rbp
  mov    0x1c(%rsp),%eax
  lea    (%rdi,%rax,8),%r12
L91:
  mov    0x0(%rbp),%rdi
  call   <free@plt>
  add    $0x8,%rbp
  cmp    %r12,%rbp
  jne    L91
L31:
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    %ebx,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L14:
  mov    $0x1,%ebx
  jmp    L31
```

assistant: ```c
int longestIncreasingPath(int **matrix, int matrixRowSize, int matrixColSize) {
  int **lenMatrix = (int **)malloc(sizeof(int *) * matrixRowSize);
  int i = 0;
  int j = 0;
  int result = 1;
  for (; i < matrixRowSize; i++) {
    lenMatrix[i] = (int *)malloc(sizeof(int) * matrixColSize);
    for (j = 0; j < matrixColSize; j++) {
      if (i == 0 && j == 0) {
        lenMatrix[i][j] = 1;
      } else if (i == 0 && j > 0) {
        lenMatrix[i][j] = matrix[i][j] > matrix[i][j - 1] ? (lenMatrix[i][j - 1] + 1) : 1;
      } else if (i > 0 && j == 0) {
        lenMatrix[i][j] = matrix[i][j] > matrix[i - 1][j] ? (lenMatrix[i - 1][j] + 1) : 1;
      } else {
        int topDown = matrix[i][j] > matrix[i - 1][j] ? (lenMatrix[i - 1][j] + 1) : 1;
        int leftRight = matrix[i][j] > matrix[i][j - 1] ? (lenMatrix[i][j - 1] + 1) : 1;
        lenMatrix[i][j] = (topDown > leftRight) ? topDown : leftRight;
      }
      if (result < lenMatrix[i][j]) {
        result = lenMatrix[i][j];
      }
    }
  }
  for (i = 0; i < matrixRowSize; i++) {
    free(lenMatrix[i]);
  }
  free(lenMatrix);
  return result;
}
```