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

```asm
<narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rsi,0x10(%rsp)
  mov    %edx,0x44(%rsp)
  mov    %r8d,0x40(%rsp)
  mov    %ecx,0x38(%rsp)
  cmp    %ecx,%edx
  jg     L85
  mov    %rdi,%r15
  mov    %edx,%ebx
  mov    %r8d,%r14d
  lea    0x1(%rdx),%edi
  movslq %edi,%rdi
  mov    $0x8,%esi
  call   <calloc@plt>
  mov    %rax,0x30(%rsp)
  mov    %ebx,%esi
  test   %ebx,%ebx
  js     L252
  mov    %r14d,%ebx
  neg    %ebx
  mov    %r14d,%r12d
  mov    %rax,%rbp
  mov    %esi,%eax
  sub    %r14d,%eax
  lea    0x1(%rax),%r13d
  mov    $0x0,%r14d
  mov    %r15,0x8(%rsp)
  mov    0x38(%rsp),%r15d
  jmp    L158
L256:
  sub    %edx,%eax
  lea    0x1(%rsi,%rax,1),%edi
  add    %ecx,%edi
  movslq %edi,%rdi
  mov    $0x4,%esi
  call   <calloc@plt>
  mov    %rax,0x0(%rbp)
  add    $0x1,%ebx
  add    $0x1,%r12d
  add    $0x8,%rbp
  cmp    %r13d,%ebx
  je     L326
L158:
  mov    %r12d,%eax
  test   %ebx,%ebx
  setg   %sil
  movzbl %sil,%esi
  mov    $0x0,%edx
  cmovns %ebx,%edx
  mov    $0x1,%ecx
  cmp    %r12d,%r15d
  jg     L256
  mov    %r15d,%eax
  mov    %r14d,%ecx
  jmp    L256
L326:
  mov    0x8(%rsp),%r15
L252:
  cmpl   $0x0,0x40(%rsp)
  js     L39
  mov    0x40(%rsp),%ebx
  cmp    %ebx,0x38(%rsp)
  jle    L233
  mov    0x40(%rsp),%eax
  lea    0x1(%rax),%ecx
  mov    0x30(%rsp),%rax
  mov    (%rax),%rdx
  mov    %rdx,%rsi
  mov    $0x1,%edi
  movl   $0x0,0x18(%rsp)
  mov    $0x0,%eax
  jmp    L173
L129:
  movl   $0x1,0x18(%rsp)
  jmp    L91
L107:
  cmp    %r14d,0x38(%rsp)
  jle    L46
  add    $0x1,%eax
  mov    %eax,0x1c(%rsp)
  mov    0x30(%rsp),%rax
  mov    (%rax,%r13,8),%rsi
  movslq 0x18(%rsp),%rbp
  mov    -0x8(%rax,%r13,8),%rax
  lea    (%rax,%rbp,4),%r9
  movl   $0x1,0x24(%rsp)
  movl   $0x0,0x18(%rsp)
  mov    $0x0,%edi
  jmp    L340
L40:
  mov    %eax,(%rcx)
  add    $0x4,%rcx
  add    $0x4,%r10
  add    $0x4,%rsi
  add    $0x4,%r9
  add    $0x1,%edx
  cmp    %r11d,%edx
  je     L315
L57:
  mov    %ebx,%eax
  test   %edx,%edx
  je     L40
  mov    (%r10),%eax
  add    $0x1,%eax
  mov    (%rsi),%edi
  lea    0x1(%rdi),%r8d
  mov    0x8(%rsp),%edi
  add    %edx,%edi
  movslq %edi,%rdi
  mov    0x10(%rsp),%r12
  movzbl -0x1(%r15,%r13,1),%ebp
  cmp    %bpl,-0x1(%r12,%rdi,1)
  setne  %dil
  movzbl %dil,%edi
  add    (%r9),%edi
  cmp    %edi,%eax
  mov    %edi,%r12d
  cmovle %eax,%r12d
  cmp    %r8d,%eax
  cmovg  %r8d,%eax
  cmp    %edi,%r8d
  cmovge %r12d,%eax
  jmp    L40
L315:
  mov    0x28(%rsp),%rbp
  mov    0x1c(%rsp),%eax
  lea    -0x1(%rax),%eax
  lea    0x4(%rbp,%rax,4),%rbp
L210:
  cmpl   $0x0,0x24(%rsp)
  je     L312
  movl   $0x3e8,0x0(%rbp)
L312:
  add    $0x1,%r13
  addl   $0x1,0x20(%rsp)
  add    $0x1,%r14d
  cmp    0x3c(%rsp),%r14d
  je     L232
L190:
  mov    %r13d,%ebx
  mov    0x20(%rsp),%esi
  mov    %esi,%edi
  mov    %r14d,%eax
  test   %esi,%esi
  jle    L107
  cmp    %r14d,0x38(%rsp)
  jle    L159
  sub    %esi,%eax
  add    $0x1,%eax
  mov    %eax,0x1c(%rsp)
  mov    0x30(%rsp),%rax
  mov    (%rax,%r13,8),%rsi
  movslq 0x18(%rsp),%rbp
  mov    -0x8(%rax,%r13,8),%rax
  lea    (%rax,%rbp,4),%r9
  movl   $0x1,0x24(%rsp)
  jmp    L110
L232:
  mov    0x44(%rsp),%ebx
  mov    %ebx,%edx
  mov    0x40(%rsp),%eax
  sub    %eax,%edx
  add    %ebx,%eax
  mov    $0x1,%r8d
  test   %edx,%edx
  jle    L319
L349:
  mov    $0x0,%esi
  cmp    %eax,0x38(%rsp)
  jle    L206
  mov    %eax,0x38(%rsp)
  mov    $0x1,%esi
L206:
  movslq 0x44(%rsp),%rax
  mov    0x30(%rsp),%rbx
  mov    (%rbx,%rax,8),%rcx
  mov    (%rcx),%ebp
  lea    0x4(%rcx),%rax
  mov    0x38(%rsp),%edi
  sub    %edx,%edi
  lea    0x1(%r8,%rdi,1),%edx
  add    %esi,%edx
  cmp    $0x1,%edx
  jle    L283
  mov    %edx,%edx
  lea    (%rcx,%rdx,4),%rcx
L218:
  mov    (%rax),%edx
  cmp    %edx,%ebp
  cmovg  %edx,%ebp
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L218
L283:
  mov    0x44(%rsp),%eax
  test   %eax,%eax
  js     L10
  mov    0x30(%rsp),%rsi
  mov    %rsi,%rbx
  mov    %eax,%eax
  lea    0x8(%rsi,%rax,8),%r12
L175:
  mov    (%rbx),%rdi
  call   <free@plt>
  add    $0x8,%rbx
  cmp    %r12,%rbx
  jne    L175
L10:
  mov    0x30(%rsp),%rdi
  call   <free@plt>
L354:
  mov    %ebp,%eax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L319:
  mov    $0x0,%r8d
  mov    $0x0,%edx
  jmp    L349
L85:
  mov    $0xffffffff,%ebp
  jmp    L354
L159:
  mov    0x48(%rsp),%eax
  sub    %r14d,%eax
  mov    %eax,0x1c(%rsp)
  mov    0x30(%rsp),%rax
  mov    (%rax,%r13,8),%rsi
  movslq 0x18(%rsp),%rbp
  mov    -0x8(%rax,%r13,8),%rax
  lea    (%rax,%rbp,4),%r9
  movl   $0x0,0x24(%rsp)
L110:
  movl   $0x3e8,(%rsi)
  movl   $0x1,0x18(%rsp)
L340:
  mov    0x18(%rsp),%ecx
  movslq %ecx,%rax
  shl    $0x2,%rax
  lea    (%rsi,%rax,1),%rbp
  lea    (%r9,%rax,1),%r10
  sub    $0x4,%rax
  add    %rax,%rsi
  add    %rax,%r9
  mov    %ecx,%eax
  mov    %ecx,%r11d
  add    0x1c(%rsp),%r11d
  cmp    %ecx,%r11d
  jle    L210
  mov    %rbp,%rcx
  mov    %eax,%edx
  sub    %eax,%edi
  mov    %edi,0x8(%rsp)
  mov    %rbp,0x28(%rsp)
  jmp    L57
L121:
  mov    0x38(%rsp),%eax
  mov    0x40(%rsp),%ebx
  lea    0x1(%rax,%rbx,1),%ecx
  mov    0x30(%rsp),%rax
  mov    (%rax),%rdx
  mov    $0x0,%edi
  jmp    L335
L39:
  mov    0x40(%rsp),%ebx
  cmp    %ebx,0x38(%rsp)
  jle    L121
  mov    0x40(%rsp),%eax
  lea    0x1(%rax,%rax,1),%ecx
  mov    0x30(%rsp),%rax
  mov    (%rax),%rdx
  mov    $0x1,%edi
L335:
  movl   $0x3e8,(%rdx)
  add    $0x4,%rdx
  add    $0x1,%ecx
  cmp    $0x1,%ecx
  jle    L129
  mov    $0x1,%eax
L201:
  mov    %eax,0x18(%rsp)
  mov    %rdx,%rsi
L173:
  mov    %eax,(%rdx)
  add    $0x4,%rdx
  add    $0x1,%eax
  cmp    %ecx,%eax
  jne    L173
  sub    0x18(%rsp),%ecx
  lea    -0x1(%rcx),%eax
  lea    0x4(%rsi,%rax,4),%rdx
L91:
  test   %edi,%edi
  je     L204
  movl   $0x3e8,(%rdx)
L204:
  mov    0x44(%rsp),%ebx
  test   %ebx,%ebx
  jle    L232
  mov    $0x1,%eax
  mov    %eax,%esi
  mov    0x40(%rsp),%eax
  sub    %eax,%esi
  mov    %esi,0x20(%rsp)
  lea    0x1(%rax),%r14d
  add    %r14d,%ebx
  mov    %ebx,0x3c(%rsp)
  mov    $0x1,%r13d
  mov    0x38(%rsp),%ebx
  lea    0x1(%rbx,%rax,2),%eax
  mov    %eax,0x48(%rsp)
  lea    0x1(%rbx),%eax
  mov    %eax,0x4c(%rsp)
  jmp    L190
L46:
  mov    0x4c(%rsp),%eax
  mov    %eax,0x1c(%rsp)
  mov    0x30(%rsp),%rax
  mov    (%rax,%r13,8),%rsi
  movslq 0x18(%rsp),%rbp
  mov    -0x8(%rax,%r13,8),%rax
  lea    (%rax,%rbp,4),%r9
  movl   $0x0,0x24(%rsp)
  movl   $0x0,0x18(%rsp)
  mov    $0x0,%edi
  jmp    L340
L233:
  mov    0x38(%rsp),%eax
  lea    0x1(%rax),%ecx
  mov    0x30(%rsp),%rax
  mov    (%rax),%rdx
  mov    $0x0,%edi
  mov    $0x0,%eax
  test   %ecx,%ecx
  jg     L201
  movl   $0x0,0x18(%rsp)
  jmp    L204
```

assistant: ```c
int narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers(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;
  int rowlength;
  int leftboundary, rightboundary;
  int previousleftboundary;
  int *Sp, *Spu, *Spl, *Spd;
  if (len1 > len2) {
    return (-1);
  }
  S = (int **)calloc((len1 + 1), sizeof(int *));
  for (row = 0; row <= len1; row++) {
    from = row - maxerr;
    to = row + maxerr;
    leftboundary = 0;
    if (from <= 0)
      from = 0;
    else
      leftboundary = 1;
    rightboundary = 0;
    if (to >= len2)
      to = len2;
    else
      rightboundary = 1;
    rowlength = to - from + 1;
    S[row] = (int *)calloc(leftboundary + rowlength + rightboundary, sizeof(int));
  }
  row = 0;
  from = row - maxerr;
  to = row + maxerr;
  leftboundary = 0;
  if (from <= 0)
    from = 0;
  else
    leftboundary = 1;
  rightboundary = 0;
  if (to >= len2)
    to = len2;
  else
    rightboundary = 1;
  rowlength = to - from + 1;
  Sp = S[row];
  if (leftboundary) {
    (*Sp) = 1000;
  }
  Sp += leftboundary;
  for (col = leftboundary; col <= leftboundary + rowlength - 1; col++) {
    (*Sp) = col;
    Sp++;
  }
  if (rightboundary) {
    (*Sp) = 1000;
  }
  previousleftboundary = leftboundary;
  for (row = 1; row <= len1; row++) {
    from = row - maxerr;
    to = row + maxerr;
    leftboundary = 0;
    if (from <= 0)
      from = 0;
    else
      leftboundary = 1;
    rightboundary = 0;
    if (to >= len2)
      to = len2;
    else
      rightboundary = 1;
    rowlength = to - from + 1;
    Sp = S[row];
    Spu = S[row - 1] + previousleftboundary;
    Spl = Sp - 1;
    Spd = Spu - 1;
    if (leftboundary) {
      (*Sp) = 1000;
    }
    Sp += leftboundary;
    Spu += leftboundary;
    Spl += leftboundary;
    Spd += leftboundary;
    for (col = leftboundary; col <= leftboundary + rowlength - 1; col++) {
      if (col == 0)
        (*Sp) = row;
      else {
        match = (seq1[row - 1] == seq2[from + col - leftboundary - 1]) ? 0 : 1;
        up = (*Spu) + 1;
        left = (*Spl) + 1;
        diagonal = (*Spd) + match;
        (*Sp) = ((diagonal <= left) ? ((diagonal <= up) ? diagonal : up) : ((left <= up) ? left : up));
      }
      Sp++;
      Spu++;
      Spl++;
      Spd++;
    }
    if (rightboundary) {
      (*Sp) = 1000;
    }
    previousleftboundary = leftboundary;
  }
  row = len1;
  from = row - maxerr;
  to = row + maxerr;
  leftboundary = 0;
  if (from <= 0)
    from = 0;
  else
    leftboundary = 1;
  rightboundary = 0;
  if (to >= len2)
    to = len2;
  else
    rightboundary = 1;
  rowlength = to - from + 1;
  Sp = S[row];
  score = (*Sp);
  Sp++;
  for (col = 1; col <= leftboundary + rowlength + rightboundary - 1; col++) {
    if ((*Sp) < score) {
      score = (*Sp);
    }
    Sp++;
  }
  for (row = 0; row <= len1; row++) {
    free(S[row]);
  }
  free(S);
  return (score);
}
```