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

```asm
<timestamp>:
  endbr64
  push   %r15
  push   %r14
  lea    D200(%rip),%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x14(%rsp),%r12
  movl   $0x0,0x14(%rsp)
  mov    %r12,%rdi
  movl   $0x0,0x18(%rsp)
  movl   $0x0,0x1c(%rsp)
  movl   $0x0,0x20(%rsp)
  movl   $0x0,0x24(%rsp)
  movb   $0x0,D200(%rip)
  call   <time@plt>
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <localtime@plt>
  lea    0x18(%rsp),%rsi
  lea    0x1c(%rsp),%r8
  mov    0x20(%rax),%edi
  mov    0x28(%rax),%rdx
  mov    (%rax),%r13
  mov    0x8(%rax),%r12
  lea    0x1(%rdi),%ecx
  mov    %ebp,%edi
  mov    %ecx,0x20(%rsp)
  mov    0x18(%rax),%rcx
  mov    %ecx,0x24(%rsp)
  mov    0x10(%rax),%rcx
  lea    0x76c(%rdx),%eax
  lea    0x20(%rsp),%rdx
  mov    %eax,0x18(%rsp)
  xor    %eax,%eax
  mov    %ecx,0x1c(%rsp)
  lea    0x24(%rsp),%rcx
  call   <tzadjust@plt>
  mov    0x1c(%rsp),%edx
  cmp    $0x17,%edx
  ja     L168
  mov    0x24(%rsp),%r15d
  lea    -0x1(%r15),%eax
  cmp    $0x1e,%eax
  jbe    L139
L168:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L122
  add    $0x38,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L139:
  mov    0x20(%rsp),%esi
  lea    -0x1(%rsi),%eax
  cmp    $0xb,%eax
  ja     L168
  mov    0x18(%rsp),%ebp
  cmp    $0x7b4,%ebp
  jle    L168
  cmp    $0xb,%edx
  jg     L176
  test   %edx,%edx
  jne    L110
  movl   $0xc,0x1c(%rsp)
L110:
  cmp    $0x3,%ebx
  je     L6
  xor    %eax,%eax
  jmp    L148
  cs nopw 0x0(%rax,%rax,1)
L176:
  cmp    $0xc,%edx
  je     L7
  sub    $0xc,%edx
  mov    %edx,0x1c(%rsp)
  cmp    $0x3,%ebx
  je     L97
L68:
  mov    $0x1,%eax
L148:
  cmp    $0x3,%ebx
  jg     L119
  cmp    $0x1,%ebx
  je     L199
  cmp    $0x2,%ebx
  jne    L133
  test   %eax,%eax
  lea    D154(%rip),%rbx
  mov    0x1c(%rsp),%ecx
  movslq %esi,%rdx
  lea    D115(%rip),%rax
  mov    %ebp,%edi
  cmove  %rax,%rbx
  lea    D6(%rip),%rax
  mov    %ecx,0xc(%rsp)
  mov    (%rax,%rdx,8),%r14
  mov    %r15d,%edx
  xor    %eax,%eax
  call   <daynumber@plt>
  push   %rbx
  mov    %ebp,%r9d
  mov    %r15d,%r8d
  mov    %eax,%edx
  cltq
  push   %r13
  imul   $0xffffffff92492493,%rax,%rax
  mov    %edx,%esi
  push   %r12
  mov    0x24(%rsp),%ecx
  sar    $0x1f,%esi
  push   %rcx
  mov    %r14,%rcx
  lea    D200(%rip),%r14
  shr    $0x20,%rax
  mov    %r14,%rdi
  add    %edx,%eax
  sar    $0x2,%eax
  sub    %esi,%eax
  lea    0x0(,%rax,8),%esi
  sub    %eax,%esi
  mov    %edx,%eax
  lea    D118(%rip),%rdx
  sub    %esi,%eax
  lea    D93(%rip),%rsi
  cltq
  mov    (%rdx,%rax,8),%rdx
  xor    %eax,%eax
  call   <sprintf@plt>
  add    $0x20,%rsp
  jmp    L168
  nopl   0x0(%rax,%rax,1)
L6:
  mov    0x1c(%rsp),%edx
  lea    D115(%rip),%r9
L155:
  lea    D200(%rip),%r14
  mov    %r13d,%r8d
  mov    %r12d,%ecx
  xor    %eax,%eax
  lea    D68(%rip),%rsi
  mov    %r14,%rdi
  call   <sprintf@plt>
  jmp    L168
L7:
  cmp    $0x3,%ebx
  jne    L68
  nopw   0x0(%rax,%rax,1)
L97:
  lea    D154(%rip),%r9
  jmp    L155
  nopl   0x0(%rax)
L119:
  cmp    $0x4,%ebx
  jne    L133
  sub    $0x8,%rsp
  lea    D200(%rip),%r14
  mov    %esi,%edx
  mov    %r12d,%r9d
  push   %r13
  mov    0x2c(%rsp),%r8d
  mov    %r15d,%ecx
  mov    %r14,%rdi
  lea    D50(%rip),%rsi
  xor    %eax,%eax
  call   <sprintf@plt>
  pop    %rax
  pop    %rdx
  jmp    L168
  nopl   0x0(%rax,%rax,1)
L199:
  movslq %esi,%rdx
  lea    D6(%rip),%rax
  mov    %ebp,%edi
  mov    (%rax,%rdx,8),%r12
  mov    %r15d,%edx
  xor    %eax,%eax
  lea    D200(%rip),%r14
  call   <daynumber@plt>
  mov    %ebp,%r9d
  mov    %r15d,%r8d
  mov    %r14,%rdi
  movslq %eax,%rdx
  mov    %eax,%ecx
  lea    D218(%rip),%rsi
  imul   $0xffffffff92492493,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sub    %ecx,%edx
  lea    0x0(,%rdx,8),%ecx
  sub    %edx,%ecx
  lea    D118(%rip),%rdx
  sub    %ecx,%eax
  mov    %r12,%rcx
  cltq
  mov    (%rdx,%rax,8),%rdx
  xor    %eax,%eax
  call   <sprintf@plt>
  jmp    L168
  nopw   0x0(%rax,%rax,1)
L133:
  test   %eax,%eax
  lea    D115(%rip),%rdx
  mov    %esi,%ecx
  mov    %r15d,%r8d
  lea    D154(%rip),%rax
  lea    D200(%rip),%r14
  cmove  %rdx,%rax
  sub    $0x8,%rsp
  mov    %ebp,%edx
  mov    %r14,%rdi
  lea    D117(%rip),%rsi
  push   %rax
  xor    %eax,%eax
  push   %r13
  push   %r12
  mov    0x3c(%rsp),%r9d
  call   <sprintf@plt>
  add    $0x20,%rsp
  jmp    L168
L122:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D154
datatype: string
name: parse_data
arguments: data_label: D115
datatype: string
name: parse_data
arguments: data_label: D93
datatype: string
name: parse_data
arguments: data_label: D68
datatype: string
name: parse_data
arguments: data_label: D50
datatype: string
name: parse_data
arguments: data_label: D218
datatype: string
name: parse_data
arguments: data_label: D117
datatype: string

tool: D154: pm

tool: D115: am

tool: D93: %s, %s %d, %d, %d:%02d:%02d%s

tool: D68: %d:%02d:%02d%s

tool: D50: %d%02d%02d%02d%02d

tool: D218: %s, %s %d, %d

tool: D117: %04d-%02d-%02d:%02d:%02d:%02d%s

assistant: ```c
char *timestamp(int tzdelta, int ifmt) {
  static char timebuff[256];
  time_t time_val = (time_t)(0);
  struct tm *tmstruct = (struct tm *)NULL, *localtime();
  int year = 0, hour = 0, ispm = 1, month = 0, day = 0, minute = 0, second = 0;
  int tzadjust();
  int daynumber();
  static char *daynames[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
  static char *monthnames[] = {"?", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "?"};
  *timebuff = '\000';
  time((time_t *)(&time_val));
  tmstruct = localtime((time_t *)(&time_val));
  year = (int)(tmstruct->tm_year);
  month = (int)(tmstruct->tm_mon) + 1;
  day = (int)(tmstruct->tm_mday);
  hour = (int)(tmstruct->tm_hour);
  minute = (int)(tmstruct->tm_min);
  second = (int)(tmstruct->tm_sec);
  year += 1900;
  tzadjust(tzdelta, &year, &month, &day, &hour);
  if (hour < 0 || hour > 23 || day < 1 || day > 31 || month < 1 || month > 12 || year < 1973)
    goto end_of_job;
  switch (ifmt) {
  default:
  case 0:
    if (hour < 12) {
      ispm = 0;
      if (hour == 0)
        hour = 12;
    }
    if (hour > 12)
      hour -= 12;
    break;
  }
  switch (ifmt) {
  default:
  case 0:
    sprintf(timebuff, "%04d-%02d-%02d:%02d:%02d:%02d%s", year, month, day, hour, minute, second, ((ispm) ? "pm" : "am"));
    break;
  case 1:
    sprintf(timebuff, "%s, %s %d, %d", daynames[daynumber(year, month, day) % 7], monthnames[month], day, year);
    break;
  case 2:
    sprintf(timebuff, "%s, %s %d, %d, %d:%02d:%02d%s", daynames[daynumber(year, month, day) % 7], monthnames[month], day, year, hour, minute, second, ((ispm) ? "pm" : "am"));
    break;
  case 3:
    sprintf(timebuff, "%d:%02d:%02d%s", hour, minute, second, ((ispm) ? "pm" : "am"));
    break;
  case 4:
    sprintf(timebuff, "%d%02d%02d%02d%02d", month, day, hour, minute, second);
    break;
  }
end_of_job:
  return (timebuff);
}
```