user: 请从给定的汇编指令推导出C源代码：

```asm
<narrowbandUnitCostDistanceNoEndPenaltySeq2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    %ecx,-0x48(%rbp)
  mov    %r8d,-0x4c(%rbp)
  mov    -0x44(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jle    L177
  mov    $0xffffffff,%eax
  jmp    L239
L177:
  mov    -0x44(%rbp),%eax
  add    $0x1,%eax
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L60
L118:
  mov    -0x48(%rbp),%eax
  add    $0x1,%eax
  mov    $0x4,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    -0x28(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  addl   $0x1,-0x28(%rbp)
L60:
  mov    -0x28(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jle    L118
  movl   $0x0,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  sub    -0x4c(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  jns    L56
  movl   $0x0,-0x20(%rbp)
L56:
  mov    -0x1c(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jle    L52
  mov    -0x48(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
L52:
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  jmp    L147
L2:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,%rdx
  mov    -0x24(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x24(%rbp)
L147:
  mov    -0x24(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L2
  mov    -0x1c(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jge    L64
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x3e8,(%rax)
L64:
  movl   $0x1,-0x28(%rbp)
  jmp    L178
L31:
  mov    -0x28(%rbp),%eax
  sub    -0x4c(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  jns    L194
  movl   $0x0,-0x20(%rbp)
L194:
  mov    -0x1c(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jle    L85
  mov    -0x48(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
L85:
  cmpl   $0x0,-0x20(%rbp)
  jle    L3
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%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
  movl   $0x3e8,(%rax)
L3:
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  jmp    L126
L179:
  cmpl   $0x0,-0x24(%rbp)
  jne    L4
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x28(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L55
L4:
  mov    -0x28(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  setne  %al
  movzbl %al,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jg     L159
  mov    -0xc(%rbp),%edx
  mov    -0x14(%rbp),%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
  jmp    L37
L159:
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
L37:
  mov    -0x28(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    %eax,(%rdx)
L55:
  addl   $0x1,-0x24(%rbp)
L126:
  mov    -0x24(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L179
  mov    -0x1c(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jge    L50
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x3e8,(%rax)
L50:
  addl   $0x1,-0x28(%rbp)
L178:
  mov    -0x28(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jle    L31
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  sub    -0x4c(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  jns    L98
  movl   $0x0,-0x20(%rbp)
L98:
  mov    -0x1c(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jle    L213
  mov    -0x48(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
L213:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x20(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x24(%rbp)
  jmp    L33
L216:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x2c(%rbp)
  jle    L176
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x2c(%rbp)
L176:
  addl   $0x1,-0x24(%rbp)
L33:
  mov    -0x24(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L216
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x2c(%rbp),%eax
L239:
  leave
  ret
```

assistant: ```c
int narrowbandUnitCostDistanceNoEndPenaltySeq2(char *seq1, char *seq2, int len1, int len2, int maxerr) {
  int **S;
  int score;
  int row, col;
  int match;
  int left, up, diagonal;
  int from, to;
  if (len1 > len2) {
    return (-1);
  }
  S = (int **)calloc((len1 + 1), sizeof(int *));
  for (row = 0; row <= len1; row++) {
    S[row] = (int *)calloc(len2 + 1, sizeof(int));
  }
  row = 0;
  from = row - maxerr;
  to = row + maxerr;
  if (from < 0)
    from = 0;
  if (to > len2)
    to = len2;
  for (col = from; col <= to; col++) {
    S[0][col] = col;
  }
  if (to + 1 <= len2) {
    S[0][to + 1] = 1000;
  }
  for (row = 1; row <= len1; row++) {
    from = row - maxerr;
    to = row + maxerr;
    if (from < 0)
      from = 0;
    if (to > len2)
      to = len2;
    if (from > 0)
      S[row][from - 1] = 1000;
    for (col = from; col <= to; col++) {
      if (col == 0)
        S[row][0] = row;
      else {
        match = (seq1[row - 1] == seq2[col - 1]) ? 0 : 1;
        up = S[row - 1][col] + 1;
        left = S[row][col - 1] + 1;
        diagonal = S[row - 1][col - 1] + match;
        S[row][col] = ((diagonal <= left) ? ((diagonal <= up) ? diagonal : up) : ((left <= up) ? left : up));
      }
    }
    if (to + 1 <= len2) {
      S[row][to + 1] = 1000;
    }
  }
  row = len1;
  from = row - maxerr;
  to = row + maxerr;
  if (from < 0)
    from = 0;
  if (to > len2)
    to = len2;
  score = S[row][from];
  for (col = from + 1; col <= to; col++) {
    if (S[row][col] < score) {
      score = S[row][col];
    }
  }
  free(S);
  return (score);
}
```