user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<minDistance>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x1c(%rbp),%eax
  lea    0x2(%rax),%edx
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  imul   %edx,%eax
  cltq
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x1c(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L6
L56:
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  imul   -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rdx,(%rax)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x24(%rbp),%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x24(%rbp)
L6:
  mov    -0x24(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L56
  movl   $0x0,-0x20(%rbp)
  jmp    L91
L84:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x20(%rbp)
L91:
  mov    -0x20(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jle    L84
  movl   $0x1,-0x24(%rbp)
  jmp    L71
L59:
  movl   $0x1,-0x20(%rbp)
  jmp    L75
L80:
  mov    -0x24(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x20(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L96
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x20(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  jmp    L82
L96:
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x20(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <min@plt>
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x20(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  add    $0x1,%eax
  mov    %eax,(%rdx)
L82:
  addl   $0x1,-0x20(%rbp)
L75:
  mov    -0x20(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jle    L80
  addl   $0x1,-0x24(%rbp)
L71:
  mov    -0x24(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L59
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x14(%rbp),%eax
  leave
  ret
```

assistant: ```c
int minDistance(char *word1, char *word2) {
  int **dp, *temp, len1, len2, i, j, ret;
  len1 = strlen(word1);
  len2 = strlen(word2);
  temp = (int *)calloc((len1 + 2) * (len2 + 1), sizeof(int));
  dp = (int **)malloc((len1 + 1) * sizeof(int *));
  for (i = 0; i <= len1; ++i) {
    dp[i] = temp + i * (len2 + 1);
    dp[i][0] = i;
  }
  for (j = 0; j <= len2; ++j)
    dp[0][j] = j;
  for (i = 1; i <= len1; ++i) {
    for (j = 1; j <= len2; ++j) {
      if (word1[i - 1] == word2[j - 1])
        dp[i][j] = dp[i - 1][j - 1];
      else
        dp[i][j] = min(dp[i][j - 1], dp[i - 1][j]) + 1;
    }
  }
  ret = dp[len1][len2];
  free(dp);
  free(temp);
  return ret;
}
```