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

```asm
<wildmatch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %edx,-0x54(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x34(%rbp)
  mov    -0x54(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L1065
  orl    $0x2,-0x54(%rbp)
L1065:
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x20(%rbp)
L213:
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x37(%rbp)
  movsbl -0x37(%rbp),%eax
  cmp    $0x5c,%eax
  je     L932
  cmp    $0x5c,%eax
  jg     L979
  cmp    $0x5b,%eax
  je     L959
  cmp    $0x5b,%eax
  jg     L979
  cmp    $0x3f,%eax
  je     L662
  cmp    $0x3f,%eax
  jg     L979
  test   %eax,%eax
  je     L69
  cmp    $0x2a,%eax
  je     L222
  jmp    L979
L69:
  mov    -0x54(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L753
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L753
  mov    $0x0,%eax
  jmp    L889
L753:
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  setne  %al
  movzbl %al,%eax
  jmp    L889
L662:
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L721
  mov    $0x1,%eax
  jmp    L889
L721:
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L13
  mov    -0x54(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L13
  mov    $0x1,%eax
  jmp    L889
L13:
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L410
  mov    -0x54(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L410
  mov    -0x50(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  je     L60
  mov    -0x54(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L410
  mov    -0x50(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L410
L60:
  mov    $0x1,%eax
  jmp    L889
L410:
  addq   $0x1,-0x50(%rbp)
  jmp    L420
L222:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x37(%rbp)
  mov    -0x54(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L139
  cmpb   $0x2a,-0x37(%rbp)
  jne    L139
  mov    $0x1,%eax
  jmp    L50
L139:
  mov    $0x0,%eax
L50:
  mov    %eax,-0x34(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  je     L476
  mov    -0x48(%rbp),%rax
  sub    $0x2,%rax
  movzbl (%rax),%eax
  mov    %al,-0x36(%rbp)
  jmp    L1064
L45:
  addq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x37(%rbp)
L1064:
  cmpb   $0x2a,-0x37(%rbp)
  je     L45
  jmp    L940
L1073:
  movzbl -0x37(%rbp),%eax
  mov    %al,-0x36(%rbp)
  addq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x37(%rbp)
  jmp    L361
L926:
  addq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x37(%rbp)
L361:
  cmpb   $0x2a,-0x37(%rbp)
  je     L926
L940:
  cmpb   $0x2f,-0x37(%rbp)
  jne    L1050
  mov    -0x48(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L1050
  mov    -0x48(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  je     L1073
L1050:
  cmpb   $0x2f,-0x37(%rbp)
  jne    L122
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    -0x54(%rbp),%edx
  mov    -0x50(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <wildmatch>
  test   %eax,%eax
  jne    L122
  mov    $0x0,%eax
  jmp    L889
L693:
  addq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x37(%rbp)
L476:
  cmpb   $0x2a,-0x37(%rbp)
  je     L693
L122:
  cmpl   $0x0,-0x34(%rbp)
  jne    L988
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L988
  mov    -0x54(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L988
  mov    -0x50(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  je     L154
  mov    -0x54(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L988
  mov    -0x50(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L988
L154:
  mov    $0x1,%eax
  jmp    L889
L988:
  cmpb   $0x0,-0x37(%rbp)
  jne    L1034
  cmpl   $0x0,-0x34(%rbp)
  je     L1047
  cmpb   $0x2f,-0x36(%rbp)
  jne    L1047
  mov    $0x0,%eax
  jmp    L889
L1047:
  mov    -0x54(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L310
  mov    -0x54(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  jne    L196
  mov    -0x50(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L196
  mov    $0x1,%eax
  jmp    L889
L196:
  mov    $0x0,%eax
  jmp    L889
L310:
  mov    $0x0,%eax
  jmp    L889
L1034:
  cmpb   $0x2f,-0x37(%rbp)
  jne    L880
  cmpl   $0x0,-0x34(%rbp)
  je     L232
  mov    -0x20(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L118
  mov    $0x1,%eax
  jmp    L889
L393:
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rsi
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    -0x54(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <wildmatch>
  test   %eax,%eax
  jne    L167
  mov    $0x0,%eax
  jmp    L889
L167:
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x28(%rbp)
L118:
  cmpq   $0x0,-0x28(%rbp)
  jne    L393
  jmp    L538
L232:
  mov    -0x54(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L538
  mov    -0x50(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x50(%rbp)
  cmpq   $0x0,-0x50(%rbp)
  jne    L538
  mov    $0x1,%eax
  jmp    L889
L880:
  cmpl   $0x0,-0x34(%rbp)
  je     L538
  mov    $0x1,%eax
  jmp    L889
L290:
  mov    -0x54(%rbp),%eax
  and    $0xfffffffb,%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <wildmatch>
  test   %eax,%eax
  jne    L163
  mov    $0x0,%eax
  jmp    L889
L163:
  cmpb   $0x2f,-0x35(%rbp)
  jne    L472
  mov    -0x54(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  jne    L1087
L472:
  addq   $0x1,-0x50(%rbp)
L538:
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x35(%rbp)
  cmpb   $0x0,-0x35(%rbp)
  jne    L290
  jmp    L397
L1087:
  nop
L397:
  mov    $0x1,%eax
  jmp    L889
L959:
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L1030
  mov    $0x1,%eax
  jmp    L889
L1030:
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L1059
  mov    -0x54(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L1059
  mov    $0x1,%eax
  jmp    L889
L1059:
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L282
  mov    -0x54(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L282
  mov    -0x50(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  je     L233
  mov    -0x54(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L282
  mov    -0x50(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L282
L233:
  mov    $0x1,%eax
  jmp    L889
L282:
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%esi
  lea    -0x30(%rbp),%rcx
  mov    -0x54(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <rangematch@plt>
  cmp    $0x1,%eax
  je     L953
  cmp    $0x1,%eax
  jg     L344
  cmp    $0xffffffff,%eax
  je     L907
  test   %eax,%eax
  je     L971
  jmp    L344
L907:
  addq   $0x1,-0x50(%rbp)
  jmp    L979
L953:
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  jmp    L344
L971:
  mov    $0x1,%eax
  jmp    L889
L344:
  addq   $0x1,-0x50(%rbp)
  jmp    L420
L932:
  mov    -0x54(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L268
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x37(%rbp)
  cmpb   $0x0,-0x37(%rbp)
  jne    L268
  movb   $0x5c,-0x37(%rbp)
  subq   $0x1,-0x48(%rbp)
  mov    -0x50(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L268
  mov    $0x1,%eax
  jmp    L889
L268:
  nop
L979:
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,-0x37(%rbp)
  je     L103
  mov    -0x54(%rbp),%eax
  and    $0x10,%eax
  test   %eax,%eax
  je     L36
  movzbl -0x37(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %eax,%ebx
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    %eax,%ebx
  je     L103
L36:
  mov    $0x1,%eax
  jmp    L889
L103:
  addq   $0x1,-0x50(%rbp)
  nop
L420:
  jmp    L213
L889:
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L779
  call   <__stack_chk_fail@plt>
L779:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int wildmatch(const char *pattern, const char *string, int flags) {
  const char *stringstart;
  const char *newp;
  const char *slash;
  char c, test;
  char prev;
  int wild = 0;
  if (((flags) & (0x40))) {
    flags |= 0x02;
  }
  for (stringstart = string;;) {
    switch (c = *pattern++) {
    case '\0':
      if (((flags) & (0x08)) && *string == '/')
        return 0;
      return (*string == '\0') ? 0 : 1;
    case '?':
      if (*string == '\0')
        return 1;
      if (*string == '/' && ((flags) & (0x02)))
        return 1;
      if (*string == '.' && ((flags) & (0x04)) && (string == stringstart || (((flags) & (0x02)) && *(string - 1) == '/')))
        return 1;
      ++string;
      break;
    case '*':
      c = *pattern;
      wild = ((flags) & (0x40)) && c == '*';
      if (wild) {
        prev = pattern[-2];
        while (c == '*') {
          c = *++pattern;
        }
        while (c == '/' && pattern[1] == '*' && pattern[2] == '*') {
          prev = c;
          c = *++pattern;
          while (c == '*') {
            c = *++pattern;
          }
        }
        if (c == '/' && wildmatch(pattern + 1, string, flags) == 0) {
          return 0;
        }
      } else {
        while (c == '*') {
          c = *++pattern;
        }
      }
      if (!wild && *string == '.' && ((flags) & (0x04)) && (string == stringstart || (((flags) & (0x02)) && *(string - 1) == '/'))) {
        return 1;
      }
      if (c == '\0') {
        if (wild && prev == '/') {
          return 0;
        }
        if (((flags) & (0x02))) {
          return (((flags) & (0x08)) || strchr(string, '/') == NULL ? 0 : 1);
        } else {
          return 0;
        }
      } else if (c == '/') {
        if (wild) {
          slash = strchr(stringstart, '/');
          if (!slash) {
            return 1;
          }
          while (slash) {
            if (wildmatch(pattern + 1, slash + 1, flags) == 0) {
              return 0;
            }
            slash = strchr(slash + 1, '/');
          }
        } else {
          if (((flags) & (0x02))) {
            if ((string = strchr(string, '/')) == NULL) {
              return 1;
            }
          }
        }
      } else if (wild) {
        return 1;
      }
      while ((test = *string) != '\0') {
        if (!wildmatch(pattern, string, flags & ~0x04))
          return 0;
        if (test == '/' && ((flags) & (0x02)))
          break;
        ++string;
      }
      return 1;
    case '[':
      if (*string == '\0')
        return 1;
      if (*string == '/' && ((flags) & (0x02)))
        return 1;
      if (*string == '.' && ((flags) & (0x04)) && (string == stringstart || (((flags) & (0x02)) && *(string - 1) == '/')))
        return 1;
      switch (rangematch(pattern, *string, flags, &newp)) {
      case -1:
        ++string;
        goto normal;
      case 1:
        pattern = newp;
        break;
      case 0:
        return (1);
      }
      ++string;
      break;
    case '\\':
      if (!((flags) & (0x01))) {
        if ((c = *pattern++) == '\0') {
          c = '\\';
          --pattern;
          if (*(string + 1) == '\0') {
            return 1;
          }
        }
      }
    default:
    normal:
      if (c != *string && !(((flags) & (0x10)) && (tolower((unsigned char)c) == tolower((unsigned char)*string))))
        return 1;
      ++string;
      break;
    }
  }
}
```