user: Converte this assembly snippet into its equivalent C code:

```asm
<parse_rfc1123>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L183
  mov    %rdi,%rbx
  mov    %rsp,%rdi
  mov    $0x1c,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    $0x2c,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L141
  lea    0x1(%rax),%rbx
  movzbl 0x1(%rax),%edi
  cmp    $0x20,%dil
  jne    L55
L294:
  add    $0x1,%rbx
  movzbl (%rbx),%edi
  cmp    $0x20,%dil
  je     L294
L55:
  movsbl %dil,%edi
  call   <xisdigit@plt>
  test   %rax,%rax
  jne    L177
L50:
  mov    $0x2d,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L116
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    $0x11,%eax
  jle    L242
  mov    %rbx,%rdi
  call   <make_num@plt>
  mov    %eax,(%rsp)
  lea    0x3(%rbx),%rdi
  call   <make_month@plt>
  mov    %eax,0x4(%rsp)
  lea    0x7(%rbx),%rdi
  call   <make_num@plt>
  lea    0x64(%rax),%edx
  cmp    $0x45,%eax
  cmovle %edx,%eax
  mov    %eax,0x8(%rsp)
  lea    0xa(%rbx),%rdi
  call   <make_num@plt>
  mov    %eax,0xc(%rsp)
  lea    0xd(%rbx),%rdi
  call   <make_num@plt>
  mov    %eax,0x10(%rsp)
  lea    0x10(%rbx),%rdi
  call   <make_num@plt>
L218:
  mov    %eax,0x14(%rsp)
  cmp    $0x3b,%eax
  ja     L285
  cmpl   $0x3b,0x10(%rsp)
  ja     L186
  cmpl   $0x17,0xc(%rsp)
  ja     L82
  mov    (%rsp),%eax
  sub    $0x1,%eax
  cmp    $0x1e,%eax
  ja     L223
  cmpl   $0xb,0x4(%rsp)
  ja     L109
  mov    0x8(%rsp),%eax
  sub    $0x46,%eax
  cmp    $0x32,%eax
  ja     L170
  movl   $0xffffffff,0x18(%rsp)
  mov    %rsp,%rdi
  call   <mktime@plt>
  cmpl   $0x0,0x18(%rsp)
  mov    $0x0,%edx
  mov    $0xfffff1f0,%ecx
  cmovg  %ecx,%edx
  mov    D3(%rip),%rcx
  add    (%rcx),%edx
  sub    %edx,%eax
L273:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L144
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  ret
L141:
  cmpb   $0x20,(%rbx)
  jne    L308
L289:
  add    $0x1,%rbx
  cmpb   $0x20,(%rbx)
  je     L289
L308:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    $0x17,%eax
  jle    L45
  lea    0x8(%rbx),%rdi
  call   <make_num@plt>
  mov    %eax,(%rsp)
  lea    0x4(%rbx),%rdi
  call   <make_month@plt>
  mov    %eax,0x4(%rsp)
  lea    0x14(%rbx),%rdi
  call   <atoi@plt>
  sub    $0x76c,%eax
  mov    %eax,0x8(%rsp)
  lea    0xb(%rbx),%rdi
  call   <make_num@plt>
  mov    %eax,0xc(%rsp)
  lea    0xe(%rbx),%rdi
  call   <make_num@plt>
  mov    %eax,0x10(%rsp)
  lea    0x11(%rbx),%rdi
  call   <make_num@plt>
  jmp    L218
L177:
  movsbl 0x1(%rbx),%edi
  call   <xisdigit@plt>
  cmp    $0x1,%rax
  sbb    $0x0,%rbx
  jmp    L50
L116:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    $0x13,%eax
  jle    L108
  mov    %rbx,%rdi
  call   <make_num@plt>
  mov    %eax,(%rsp)
  lea    0x3(%rbx),%rdi
  call   <make_month@plt>
  mov    %eax,0x4(%rsp)
  lea    0x7(%rbx),%rdi
  call   <make_num@plt>
  mov    %eax,%ebp
  lea    0x9(%rbx),%rdi
  call   <make_num@plt>
  imul   $0x64,%ebp,%ebp
  lea    -0x76c(%rbp,%rax,1),%eax
  mov    %eax,0x8(%rsp)
  lea    0xc(%rbx),%rdi
  call   <make_num@plt>
  mov    %eax,0xc(%rsp)
  lea    0xf(%rbx),%rdi
  call   <make_num@plt>
  mov    %eax,0x10(%rsp)
  lea    0x12(%rbx),%rdi
  call   <make_num@plt>
  jmp    L218
L183:
  mov    $0xffffffff,%eax
  jmp    L273
L242:
  mov    $0xffffffff,%eax
  jmp    L273
L108:
  mov    $0xffffffff,%eax
  jmp    L273
L45:
  mov    $0xffffffff,%eax
  jmp    L273
L285:
  mov    $0xffffffff,%eax
  jmp    L273
L186:
  mov    $0xffffffff,%eax
  jmp    L273
L82:
  mov    $0xffffffff,%eax
  jmp    L273
L223:
  mov    $0xffffffff,%eax
  jmp    L273
L109:
  mov    $0xffffffff,%eax
  jmp    L273
L170:
  mov    $0xffffffff,%eax
  jmp    L273
L144:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
time_t parse_rfc1123(const char *str) {
  const char *s;
  struct tm tm;
  time_t t;
  if (!str)
    return -1;
  memset(&tm, '\0', sizeof(struct tm));
  if ((s = strchr(str, ','))) {
    s++;
    while (*s == ' ')
      s++;
    if (xisdigit(*s) && !xisdigit(*(s + 1)))
      s--;
    if (strchr(s, '-')) {
      if ((int)strlen(s) < 18)
        return -1;
      tm.tm_mday = make_num(s);
      tm.tm_mon = make_month(s + 3);
      tm.tm_year = make_num(s + 7);
      if (tm.tm_year < 70)
        tm.tm_year += 100;
      tm.tm_hour = make_num(s + 10);
      tm.tm_min = make_num(s + 13);
      tm.tm_sec = make_num(s + 16);
    } else {
      if ((int)strlen(s) < 20)
        return -1;
      tm.tm_mday = make_num(s);
      tm.tm_mon = make_month(s + 3);
      tm.tm_year = (100 * make_num(s + 7) - 1900) + make_num(s + 9);
      tm.tm_hour = make_num(s + 12);
      tm.tm_min = make_num(s + 15);
      tm.tm_sec = make_num(s + 18);
    }
  } else {
    s = str;
    while (*s && *s == ' ')
      s++;
    if ((int)strlen(s) < 24)
      return -1;
    tm.tm_mday = make_num(s + 8);
    tm.tm_mon = make_month(s + 4);
    tm.tm_year = atoi(s + 20) - 1900;
    tm.tm_hour = make_num(s + 11);
    tm.tm_min = make_num(s + 14);
    tm.tm_sec = make_num(s + 17);
  }
  if (tm.tm_sec < 0 || tm.tm_sec > 59 || tm.tm_min < 0 || tm.tm_min > 59 || tm.tm_hour < 0 || tm.tm_hour > 23 || tm.tm_mday < 1 || tm.tm_mday > 31 || tm.tm_mon < 0 || tm.tm_mon > 11 || tm.tm_year < 70 || tm.tm_year > 120) {
    return -1;
  }
  tm.tm_isdst = -1;
  t = mktime(&tm);
  {
    time_t dst = 0;
    extern time_t timezone;
    if (tm.tm_isdst > 0)
      dst = -3600;
    t -= (timezone + dst);
  }
  return t;
}
```