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

```asm
<tc2fr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x38(%rbp)
  movl   $0x0,-0x34(%rbp)
  movq   $0x0,-0x20(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x28(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  jne    L239
  mov    $0xffffffffffffffff,%rax
  jmp    L238
L239:
  movl   $0x0,-0x2c(%rbp)
  jmp    L159
L309:
  mov    -0x2c(%rbp),%eax
  cltq
  movb   $0x0,-0xb(%rbp,%rax,1)
  addl   $0x1,-0x2c(%rbp)
L159:
  cmpl   $0x2,-0x2c(%rbp)
  jle    L309
  jmp    L305
L78:
  addq   $0x1,-0x48(%rbp)
L305:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L78
  movl   $0x0,-0x30(%rbp)
  jmp    L69
L297:
  cmpl   $0x0,-0x30(%rbp)
  jle    L254
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  je     L135
  subl   $0x1,-0x30(%rbp)
  jmp    L196
L135:
  addq   $0x1,-0x48(%rbp)
L254:
  movl   $0x0,-0x2c(%rbp)
  jmp    L353
L16:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L55
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x2c(%rbp),%eax
  cltq
  mov    %dl,-0xb(%rbp,%rax,1)
  movl   $0x0,-0x24(%rbp)
  jmp    L84
L55:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L209
  cmpl   $0x0,-0x2c(%rbp)
  jne    L242
  movl   $0x1,-0x28(%rbp)
  jmp    L242
L209:
  movl   $0x1,-0x28(%rbp)
  jmp    L38
L84:
  addl   $0x1,-0x2c(%rbp)
L353:
  cmpl   $0x1,-0x2c(%rbp)
  jle    L16
  jmp    L38
L242:
  nop
L38:
  cmpl   $0x0,-0x2c(%rbp)
  je     L95
  mov    -0x2c(%rbp),%eax
  cltq
  movb   $0x0,-0xb(%rbp,%rax,1)
  lea    -0xb(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    -0x30(%rbp),%edx
  movslq %edx,%rdx
  mov    %eax,-0x18(%rbp,%rdx,4)
  mov    -0x2c(%rbp),%eax
  cltq
  add    %rax,-0x48(%rbp)
  jmp    L51
L95:
  subl   $0x1,-0x30(%rbp)
L51:
  cmpl   $0x0,-0x28(%rbp)
  jne    L241
  addl   $0x1,-0x30(%rbp)
L69:
  cmpl   $0x2,-0x30(%rbp)
  jle    L297
  jmp    L196
L241:
  nop
L196:
  cmpl   $0x3,-0x30(%rbp)
  jne    L61
  subl   $0x1,-0x30(%rbp)
L61:
  movl   $0x0,-0x3c(%rbp)
  mov    -0x3c(%rbp),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  cmpl   $0x2,-0x30(%rbp)
  je     L206
  cmpl   $0x2,-0x30(%rbp)
  jg     L113
  cmpl   $0x0,-0x30(%rbp)
  je     L45
  cmpl   $0x1,-0x30(%rbp)
  je     L105
  jmp    L113
L45:
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  jmp    L113
L105:
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  jmp    L113
L206:
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  nop
L113:
  mov    -0x3c(%rbp),%eax
  imul   $0x3c,%eax,%edx
  mov    -0x38(%rbp),%eax
  add    %edx,%eax
  imul   $0x4b,%eax,%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  cltq
  mov    %rax,-0x20(%rbp)
  cmpl   $0x3b,-0x38(%rbp)
  jg     L99
  cmpl   $0x4a,-0x34(%rbp)
  jle    L244
L99:
  mov    $0xffffffffffffffff,%rax
  jmp    L238
L244:
  mov    -0x20(%rbp),%rax
L238:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L1
  call   <__stack_chk_fail@plt>
L1:
  leave
  ret
```

assistant: ```c
long tc2fr(const char *tc) {
  int minutes = 0;
  int seconds = 0;
  int frames = 0;
  long totalframes = 0;
  char tmp[2 + 1];
  int nums[3];
  int n = 0;
  int i = 0;
  int last_was_colon = 0;
  int stop = 0;
  if (tc == NULL)
    return -1;
  for (i = 0; i <= 2; i++)
    tmp[i] = '\0';
  while (isspace(*tc))
    tc++;
  for (n = 0; n < 3; n++) {
    if (n > 0) {
      if (tc[0] != ':') {
        --n;
        break;
      } else
        tc++;
    }
    for (i = 0; i < 2; i++) {
      if (isdigit(tc[i])) {
        tmp[i] = tc[i];
        last_was_colon = 0;
      } else if (tc[i] == ':') {
        if (i == 0)
          stop = 1;
        break;
      } else {
        stop = 1;
        break;
      }
    }
    if (i != 0) {
      tmp[i] = '\0';
      nums[n] = atoi(tmp);
      tc = &tc[i];
    } else
      --n;
    if (stop)
      break;
  }
  if (n == 3)
    --n;
  frames = seconds = minutes = 0;
  switch (n) {
  case 0:
    frames = nums[0];
    break;
  case 1:
    seconds = nums[0];
    frames = nums[1];
    break;
  case 2:
    minutes = nums[0];
    seconds = nums[1];
    frames = nums[2];
    break;
  }
  totalframes = ((60 * minutes) + seconds) * 75 + frames;
  if (seconds > 59 || frames > 74)
    return -1;
  return totalframes;
}
```