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

```asm
<parse_rfc1123>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L71
  mov    %rsp,%rbp
  xor    %esi,%esi
  mov    %rdi,%rbx
  mov    $0x1c,%edx
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    $0x2c,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L190
  movsbl 0x1(%rax),%edi
  lea    0x1(%rax),%rbx
  cmp    $0x20,%dil
  jne    L134
  xchg   %ax,%ax
L180:
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  cmp    $0x20,%dil
  je     L180
L134:
  call   <xisdigit@plt>
  test   %rax,%rax
  jne    L161
L129:
  mov    %rbx,%rdi
  mov    $0x2d,%esi
  call   <strchr@plt>
  mov    %rbx,%rdi
  test   %rax,%rax
  je     L50
  call   <strlen@plt>
  cmp    $0x11,%eax
  jle    L71
  mov    %rbx,%rdi
  call   <make_num@plt>
  lea    0x3(%rbx),%rdi
  mov    %eax,(%rsp)
  call   <make_month@plt>
  lea    0x7(%rbx),%rdi
  mov    %eax,0x4(%rsp)
  call   <make_num@plt>
  lea    0xa(%rbx),%rdi
  lea    0x64(%rax),%edx
  cmp    $0x45,%eax
  cmovle %edx,%eax
  mov    %eax,0x8(%rsp)
  call   <make_num@plt>
  lea    0xd(%rbx),%rdi
  mov    %eax,0xc(%rsp)
  call   <make_num@plt>
  lea    0x10(%rbx),%rdi
  mov    %eax,0x10(%rsp)
  call   <make_num@plt>
L151:
  mov    %eax,0x14(%rsp)
  cmp    $0x3b,%eax
  ja     L71
  cmpl   $0x3b,0x10(%rsp)
  ja     L71
  cmpl   $0x17,0xc(%rsp)
  ja     L71
  mov    (%rsp),%eax
  sub    $0x1,%eax
  cmp    $0x1e,%eax
  ja     L71
  cmpl   $0xb,0x4(%rsp)
  ja     L71
  mov    0x8(%rsp),%eax
  sub    $0x46,%eax
  cmp    $0x32,%eax
  ja     L71
  mov    %rbp,%rdi
  movl   $0xffffffff,0x18(%rsp)
  call   <mktime@plt>
  mov    0x18(%rsp),%ecx
  xor    %edx,%edx
  test   %ecx,%ecx
  mov    $0xfffff1f0,%ecx
  cmovg  %ecx,%edx
  mov    D2(%rip),%rcx
  add    (%rcx),%edx
  sub    %edx,%eax
L30:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L16
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L120:
  add    $0x1,%rbx
L190:
  cmpb   $0x20,(%rbx)
  je     L120
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    $0x17,%eax
  jle    L71
  lea    0x8(%rbx),%rdi
  call   <make_num@plt>
  lea    0x4(%rbx),%rdi
  mov    %eax,(%rsp)
  call   <make_month@plt>
  lea    0x14(%rbx),%rdi
  mov    %eax,0x4(%rsp)
  call   <atoi@plt>
  lea    0xb(%rbx),%rdi
  sub    $0x76c,%eax
  mov    %eax,0x8(%rsp)
  call   <make_num@plt>
  lea    0xe(%rbx),%rdi
  mov    %eax,0xc(%rsp)
  call   <make_num@plt>
  lea    0x11(%rbx),%rdi
  mov    %eax,0x10(%rsp)
  call   <make_num@plt>
  jmp    L151
  nopl   (%rax)
L161:
  movsbl 0x1(%rbx),%edi
  call   <xisdigit@plt>
  cmp    $0x1,%rax
  sbb    $0x0,%rbx
  jmp    L129
  cs nopw 0x0(%rax,%rax,1)
L50:
  call   <strlen@plt>
  cmp    $0x13,%eax
  jle    L71
  mov    %rbx,%rdi
  call   <make_num@plt>
  lea    0x3(%rbx),%rdi
  mov    %eax,(%rsp)
  call   <make_month@plt>
  lea    0x7(%rbx),%rdi
  mov    %eax,0x4(%rsp)
  call   <make_num@plt>
  lea    0x9(%rbx),%rdi
  mov    %eax,%r12d
  call   <make_num@plt>
  imul   $0x64,%r12d,%r12d
  lea    0xc(%rbx),%rdi
  lea    -0x76c(%r12,%rax,1),%eax
  mov    %eax,0x8(%rsp)
  call   <make_num@plt>
  lea    0xf(%rbx),%rdi
  mov    %eax,0xc(%rsp)
  call   <make_num@plt>
  lea    0x12(%rbx),%rdi
  mov    %eax,0x10(%rsp)
  call   <make_num@plt>
  jmp    L151
  nop
L71:
  mov    $0xffffffff,%eax
  jmp    L30
L16:
  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;
}
```