user: What is the c source code of the assembly code below?

```asm
<timeparse>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <atoi@plt>
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <dbtget@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L104
L42:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L63
  mov    %r12,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L104:
  mov    $0x0,%edi
  call   <dbtgetnxt@plt>
  mov    %rax,%r12
  lea    0x4(%rsp),%rdi
  mov    $0x4,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  test   %r12,%r12
  je     L74
L61:
  lea    0x4(%rsp),%rdx
  lea    D23(%rip),%rsi
  mov    %rbx,%rdi
  call   <strptime@plt>
  test   %eax,%eax
  je     L66
L78:
  lea    0x4(%rsp),%rdi
  call   <mktime@plt>
  mov    %rax,%r13
  mov    %r12,%rbp
  jmp    L47
L74:
  mov    %rbp,%rcx
  mov    %rbx,%rdx
  lea    D50(%rip),%rsi
  mov    $0x1,%edi
  call   <error@plt>
  jmp    L61
L66:
  lea    0x4(%rsp),%rdx
  lea    D39(%rip),%rsi
  mov    %rbx,%rdi
  call   <strptime@plt>
  test   %eax,%eax
  jne    L78
  lea    0x4(%rsp),%rdx
  lea    D59(%rip),%rsi
  mov    %rbx,%rdi
  call   <strptime@plt>
  test   %eax,%eax
  jne    L78
  lea    0x4(%rsp),%rdx
  lea    D5(%rip),%rsi
  mov    %rbx,%rdi
  call   <strptime@plt>
  test   %eax,%eax
  jne    L78
  mov    %rbp,%rcx
  mov    %rbx,%rdx
  lea    D19(%rip),%rsi
  mov    $0x1,%edi
  call   <error@plt>
  jmp    L78
L40:
  mov    %rbp,%rdi
  call   <dbtgett@plt>
  mov    %rax,%rbx
  mov    %r12,%rdi
  call   <dbtgett@plt>
  mov    %rax,%rdx
  mov    %rbx,%rax
  sub    %r13,%rax
  mov    %rax,%rcx
  neg    %rcx
  cmovs  %rax,%rcx
  mov    %rdx,%rax
  sub    %r13,%rax
  mov    %rax,%rdx
  neg    %rdx
  cmovns %rdx,%rax
  cmp    %rax,%rcx
  cmovl  %rbp,%r12
L47:
  mov    %rbp,%rdi
  call   <dbtgetnxt@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L40
  jmp    L42
L63:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D23
type_guessed: string
name: disassemble_data
arguments: tag: D50
type_guessed: string
name: disassemble_data
arguments: tag: D39
type_guessed: string
name: disassemble_data
arguments: tag: D59
type_guessed: string
name: disassemble_data
arguments: tag: D5
type_guessed: string
name: disassemble_data
arguments: tag: D19
type_guessed: string

tool: D23: %y-%m-%d %H:%M

tool: D50: not time found: '%s' -> %li


tool: D39: %y-%m-%d

tool: D59: %y-%m

tool: D5: %y

tool: D19: time not parseable: '%s' -> %li


assistant: ```c
struct dbt *timeparse(const char *stime) {
  time_t t = atoi(stime);
  struct dbt *dt = dbtget(t);
  if (!dt) {
    struct tm tm;
    struct dbt *dti = dt = dbtgetnxt(NULL);
    memset(&tm, 0, sizeof(struct tm));
    if (!dt)
      error(1, "not time found: '%s' -> %li\n", stime, t);
    if (!strptime(stime, "%y-%m-%d %H:%M", &tm) && !strptime(stime, "%y-%m-%d", &tm) && !strptime(stime, "%y-%m", &tm) && !strptime(stime, "%y", &tm))
      error(1, "time not parseable: '%s' -> %li\n", stime, t);
    t = mktime(&tm);
    while ((dti = dbtgetnxt(dti)))
      if (labs((long)dbtgett(dti) - (long)t) < labs((long)dbtgett(dt) - (long)t))
        dt = dti;
  }
  return dt;
}
```