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

```asm
<parseVtCmd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  mov    %r8,-0x28(%rbp)
  cmpl   $0x1b,-0x4(%rbp)
  jne    L108
  mov    -0x10(%rbp),%rax
  movl   $0x1,(%rax)
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
  movl   $0xffffffff,(%rax)
  mov    -0x28(%rbp),%rax
  movl   $0xffffffff,(%rax)
  jmp    L24
L108:
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x3,%eax
  je     L141
  cmp    $0x3,%eax
  jg     L24
  cmp    $0x1,%eax
  je     L160
  cmp    $0x2,%eax
  je     L36
  jmp    L24
L160:
  cmpl   $0x5b,-0x4(%rbp)
  je     L29
  mov    -0x4(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0xffffffff,(%rax)
  jmp    L24
L29:
  mov    -0x10(%rbp),%rax
  movl   $0x2,(%rax)
  jmp    L24
L36:
  mov    -0x4(%rbp),%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L143
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jns    L20
  mov    -0x20(%rbp),%rax
  movl   $0x0,(%rax)
  jmp    L169
L20:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
L169:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  sub    $0x30,%eax
  add    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L24
L143:
  cmpl   $0x3b,-0x4(%rbp)
  jne    L109
  mov    -0x10(%rbp),%rax
  movl   $0x3,(%rax)
  jmp    L24
L109:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0xffffffff,(%rax)
  jmp    L24
L141:
  mov    -0x4(%rbp),%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L117
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jns    L4
  mov    -0x28(%rbp),%rax
  movl   $0x0,(%rax)
  jmp    L189
L4:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
L189:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  sub    $0x30,%eax
  add    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L179
L117:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  movl   $0xffffffff,(%rax)
L179:
  nop
L24:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void parseVtCmd(int c, int *state, char *cmd, int *arg0, int *arg1) {
  if (c == 0x1B) {
    *state = 1;
    *cmd = '\0';
    *arg0 = -1;
    *arg1 = -1;
  } else {
    switch (*state) {
    case 1:
      if (c != '[') {
        *cmd = c;
        *state = -1;
      } else {
        *state = 2;
      }
      break;
    case 2:
      if (isdigit(c)) {
        if (*arg0 < 0)
          *arg0 = 0;
        else
          *arg0 *= 10;
        *arg0 += c - '0';
      } else if (c == ';') {
        *state = 3;
      } else {
        *cmd = c;
        *state = -1;
      }
      break;
    case 3:
      if (isdigit(c)) {
        if (*arg1 < 0)
          *arg1 = 0;
        else
          *arg1 *= 10;
        *arg1 += c - '0';
      } else {
        *cmd = c;
        *state = -1;
      }
      break;
    }
  }
}
```