user: Demonstrate the C code that generates the assembly output below:

```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     L56
  cmp    $0x2b,%r13d
  je     L42
  lea    0x1(%r12),%r14
  mov    $0x1,%r8d
L131:
  mov    D16(%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     L165
  movl   $0x0,0x1c(%rsp)
L207:
  xor    %r15d,%r15d
  xor    %ebx,%ebx
  jmp    L75
  nopl   0x0(%rax)
L135:
  jne    L130
  mov    $0xffffffff,%r15d
  cmp    0x18(%rsp),%ecx
  jle    L130
L78:
  add    $0x1,%r14
  movsbl -0x1(%r14),%r13d
  mov    %r14,%rax
  sub    %r12,%rax
  cmp    0x8(%rsp),%rax
  jg     L80
L75:
  mov    %r13d,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L48
  lea    -0x30(%r13),%ecx
  cmp    $0x9,%ecx
  jg     L119
  test   %r15d,%r15d
  js     L103
  cmp    %rbp,%rbx
  jbe    L135
L103:
  mov    $0xffffffff,%r15d
  jmp    L78
  nopl   0x0(%rax,%rax,1)
L56:
  mov    D8(%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     L207
  neg    %rbx
  nopl   (%rax)
L203:
  mov    %rbx,%rax
  xor    %r15d,%r15d
L159:
  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
L130:
  lea    (%rbx,%rbx,4),%rax
  movslq %ecx,%rcx
  mov    $0x1,%r15d
  lea    (%rcx,%rax,2),%rbx
  jmp    L78
  cs nopw 0x0(%rax,%rax,1)
L80:
  cmp    $0xffffffff,%r15d
  je     L175
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  je     L203
  neg    %rbx
  jmp    L203
  nopl   0x0(%rax,%rax,1)
L119:
  xor    %eax,%eax
L48:
  mov    $0xffffffff,%r15d
  jmp    L159
  nopw   0x0(%rax,%rax,1)
L42:
  movsbl 0x1(%r12),%r13d
  lea    0x2(%r12),%r14
  mov    $0x2,%r8d
  jmp    L131
L165:
  xor    %ebx,%ebx
  jmp    L203
L175:
  xor    %eax,%eax
  jmp    L159
```

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