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

```asm
<nstrcmp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x30(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x28(%rbp)
  movl   $0x0,-0x48(%rbp)
  movl   $0x0,-0x44(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <cutalias@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <cutalias@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rindex_nondigit@plt>
  mov    %eax,-0x40(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <rindex_nondigit@plt>
  mov    %eax,-0x3c(%rbp)
  mov    -0x3c(%rbp),%edx
  mov    -0x40(%rbp),%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x38(%rbp),%edx
  mov    -0x28(%rbp),%rcx
  mov    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  mov    %eax,-0x34(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  je     L87
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x34(%rbp),%eax
  jmp    L79
L87:
  mov    -0x40(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jle    L60
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x1,%eax
  jmp    L79
L60:
  mov    -0x40(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jge    L93
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L79
L93:
  mov    -0x40(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x48(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x44(%rbp)
  mov    -0x48(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jge    L97
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L79
L97:
  mov    -0x48(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jle    L63
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x1,%eax
  jmp    L79
L63:
  movl   $0xffffffff,-0x48(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L119
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x48(%rbp)
L119:
  movl   $0xffffffff,-0x44(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L99
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x44(%rbp)
L99:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x48(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jge    L137
  mov    $0xffffffff,%eax
  jmp    L79
L137:
  mov    -0x48(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jle    L1
  mov    $0x1,%eax
  jmp    L79
L1:
  mov    $0x0,%eax
L79:
  leave
  ret
```

assistant: ```c
int nstrcmp(const char *ap, const char *bp) {
  char *a = (char *)strdup(ap);
  char *b = (char *)strdup(bp);
  char *an, *bn;
  int av = 0, bv = 0;
  char *aalias = cutalias(a);
  char *balias = cutalias(b);
  int aindex = rindex_nondigit(a);
  int bindex = rindex_nondigit(b);
  int complen = (aindex < bindex) ? aindex : bindex;
  int res = strncmp(a, b, complen);
  if (res != 0) {
    free(a);
    free(b);
    return res;
  }
  if (aindex > bindex) {
    free(a);
    free(b);
    return 1;
  }
  if (aindex < bindex) {
    free(a);
    free(b);
    return -1;
  }
  an = a + aindex;
  bn = b + bindex;
  av = atoi(an);
  bv = atoi(bn);
  if (av < bv) {
    free(a);
    free(b);
    return -1;
  }
  if (av > bv) {
    free(a);
    free(b);
    return 1;
  }
  av = -1;
  if (aalias != NULL)
    av = atoi(aalias);
  bv = -1;
  if (balias != NULL)
    bv = atoi(balias);
  free(a);
  free(b);
  if (av < bv)
    return -1;
  if (av > bv)
    return 1;
  return 0;
}
```