user: 请从给定的汇编指令推导出C源代码：

```asm
<wildmatch>:
  endbr64
  push   %r15
  mov    %rdi,%rcx
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  mov    %edx,%eax
  and    $0x40,%eax
  mov    %eax,0xc(%rsp)
  jne    L192
  mov    %edx,%eax
  and    $0x2,%eax
  mov    %eax,0x8(%rsp)
L591:
  mov    %ebx,%eax
  mov    %ebx,%r12d
  lea    0x20(%rsp),%r15
  mov    %rbp,%r14
  and    $0x1,%eax
  and    $0x10,%r12d
  mov    %eax,0x10(%rsp)
  mov    %ebx,%eax
  and    $0x4,%eax
  mov    %eax,0x14(%rsp)
L241:
  movzbl (%rcx),%r8d
  lea    0x1(%rcx),%r13
  cmp    $0x3f,%r8b
  je     L760
L23:
  jg     L242
  test   %r8b,%r8b
  je     L722
  cmp    $0x2a,%r8b
  jne    L319
  mov    0xc(%rsp),%edx
  movzbl 0x1(%rcx),%eax
  test   %edx,%edx
  je     L298
  cmp    $0x2a,%al
  je     L303
  movzbl (%r14),%r12d
  cmp    $0x2e,%r12b
  je     L833
L220:
  test   %al,%al
  je     L428
  cmp    $0x2f,%al
  je     L473
L800:
  test   %r12b,%r12b
  je     L68
L405:
  mov    0x8(%rsp),%r8d
  and    $0xfffffffb,%ebx
  test   %r8d,%r8d
  je     L211
  jmp    L910
  nopl   0x0(%rax)
L414:
  add    $0x1,%r14
  cmpb   $0x0,(%r14)
  je     L68
L211:
  mov    %ebx,%edx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <wildmatch>
  test   %eax,%eax
  jne    L414
  nop
L792:
  xor    %eax,%eax
  jmp    L55
  nopw   0x0(%rax,%rax,1)
L762:
  movzbl 0x1(%r13),%eax
  add    $0x1,%r13
L298:
  cmp    $0x2a,%al
  je     L762
  movzbl (%r14),%r12d
  cmp    $0x2e,%r12b
  jne    L220
L833:
  mov    0x14(%rsp),%r15d
  test   %r15d,%r15d
  je     L220
  cmp    %rbp,%r14
  je     L68
  mov    0x8(%rsp),%r11d
  test   %r11d,%r11d
  je     L36
  cmpb   $0x2f,-0x1(%r14)
  je     L68
  test   %al,%al
  je     L791
  cmp    $0x2f,%al
  jne    L405
L239:
  mov    %r14,%rdi
  mov    $0x2f,%esi
  call   <strchr@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L68
  movzbl (%rax),%r12d
  and    $0xfffffffb,%ebx
  test   %r12b,%r12b
  je     L68
L910:
  mov    %ebx,%edx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <wildmatch>
  test   %eax,%eax
  je     L792
  cmp    $0x2f,%r12b
  je     L68
  movzbl 0x1(%r14),%r12d
  add    $0x1,%r14
  test   %r12b,%r12b
  jne    L910
  nopl   0x0(%rax)
L68:
  mov    $0x1,%eax
  jmp    L55
  nopw   0x0(%rax,%rax,1)
L242:
  cmp    $0x5b,%r8b
  je     L914
  cmp    $0x5c,%r8b
  jne    L319
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  je     L801
L319:
  mov    %r13,%rcx
L210:
  cmp    %r8b,(%r14)
  je     L673
  mov    %rcx,0x18(%rsp)
  test   %r12d,%r12d
  je     L68
  movzbl %r8b,%edi
  call   <tolower@plt>
  movzbl (%r14),%edi
  mov    %eax,%r13d
  call   <tolower@plt>
  mov    0x18(%rsp),%rcx
  cmp    %eax,%r13d
  jne    L68
L673:
  movzbl (%rcx),%r8d
  add    $0x1,%r14
  lea    0x1(%rcx),%r13
  cmp    $0x3f,%r8b
  jne    L23
L760:
  movzbl (%r14),%eax
  test   %al,%al
  je     L68
  cmp    $0x2f,%al
  je     L802
  cmp    $0x2e,%al
  jne    L923
  mov    0x14(%rsp),%esi
  test   %esi,%esi
  je     L923
  cmp    %rbp,%r14
  je     L68
  mov    0x8(%rsp),%ecx
  test   %ecx,%ecx
  je     L923
  cmpb   $0x2f,-0x1(%r14)
  je     L68
  nopl   0x0(%rax,%rax,1)
L923:
  add    $0x1,%r14
  mov    %r13,%rcx
  jmp    L241
  nopl   0x0(%rax)
L192:
  movl   $0x2,0x8(%rsp)
  or     $0x2,%ebx
  jmp    L591
L801:
  movzbl 0x1(%rcx),%eax
  test   %al,%al
  jne    L406
  cmpb   $0x0,0x1(%r14)
  jne    L319
  jmp    L68
  nopl   0x0(%rax)
L722:
  and    $0x8,%ebx
  movzbl (%r14),%eax
  je     L751
  cmp    $0x2f,%al
  je     L792
L751:
  test   %al,%al
  setne  %al
  movzbl %al,%eax
L55:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L662
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L914:
  movsbl (%r14),%esi
  test   %sil,%sil
  je     L68
  cmp    $0x2f,%sil
  je     L275
  cmp    $0x2e,%sil
  jne    L593
  mov    0x14(%rsp),%ecx
  test   %ecx,%ecx
  je     L593
  cmp    %rbp,%r14
  je     L68
  mov    0x8(%rsp),%edx
  test   %edx,%edx
  je     L593
  cmpb   $0x2f,-0x1(%r14)
  je     L68
  nopl   0x0(%rax)
L593:
  mov    %r15,%rcx
  mov    %ebx,%edx
  mov    %r13,%rdi
  mov    %r8b,0x18(%rsp)
  call   <rangematch@plt>
  test   %eax,%eax
  je     L68
  cmp    $0x1,%eax
  je     L199
  cmp    $0xffffffff,%eax
  movzbl 0x18(%rsp),%r8d
  jne    L923
  add    $0x1,%r14
  mov    %r13,%rcx
  jmp    L210
L594:
  test   %al,%al
  jne    L68
  cmp    $0x2f,%cl
  je     L792
  nopw   0x0(%rax,%rax,1)
L428:
  mov    0x8(%rsp),%r10d
  test   %r10d,%r10d
  je     L792
L791:
  and    $0x8,%ebx
  jne    L792
  mov    $0x2f,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  setne  %al
  movzbl %al,%eax
  jmp    L55
  nopw   0x0(%rax,%rax,1)
L406:
  add    $0x2,%rcx
  mov    %eax,%r8d
  jmp    L210
  nopl   0x0(%rax)
L303:
  movzbl -0x1(%rcx),%ecx
  nopl   0x0(%rax)
L240:
  movzbl 0x1(%r13),%eax
  add    $0x1,%r13
  cmp    $0x2a,%al
  je     L240
  cmp    $0x2f,%al
  jne    L594
  nopl   0x0(%rax)
L734:
  cmpb   $0x2a,0x1(%r13)
  lea    0x1(%r13),%r12
  jne    L334
  cmpb   $0x2a,0x2(%r13)
  jne    L334
  nopw   0x0(%rax,%rax,1)
L454:
  movzbl 0x1(%r12),%eax
  add    $0x1,%r12
  cmp    $0x2a,%al
  je     L454
  cmp    $0x2f,%al
  jne    L108
  mov    %r12,%r13
  jmp    L734
  nop
L275:
  mov    0x8(%rsp),%edi
  test   %edi,%edi
  je     L593
  jmp    L68
  nopl   0x0(%rax)
L802:
  mov    0x8(%rsp),%edi
  test   %edi,%edi
  jne    L68
  add    $0x1,%r14
  mov    %r13,%rcx
  jmp    L241
L199:
  mov    0x20(%rsp),%r13
  add    $0x1,%r14
  mov    %r13,%rcx
  jmp    L241
L473:
  mov    0x8(%rsp),%r9d
  test   %r9d,%r9d
  jne    L239
  test   %r12b,%r12b
  je     L68
L494:
  and    $0xfffffffb,%ebx
  jmp    L211
L108:
  test   %al,%al
  jne    L68
  jmp    L792
L36:
  test   %al,%al
  je     L792
  cmp    $0x2f,%al
  jne    L405
  jmp    L494
L334:
  mov    %ebx,%edx
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <wildmatch>
  test   %eax,%eax
  je     L792
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L68
L238:
  lea    0x1(%rax),%rbp
  mov    %ebx,%edx
  mov    %r12,%rdi
  mov    %rbp,%rsi
  call   <wildmatch>
  test   %eax,%eax
  je     L792
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L238
  movzbl (%r14),%r12d
  jmp    L800
L662:
  call   <__stack_chk_fail@plt>
```

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;
    }
  }
}
```