user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<pq_nkrange>:
  endbr64
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  cmpb   $0x0,(%rdi)
  jne    L101
  pop    %rbx
  mov    %r14d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L101:
  mov    %rdi,%rbp
  call   <strlen@plt>
  mov    $0x1,%esi
  lea    0x1(%rax),%r13d
  mov    %r13d,%edi
  call   <calloc@plt>
  mov    %r13d,%edi
  mov    $0x1,%esi
  mov    %rax,%r12
  call   <calloc@plt>
  movb   $0x0,(%rax)
  mov    %rax,%r13
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L46
  xor    %ecx,%ecx
  xor    %esi,%esi
  xor    %ebx,%ebx
  jmp    L83
  nopl   0x0(%rax,%rax,1)
L142:
  mov    %al,(%rdx)
  movslq %esi,%rdx
  add    $0x1,%esi
  mov    %al,(%r12,%rdx,1)
L89:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L43
L83:
  movslq %ecx,%rdx
  add    $0x1,%rbp
  add    %r13,%rdx
  cmp    $0x2c,%al
  je     L50
  add    $0x1,%ecx
  movslq %ecx,%rdi
  add    %r13,%rdi
  cmp    $0x2d,%al
  jne    L142
  movb   $0x0,(%r12)
  xor    %esi,%esi
  movb   $0x0,(%rdx)
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  jne    L83
L43:
  movslq %esi,%rsi
  lea    0x1(%rbx),%r14d
  add    %r12,%rsi
L77:
  movb   $0x0,(%rdi)
  mov    %r12,%rdi
  movb   $0x0,(%rsi)
  call   <atoi@plt>
  mov    %r13,%rdi
  mov    %eax,%ebp
  call   <atoi@plt>
  cmp    %eax,%ebp
  jl     L106
  mov    $0x1,%ecx
  je     L9
  xchg   %ax,%ax
L145:
  add    %ecx,%eax
  mov    %ebx,%edx
  add    $0x1,%ebx
  cmp    %eax,%ebp
  jne    L145
L100:
  lea    0x2(%rdx),%r14d
L9:
  mov    %r12,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  pop    %rbx
  mov    %r14d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L50:
  movslq %esi,%rsi
  movb   $0x0,(%rdx)
  mov    %r12,%rdi
  movb   $0x0,(%r12,%rsi,1)
  call   <atoi@plt>
  mov    %r13,%rdi
  mov    %eax,%r14d
  call   <atoi@plt>
  cmp    %eax,%r14d
  jge    L108
  mov    $0xffffffff,%edx
  nopl   0x0(%rax,%rax,1)
L171:
  add    %edx,%eax
  add    $0x1,%ebx
  cmp    %eax,%r14d
  jne    L171
L52:
  movb   $0x0,0x0(%r13)
  add    $0x1,%ebx
  mov    %r13,%rdi
  xor    %ecx,%ecx
  movb   $0x0,(%r12)
  xor    %esi,%esi
  jmp    L89
  nopl   0x0(%rax,%rax,1)
L106:
  mov    $0xffffffff,%ecx
  mov    %ebx,%edx
  add    $0x1,%ebx
  add    %ecx,%eax
  cmp    %eax,%ebp
  jne    L145
  jmp    L100
  nopl   0x0(%rax)
L108:
  mov    $0x1,%edx
  jne    L171
  jmp    L52
  nopl   0x0(%rax)
L46:
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    $0x1,%r14d
  xor    %ebx,%ebx
  jmp    L77
```

assistant: ```c
int pq_nkrange(char *text) {
  int a, i, j, c;
  int strsize;
  int cval, pval;
  char *tmp, *curr, *prev;
  if (*text == '\0') {
    return 0;
  }
  strsize = strlen(text);
  curr = calloc(strsize + 1, sizeof *curr);
  prev = calloc(strsize + 1, sizeof *prev);
  tmp = text;
  prev[0] = '\0';
  a = c = i = j = 0;
  while (*tmp) {
    if (*tmp == ',') {
      curr[i] = prev[j] = '\0';
      cval = atoi(curr);
      pval = atoi(prev);
      c = cval >= pval ? 1 : -1;
      while (pval != cval) {
        a++;
        pval = pval + c;
      }
      i = j = 0;
      a++;
      tmp++;
      curr[0] = prev[0] = '\0';
    } else if (*tmp == '-') {
      prev[j] = curr[0] = '\0';
      i = 0;
      j++;
      tmp++;
    } else {
      curr[i] = prev[j] = *tmp;
      i++;
      j++;
      tmp++;
    }
  }
  curr[i] = prev[j] = '\0';
  cval = atoi(curr);
  pval = atoi(prev);
  c = cval >= pval ? 1 : -1;
  while (pval != cval) {
    a++;
    pval = pval + c;
  }
  a++;
  free(curr);
  free(prev);
  return a;
}
```