user: 请将以下的汇编代码转换成C语言代码：

```asm
<fnmatch>:
  endbr64
  push   %r15
  mov    %edx,%eax
  mov    %edx,%r15d
  push   %r14
  and    $0x1,%eax
  mov    %rsi,%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  and    $0x2,%r12d
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x18,%rsp
  mov    %eax,0x8(%rsp)
  mov    %edx,%eax
  and    $0x4,%eax
  mov    %eax,0xc(%rsp)
  mov    %edx,%eax
  and    $0x10,%eax
  mov    %eax,0x4(%rsp)
L13:
  movzbl 0x0(%r13),%edi
  movzbl (%r14),%ebp
  lea    0x1(%r13),%r9
  cmp    $0x3f,%dil
  je     L285
  jg     L124
  test   %dil,%dil
  je     L471
  cmp    $0x2a,%dil
  jne    L497
  movzbl 0x1(%r13),%eax
  mov    %r9,%r13
  cmp    $0x2a,%al
  jne    L343
  nopl   0x0(%rax)
L489:
  movzbl 0x1(%r13),%eax
  add    $0x1,%r13
  cmp    $0x2a,%al
  je     L489
L343:
  cmp    $0x2e,%bpl
  je     L284
L234:
  test   %al,%al
  je     L147
  cmp    $0x2f,%al
  jne    L354
  test   %r12d,%r12d
  je     L159
  mov    %r14,%rdi
  mov    $0x2f,%esi
  call   <strchr@plt>
  mov    %rax,%r14
  test   %rax,%rax
  jne    L13
L435:
  add    $0x18,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L124:
  cmp    $0x5b,%dil
  je     L34
  cmp    $0x5c,%dil
  jne    L497
  mov    0x8(%rsp),%edx
  test   %edx,%edx
  je     L407
L497:
  mov    %r9,%r13
L451:
  cmp    %dil,%bpl
  je     L560
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  je     L435
  call   <tolower@plt>
  movzbl (%r14),%edi
  mov    %eax,%ebp
  call   <tolower@plt>
  cmp    %eax,%ebp
  jne    L435
L560:
  add    $0x1,%r14
  jmp    L13
  nopl   (%rax)
L34:
  test   %bpl,%bpl
  je     L435
  cmp    $0x2f,%bpl
  jne    L38
  test   %r12d,%r12d
  jne    L435
L38:
  movsbl %bpl,%esi
  mov    %r15d,%edx
  mov    %r9,%rdi
  call   <rangematch@plt>
  mov    %rax,%r13
  test   %rax,%rax
  jne    L560
  jmp    L435
  nopl   0x0(%rax)
L471:
  and    $0x8,%r15d
  jne    L21
L51:
  xor    %eax,%eax
  test   %bpl,%bpl
  setne  %al
L390:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L285:
  test   %bpl,%bpl
  je     L435
  cmp    $0x2f,%bpl
  je     L359
  cmp    $0x2e,%bpl
  jne    L291
  mov    0xc(%rsp),%esi
  test   %esi,%esi
  je     L291
  cmp    %rbx,%r14
  je     L435
  test   %r12d,%r12d
  je     L291
  cmpb   $0x2f,-0x1(%r14)
  je     L435
  nopw   0x0(%rax,%rax,1)
L291:
  add    $0x1,%r14
  mov    %r9,%r13
  jmp    L13
  nopl   0x0(%rax)
L407:
  movzbl 0x1(%r13),%eax
  test   %al,%al
  je     L497
  add    $0x2,%r13
  movzbl %al,%edi
  jmp    L451
  nopl   0x0(%rax)
L21:
  cmp    $0x2f,%bpl
  jne    L51
L267:
  xor    %eax,%eax
L72:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L284:
  mov    0xc(%rsp),%ecx
  test   %ecx,%ecx
  je     L234
  cmp    %rbx,%r14
  je     L435
  test   %r12d,%r12d
  je     L234
  cmpb   $0x2f,-0x1(%r14)
  jne    L234
  jmp    L435
  xchg   %ax,%ax
L359:
  test   %r12d,%r12d
  jne    L435
  add    $0x1,%r14
  mov    %r9,%r13
  jmp    L13
L147:
  test   %r12d,%r12d
  je     L267
  and    $0x8,%r15d
  jne    L267
  mov    $0x2f,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  setne  %al
  movzbl %al,%eax
  jmp    L390
L159:
  mov    %r15d,%ebx
  and    $0xfffffffb,%ebx
  test   %bpl,%bpl
  jne    L11
  jmp    L435
  nopl   0x0(%rax,%rax,1)
L408:
  add    $0x1,%r14
  cmpb   $0x0,(%r14)
  je     L435
L11:
  mov    %ebx,%edx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <fnmatch>
  test   %eax,%eax
  jne    L408
  xor    %eax,%eax
  jmp    L72
L354:
  test   %bpl,%bpl
  je     L435
  mov    %r15d,%ebx
  and    $0xfffffffb,%ebx
  test   %r12d,%r12d
  je     L11
  jmp    L85
L310:
  movzbl 0x1(%r14),%ebp
  add    $0x1,%r14
  test   %bpl,%bpl
  je     L435
L85:
  mov    %ebx,%edx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <fnmatch>
  test   %eax,%eax
  je     L267
  cmp    $0x2f,%bpl
  jne    L310
  jmp    L435
```

assistant: ```c
int fnmatch(const char *pattern, const char *string, int flags) {
  const char *stringstart;
  char c;
  char 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 (!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 ((pattern = rangematch(pattern, *string, flags)) == NULL)
        return (1);
      ++string;
      break;
    case '\\':
      if (!(flags & 0x01)) {
        if ((c = *pattern++) == '\0') {
          c = '\\';
          --pattern;
        }
      }
    default:
      if (c == *string)
        ;
      else if ((flags & 0x10) && (tolower((unsigned char)c) == tolower((unsigned char)*string)))
        ;
      else
        return (1);
      string++;
      break;
    }
}
```