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

```asm
<numstrcmp>:
  endbr64
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  nopl   0x0(%rax)
L159:
  movsbl (%r12),%edi
  mov    %r12,%rbx
  cmp    $0x20,%dil
  jne    L258
  cs nopw 0x0(%rax,%rax,1)
L67:
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  cmp    $0x20,%dil
  je     L67
L258:
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L85
  mov    %r12,%rbx
  add    $0x1,%r12
L280:
  movsbl 0x0(%r13),%edi
  mov    %r13,%rbp
  cmp    $0x20,%dil
  jne    L92
  nopl   0x0(%rax)
L244:
  movsbl 0x1(%rbp),%edi
  add    $0x1,%rbp
  cmp    $0x20,%dil
  je     L244
L92:
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L101
  mov    %r13,%rbp
  add    $0x1,%r13
L42:
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  movsbl 0x0(%rbp),%edi
  test   %rax,%rax
  jne    L229
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L171
  movzbl (%rbx),%eax
  cmp    0x0(%rbp),%al
  jl     L114
  jg     L171
  test   %al,%al
  jne    L159
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L85:
  lea    0x1(%rbx),%r12
  jmp    L109
  xchg   %ax,%ax
L19:
  add    $0x1,%r12
L109:
  movsbl (%r12),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L19
  jmp    L280
  nopl   0x0(%rax,%rax,1)
L229:
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L174
  jmp    L114
  nop
L239:
  add    $0x1,%rbx
L174:
  cmpb   $0x30,(%rbx)
  je     L239
  cmpb   $0x30,0x0(%rbp)
  jne    L176
  nop
L201:
  add    $0x1,%rbp
  cmpb   $0x30,0x0(%rbp)
  je     L201
L176:
  mov    %r12,%rdx
  mov    %r13,%rax
  sub    %rbx,%rdx
  sub    %rbp,%rax
  cmp    %rax,%rdx
  jl     L114
  jg     L171
  cmp    %rbx,%r12
  ja     L281
  jmp    L159
  nopw   0x0(%rax,%rax,1)
L182:
  add    $0x1,%rbx
  add    $0x1,%rbp
  cmp    %rbx,%r12
  je     L159
L281:
  movzbl (%rbx),%edx
  movzbl 0x0(%rbp),%eax
  cmp    %al,%dl
  je     L182
  cmp    %rbx,%r12
  jbe    L159
  cmp    %al,%dl
  jl     L114
L171:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L101:
  lea    0x1(%rbp),%r13
  jmp    L272
  cs nopw 0x0(%rax,%rax,1)
L21:
  add    $0x1,%r13
L272:
  movsbl 0x0(%r13),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L21
  jmp    L42
L114:
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int numstrcmp(char *s1, char *s2) {
  char *a1, *a2;
  while (1) {
    for (a1 = s1; *a1 == ' '; ++a1) {
    }
    if (isdigit(*a1)) {
      for (s1 = a1 + 1; isdigit(*s1); ++s1) {
      }
    } else {
      a1 = s1;
      ++s1;
    }
    for (a2 = s2; *a2 == ' '; ++a2) {
    }
    if (isdigit(*a2)) {
      for (s2 = a2 + 1; isdigit(*s2); ++s2) {
      }
    } else {
      a2 = s2;
      ++s2;
    }
    if (!isdigit(*a1)) {
      if (!isdigit(*a2)) {
        if (*a1 < *a2)
          return -1;
        if (*a1 > *a2)
          return 1;
        if (*a1 == '\0')
          return 0;
      } else
        return 1;
    } else {
      if (!isdigit(*a2))
        return -1;
      else {
        for (; *a1 == '0'; ++a1) {
        }
        for (; *a2 == '0'; ++a2) {
        }
        if (s1 - a1 < s2 - a2)
          return -1;
        if (s1 - a1 > s2 - a2)
          return 1;
        for (; a1 < s1 && *a1 == *a2; ++a1, ++a2) {
        }
        if (a1 < s1) {
          if (*a1 < *a2)
            return -1;
          else
            return 1;
        }
      }
    }
  }
}
```