user: What is the c source code of the assembly code below?

```asm
<cfstore_fnmatch>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %edx,%r14d
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  and    $0x2,%r12d
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  mov    %edx,%eax
  and    $0x1,%eax
  mov    %eax,0xc(%rsp)
  mov    %edx,%eax
  and    $0x4,%eax
  mov    %eax,0x8(%rsp)
  mov    %edx,%eax
  and    $0x10,%eax
  mov    %eax,0x4(%rsp)
  lea    0x20(%rsp),%rax
  mov    %rax,0x10(%rsp)
L517:
  movzbl (%r15),%ebp
  movzbl 0x0(%r13),%r9d
  lea    0x1(%r15),%rdi
  cmp    $0x3f,%bpl
  je     L289
  jg     L370
  test   %bpl,%bpl
  je     L325
  cmp    $0x2a,%bpl
  jne    L450
  movzbl 0x1(%r15),%eax
  mov    %rdi,%r15
  cmp    $0x2a,%al
  jne    L668
L642:
  movzbl 0x1(%r15),%eax
  add    $0x1,%r15
  cmp    $0x2a,%al
  je     L642
L668:
  cmp    $0x2e,%r9b
  je     L657
L184:
  test   %al,%al
  je     L266
  cmp    $0x2f,%al
  jne    L312
  test   %r12d,%r12d
  je     L428
  mov    %r13,%rdi
  mov    $0x2f,%esi
  call   <strchr@plt>
  mov    %rax,%r13
  test   %rax,%rax
  jne    L517
  nopl   (%rax)
L244:
  mov    $0x1,%eax
  jmp    L205
  nopw   0x0(%rax,%rax,1)
L370:
  cmp    $0x5b,%bpl
  je     L644
  cmp    $0x5c,%bpl
  jne    L450
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  je     L405
L450:
  mov    %rdi,%r15
L512:
  cmp    %bpl,0x0(%r13)
  je     L660
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  je     L244
  movzbl %bpl,%edi
  call   <tolower@plt>
  movzbl 0x0(%r13),%edi
  mov    %eax,%ebp
  call   <tolower@plt>
  cmp    %eax,%ebp
  jne    L244
L660:
  add    $0x1,%r13
  jmp    L517
  nopw   0x0(%rax,%rax,1)
L289:
  test   %r9b,%r9b
  je     L244
  cmp    $0x2f,%r9b
  je     L264
  cmp    $0x2e,%r9b
  jne    L681
  mov    0x8(%rsp),%r8d
  test   %r8d,%r8d
  je     L681
  cmp    %rbx,%r13
  je     L244
  test   %r12d,%r12d
  je     L681
  cmpb   $0x2f,-0x1(%r13)
  jne    L681
  jmp    L244
  nopl   0x0(%rax)
L325:
  and    $0x8,%r14d
  jne    L32
L670:
  xor    %eax,%eax
  test   %r9b,%r9b
  setne  %al
L205:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L339
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L644:
  test   %r9b,%r9b
  je     L244
  cmp    $0x2f,%r9b
  je     L226
  cmp    $0x2e,%r9b
  jne    L111
  mov    0x8(%rsp),%ecx
  test   %ecx,%ecx
  je     L111
  cmp    %rbx,%r13
  je     L244
  test   %r12d,%r12d
  je     L111
  cmpb   $0x2f,-0x1(%r13)
  jne    L111
  jmp    L244
  nopl   0x0(%rax,%rax,1)
L32:
  cmp    $0x2f,%r9b
  jne    L670
L639:
  xor    %eax,%eax
  jmp    L205
  nopw   0x0(%rax,%rax,1)
L405:
  movzbl 0x1(%r15),%eax
  test   %al,%al
  je     L450
  add    $0x2,%r15
  mov    %eax,%ebp
  jmp    L512
  nopl   0x0(%rax,%rax,1)
L657:
  mov    0x8(%rsp),%esi
  test   %esi,%esi
  je     L184
  cmp    %rbx,%r13
  je     L244
  test   %r12d,%r12d
  je     L184
  cmpb   $0x2f,-0x1(%r13)
  jne    L184
  jmp    L244
  xchg   %ax,%ax
L226:
  test   %r12d,%r12d
  jne    L244
L111:
  mov    0x10(%rsp),%rcx
  movsbl %r9b,%esi
  mov    %r14d,%edx
  mov    %rdi,0x18(%rsp)
  call   <rangematch@plt>
  test   %eax,%eax
  je     L244
  cmp    $0x1,%eax
  je     L619
  cmp    $0xffffffff,%eax
  mov    0x18(%rsp),%rdi
  je     L450
L681:
  add    $0x1,%r13
  mov    %rdi,%r15
  jmp    L517
  cs nopw 0x0(%rax,%rax,1)
L264:
  test   %r12d,%r12d
  je     L681
  jmp    L244
  nopw   0x0(%rax,%rax,1)
L619:
  mov    0x20(%rsp),%rdi
  jmp    L681
L266:
  test   %r12d,%r12d
  je     L639
  and    $0x8,%r14d
  jne    L639
  mov    $0x2f,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  setne  %al
  movzbl %al,%eax
  jmp    L205
L312:
  test   %r9b,%r9b
  je     L244
  mov    %r14d,%ebx
  and    $0xfffffffb,%ebx
  test   %r12d,%r12d
  je     L335
  jmp    L607
  nopl   0x0(%rax,%rax,1)
L561:
  add    $0x1,%r13
  cmpb   $0x0,0x0(%r13)
  je     L244
L335:
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    %r15,%rdi
  call   <cfstore_fnmatch>
  test   %eax,%eax
  jne    L561
  xor    %eax,%eax
  jmp    L205
L113:
  movzbl 0x1(%r13),%r9d
  add    $0x1,%r13
  test   %r9b,%r9b
  je     L244
L607:
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    %r15,%rdi
  mov    %r9b,0x4(%rsp)
  call   <cfstore_fnmatch>
  test   %eax,%eax
  je     L639
  movzbl 0x4(%rsp),%r9d
  cmp    $0x2f,%r9b
  jne    L113
  jmp    L244
L428:
  mov    %r14d,%ebx
  and    $0xfffffffb,%ebx
  test   %r9b,%r9b
  jne    L335
  jmp    L244
L339:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int cfstore_fnmatch(const char *pattern, const char *string, int flags) {
  const char *stringstart;
  char *newp;
  char c, test;
  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;
      while (c == '*')
        c = *++pattern;
      if (*string == '.' && (flags & 0x04) && (string == stringstart || ((flags & 0x02) && *(string - 1) == '/')))
        return (1);
      if (c == '\0')
        if (flags & 0x02)
          return ((flags & 0x08) || strchr(string, '/') == NULL ? 0 : 1);
        else
          return (0);
      else if (c == '/' && flags & 0x02) {
        if ((string = strchr(string, '/')) == NULL)
          return (1);
        break;
      }
      while ((test = *string) != '\0') {
        if (!cfstore_fnmatch(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):
        goto norm;
      case 1:
        pattern = newp;
        break;
      case 0:
        return (1);
      }
      ++string;
      break;
    case '\\':
      if (!(flags & 0x01)) {
        if ((c = *pattern++) == '\0') {
          c = '\\';
          --pattern;
        }
      }
    default:
    norm:
      if (c == *string)
        ;
      else if ((flags & 0x10) && (tolower((unsigned char)c) == tolower((unsigned char)*string)))
        ;
      else
        return (1);
      string++;
      break;
    }
}
```