user: Translate the below assembly code into C programming language:

```asm
<Sfile_decode_datestr>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  xor    %edi,%edi
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <time@plt>
  lea    0x4(%rsp),%rdi
  mov    %eax,0x4(%rsp)
  call   <localtime@plt>
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L170:
  movzbl (%rax,%rdx,1),%ecx
  mov    %cl,(%rbx,%rdx,1)
  add    $0x1,%rdx
  cmp    $0x18,%rdx
  jne    L170
  movzbl 0x0(%rbp),%eax
  lea    -0x3a(%rax),%edx
  cmp    $0x6,%dl
  jbe    L186
  sub    $0x30,%eax
  cmp    $0x2a,%al
  jbe    L163
L186:
  xor    %eax,%eax
L161:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L163:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %eax,%esi
  cmp    $0x1,%eax
  jle    L186
  lea    0x1(%rbp),%rcx
  mov    $0x1,%edx
  jmp    L66
  nopw   0x0(%rax,%rax,1)
L101:
  add    $0x1,%edx
  add    $0x1,%rcx
  cmp    %edx,%esi
  je     L175
L66:
  movzbl (%rcx),%eax
  sub    $0x30,%eax
  cmp    $0x9,%al
  jbe    L101
L175:
  cmp    $0x6,%edx
  jne    L186
  movzbl 0x6(%rbp),%eax
  test   %al,%al
  je     L135
  cmp    $0x2e,%al
  jne    L186
  lea    -0xb(%rsi),%eax
  and    $0xfffffffd,%eax
  jne    L186
  cmp    $0x7,%esi
  jle    L111
  lea    -0x8(%rsi),%ecx
  mov    $0x8,%eax
  add    $0x9,%rcx
  jmp    L57
  nopl   0x0(%rax)
L211:
  mov    %eax,%edx
  add    $0x1,%rax
  cmp    %rax,%rcx
  je     L91
L57:
  movzbl -0x1(%rbp,%rax,1),%edi
  lea    -0x30(%rdi),%edx
  cmp    $0x9,%dl
  jbe    L211
  jmp    L186
L111:
  mov    $0x7,%edx
L91:
  cmp    %edx,%esi
  jne    L186
L135:
  movq   $0x0,(%rbx)
  movl   $0x0,0x8(%rbx)
  movsbl 0x0(%rbp),%eax
  cmp    $0x40,%al
  jg     L204
  lea    -0xf0(%rax,%rax,4),%edx
  movsbl 0x1(%rbp),%eax
  lea    -0x30(%rax,%rdx,2),%eax
L77:
  mov    %eax,0xc(%rbx)
  movsbl 0x2(%rbp),%eax
  lea    -0xf0(%rax,%rax,4),%edx
  movsbl 0x3(%rbp),%eax
  lea    -0x31(%rax,%rdx,2),%eax
  mov    %eax,0x10(%rbx)
  movsbl 0x4(%rbp),%eax
  lea    -0xf0(%rax,%rax,4),%edx
  movsbl 0x5(%rbp),%eax
  lea    -0x30(%rax,%rdx,2),%eax
  mov    %eax,0x14(%rbx)
  cmp    $0x6,%esi
  je     L30
  movsbl 0x7(%rbp),%eax
  lea    -0xf0(%rax,%rax,4),%edx
  movsbl 0x8(%rbp),%eax
  lea    -0x30(%rax,%rdx,2),%eax
  mov    %eax,(%rbx)
  movsbl 0x9(%rbp),%eax
  lea    -0xf0(%rax,%rax,4),%edx
  movsbl 0xa(%rbp),%eax
  lea    -0x30(%rax,%rdx,2),%eax
  mov    %eax,0x4(%rbx)
  cmp    $0xb,%esi
  je     L30
  movsbl 0xb(%rbp),%eax
  lea    -0xf0(%rax,%rax,4),%edx
  movsbl 0xc(%rbp),%eax
  lea    -0x30(%rax,%rdx,2),%eax
  mov    %eax,0x8(%rbx)
L30:
  mov    $0x1,%eax
  jmp    L161
L204:
  sub    $0x41,%eax
  movsbl %al,%eax
  lea    (%rax,%rax,4),%edx
  movsbl 0x1(%rbp),%eax
  lea    0x34(%rax,%rdx,2),%eax
  jmp    L77
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int Sfile_decode_datestr(struct tm *reply, char *text, int flag) {
  int i, l;
  time_t current_time;
  struct tm *now;
  current_time = time(0);
  now = localtime(&current_time);
  for (i = 0; i < (int)sizeof(struct tm); i++)
    ((char *)reply)[i] = ((char *)now)[i];
  if (text[0] < '0' || (text[0] > '9' && text[0] < 'A') || text[0] > 'Z')
    return (0);
  l = strlen(text);
  for (i = 1; i < l; i++)
    if (text[i] < '0' || text[i] > '9')
      break;
  if (i != 6)
    return (0);
  if (text[i] == 0)
    goto decode;
  if (text[i] != '.' || (l != 11 && l != 13))
    return (0);
  for (i++; i < l; i++)
    if (text[i] < '0' || text[i] > '9')
      break;
  if (i != l)
    return (0);
decode:;
  reply->tm_hour = 0;
  reply->tm_min = 0;
  reply->tm_sec = 0;
  i = 0;
  if (text[0] >= 'A')
    reply->tm_year = 100 + (text[i] - 'A') * 10 + text[1] - '0';
  else
    reply->tm_year = 10 * (text[0] - '0') + text[1] - '0';
  reply->tm_mon = 10 * (text[2] - '0') + text[3] - '0' - 1;
  reply->tm_mday = 10 * (text[4] - '0') + text[5] - '0';
  if (l == 6)
    return (1);
  reply->tm_hour = 10 * (text[7] - '0') + text[8] - '0';
  reply->tm_min = 10 * (text[9] - '0') + text[10] - '0';
  if (l == 11)
    return (1);
  reply->tm_sec = 10 * (text[11] - '0') + text[12] - '0';
  return (1);
}
```