user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<parse_cmd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x150,%rsp
  mov    %edi,-0x144(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x6e6973,-0x120(%rbp)
  movq   $0x0,-0x118(%rbp)
  movl   $0x0,-0x110(%rbp)
  movq   $0x736f63,-0x10c(%rbp)
  movq   $0x0,-0x104(%rbp)
  movl   $0x0,-0xfc(%rbp)
  movq   $0x776f70,-0xf8(%rbp)
  movq   $0x0,-0xf0(%rbp)
  movl   $0x0,-0xe8(%rbp)
  movq   $0x78,-0xe4(%rbp)
  movq   $0x0,-0xdc(%rbp)
  movl   $0x0,-0xd4(%rbp)
  movl   $0x31,-0x130(%rbp)
  movl   $0x32,-0x12c(%rbp)
  movl   $0x33,-0x128(%rbp)
  movl   $0x35,-0x124(%rbp)
  movl   $0x4,-0x134(%rbp)
  movl   $0x0,-0x138(%rbp)
  movl   $0x0,-0x140(%rbp)
  jmp    L69
L9:
  movl   $0x0,-0x13c(%rbp)
  jmp    L88
L60:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,-0x144(%rbp)
  mov    -0x138(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x138(%rbp)
  mov    -0x144(%rbp),%edx
  cltq
  mov    %dl,-0xd0(%rbp,%rax,1)
  addl   $0x1,-0x13c(%rbp)
L88:
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x140(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rcx,%rax
  sub    $0x120,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L87
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x140(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rcx,%rax
  sub    $0x120,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    %eax,-0x144(%rbp)
  je     L60
L87:
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x140(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rcx,%rax
  sub    $0x120,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L29
  subl   $0x1,-0x138(%rbp)
  mov    -0x138(%rbp),%eax
  cltq
  movzbl -0xd0(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <ungetch@plt>
  mov    -0x140(%rbp),%eax
  cltq
  mov    -0x130(%rbp,%rax,4),%eax
  jmp    L59
L0:
  subl   $0x1,-0x138(%rbp)
  mov    -0x138(%rbp),%eax
  cltq
  movzbl -0xd0(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <ungetch@plt>
L29:
  mov    -0x13c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x13c(%rbp)
  test   %eax,%eax
  jne    L0
  addl   $0x1,-0x140(%rbp)
L69:
  mov    -0x140(%rbp),%eax
  cmp    -0x134(%rbp),%eax
  jl     L9
  mov    $0x34,%eax
L59:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L71
  call   <__stack_chk_fail@plt>
L71:
  leave
  ret
```

assistant: ```c
int parse_cmd(int cstart) {
  char cmds[][20] = {"sin", "cos", "pow", "x"};
  int cmd_flag[] = {'1', '2', '3', '5'};
  int len = sizeof(cmds) / (sizeof(char) * 20);
  int i, j, top;
  char stack[200];
  top = 0;
  for (i = 0; i < len; i++) {
    j = 0;
    while (cmds[i][j] != '\0' && cstart == cmds[i][j]) {
      cstart = getch();
      stack[top++] = cstart;
      j++;
    }
    if (cmds[i][j] == '\0') {
      ungetch(stack[--top]);
      return cmd_flag[i];
    } else {
      while (j--) {
        ungetch(stack[--top]);
      }
    }
  }
  return '4';
}
```