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

```asm
<is_valid_pattern>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movl   $0x0,(%rax)
  jmp    L45
L126:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x5b,%eax
  je     L173
  cmp    $0x5c,%eax
  jne    L164
  addq   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L56
  mov    -0x10(%rbp),%rax
  movl   $0xffffffff,(%rax)
  mov    $0x0,%eax
  jmp    L57
L56:
  addq   $0x1,-0x8(%rbp)
  jmp    L45
L173:
  addq   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  jne    L82
  mov    -0x10(%rbp),%rax
  movl   $0xfffffffc,(%rax)
  mov    $0x0,%eax
  jmp    L57
L82:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L216
  mov    -0x10(%rbp),%rax
  movl   $0xfffffffd,(%rax)
  mov    $0x0,%eax
  jmp    L57
L224:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L29
  addq   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rax),%eax
  test   %al,%al
  jne    L187
  mov    -0x10(%rbp),%rax
  movl   $0xffffffff,(%rax)
  mov    $0x0,%eax
  jmp    L57
L29:
  addq   $0x1,-0x8(%rbp)
L187:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L245
  mov    -0x10(%rbp),%rax
  movl   $0xfffffffd,(%rax)
  mov    $0x0,%eax
  jmp    L57
L245:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L216
  addq   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L199
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  jne    L226
L199:
  mov    -0x10(%rbp),%rax
  movl   $0xfffffffe,(%rax)
  mov    $0x0,%eax
  jmp    L57
L226:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L8
  addq   $0x1,-0x8(%rbp)
L8:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rax),%eax
  test   %al,%al
  jne    L216
  mov    -0x10(%rbp),%rax
  movl   $0xffffffff,(%rax)
  mov    $0x0,%eax
  jmp    L57
L216:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  jne    L224
  jmp    L45
L164:
  addq   $0x1,-0x8(%rbp)
  nop
L45:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L126
  mov    $0x1,%eax
L57:
  pop    %rbp
  ret
```

assistant: ```c
int is_valid_pattern(char *p, int *error_type) {
  *error_type = 0;
  while (*p) {
    switch (*p) {
    case '\\':
      if (!*++p) {
        *error_type = -1;
        return 0;
      }
      p++;
      break;
    case '[':
      p++;
      if (*p == ']') {
        *error_type = -4;
        return 0;
      }
      if (!*p) {
        *error_type = -3;
        return 0;
      }
      while (*p != ']') {
        if (*p == '\\') {
          p++;
          if (!*p++) {
            *error_type = -1;
            return 0;
          }
        } else
          p++;
        if (!*p) {
          *error_type = -3;
          return 0;
        }
        if (*p == '-') {
          if (!*++p || *p == ']') {
            *error_type = -2;
            return 0;
          } else {
            if (*p == '\\')
              p++;
            if (!*p++) {
              *error_type = -1;
              return 0;
            }
          }
        }
      }
      break;
    case '*':
    case '?':
    default:
      p++;
      break;
    }
  }
  return 1;
}
```