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

```asm
<ASAPInfo_ParseDuration>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  jle    L182
  mov    %rax,%rdx
  movsbl (%rbx),%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L182
  cmp    $0x1,%edx
  je     L92
  movsbl 0x1(%rbx),%ecx
  sub    $0x30,%ecx
  cmp    $0x9,%ecx
  jbe    L106
  mov    $0x4,%ecx
  mov    $0x3,%r11d
  mov    $0x3,%r10d
  mov    $0x2,%r9d
  mov    $0x2,%r8d
  mov    $0x1,%esi
  mov    $0x1,%edi
L110:
  movzbl (%rbx,%rsi,1),%esi
  cmp    $0x3a,%sil
  je     L39
  imul   $0x3e8,%eax,%eax
  mov    %edi,%ecx
L105:
  cmp    $0x2e,%sil
  jne    L182
  lea    0x1(%rcx),%esi
  cmp    %esi,%edx
  jle    L182
  movslq %esi,%rsi
  movsbl (%rbx,%rsi,1),%esi
  sub    $0x30,%esi
  cmp    $0x9,%esi
  ja     L182
  imul   $0x64,%esi,%esi
  lea    0x2(%rcx),%edi
  add    %esi,%eax
  cmp    %edi,%edx
  jle    L36
  movslq %edi,%rdi
  movsbl (%rbx,%rdi,1),%esi
  sub    $0x30,%esi
  cmp    $0x9,%esi
  ja     L182
  lea    (%rsi,%rsi,4),%esi
  add    $0x3,%ecx
  lea    (%rax,%rsi,2),%eax
  cmp    %ecx,%edx
  jle    L36
  movslq %ecx,%rcx
  movsbl (%rbx,%rcx,1),%edx
  sub    $0x30,%edx
  cmp    $0x9,%edx
  ja     L182
  add    %edx,%eax
L36:
  pop    %rbx
  ret
  nopl   0x0(%rax)
L106:
  lea    (%rax,%rax,4),%eax
  lea    (%rcx,%rax,2),%eax
  cmp    $0x2,%edx
  jne    L173
L92:
  imul   $0x3e8,%eax,%eax
  pop    %rbx
  ret
  nopl   0x0(%rax,%rax,1)
L39:
  cmp    %edx,%r8d
  jge    L182
  movsbl (%rbx,%r9,1),%esi
  sub    $0x30,%esi
  cmp    $0x5,%esi
  ja     L182
  lea    (%rax,%rax,2),%eax
  lea    (%rsi,%rax,2),%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  cmp    %r10d,%edx
  jle    L182
  movsbl (%rbx,%r11,1),%esi
  sub    $0x30,%esi
  cmp    $0x9,%esi
  ja     L182
  add    %esi,%eax
  imul   $0x3e8,%eax,%eax
  cmp    %ecx,%edx
  jle    L36
  movslq %ecx,%rsi
  movzbl (%rbx,%rsi,1),%esi
  jmp    L105
  nopw   0x0(%rax,%rax,1)
L182:
  mov    $0xffffffff,%eax
  pop    %rbx
  ret
L173:
  mov    $0x5,%ecx
  mov    $0x4,%r11d
  mov    $0x4,%r10d
  mov    $0x3,%r9d
  mov    $0x3,%r8d
  mov    $0x2,%esi
  mov    $0x2,%edi
  jmp    L110
```

assistant: ```c
int ASAPInfo_ParseDuration(const char *s) {
  int i = 0;
  int n = (int)strlen(s);
  int d;
  int r;
  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] == 58) {
      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] != 46)
    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;
}
```