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

```asm
<compute_fst>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x54,%eax
  je     L133
  cmp    $0x54,%eax
  jg     L166
  cmp    $0x53,%eax
  je     L12
  cmp    $0x53,%eax
  jg     L166
  cmp    $0x4d,%eax
  je     L198
  cmp    $0x50,%eax
  jne    L166
  addl   $0x2,-0x4(%rbp)
  jmp    L146
L133:
  addl   $0x5,-0x4(%rbp)
  jmp    L146
L12:
  addl   $0x3,-0x4(%rbp)
  nop
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x54,%eax
  jne    L191
  jmp    L57
L166:
  mov    $0xffffffff,%eax
  jmp    L301
L198:
  nop
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x4f,%eax
  je     L211
  mov    $0xffffffff,%eax
  jmp    L301
L211:
  nop
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x50,%eax
  je     L99
  cmp    $0x54,%eax
  jne    L285
  addl   $0x1,-0x4(%rbp)
  nop
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x48,%eax
  jne    L194
  jmp    L248
L285:
  mov    $0xffffffff,%eax
  jmp    L301
L194:
  mov    $0xffffffff,%eax
  jmp    L301
L146:
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x4f,%eax
  je     L79
  mov    $0xffffffff,%eax
  jmp    L301
L79:
  nop
L162:
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x50,%eax
  je     L143
  mov    $0xffffffff,%eax
  jmp    L301
L191:
  mov    $0xffffffff,%eax
  jmp    L301
L57:
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x41,%eax
  je     L85
  cmp    $0x4f,%eax
  jne    L65
  addl   $0x1,-0x4(%rbp)
  jmp    L162
L65:
  mov    $0xffffffff,%eax
  jmp    L301
L85:
  nop
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x52,%eax
  je     L45
  mov    $0xffffffff,%eax
  jmp    L301
L99:
  nop
  jmp    L248
L143:
  nop
  jmp    L248
L45:
  nop
L248:
  nop
  mov    -0x4(%rbp),%eax
L301:
  pop    %rbp
  ret
```

assistant: ```c
int compute_fst(const char *token) {
  int pos = 0;
  int total = 0;
NODE_0:
  switch (token[pos++]) {
  case 'M':
    goto NODE_1;
  case 'P':
    total += 2;
    goto NODE_4;
  case 'T':
    total += 5;
    goto NODE_4;
  case 'S':
    total += 3;
    goto NODE_6;
  default:
    return -1;
  }
NODE_1:
  switch (token[pos++]) {
  case 'O':
    goto NODE_2;
  default:
    return -1;
  }
NODE_2:
  switch (token[pos++]) {
  case 'T':
    total += 1;
    goto NODE_3;
  case 'P':
    goto NODE_9;
  default:
    return -1;
  }
NODE_3:
  switch (token[pos++]) {
  case 'H':
    goto NODE_9;
  default:
    return -1;
  }
NODE_4:
  switch (token[pos++]) {
  case 'O':
    goto NODE_5;
  default:
    return -1;
  }
NODE_5:
  switch (token[pos++]) {
  case 'P':
    goto NODE_9;
  default:
    return -1;
  }
NODE_6:
  switch (token[pos++]) {
  case 'T':
    goto NODE_7;
  default:
    return -1;
  }
NODE_7:
  switch (token[pos++]) {
  case 'O':
    total += 1;
    goto NODE_5;
  case 'A':
    goto NODE_8;
  default:
    return -1;
  }
NODE_8:
  switch (token[pos++]) {
  case 'R':
    goto NODE_9;
  default:
    return -1;
  }
NODE_9:
  goto END;
END:
  return total;
}
```