user: 请将以下的汇编代码转换成C语言代码：

```asm
<size_str_to_size_t>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x20(%rbp)
  movl   $0x0,-0x24(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  jne    L379
  mov    $0xffffffff,%eax
  jmp    L361
L379:
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L114
L273:
  addq   $0x1,-0x18(%rbp)
L114:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L165
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L273
L165:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L253
  mov    $0xffffffff,%eax
  jmp    L361
L253:
  mov    D6(%rip),%rax
  movq   $0x0,(%rax)
  lea    -0x20(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %rax,-0x10(%rbp)
  mov    D6(%rip),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L66
  mov    $0xffffffff,%eax
  jmp    L361
L66:
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L343
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L343
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,-0x24(%rbp)
  cmpl   $0x4b,-0x24(%rbp)
  je     L152
  cmpl   $0x4d,-0x24(%rbp)
  je     L152
  cmpl   $0x47,-0x24(%rbp)
  je     L152
  cmpl   $0x54,-0x24(%rbp)
  je     L152
  mov    $0xffffffff,%eax
  jmp    L361
L152:
  addq   $0x1,-0x18(%rbp)
  jmp    L343
L137:
  addq   $0x1,-0x18(%rbp)
L343:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L275
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L137
L275:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L182
  mov    $0xffffffff,%eax
  jmp    L361
L182:
  cmpl   $0x54,-0x24(%rbp)
  jne    L176
  mov    $0xffffffff,%eax
  jmp    L361
L176:
  cmpl   $0x47,-0x24(%rbp)
  jne    L186
  cmpq   $0xfffffffffffffffe,-0x10(%rbp)
  jl     L17
  cmpq   $0x1,-0x10(%rbp)
  jle    L84
L17:
  mov    $0xffffffff,%eax
  jmp    L361
L84:
  shlq   $0x1e,-0x10(%rbp)
  jmp    L133
L186:
  cmpl   $0x4d,-0x24(%rbp)
  jne    L31
  cmpq   $0xfffffffffffff800,-0x10(%rbp)
  jl     L215
  cmpq   $0x7ff,-0x10(%rbp)
  jle    L38
L215:
  mov    $0xffffffff,%eax
  jmp    L361
L38:
  shlq   $0x14,-0x10(%rbp)
  jmp    L133
L31:
  cmpl   $0x4b,-0x24(%rbp)
  jne    L133
  cmpq   $0xffffffffffe00000,-0x10(%rbp)
  jl     L26
  cmpq   $0x1fffff,-0x10(%rbp)
  jle    L205
L26:
  mov    $0xffffffff,%eax
  jmp    L361
L205:
  shlq   $0xa,-0x10(%rbp)
L133:
  cmpq   $0x0,-0x40(%rbp)
  je     L12
  mov    -0x10(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,(%rax)
L12:
  mov    $0x0,%eax
L361:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L146
  call   <__stack_chk_fail@plt>
L146:
  leave
  ret
```

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