user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<duda_utils_strtol>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  mov    %esi,%edi
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  movsbl (%r12),%r13d
  mov    %rdx,0x10(%rsp)
  cmp    $0x2d,%r13d
  je     L143
  cmp    $0x2b,%r13d
  je     L197
  lea    0x1(%r12),%r14
  mov    $0x1,%r8d
L41:
  mov    D19(%rip),%rax
  movabs $0xcccccccccccccccd,%rbp
  mov    (%rax),%rcx
  mov    %rcx,%rax
  mul    %rbp
  mov    %rdx,%rbp
  mov    %ecx,%edx
  shr    $0x3,%rbp
  lea    0x0(%rbp,%rbp,4),%rax
  add    %rax,%rax
  sub    %eax,%edx
  movslq %edi,%rax
  mov    %edx,0x18(%rsp)
  mov    %rax,0x8(%rsp)
  cmp    %rax,%r8
  jg     L162
  movl   $0x0,0x1c(%rsp)
L10:
  xor    %r15d,%r15d
  xor    %ebx,%ebx
  jmp    L64
  nopl   0x0(%rax)
L186:
  jne    L187
  mov    $0xffffffff,%r15d
  cmp    0x18(%rsp),%ecx
  jle    L187
L132:
  add    $0x1,%r14
  movsbl -0x1(%r14),%r13d
  mov    %r14,%rax
  sub    %r12,%rax
  cmp    0x8(%rsp),%rax
  jg     L9
L64:
  mov    %r13d,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L31
  lea    -0x30(%r13),%ecx
  cmp    $0x9,%ecx
  jg     L85
  test   %r15d,%r15d
  js     L189
  cmp    %rbp,%rbx
  jbe    L186
L189:
  mov    $0xffffffff,%r15d
  jmp    L132
  nopl   0x0(%rax,%rax,1)
L143:
  mov    D18(%rip),%rax
  movl   $0x1,0x1c(%rsp)
  lea    0x2(%r12),%r14
  xor    %ebx,%ebx
  movabs $0xcccccccccccccccd,%rbp
  movsbl 0x1(%r12),%r13d
  mov    (%rax),%rax
  neg    %rax
  mov    %rax,%rcx
  mul    %rbp
  mov    %rdx,%rbp
  mov    %ecx,%edx
  shr    $0x3,%rbp
  lea    0x0(%rbp,%rbp,4),%rax
  add    %rax,%rax
  sub    %eax,%edx
  movslq %esi,%rax
  mov    %edx,0x18(%rsp)
  mov    %rax,0x8(%rsp)
  cmp    $0x1,%esi
  jg     L10
  neg    %rbx
  nopl   (%rax)
L46:
  mov    %rbx,%rax
  xor    %r15d,%r15d
L80:
  mov    0x10(%rsp),%rdx
  mov    %rax,(%rdx)
  add    $0x28,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L187:
  lea    (%rbx,%rbx,4),%rax
  movslq %ecx,%rcx
  mov    $0x1,%r15d
  lea    (%rcx,%rax,2),%rbx
  jmp    L132
  cs nopw 0x0(%rax,%rax,1)
L9:
  cmp    $0xffffffff,%r15d
  je     L52
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  je     L46
  neg    %rbx
  jmp    L46
  nopl   0x0(%rax,%rax,1)
L85:
  xor    %eax,%eax
L31:
  mov    $0xffffffff,%r15d
  jmp    L80
  nopw   0x0(%rax,%rax,1)
L197:
  movsbl 0x1(%r12),%r13d
  lea    0x2(%r12),%r14
  mov    $0x2,%r8d
  jmp    L41
L162:
  xor    %ebx,%ebx
  jmp    L46
L52:
  xor    %eax,%eax
  jmp    L80
```

assistant: ```c
int duda_utils_strtol(const char *nptr, int len, long *result) {
  const char *s = nptr;
  unsigned long acc;
  int c;
  unsigned long cutoff;
  int neg = 0, any, cutlim;
  int base = 10;
  c = *s++;
  if (c == '-') {
    neg = 1;
    c = *s++;
  } else if (c == '+') {
    c = *s++;
  }
  cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX;
  cutlim = cutoff % (unsigned long)base;
  cutoff /= (unsigned long)base;
  for (acc = 0, any = 0; (s - ((const char *)nptr) <= len); c = *s++) {
    if (isdigit(c)) {
      c -= '0';
    } else {
      any = -1;
      break;
    }
    if (c >= base) {
      any = -1;
      break;
    }
    if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) {
      any = -1;
    } else {
      any = 1;
      acc *= base;
      acc += c;
    }
  }
  if (any < 0) {
    *result = 0;
    return -1;
  } else if (neg) {
    acc = -acc;
  }
  *result = acc;
  return 0;
}
```