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

```asm
<hmsf2fsec>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x4(%rsp)
  call   <strlen@plt>
  test   %eax,%eax
  jne    L142
L64:
  xor    %eax,%eax
L113:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L129
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L142:
  movq   $0x0,(%r12)
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L57
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rbx
  xor    %eax,%eax
  mov    %r12,%rdx
  lea    D33(%rip),%rsi
  mov    %rbx,%rdi
  call   <sscanf@plt>
  test   %eax,%eax
  je     L64
  cmp    %rbx,%rbp
  je     L104
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L19
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rbx
  xor    %eax,%eax
  lea    0x4(%rsp),%r14
  lea    D19(%rip),%r13
  mov    %r14,%rdx
  mov    %rbx,%rdi
  mov    %r13,%rsi
  call   <sscanf@plt>
  test   %eax,%eax
  je     L64
  imul   $0x3c,0x4(%rsp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  (%r12),%xmm0
  movsd  %xmm0,(%r12)
  cmp    %rbx,%rbp
  je     L104
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  mov    %rbp,%rbx
  call   <strrchr@plt>
  test   %rax,%rax
  je     L127
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rbx
L127:
  xor    %eax,%eax
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <sscanf@plt>
  test   %eax,%eax
  je     L64
  imul   $0xe10,0x4(%rsp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  (%r12),%xmm0
  xor    %eax,%eax
  cmp    %rbp,%rbx
  sete   %al
  movsd  %xmm0,(%r12)
  jmp    L113
  cs nopw 0x0(%rax,%rax,1)
L19:
  xor    %eax,%eax
  lea    0x4(%rsp),%rdx
  lea    D19(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  test   %eax,%eax
  je     L64
  imul   $0x3c,0x4(%rsp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  (%r12),%xmm0
  movsd  %xmm0,(%r12)
  jmp    L104
  nopl   0x0(%rax)
L57:
  xor    %eax,%eax
  mov    %r12,%rdx
  lea    D33(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  test   %eax,%eax
  je     L64
L104:
  mov    $0x1,%eax
  jmp    L113
L129:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D33
datatype: string
name: retrieve_data
arguments: data_label: D19
datatype: string

tool: D33: %lf

tool: D19: %d

assistant: ```c
int hmsf2fsec(char *instring, double *seconds) {
  char *charptr;
  int i = 0;
  if (!strlen(instring))
    return 0;
  *seconds = 0;
  charptr = strrchr(instring, ':');
  if (charptr == NULL)
    charptr = instring;
  else {
    *charptr = '\0';
    charptr++;
  }
  if (!sscanf(charptr, "%lf", seconds))
    return 0;
  if (charptr == instring)
    return 1;
  charptr = strrchr(instring, ':');
  if (charptr == NULL)
    charptr = instring;
  else {
    *charptr = '\0';
    charptr++;
  }
  if (!sscanf(charptr, "%d", &i))
    return 0;
  *seconds += i * 60;
  if (charptr == instring)
    return 1;
  charptr = strrchr(instring, ':');
  if (charptr == NULL)
    charptr = instring;
  else {
    *charptr = '\0';
    charptr++;
  }
  if (!sscanf(charptr, "%d", &i))
    return 0;
  *seconds += i * 3600;
  if (charptr == instring)
    return 1;
  return 0;
}
```