user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<ASAP_ParseDuration>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L197
  mov    $0xffffffff,%eax
  jmp    L173
L197:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L13
  cmpl   $0x9,-0x4(%rbp)
  jle    L277
L13:
  mov    $0xffffffff,%eax
  jmp    L173
L277:
  addl   $0x1,-0x10(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jge    L261
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L338
  cmpl   $0x9,-0x4(%rbp)
  jg     L338
  addl   $0x1,-0x10(%rbp)
  mov    -0xc(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L338:
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jge    L261
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L261
  addl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L342
  mov    $0xffffffff,%eax
  jmp    L173
L342:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L256
  cmpl   $0x5,-0x4(%rbp)
  jle    L187
L256:
  mov    $0xffffffff,%eax
  jmp    L173
L187:
  addl   $0x1,-0x10(%rbp)
  mov    -0xc(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L85
  mov    $0xffffffff,%eax
  jmp    L173
L85:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L136
  cmpl   $0x9,-0x4(%rbp)
  jle    L323
L136:
  mov    $0xffffffff,%eax
  jmp    L173
L323:
  addl   $0x1,-0x10(%rbp)
  mov    -0x4(%rbp),%eax
  add    %eax,-0xc(%rbp)
L261:
  mov    -0xc(%rbp),%eax
  imul   $0x3e8,%eax,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L363
  mov    -0xc(%rbp),%eax
  jmp    L173
L363:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L332
  mov    $0xffffffff,%eax
  jmp    L173
L332:
  addl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L251
  mov    $0xffffffff,%eax
  jmp    L173
L251:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L317
  cmpl   $0x9,-0x4(%rbp)
  jle    L11
L317:
  mov    $0xffffffff,%eax
  jmp    L173
L11:
  addl   $0x1,-0x10(%rbp)
  mov    -0x4(%rbp),%eax
  imul   $0x64,%eax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L93
  mov    -0xc(%rbp),%eax
  jmp    L173
L93:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L50
  cmpl   $0x9,-0x4(%rbp)
  jle    L362
L50:
  mov    $0xffffffff,%eax
  jmp    L173
L362:
  addl   $0x1,-0x10(%rbp)
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L179
  mov    -0xc(%rbp),%eax
  jmp    L173
L179:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L275
  cmpl   $0x9,-0x4(%rbp)
  jle    L0
L275:
  mov    $0xffffffff,%eax
  jmp    L173
L0:
  addl   $0x1,-0x10(%rbp)
  mov    -0x4(%rbp),%eax
  add    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
L173:
  leave
  ret
```

assistant: ```c
int ASAP_ParseDuration(const char *s) {
  int i = 0;
  int r;
  int d;
  int n = strlen(s);
  if (i >= n)
    return -1;
  d = (s)[i] - 48;
  if (d < 0 || d > 9)
    return -1;
  i++;
  ;
  r = d;
  if (i < n) {
    d = (s)[i] - 48;
    if (d >= 0 && d <= 9) {
      i++;
      r = 10 * r + d;
    }
    if (i < n && (s)[i] == ':') {
      i++;
      if (i >= n)
        return -1;
      d = (s)[i] - 48;
      if (d < 0 || d > 5)
        return -1;
      i++;
      ;
      r = (6 * r + d) * 10;
      if (i >= n)
        return -1;
      d = (s)[i] - 48;
      if (d < 0 || d > 9)
        return -1;
      i++;
      ;
      r += d;
    }
  }
  r *= 1000;
  if (i >= n)
    return r;
  if ((s)[i] != '.')
    return -1;
  i++;
  if (i >= n)
    return -1;
  d = (s)[i] - 48;
  if (d < 0 || d > 9)
    return -1;
  i++;
  ;
  r += 100 * d;
  if (i >= n)
    return r;
  d = (s)[i] - 48;
  if (d < 0 || d > 9)
    return -1;
  i++;
  ;
  r += 10 * d;
  if (i >= n)
    return r;
  d = (s)[i] - 48;
  if (d < 0 || d > 9)
    return -1;
  i++;
  ;
  r += d;
  return r;
}
```