user: Translate the below assembly code into C programming language:

```asm
<fnmatch>:
  endbr64
  push   %r15
  push   %r14
  mov    %edx,%r14d
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
L334:
  movzbl (%rbx),%eax
  movzbl 0x0(%rbp),%r12d
  lea    0x1(%rbx),%rdi
  cmp    $0x3f,%al
  je     L300
L422:
  jg     L354
  test   %al,%al
  je     L59
  cmp    $0x2a,%al
  jne    L227
  movzbl 0x1(%rbx),%eax
  mov    %rdi,%rbx
  cmp    $0x2a,%al
  jne    L303
  nopl   0x0(%rax,%rax,1)
L325:
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  cmp    $0x2a,%al
  je     L325
L303:
  cmp    $0x2e,%r12b
  je     L460
L2:
  test   %al,%al
  je     L114
  cmp    $0x2f,%al
  jne    L186
  mov    D76(%rip),%rax
  mov    %r14d,%ecx
  and    (%rax),%ecx
  je     L186
  mov    %rbp,%rdi
  mov    $0x2f,%esi
  call   <index@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L334
L206:
  mov    D107(%rip),%rax
  mov    (%rax),%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L354:
  cmp    $0x5b,%al
  je     L103
  cmp    $0x5c,%al
  jne    L227
  mov    D62(%rip),%rdx
  mov    %r14d,%ecx
  and    (%rdx),%ecx
  jne    L227
  movzbl 0x1(%rbx),%edx
  test   %dl,%dl
  je     L227
  add    $0x2,%rbx
  mov    %edx,%eax
  jmp    L462
  nopw   0x0(%rax,%rax,1)
L227:
  mov    %rdi,%rbx
L462:
  add    $0x1,%rbp
  cmp    %al,%r12b
  jne    L206
  movzbl (%rbx),%eax
  movzbl 0x0(%rbp),%r12d
  lea    0x1(%rbx),%rdi
  cmp    $0x3f,%al
  jne    L422
L300:
  test   %r12b,%r12b
  je     L206
  cmp    $0x2f,%r12b
  je     L254
  cmp    $0x2e,%r12b
  jne    L452
  mov    D74(%rip),%r15
  mov    %r14d,%eax
  and    (%r15),%eax
  je     L452
  cmp    %r13,%rbp
  je     L206
  mov    D76(%rip),%rax
  mov    %r14d,%esi
  and    (%rax),%esi
  je     L452
  cmpb   $0x2f,-0x1(%rbp)
  je     L206
  nopl   (%rax)
L452:
  add    $0x1,%rbp
  mov    %rdi,%rbx
  jmp    L334
  nopl   0x0(%rax)
L103:
  test   %r12b,%r12b
  je     L206
  cmp    $0x2f,%r12b
  jne    L362
  mov    D76(%rip),%rax
  mov    %r14d,%ecx
  and    (%rax),%ecx
  jne    L206
L362:
  movsbl %r12b,%esi
  mov    %r14d,%edx
  call   <rangematch@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L206
  add    $0x1,%rbp
  jmp    L334
  nopw   0x0(%rax,%rax,1)
L59:
  test   %r12b,%r12b
  jne    L206
L389:
  xor    %eax,%eax
L369:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L460:
  mov    D74(%rip),%r15
  mov    %r14d,%edx
  and    (%r15),%edx
  je     L2
  cmp    %r13,%rbp
  je     L206
  mov    D76(%rip),%rdx
  mov    %r14d,%esi
  and    (%rdx),%esi
  je     L2
  cmpb   $0x2f,-0x1(%rbp)
  jne    L2
  jmp    L206
  nopl   (%rax)
L254:
  mov    D76(%rip),%rax
  mov    %r14d,%ecx
  and    (%rax),%ecx
  jne    L206
  add    $0x1,%rbp
  mov    %rdi,%rbx
  jmp    L334
L186:
  test   %r12b,%r12b
  je     L206
  mov    D74(%rip),%r15
  jmp    L188
  nopl   0x0(%rax,%rax,1)
L396:
  movzbl 0x1(%rbp),%r12d
  add    $0x1,%rbp
  test   %r12b,%r12b
  je     L206
L188:
  mov    (%r15),%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  not    %edx
  and    %r14d,%edx
  call   <fnmatch>
  test   %eax,%eax
  je     L389
  cmp    $0x2f,%r12b
  jne    L396
  mov    D76(%rip),%rax
  mov    %r14d,%ecx
  and    (%rax),%ecx
  je     L396
  jmp    L206
L114:
  mov    D76(%rip),%rax
  and    (%rax),%r14d
  je     L389
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <index@plt>
  test   %rax,%rax
  jne    L206
  xor    %eax,%eax
  jmp    L369
```

assistant: ```c
int fnmatch(const char *pattern, const char *string, int flags) {
  const char *stringstart = string;
  char c;
  char test;
  for (;;) {
    switch (c = *pattern++) {
    case '\0':
      return (*string == '\0' ? 0 : FNM_NOMATCH);
    case '?':
      if (*string == '\0') {
        return (FNM_NOMATCH);
      }
      if (*string == '/' && (flags & FNM_PATHNAME)) {
        return (FNM_NOMATCH);
      }
      if (*string == '.' && (flags & FNM_PERIOD) && (string == stringstart || ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) {
        return (FNM_NOMATCH);
      }
      ++string;
      break;
    case '*':
      c = *pattern;
      while (c == '*') {
        c = *++pattern;
      }
      if (*string == '.' && (flags & FNM_PERIOD) && (string == stringstart || ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) {
        return (FNM_NOMATCH);
      }
      if (c == '\0') {
        if (flags & FNM_PATHNAME) {
          return (index(string, '/') == NULL ? 0 : FNM_NOMATCH);
        } else {
          return (0);
        }
      } else if (c == '/' && flags & FNM_PATHNAME) {
        if ((string = index(string, '/')) == NULL) {
          return (FNM_NOMATCH);
        }
        break;
      }
      while ((test = *string) != '\0') {
        if (!fnmatch(pattern, string, flags & ~FNM_PERIOD)) {
          return (0);
        }
        if (test == '/' && flags & FNM_PATHNAME) {
          break;
        }
        ++string;
      }
      return (FNM_NOMATCH);
    case '[':
      if (*string == '\0') {
        return (FNM_NOMATCH);
      }
      if (*string == '/' && flags & FNM_PATHNAME) {
        return (FNM_NOMATCH);
      }
      if ((pattern = rangematch(pattern, *string, flags)) == NULL) {
        return (FNM_NOMATCH);
      }
      ++string;
      break;
    case '\\':
      if (!(flags & FNM_NOESCAPE)) {
        if ((c = *pattern++) == '\0') {
          c = '\\';
          --pattern;
        }
      }
    default:
      if (c != *string++) {
        return (FNM_NOMATCH);
      }
      break;
    }
  }
}
```