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

```asm
<flu_parse_tstamp>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  mov    $0x2d,%esi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <strchr@plt>
  test   %rax,%rax
  je     L60
  lea    0x4(%rsp),%r13
  mov    %r12,%rdi
  xor    %ebp,%ebp
  mov    %r13,%rsi
  call   <ptime@plt>
  test   %eax,%eax
  jne    L45
L142:
  lea    D17(%rip),%r14
  mov    %r14,%rdi
  call   <getenv@plt>
  mov    $0x1,%edx
  lea    D4(%rip),%rsi
  mov    %r14,%rdi
  mov    %rax,%r12
  call   <setenv@plt>
  xor    %eax,%eax
  call   <tzset@plt>
  mov    %r13,%rdi
  call   <mktime@plt>
  mov    %eax,%r13d
  test   %r12,%r12
  je     L39
  mov    $0x1,%edx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <setenv@plt>
L10:
  xor    %eax,%eax
  call   <tzset@plt>
L65:
  mov    $0x8,%esi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %r13d,0x4(%rax)
  mov    %rax,%r12
  movl   $0x0,(%rax)
  test   %rbp,%rbp
  je     L57
  mov    %rbp,%rdi
  call   <strlen@plt>
  xor    %esi,%esi
  mov    $0xa,%edx
  mov    %rbp,%rdi
  mov    %rax,%r13
  call   <strtoll@plt>
  cmp    $0x3,%r13
  je     L40
  cmp    $0x6,%r13
  je     L11
L82:
  mov    %eax,(%r12)
L57:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  add    $0x10,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L60:
  mov    $0x2e,%esi
  mov    %r12,%rdi
  mov    %rax,%rbp
  call   <strchr@plt>
  mov    $0x2e,%esi
  mov    %r12,%rdi
  mov    %rax,%r13
  call   <strrchr@plt>
  test   %r13,%r13
  je     L45
  cmp    %rax,%r13
  lea    0x4(%rsp),%r13
  lea    0x1(%rax),%rdx
  mov    %r12,%rdi
  mov    %r13,%rsi
  cmovne %rdx,%rbp
  call   <ptime@plt>
  test   %eax,%eax
  jne    L45
  test   %ebx,%ebx
  jne    L142
  mov    %r13,%rdi
  call   <mktime@plt>
  mov    %eax,%r13d
  jmp    L65
  nopl   0x0(%rax)
L11:
  imul   $0x3e8,%eax,%eax
  jmp    L82
  nopl   0x0(%rax,%rax,1)
L39:
  mov    %r14,%rdi
  call   <unsetenv@plt>
  jmp    L10
  nopl   (%rax)
L45:
  xor    %r12d,%r12d
  jmp    L57
L40:
  imul   $0xf4240,%eax,%eax
  mov    %eax,(%r12)
  jmp    L57
L38:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D17
data_type: string
name: disassemble_data
arguments: data_label: D4
data_type: string

tool: D17: TZ

tool: D4: 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;
}
```