user: 请从给定的汇编指令推导出C源代码：

```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    L58
L59:
  xor    %eax,%eax
L66:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L58:
  movq   $0x0,(%r12)
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L112
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rbx
  xor    %eax,%eax
  mov    %r12,%rdx
  lea    D31(%rip),%rsi
  mov    %rbx,%rdi
  call   <sscanf@plt>
  test   %eax,%eax
  je     L59
  cmp    %rbx,%rbp
  je     L67
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L55
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rbx
  xor    %eax,%eax
  lea    0x4(%rsp),%r14
  lea    D10(%rip),%r13
  mov    %r14,%rdx
  mov    %rbx,%rdi
  mov    %r13,%rsi
  call   <sscanf@plt>
  test   %eax,%eax
  je     L59
  imul   $0x3c,0x4(%rsp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  (%r12),%xmm0
  movsd  %xmm0,(%r12)
  cmp    %rbx,%rbp
  je     L67
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  mov    %rbp,%rbx
  call   <strrchr@plt>
  test   %rax,%rax
  je     L69
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rbx
L69:
  xor    %eax,%eax
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <sscanf@plt>
  test   %eax,%eax
  je     L59
  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    L66
  cs nopw 0x0(%rax,%rax,1)
L55:
  xor    %eax,%eax
  lea    0x4(%rsp),%rdx
  lea    D10(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  test   %eax,%eax
  je     L59
  imul   $0x3c,0x4(%rsp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  (%r12),%xmm0
  movsd  %xmm0,(%r12)
  jmp    L67
  nopl   0x0(%rax)
L112:
  xor    %eax,%eax
  mov    %r12,%rdx
  lea    D31(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  test   %eax,%eax
  je     L59
L67:
  mov    $0x1,%eax
  jmp    L66
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D31
type_guessed: string
name: retrieve_data
arguments: tag: D10
type_guessed: string

tool: D31: %lf

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