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

```asm
<editDistanceP>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbx
  lea    0x1(%rsi),%ebx
  sub    $0x58,%rsp
  mov    %rdx,-0x60(%rbp)
  mov    %ecx,-0x6c(%rbp)
  mov    %esi,-0x54(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  mov    %ecx,%eax
  mov    %rsp,%rcx
  mov    %ebx,-0x50(%rbp)
  add    $0x1,%eax
  movslq %eax,%rdx
  mov    %eax,-0x58(%rbp)
  lea    0x0(,%rdx,4),%rax
  mov    %rax,-0x48(%rbp)
  movslq %ebx,%rax
  imul   %rdx,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L0
L82:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L82
L0:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L67
L21:
  mov    -0x48(%rbp),%rbx
  mov    -0x58(%rbp),%eax
  mov    %rsp,%r15
  xor    %r12d,%r12d
  mov    -0x50(%rbp),%ecx
  mov    %r15,-0x78(%rbp)
  shr    $0x2,%rbx
  lea    0x0(,%rax,4),%r13d
  test   %ecx,%ecx
  jle    L142
  mov    %r14,-0x68(%rbp)
  mov    %r15,%r14
  mov    -0x78(%rbp),%r15
  nopl   0x0(%rax)
L56:
  mov    %r14,%rdi
  mov    %r13d,%edx
  xor    %esi,%esi
  call   <memset@plt>
  movslq %r12d,%rax
  add    -0x48(%rbp),%r14
  imul   %rbx,%rax
  mov    %r12d,(%r15,%rax,4)
  mov    %r12d,%eax
  add    $0x1,%r12d
  cmp    %eax,-0x54(%rbp)
  jne    L56
  mov    -0x68(%rbp),%r14
L142:
  mov    -0x58(%rbp),%edx
  mov    -0x6c(%rbp),%ecx
  xor    %eax,%eax
  mov    -0x78(%rbp),%rsi
  test   %edx,%edx
  jle    L33
  nopl   0x0(%rax)
L114:
  mov    %rax,%rdx
  mov    %eax,(%rsi,%rax,4)
  add    $0x1,%rax
  cmp    %rcx,%rdx
  jne    L114
L33:
  cmpl   $0x1,-0x50(%rbp)
  jle    L31
  mov    -0x78(%rbp),%rax
  mov    -0x60(%rbp),%rdx
  mov    %r14,%r12
  mov    %rax,-0x50(%rbp)
  mov    -0x54(%rbp),%eax
  sub    $0x1,%eax
  lea    0x1(%r14,%rax,1),%rax
  mov    %rax,-0x68(%rbp)
  mov    -0x6c(%rbp),%eax
  sub    $0x1,%eax
  lea    0x1(%rdx,%rax,1),%r15
  nopw   0x0(%rax,%rax,1)
L135:
  cmpl   $0x1,-0x58(%rbp)
  mov    -0x60(%rbp),%r13
  mov    -0x50(%rbp),%r14
  jg     L98
  jmp    L49
  nopl   0x0(%rax,%rax,1)
L132:
  mov    (%r14),%eax
L19:
  add    $0x1,%r13
  mov    %eax,0x4(%r14,%rbx,4)
  add    $0x4,%r14
  cmp    %r15,%r13
  je     L49
L98:
  movsbl 0x0(%r13),%esi
  movsbl (%r12),%edi
  call   <fitPattern@plt>
  test   %rax,%rax
  jne    L132
  mov    (%r14,%rbx,4),%ecx
  mov    0x4(%r14),%edx
  mov    (%r14),%esi
  cmp    %edx,%ecx
  jge    L66
  lea    0x1(%rcx),%edx
  lea    0x1(%rsi),%eax
  cmp    %esi,%ecx
  cmovl  %edx,%eax
  jmp    L19
  nopl   (%rax)
L66:
  lea    0x1(%rdx),%ecx
  lea    0x1(%rsi),%eax
  cmp    %esi,%edx
  cmovl  %ecx,%eax
  jmp    L19
  nopl   (%rax)
L49:
  mov    -0x48(%rbp),%rcx
  add    $0x1,%r12
  add    %rcx,-0x50(%rbp)
  cmp    -0x68(%rbp),%r12
  jne    L135
L31:
  movslq -0x54(%rbp),%rax
  movslq -0x6c(%rbp),%rdx
  imul   %rbx,%rax
  mov    -0x78(%rbp),%rbx
  add    %rdx,%rax
  mov    (%rbx,%rax,4),%eax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L75
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L67:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L21
L75:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int editDistanceP(const char *t, int tlen, const char *s, int slen) {
  int m = slen + 1;
  int n = tlen + 1;
  int matrix[n][m];
  int i;
  int j;
  for (i = 0; i < n; i++) {
    memset(matrix[i], 0, m * sizeof(int));
    matrix[i][0] = i;
  }
  for (i = 0; i < m; i++)
    matrix[0][i] = i;
  for (i = 1; i < n; i++) {
    for (j = 1; j < m; j++) {
      if (fitPattern(t[i - 1], s[j - 1])) {
        matrix[i][j] = matrix[i - 1][j - 1];
      } else {
        matrix[i][j] = ((matrix[i][j - 1] + 1 < matrix[i - 1][j] + 1) ? ((matrix[i][j - 1] + 1 < matrix[i - 1][j - 1] + 1) ? matrix[i][j - 1] + 1 : matrix[i - 1][j - 1] + 1) : ((matrix[i - 1][j] + 1 < matrix[i - 1][j - 1] + 1) ? matrix[i - 1][j] + 1 : matrix[i - 1][j - 1] + 1));
      }
    }
  }
  return matrix[n - 1][m - 1];
}
```