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

```asm
<parse_timespec>:
  endbr64
  push   %r12
  push   %rbp
  sub    $0x28,%rsp
  movsd  D175(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L28
  mov    %rsp,%r12
  lea    D117(%rip),%rsi
  mov    %rdi,%rbp
  mov    %r12,%rdx
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L39
  mov    %r12,%rdx
  lea    D41(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L98
  mov    %r12,%rdx
  lea    D64(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L76
  mov    %r12,%rdx
  lea    D3(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L62
  mov    %r12,%rdx
  lea    D137(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L115
  mov    %r12,%rdx
  lea    D97(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L168
  mov    %r12,%rdx
  lea    D161(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L167
  mov    %r12,%rdx
  lea    D14(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L102
  mov    %r12,%rdx
  lea    D52(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L162
  mov    %rbp,%rdi
  call   <parse_npt@plt>
  nopw   0x0(%rax,%rax,1)
L28:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L195
  add    $0x28,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L98:
  movsd  D2(%rip),%xmm0
  mov    %r12,%rdi
  call   <parse_smpte@plt>
  jmp    L28
  nopw   0x0(%rax,%rax,1)
L39:
  mov    %r12,%rdi
  call   <parse_npt@plt>
  jmp    L28
  nopw   0x0(%rax,%rax,1)
L76:
  movsd  D50(%rip),%xmm0
  mov    %r12,%rdi
  call   <parse_smpte@plt>
  jmp    L28
  nopw   0x0(%rax,%rax,1)
L62:
  movsd  D164(%rip),%xmm0
  mov    %r12,%rdi
  call   <parse_smpte@plt>
  jmp    L28
  nopw   0x0(%rax,%rax,1)
L115:
  movsd  D179(%rip),%xmm0
  mov    %r12,%rdi
  call   <parse_smpte@plt>
  jmp    L28
  nopl   (%rax)
L168:
  movsd  D57(%rip),%xmm0
  mov    %r12,%rdi
  call   <parse_smpte@plt>
  jmp    L28
  nopl   (%rax)
L167:
  movsd  D106(%rip),%xmm0
  mov    %r12,%rdi
  call   <parse_smpte@plt>
  jmp    L28
  nopl   (%rax)
L102:
  movsd  D145(%rip),%xmm0
  mov    %r12,%rdi
  call   <parse_smpte@plt>
  jmp    L28
  nopl   (%rax)
L162:
  movsd  D178(%rip),%xmm0
  mov    %r12,%rdi
  call   <parse_smpte@plt>
  jmp    L28
L195:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D175
type: byte[8]
name: disassemble_data
arguments: data_label: D117
type: string
name: disassemble_data
arguments: data_label: D41
type: string
name: disassemble_data
arguments: data_label: D64
type: string
name: disassemble_data
arguments: data_label: D3
type: string
name: disassemble_data
arguments: data_label: D137
type: string
name: disassemble_data
arguments: data_label: D97
type: string
name: disassemble_data
arguments: data_label: D161
type: string
name: disassemble_data
arguments: data_label: D14
type: string
name: disassemble_data
arguments: data_label: D52
type: string
name: disassemble_data
arguments: data_label: D2
type: f64
name: disassemble_data
arguments: data_label: D50
type: f64
name: disassemble_data
arguments: data_label: D164
type: f64
name: disassemble_data
arguments: data_label: D179
type: f64
name: disassemble_data
arguments: data_label: D57
type: f64
name: disassemble_data
arguments: data_label: D106
type: f64
name: disassemble_data
arguments: data_label: D145
type: byte[8]
name: disassemble_data
arguments: data_label: D178
type: f64

tool: {"D175": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: D117: npt:%16s

tool: D41: smpte-24:%16s

tool: D64: smpte-24-drop:%16s

tool: D3: smpte-25:%16s

tool: D137: smpte-30:%16s

tool: D97: smpte-30-drop:%16s

tool: D161: smpte-50:%16s

tool: D14: smpte-60:%16s

tool: D52: smpte-60-drop:%16s

tool: D2: 24

tool: D50: 23.976

tool: D164: 25

tool: D179: 30

tool: D57: 29.97

tool: D106: 50

tool: {"D145": [0x00,0x00,0x00,0x00,0x00,0x00,0x4e,0x40]}

tool: D178: 59.94

assistant: ```c
double parse_timespec(const char *str) {
  char timespec[16];
  if (str == NULL)
    return -1.0;
  if (sscanf(str, "npt:%16s", timespec) == 1) {
    return parse_npt(timespec);
  }
  if (sscanf(str, "smpte-24:%16s", timespec) == 1) {
    return parse_smpte(timespec, 24.0);
  }
  if (sscanf(str, "smpte-24-drop:%16s", timespec) == 1) {
    return parse_smpte(timespec, 23.976);
  }
  if (sscanf(str, "smpte-25:%16s", timespec) == 1) {
    return parse_smpte(timespec, 25.0);
  }
  if (sscanf(str, "smpte-30:%16s", timespec) == 1) {
    return parse_smpte(timespec, 30.0);
  }
  if (sscanf(str, "smpte-30-drop:%16s", timespec) == 1) {
    return parse_smpte(timespec, 29.97);
  }
  if (sscanf(str, "smpte-50:%16s", timespec) == 1) {
    return parse_smpte(timespec, 50.0);
  }
  if (sscanf(str, "smpte-60:%16s", timespec) == 1) {
    return parse_smpte(timespec, 60);
  }
  if (sscanf(str, "smpte-60-drop:%16s", timespec) == 1) {
    return parse_smpte(timespec, 59.94);
  }
  return parse_npt(str);
}
```