user: Please show me the C implementation that matches the assembly code listed below:

```asm
<flu_parse_tstamp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x38(%rbp)
  mov    -0x58(%rbp),%rax
  mov    $0x2d,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L82
  movl   $0x1,-0x5c(%rbp)
  jmp    L157
L82:
  mov    -0x58(%rbp),%rax
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x58(%rbp),%rax
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L33
  mov    $0x0,%eax
  jmp    L152
L33:
  mov    -0x28(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  je     L157
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x38(%rbp)
L157:
  lea    -0x44(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <ptime@plt>
  mov    %eax,-0x40(%rbp)
  cmpl   $0x0,-0x40(%rbp)
  je     L15
  mov    $0x0,%eax
  jmp    L152
L15:
  movq   $0x0,-0x30(%rbp)
  cmpl   $0x0,-0x5c(%rbp)
  je     L98
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  call   <getenv@plt>
  mov    %rax,-0x30(%rbp)
  mov    $0x1,%edx
  lea    D37(%rip),%rax
  mov    %rax,%rsi
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  call   <setenv@plt>
  mov    $0x0,%eax
  call   <tzset@plt>
L98:
  lea    -0x44(%rbp),%rax
  mov    %rax,%rdi
  call   <mktime@plt>
  mov    %eax,-0x3c(%rbp)
  cmpl   $0x0,-0x5c(%rbp)
  je     L135
  cmpq   $0x0,-0x30(%rbp)
  jne    L57
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  call   <unsetenv@plt>
  jmp    L14
L57:
  mov    -0x30(%rbp),%rax
  mov    $0x1,%edx
  mov    %rax,%rsi
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  call   <setenv@plt>
L14:
  mov    $0x0,%eax
  call   <tzset@plt>
L135:
  mov    $0x8,%esi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    -0x3c(%rbp),%edx
  mov    %edx,0x4(%rax)
  mov    -0x18(%rbp),%rax
  movl   $0x0,(%rax)
  cmpq   $0x0,-0x38(%rbp)
  je     L50
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x38(%rbp),%rax
  mov    $0xa,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strtoll@plt>
  mov    -0x18(%rbp),%rdx
  mov    %eax,(%rdx)
  cmpq   $0x3,-0x10(%rbp)
  jne    L5
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  imul   $0xf4240,%eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L50
L5:
  cmpq   $0x6,-0x10(%rbp)
  jne    L50
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  imul   $0x3e8,%eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
L50:
  mov    -0x18(%rbp),%rax
L152:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L43
  call   <__stack_chk_fail@plt>
L43:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D30
type_infered: string
name: extract_symbolic_data
arguments: data_label: D37
type_infered: string

tool: D30: TZ

tool: D37: UTC

assistant: ```c
struct timespec *flu_parse_tstamp(char *s, int utc) {
  struct tm tm;
  char *subseconds = NULL;
  if (strchr(s, '-')) {
    utc = 1;
  } else {
    char *a = strchr(s, '.');
    char *b = strrchr(s, '.');
    if (a == NULL)
      return NULL;
    if (a != b)
      subseconds = b + 1;
  }
  int r = ptime(s, &tm);
  if (r != 0)
    return NULL;
  char *tz = NULL;
  if (utc) {
    tz = getenv("TZ");
    setenv("TZ", "UTC", 1);
    tzset();
  }
  time_t t = mktime(&tm);
  if (utc) {
    if (!tz)
      unsetenv("TZ");
    else
      setenv("TZ", tz, 1);
    tzset();
  }
  struct timespec *ts = calloc(1, sizeof(struct timespec));
  ts->tv_sec = t;
  ts->tv_nsec = 0;
  if (subseconds) {
    size_t st = strlen(subseconds);
    ts->tv_nsec = strtoll(subseconds, NULL, 10);
    if (st == 3)
      ts->tv_nsec = ts->tv_nsec * 1000 * 1000;
    else if (st == 6)
      ts->tv_nsec = ts->tv_nsec * 1000;
  }
  return ts;
}
```