user: What would the C source look like for the assembly code provided here?

```asm
<size_str_to_size_t>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsp)
  test   %rdi,%rdi
  je     L109
  mov    %rdi,%r12
  movzbl (%rdi),%edi
  mov    %rsi,%rbp
  mov    %r12,%rbx
  test   %dil,%dil
  jne    L62
  jmp    L109
  nopl   0x0(%rax)
L158:
  movzbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  je     L109
L62:
  call   <isspace@plt>
  test   %rax,%rax
  jne    L158
  cmpb   $0x0,(%rbx)
  je     L109
  mov    D6(%rip),%r13
  mov    %rsp,%rsi
  mov    $0xa,%edx
  mov    %r12,%rdi
  movq   $0x0,0x0(%r13)
  call   <strtol@plt>
  cmpq   $0x0,0x0(%r13)
  mov    %rax,%rbx
  jne    L109
  mov    (%rsp),%r15
  movzbl (%r15),%edi
  test   %dil,%dil
  jne    L34
L88:
  xor    %eax,%eax
  test   %rbp,%rbp
  je     L139
  mov    %rbx,0x0(%rbp)
L139:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L128
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L34:
  call   <isspace@plt>
  movzbl (%r15),%edi
  test   %rax,%rax
  je     L199
  test   %dil,%dil
  je     L88
  mov    %r15,%r14
  xor    %r12d,%r12d
  xor    %r13d,%r13d
  jmp    L150
  xchg   %ax,%ax
L303:
  movzbl 0x1(%r14),%edi
  add    $0x1,%r14
  test   %dil,%dil
  je     L211
L150:
  call   <isspace@plt>
  test   %rax,%rax
  jne    L303
  movzbl (%r14),%edi
  test   %dil,%dil
  jne    L109
L211:
  test   %r13b,%r13b
  jne    L109
  cmp    $0x47,%r12d
  jne    L7
  lea    0x2(%rbx),%rax
  cmp    $0x3,%rax
  ja     L109
  shl    $0x1e,%rbx
  jmp    L88
  nop
L199:
  call   <toupper@plt>
  mov    %eax,%r12d
  lea    -0x47(%rax),%eax
  cmp    $0xd,%eax
  ja     L109
  mov    $0xffffffffffffdfae,%rdx
  bt     %rax,%rdx
  jb     L109
  movzbl 0x1(%r15),%edi
  cmp    $0x54,%r12d
  lea    0x1(%r15),%r14
  sete   %r13b
  test   %dil,%dil
  jne    L150
  jmp    L211
  nopl   (%rax)
L109:
  mov    $0xffffffff,%eax
  jmp    L139
L128:
  call   <__stack_chk_fail@plt>
L7:
  cmp    $0x4d,%r12d
  je     L40
  cmp    $0x4b,%r12d
  jne    L88
  lea    0x200000(%rbx),%rax
  cmp    $0x3fffff,%rax
  ja     L109
  shl    $0xa,%rbx
  jmp    L88
L40:
  lea    0x800(%rbx),%rax
  cmp    $0xfff,%rax
  ja     L109
  shl    $0x14,%rbx
  jmp    L88
```

assistant: ```c
int size_str_to_size_t(const unsigned char *str, size_t *p_size) {
  const unsigned char *s;
  long value;
  char *eptr = 0;
  int suffix = 0;
  if (!str)
    return -1;
  s = str;
  while (*s && isspace(*s))
    ++s;
  if (!*s)
    return -1;
  errno = 0;
  value = strtol(str, &eptr, 10);
  if (errno)
    return -1;
  s = (const unsigned char *)eptr;
  if (*s && !isspace(*s)) {
    suffix = toupper(*s);
    if (suffix != 'K' && suffix != 'M' && suffix != 'G' && suffix != 'T')
      return -1;
    ++s;
  }
  while (*s && isspace(*s))
    ++s;
  if (*s)
    return -1;
  if (suffix == 'T') {
    return -1;
  } else if (suffix == 'G') {
    if (value < -2 || value > 1)
      return -1;
    value *= (1024 * 1024 * 1024);
  } else if (suffix == 'M') {
    if (value < -2048 || value > 2047)
      return -1;
    value *= (1024 * 1024);
  } else if (suffix == 'K') {
    if (value < -2097152 || value > 2097151)
      return -1;
    value *= (1024);
  }
  if (p_size)
    *p_size = (size_t)value;
  return 0;
}
```