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

```asm
<Tcl_StringMatch>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  movzbl (%rsi),%eax
  test   %al,%al
  je     L51
  nopl   0x0(%rax,%rax,1)
L107:
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  jne    L202
  cmp    $0x2a,%al
  jne    L9
L152:
  cmpb   $0x0,0x1(%rsi)
  mov    $0x1,%eax
  je     L85
  lea    0x1(%rsi),%rbx
  mov    %rbp,%rdi
  mov    %rbx,%rsi
  call   <Tcl_StringMatch>
  test   %eax,%eax
  jne    L72
L326:
  cmpb   $0x0,0x0(%rbp)
  je     L85
  add    $0x1,%rbp
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <Tcl_StringMatch>
  test   %eax,%eax
  je     L326
L72:
  mov    $0x1,%eax
L85:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L202:
  cmp    $0x2a,%al
  je     L152
  cmp    $0x3f,%al
  je     L335
  cmp    $0x5b,%al
  je     L330
  cmp    $0x5c,%al
  je     L178
L191:
  cmp    %al,%dil
  jne    L9
L335:
  movzbl 0x1(%rsi),%eax
L254:
  add    $0x1,%rsi
  add    $0x1,%rbp
  test   %al,%al
  jne    L107
L51:
  xor    %eax,%eax
  cmpb   $0x0,0x0(%rbp)
  sete   %al
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L178:
  movzbl 0x1(%rsi),%eax
  lea    0x1(%rsi),%rdx
  test   %al,%al
  je     L9
  mov    %rdx,%rsi
  jmp    L191
  nopl   0x0(%rax)
L330:
  movzbl 0x1(%rsi),%ecx
  lea    0x1(%rsi),%rdx
  cmp    $0x5d,%cl
  jne    L331
  jmp    L9
  nop
L241:
  mov    %eax,%ecx
  add    $0x1,%rdx
  cmp    $0x5d,%cl
  je     L9
L331:
  test   %cl,%cl
  je     L9
  movzbl 0x1(%rdx),%eax
  cmp    %cl,%dil
  je     L274
  cmp    $0x2d,%al
  jne    L241
  movzbl 0x2(%rdx),%esi
  test   %sil,%sil
  je     L9
  cmp    %sil,%dil
  jg     L149
  cmp    %cl,%dil
  jge    L46
  cmp    %sil,%dil
  jge    L149
L258:
  movzbl 0x3(%rdx),%ecx
  add    $0x2,%rdx
  add    $0x1,%rdx
  cmp    $0x5d,%cl
  jne    L331
L9:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  xchg   %ax,%ax
L149:
  cmp    %cl,%dil
  jg     L258
L46:
  cmp    $0x5d,%cl
  je     L118
  test   %cl,%cl
  jne    L237
L118:
  lea    0x1(%rdx),%rsi
  add    $0x1,%rbp
  jmp    L107
  nopl   0x0(%rax,%rax,1)
L274:
  mov    %rdx,%rsi
  test   %dil,%dil
  je     L254
  nopl   0x0(%rax)
L237:
  mov    %rdx,%rcx
  movzbl 0x1(%rdx),%eax
  add    $0x1,%rdx
  cmp    $0x5d,%al
  je     L329
  test   %al,%al
  jne    L237
L329:
  movzbl 0x2(%rcx),%eax
  mov    %rdx,%rsi
  jmp    L254
```

assistant: ```c
int Tcl_StringMatch(const char *string, const char *pattern) {
  char c2;
  while (1) {
    if (*pattern == 0) {
      if (*string == 0) {
        return 1;
      } else {
        return 0;
      }
    }
    if ((*string == 0) && (*pattern != '*')) {
      return 0;
    }
    if (*pattern == '*') {
      pattern += 1;
      if (*pattern == 0) {
        return 1;
      }
      while (1) {
        if (Tcl_StringMatch(string, pattern)) {
          return 1;
        }
        if (*string == 0) {
          return 0;
        }
        string += 1;
      }
    }
    if (*pattern == '?') {
      goto thisCharOK;
    }
    if (*pattern == '[') {
      pattern += 1;
      while (1) {
        if ((*pattern == ']') || (*pattern == 0)) {
          return 0;
        }
        if (*pattern == *string) {
          break;
        }
        if (pattern[1] == '-') {
          c2 = pattern[2];
          if (c2 == 0) {
            return 0;
          }
          if ((*pattern <= *string) && (c2 >= *string)) {
            break;
          }
          if ((*pattern >= *string) && (c2 <= *string)) {
            break;
          }
          pattern += 2;
        }
        pattern += 1;
      }
      while ((*pattern != ']') && (*pattern != 0)) {
        pattern += 1;
      }
      goto thisCharOK;
    }
    if (*pattern == '\\') {
      pattern += 1;
      if (*pattern == 0) {
        return 0;
      }
    }
    if (*pattern != *string) {
      return 0;
    }
  thisCharOK:
    pattern += 1;
    string += 1;
  }
}
```