user: Converte this assembly snippet into its equivalent C code:

```asm
<parse_msec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L19
L182:
  addl   $0x1,-0x8(%rbp)
L19:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L182
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L182
  jmp    L38
L16:
  mov    -0x10(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %ecx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x10(%rbp)
  addl   $0x1,-0x8(%rbp)
L38:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L122
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L16
L122:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L93
  addl   $0x1,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L91
L176:
  mov    -0xc(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %ecx,%eax
  sub    $0x30,%eax
  mov    %eax,-0xc(%rbp)
  addl   $0x1,-0x8(%rbp)
  addl   $0x1,-0x4(%rbp)
L91:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L67
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L176
  jmp    L67
L94:
  mov    -0xc(%rbp),%eax
  mov    %eax,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x3,%eax
  mov    %eax,-0xc(%rbp)
  subl   $0x1,-0x4(%rbp)
L67:
  cmpl   $0x3,-0x4(%rbp)
  jg     L94
  jmp    L129
L72:
  mov    -0xc(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,-0xc(%rbp)
  addl   $0x1,-0x4(%rbp)
L129:
  cmpl   $0x2,-0x4(%rbp)
  jle    L72
  jmp    L93
L108:
  addl   $0x1,-0x8(%rbp)
L93:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L108
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L108
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L179
  mov    -0x10(%rbp),%eax
  imul   $0x3e8,%eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  jmp    L82
L179:
  mov    $0xffffffff,%eax
L82:
  pop    %rbp
  ret
```

assistant: ```c
int parse_msec(const char *string) {
  unsigned int in, fl;
  int i, j;
  in = fl = 0;
  i = 0;
  while (string[i] == ' ' || string[i] == '\t')
    i++;
  while (string[i] >= '0' && string[i] <= '9') {
    in = in * 10 + string[i] - '0';
    i++;
  }
  if (string[i] == '.') {
    i++;
    j = 0;
    while (string[i] >= '0' && string[i] <= '9') {
      fl = fl * 10 + string[i] - '0';
      i++;
      j++;
    }
    while (j > 3) {
      fl /= 10;
      j--;
    }
    while (j < 3) {
      fl *= 10;
      j++;
    }
  }
  while (string[i] == ' ' || string[i] == '\t')
    i++;
  if (string[i] == '\0')
    return in * 1000 + fl;
  return -1;
}
```