user: Please show me the C implementation that matches the assembly code listed below:

```asm
<narrowbandUnitCostDistanceNoEndPenaltySeq2LowMemUsesPointers>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %edx,-0x84(%rbp)
  mov    %ecx,-0x88(%rbp)
  mov    %r8d,-0x8c(%rbp)
  mov    -0x84(%rbp),%eax
  cmp    -0x88(%rbp),%eax
  jle    L365
  mov    $0xffffffff,%eax
  jmp    L367
L365:
  mov    -0x84(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    $0x8,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x68(%rbp)
  jmp    L216
L87:
  mov    -0x68(%rbp),%eax
  sub    -0x8c(%rbp),%eax
  mov    %eax,-0x60(%rbp)
  mov    -0x68(%rbp),%edx
  mov    -0x8c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x5c(%rbp)
  movl   $0x0,-0x58(%rbp)
  cmpl   $0x0,-0x60(%rbp)
  jg     L119
  movl   $0x0,-0x60(%rbp)
  jmp    L223
L119:
  movl   $0x1,-0x58(%rbp)
L223:
  movl   $0x0,-0x54(%rbp)
  mov    -0x5c(%rbp),%eax
  cmp    -0x88(%rbp),%eax
  jl     L82
  mov    -0x88(%rbp),%eax
  mov    %eax,-0x5c(%rbp)
  jmp    L389
L82:
  movl   $0x1,-0x54(%rbp)
L389:
  mov    -0x5c(%rbp),%eax
  sub    -0x60(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x58(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  add    %eax,%edx
  mov    -0x54(%rbp),%eax
  add    %edx,%eax
  cltq
  mov    -0x68(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x18(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,(%rbx)
  addl   $0x1,-0x68(%rbp)
L216:
  mov    -0x68(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jle    L87
  movl   $0x0,-0x68(%rbp)
  mov    -0x68(%rbp),%eax
  sub    -0x8c(%rbp),%eax
  mov    %eax,-0x60(%rbp)
  mov    -0x68(%rbp),%edx
  mov    -0x8c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x5c(%rbp)
  movl   $0x0,-0x58(%rbp)
  cmpl   $0x0,-0x60(%rbp)
  jg     L201
  movl   $0x0,-0x60(%rbp)
  jmp    L304
L201:
  movl   $0x1,-0x58(%rbp)
L304:
  movl   $0x0,-0x54(%rbp)
  mov    -0x5c(%rbp),%eax
  cmp    -0x88(%rbp),%eax
  jl     L379
  mov    -0x88(%rbp),%eax
  mov    %eax,-0x5c(%rbp)
  jmp    L348
L379:
  movl   $0x1,-0x54(%rbp)
L348:
  mov    -0x5c(%rbp),%eax
  sub    -0x60(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x68(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x38(%rbp)
  cmpl   $0x0,-0x58(%rbp)
  je     L182
  mov    -0x38(%rbp),%rax
  movl   $0x3e8,(%rax)
L182:
  mov    -0x58(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,-0x38(%rbp)
  mov    -0x58(%rbp),%eax
  mov    %eax,-0x64(%rbp)
  jmp    L183
L319:
  mov    -0x38(%rbp),%rax
  mov    -0x64(%rbp),%edx
  mov    %edx,(%rax)
  addq   $0x4,-0x38(%rbp)
  addl   $0x1,-0x64(%rbp)
L183:
  mov    -0x58(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x64(%rbp)
  jl     L319
  cmpl   $0x0,-0x54(%rbp)
  je     L383
  mov    -0x38(%rbp),%rax
  movl   $0x3e8,(%rax)
L383:
  mov    -0x58(%rbp),%eax
  mov    %eax,-0x50(%rbp)
  movl   $0x1,-0x68(%rbp)
  jmp    L35
L86:
  mov    -0x68(%rbp),%eax
  sub    -0x8c(%rbp),%eax
  mov    %eax,-0x60(%rbp)
  mov    -0x68(%rbp),%edx
  mov    -0x8c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x5c(%rbp)
  movl   $0x0,-0x58(%rbp)
  cmpl   $0x0,-0x60(%rbp)
  jg     L356
  movl   $0x0,-0x60(%rbp)
  jmp    L44
L356:
  movl   $0x1,-0x58(%rbp)
L44:
  movl   $0x0,-0x54(%rbp)
  mov    -0x5c(%rbp),%eax
  cmp    -0x88(%rbp),%eax
  jl     L350
  mov    -0x88(%rbp),%eax
  mov    %eax,-0x5c(%rbp)
  jmp    L220
L350:
  movl   $0x1,-0x54(%rbp)
L220:
  mov    -0x5c(%rbp),%eax
  sub    -0x60(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x68(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x68(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x50(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x38(%rbp),%rax
  sub    $0x4,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%rax
  sub    $0x4,%rax
  mov    %rax,-0x20(%rbp)
  cmpl   $0x0,-0x58(%rbp)
  je     L298
  mov    -0x38(%rbp),%rax
  movl   $0x3e8,(%rax)
L298:
  mov    -0x58(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,-0x38(%rbp)
  mov    -0x58(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,-0x30(%rbp)
  mov    -0x58(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,-0x28(%rbp)
  mov    -0x58(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,-0x20(%rbp)
  mov    -0x58(%rbp),%eax
  mov    %eax,-0x64(%rbp)
  jmp    L245
L330:
  cmpl   $0x0,-0x64(%rbp)
  jne    L236
  mov    -0x38(%rbp),%rax
  mov    -0x68(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L386
L236:
  mov    -0x68(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x60(%rbp),%ecx
  mov    -0x64(%rbp),%eax
  add    %ecx,%eax
  sub    -0x58(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rcx
  mov    -0x80(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  setne  %al
  movzbl %al,%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x48(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x3c(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jg     L23
  mov    -0x3c(%rbp),%edx
  mov    -0x44(%rbp),%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
  jmp    L34
L23:
  mov    -0x40(%rbp),%edx
  mov    -0x44(%rbp),%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
L34:
  mov    -0x38(%rbp),%rdx
  mov    %eax,(%rdx)
L386:
  addq   $0x4,-0x38(%rbp)
  addq   $0x4,-0x30(%rbp)
  addq   $0x4,-0x28(%rbp)
  addq   $0x4,-0x20(%rbp)
  addl   $0x1,-0x64(%rbp)
L245:
  mov    -0x58(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x64(%rbp)
  jl     L330
  cmpl   $0x0,-0x54(%rbp)
  je     L192
  mov    -0x38(%rbp),%rax
  movl   $0x3e8,(%rax)
L192:
  mov    -0x58(%rbp),%eax
  mov    %eax,-0x50(%rbp)
  addl   $0x1,-0x68(%rbp)
L35:
  mov    -0x68(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jle    L86
  mov    -0x84(%rbp),%eax
  mov    %eax,-0x68(%rbp)
  mov    -0x68(%rbp),%eax
  sub    -0x8c(%rbp),%eax
  mov    %eax,-0x60(%rbp)
  mov    -0x68(%rbp),%edx
  mov    -0x8c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x5c(%rbp)
  movl   $0x0,-0x58(%rbp)
  cmpl   $0x0,-0x60(%rbp)
  jg     L194
  movl   $0x0,-0x60(%rbp)
  jmp    L296
L194:
  movl   $0x1,-0x58(%rbp)
L296:
  movl   $0x0,-0x54(%rbp)
  mov    -0x5c(%rbp),%eax
  cmp    -0x88(%rbp),%eax
  jl     L334
  mov    -0x88(%rbp),%eax
  mov    %eax,-0x5c(%rbp)
  jmp    L140
L334:
  movl   $0x1,-0x54(%rbp)
L140:
  mov    -0x5c(%rbp),%eax
  sub    -0x60(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x68(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x6c(%rbp)
  addq   $0x4,-0x38(%rbp)
  movl   $0x1,-0x64(%rbp)
  jmp    L113
L32:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x6c(%rbp)
  jle    L7
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x6c(%rbp)
L7:
  addq   $0x4,-0x38(%rbp)
  addl   $0x1,-0x64(%rbp)
L113:
  mov    -0x58(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  add    %eax,%edx
  mov    -0x54(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x64(%rbp)
  jl     L32
  movl   $0x0,-0x68(%rbp)
  jmp    L368
L187:
  mov    -0x68(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  addl   $0x1,-0x68(%rbp)
L368:
  mov    -0x68(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jle    L187
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x6c(%rbp),%eax
L367:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

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);
}
```