user: Translate the below assembly code into C programming language:

```asm
<parse_npt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  lea    -0x18(%rbp),%rsi
  lea    -0x1c(%rbp),%rcx
  lea    -0x20(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rsi,%r8
  lea    D19(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x3,-0x14(%rbp)
  je     L141
  lea    -0x18(%rbp),%rcx
  lea    -0x1c(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  lea    D28(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x2,-0x14(%rbp)
  jne    L37
  movl   $0x0,-0x20(%rbp)
  jmp    L104
L37:
  lea    -0x18(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  lea    D5(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x1,-0x14(%rbp)
  jne    L71
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L103
L71:
  movsd  D80(%rip),%xmm0
  jmp    L148
L141:
  nop
L104:
  mov    -0x20(%rbp),%eax
  test   %eax,%eax
  jns    L68
  movsd  D80(%rip),%xmm0
  jmp    L148
L68:
  mov    -0x1c(%rbp),%eax
  cmp    $0x3b,%eax
  jg     L48
  mov    -0x1c(%rbp),%eax
  test   %eax,%eax
  jns    L134
L48:
  movsd  D80(%rip),%xmm0
  jmp    L148
L134:
  movss  -0x18(%rbp),%xmm0
  comiss D79(%rip),%xmm0
  jae    L107
  movss  -0x18(%rbp),%xmm1
  pxor   %xmm0,%xmm0
  comiss %xmm1,%xmm0
  jbe    L103
L107:
  movsd  D80(%rip),%xmm0
  jmp    L148
L103:
  mov    -0x20(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D46(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x1c(%rbp),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movsd  D89(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movss  -0x18(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
L148:
  movq   %xmm0,%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L59
  call   <__stack_chk_fail@plt>
L59:
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D19
type: string
name: read_data
arguments: tag: D28
type: string
name: read_data
arguments: tag: D5
type: string
name: read_data
arguments: tag: D80
type: f32[2]
name: read_data
arguments: tag: D79
type: f32
name: read_data
arguments: tag: D46
type: f64
name: read_data
arguments: tag: D89
type: f32[2]

tool: D19: %d:%d:%f

tool: D28: %d:%f

tool: D5: %f

tool: {"D80": [0.0,-1.875]}

tool: D79: 60

tool: D46: 3600

tool: {"D89": [0.0,3.21875]}

assistant: ```c
double parse_npt(const char *str) {
  int h = 0, m = 0, n;
  float s;
  double result;
  n = sscanf(str, "%d:%d:%f", &h, &m, &s);
  if (n == 3) {
    goto done;
  }
  n = sscanf(str, "%d:%f", &m, &s);
  if (n == 2) {
    h = 0;
    goto done;
  }
  n = sscanf(str, "%f", &s);
  if (n == 1) {
    h = 0;
    m = 0;
    goto sec_only;
  }
  return -1.0;
done:
  if (h < 0)
    return -1;
  if (m > 59 || m < 0)
    return -1;
  if (s >= 60.0 || s < 0.0)
    return -1;
sec_only:
  result = ((h * 3600.0) + (m * 60.0) + s);
  return result;
}
```