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

```asm
<xgetdate_r>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %rdx,-0x98(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x70(%rbp)
  movl   $0x0,-0x7c(%rbp)
  movq   $0x0,-0x68(%rbp)
  jmp    L72
L167:
  mov    D102(%rip),%rax
  mov    (%rax),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x18(%rax)
  mov    -0x90(%rbp),%rax
  mov    0x18(%rax),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x10(%rax)
  mov    -0x90(%rbp),%rax
  mov    0x10(%rax),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x8(%rax)
  mov    -0x90(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,(%rax)
  mov    D102(%rip),%rax
  mov    (%rax),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x30(%rax)
  mov    -0x90(%rbp),%rax
  mov    0x30(%rax),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x28(%rax)
  mov    -0x90(%rbp),%rax
  mov    0x28(%rax),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x20(%rax)
  mov    -0x90(%rbp),%rax
  movl   $0xffffffff,0x38(%rax)
  mov    -0x90(%rbp),%rax
  movq   $0x0,0x48(%rax)
  mov    -0x90(%rbp),%rax
  movq   $0x0,0x40(%rax)
  mov    -0x90(%rbp),%rdx
  mov    -0x68(%rbp),%rcx
  mov    -0x88(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <my_strptime@plt>
  mov    %rax,-0x70(%rbp)
  cmpq   $0x0,-0x70(%rbp)
  je     L72
  mov    -0x70(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L290
L72:
  mov    -0x98(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x98(%rbp)
  mov    (%rax),%rax
  mov    %rax,-0x68(%rbp)
  cmpq   $0x0,-0x68(%rbp)
  jne    L167
  jmp    L259
L290:
  nop
L259:
  cmpq   $0x0,-0x70(%rbp)
  je     L296
  mov    -0x70(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L86
L296:
  mov    $0x7,%eax
  jmp    L118
L86:
  lea    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <time@plt>
  lea    -0x60(%rbp),%rdx
  lea    -0x78(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <localtime_r@plt>
  mov    -0x90(%rbp),%rax
  mov    0x18(%rax),%rax
  cmp    $0x6,%rax
  ja     L110
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L110
  mov    -0x90(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L110
  mov    -0x90(%rbp),%rax
  mov    0x10(%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L110
  mov    -0x60(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x58(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x8(%rax)
  mov    -0x50(%rbp),%rsi
  mov    -0x90(%rbp),%rax
  mov    0x18(%rax),%rax
  mov    -0x48(%rbp),%rdx
  sub    %rdx,%rax
  lea    0x7(%rax),%rcx
  movabs $0x4924924924924925,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    %rax
  mov    %rcx,%rdx
  sar    $0x3f,%rdx
  sub    %rdx,%rax
  mov    %rax,%rdx
  shl    $0x3,%rdx
  sub    %rax,%rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  lea    (%rsi,%rax,1),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x10(%rax)
  movl   $0x1,-0x7c(%rbp)
L110:
  mov    -0x90(%rbp),%rax
  mov    0x8(%rax),%rax
  cmp    $0xb,%rax
  ja     L130
  mov    -0x90(%rbp),%rax
  mov    0x10(%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L130
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L295
  mov    -0x60(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    -0x58(%rbp),%rcx
  sub    %rcx,%rax
  shr    $0x3f,%rax
  add    %rax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,(%rax)
L295:
  mov    -0x90(%rbp),%rax
  mov    0x18(%rax),%rax
  mov    %eax,%edx
  mov    -0x90(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,%rcx
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <first_wday@plt>
  mov    -0x90(%rbp),%rdx
  mov    %rax,0x10(%rdx)
  movl   $0x1,-0x7c(%rbp)
L130:
  mov    -0x90(%rbp),%rax
  mov    0x20(%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L151
  mov    -0x90(%rbp),%rax
  mov    0x30(%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L151
  mov    -0x90(%rbp),%rax
  mov    0x28(%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L151
  mov    -0x40(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x20(%rax)
  mov    -0x30(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x30(%rax)
  mov    -0x38(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x28(%rax)
L151:
  mov    -0x90(%rbp),%rax
  mov    0x20(%rax),%rax
  cmp    $0x17,%rax
  ja     L188
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L188
  mov    -0x90(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L188
  mov    -0x90(%rbp),%rax
  mov    0x10(%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L188
  mov    -0x90(%rbp),%rax
  mov    0x18(%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L188
  mov    -0x60(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x58(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x8(%rax)
  mov    -0x50(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    0x20(%rax),%rax
  mov    -0x40(%rbp),%rcx
  sub    %rcx,%rax
  shr    $0x3f,%rax
  add    %rax,%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,0x10(%rax)
  movl   $0x1,-0x7c(%rbp)
L188:
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L194
  mov    -0x60(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  mov    %rdx,(%rax)
L194:
  mov    -0x90(%rbp),%rax
  mov    0x20(%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L261
  mov    -0x90(%rbp),%rax
  movq   $0x0,0x20(%rax)
L261:
  mov    -0x90(%rbp),%rax
  mov    0x30(%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L204
  mov    -0x90(%rbp),%rax
  movq   $0x0,0x30(%rax)
L204:
  mov    -0x90(%rbp),%rax
  mov    0x28(%rax),%rdx
  mov    D102(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L273
  mov    -0x90(%rbp),%rax
  movq   $0x0,0x28(%rax)
L273:
  cmpl   $0x0,-0x7c(%rbp)
  jne    L199
  mov    -0x90(%rbp),%rax
  mov    0x10(%rax),%rdx
  mov    -0x90(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    -0x90(%rbp),%rcx
  mov    (%rcx),%rcx
  add    $0x76c,%rcx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <check_mday@plt>
  test   %eax,%eax
  je     L268
L199:
  mov    -0x90(%rbp),%rax
  mov    %rax,%rdi
  call   <mktime@plt>
  cmp    $0xffffffffffffffff,%rax
  jne    L141
L268:
  mov    $0x8,%eax
  jmp    L118
L141:
  mov    $0x0,%eax
L118:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L301
  call   <__stack_chk_fail@plt>
L301:
  leave
  ret
```

assistant: ```c
int xgetdate_r(const char *string, struct tm *tp, const char *const *template) {
  const char *line;
  char *result = NULL;
  time_t timer;
  struct tm tm;
  int mday_ok = 0;
  line = NULL;
  while ((line = *template ++)) {
    tp->tm_year = tp->tm_mon = tp->tm_mday = tp->tm_wday = INT_MIN;
    tp->tm_hour = tp->tm_sec = tp->tm_min = INT_MIN;
    tp->tm_isdst = -1;
    tp->tm_gmtoff = 0;
    tp->tm_zone = NULL;
    result = my_strptime(string, line, tp);
    if (result && *result == '\0')
      break;
  }
  if (result == NULL || *result != '\0')
    return 7;
  time(&timer);
  localtime_r(&timer, &tm);
  if (tp->tm_wday >= 0 && tp->tm_wday <= 6 && tp->tm_year == INT_MIN && tp->tm_mon == INT_MIN && tp->tm_mday == INT_MIN) {
    tp->tm_year = tm.tm_year;
    tp->tm_mon = tm.tm_mon;
    tp->tm_mday = tm.tm_mday + (tp->tm_wday - tm.tm_wday + 7) % 7;
    mday_ok = 1;
  }
  if (tp->tm_mon >= 0 && tp->tm_mon <= 11 && tp->tm_mday == INT_MIN) {
    if (tp->tm_year == INT_MIN)
      tp->tm_year = tm.tm_year + (((tp->tm_mon - tm.tm_mon) < 0) ? 1 : 0);
    tp->tm_mday = first_wday(tp->tm_year, tp->tm_mon, tp->tm_wday);
    mday_ok = 1;
  }
  if (tp->tm_hour == INT_MIN && tp->tm_min == INT_MIN && tp->tm_sec == INT_MIN) {
    tp->tm_hour = tm.tm_hour;
    tp->tm_min = tm.tm_min;
    tp->tm_sec = tm.tm_sec;
  }
  if (tp->tm_hour >= 0 && tp->tm_hour <= 23 && tp->tm_year == INT_MIN && tp->tm_mon == INT_MIN && tp->tm_mday == INT_MIN && tp->tm_wday == INT_MIN) {
    tp->tm_year = tm.tm_year;
    tp->tm_mon = tm.tm_mon;
    tp->tm_mday = tm.tm_mday + ((tp->tm_hour - tm.tm_hour) < 0 ? 1 : 0);
    mday_ok = 1;
  }
  if (tp->tm_year == INT_MIN)
    tp->tm_year = tm.tm_year;
  if (tp->tm_hour == INT_MIN)
    tp->tm_hour = 0;
  if (tp->tm_min == INT_MIN)
    tp->tm_min = 0;
  if (tp->tm_sec == INT_MIN)
    tp->tm_sec = 0;
  if ((!mday_ok && !check_mday(1900 + tp->tm_year, tp->tm_mon, tp->tm_mday)) || mktime(tp) == (time_t)-1)
    return 8;
  return 0;
}
```