user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<fnmatch_helper>:
  endbr64
  push   %r15
  mov    %edx,%r8d
  mov    %edx,%eax
  xor    %r9d,%r9d
  push   %r14
  mov    %edx,%r14d
  and    $0x8,%eax
  and    $0x2,%r8d
  push   %r13
  and    $0x1,%r14d
  xor    %r10d,%r10d
  mov    %rdi,%r15
  push   %r12
  mov    %edx,%r12d
  mov    %rsi,%r13
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    (%rdi),%rbx
  and    $0x4,%edx
  mov    (%rsi),%rbp
  mov    %eax,0xc(%rsp)
  movzbl (%rbx),%eax
  jne    L352
  cmpb   $0x2e,0x0(%rbp)
  je     L512
L352:
  xor    $0x1,%r14d
L386:
  movzbl (%rbx),%eax
  cmp    $0x3f,%al
  je     L86
L133:
  cmp    $0x5b,%al
  je     L469
  cmp    $0x2a,%al
  je     L272
  cmp    $0x5c,%al
  jne    L145
  mov    %r14d,%eax
  and    $0x1,%eax
  cmp    $0x1,%al
  sbb    $0xffffffffffffffff,%rbx
L145:
  movzbl 0x0(%rbp),%edx
  test   %dl,%dl
  je     L170
  test   %r8d,%r8d
  je     L464
  cmp    $0x2f,%dl
  je     L303
  movzbl (%rbx),%esi
  test   %sil,%sil
  je     L435
  cmp    $0x2f,%sil
  jne    L10
  nopl   0x0(%rax,%rax,1)
L435:
  test   %r10,%r10
  je     L328
  test   %r9,%r9
  jne    L510
L328:
  mov    %rbx,(%r15)
  mov    %rbp,0x0(%r13)
L120:
  mov    $0x1,%eax
L111:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L272:
  mov    %rbx,%rdx
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  cmp    $0x2a,%al
  je     L272
  test   %r14d,%r14d
  je     L350
  cmp    $0x5c,%al
  je     L124
L350:
  mov    %rbx,%rsi
L181:
  test   %al,%al
  je     L234
  test   %r8d,%r8d
  je     L507
  cmp    $0x2f,%al
  je     L234
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L328
  cmp    $0x2f,%al
  je     L328
  mov    %rbp,%r9
  mov    %rbx,%r10
L64:
  movzbl (%rbx),%eax
  cmp    $0x3f,%al
  jne    L133
  nopl   (%rax)
L86:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L328
  cmp    $0x2f,%al
  jne    L404
  test   %r8d,%r8d
  jne    L328
L404:
  add    $0x1,%rbx
  add    $0x1,%rbp
  jmp    L386
  xchg   %ax,%ax
L469:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L328
  cmp    $0x2f,%al
  jne    L116
  test   %r8d,%r8d
  jne    L328
L116:
  xor    %eax,%eax
  lea    0x1(%rbx),%rdi
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %r8d,0x20(%rsp)
  mov    %r10,0x18(%rsp)
  mov    %r9,0x10(%rsp)
  call   <bracket@plt>
  mov    0x10(%rsp),%r9
  mov    0x18(%rsp),%r10
  test   %eax,%eax
  mov    0x20(%rsp),%r8d
  je     L435
  movslq %eax,%rbx
  add    $0x1,%rbp
  jmp    L386
  nopl   0x0(%rax)
L507:
  cmpb   $0x0,0x0(%rbp)
  je     L328
  mov    %rbp,%r9
  mov    %rbx,%r10
  jmp    L64
  nopl   (%rax)
L464:
  movzbl (%rbx),%esi
  test   %sil,%sil
  je     L435
L10:
  mov    0xc(%rsp),%eax
  mov    %sil,0x10(%rsp)
  movzbl %dl,%r11d
  movzbl %sil,%ecx
  test   %eax,%eax
  je     L271
  test   $0x80,%cl
  jne    L154
  mov    %ecx,%edi
  mov    %r8d,0x3c(%rsp)
  mov    %r11d,0x38(%rsp)
  mov    %r10,0x30(%rsp)
  mov    %dl,0x28(%rsp)
  mov    %r9,0x20(%rsp)
  mov    %ecx,0x18(%rsp)
  call   <isupper@plt>
  mov    0x18(%rsp),%ecx
  mov    0x20(%rsp),%r9
  test   %eax,%eax
  movzbl 0x28(%rsp),%edx
  mov    0x30(%rsp),%r10
  mov    0x38(%rsp),%r11d
  mov    0x3c(%rsp),%r8d
  jne    L184
L154:
  mov    %dl,0x10(%rsp)
  test   $0x80,%r11b
  jne    L271
  mov    %r11d,%edi
  mov    %ecx,0x38(%rsp)
  mov    %r8d,0x30(%rsp)
  mov    %r10,0x28(%rsp)
  mov    %r9,0x20(%rsp)
  mov    %r11d,0x18(%rsp)
  call   <isupper@plt>
  mov    0x18(%rsp),%r11d
  mov    0x20(%rsp),%r9
  test   %eax,%eax
  mov    0x28(%rsp),%r10
  mov    0x30(%rsp),%r8d
  mov    0x38(%rsp),%ecx
  je     L271
  movsbl 0x10(%rsp),%edi
  mov    %ecx,0x30(%rsp)
  mov    %r8d,0x28(%rsp)
  mov    %r10,0x20(%rsp)
  mov    %r9,0x18(%rsp)
  call   <tolower@plt>
  mov    0x30(%rsp),%ecx
  mov    0x28(%rsp),%r8d
  mov    0x20(%rsp),%r10
  mov    0x18(%rsp),%r9
  movzbl %al,%r11d
  nopl   0x0(%rax)
L271:
  cmp    %ecx,%r11d
  jne    L435
  add    $0x1,%rbx
  add    $0x1,%rbp
  jmp    L386
  xchg   %ax,%ax
L510:
  add    $0x1,%r9
  mov    %r10,%rbx
  mov    %r9,%rbp
  jmp    L386
  nop
L512:
  test   %r14d,%r14d
  jne    L293
  cmp    $0x5c,%al
  jne    L293
  movzbl 0x1(%rbx),%eax
  nopl   (%rax)
L293:
  cmp    $0x2e,%al
  jne    L120
  xor    %r9d,%r9d
  xor    %r10d,%r10d
  jmp    L352
  nopl   0x0(%rax,%rax,1)
L124:
  movzbl 0x2(%rdx),%eax
  lea    0x2(%rdx),%rsi
  jmp    L181
L184:
  movsbl 0x10(%rsp),%edi
  mov    %r8d,0x38(%rsp)
  mov    %r11d,0x30(%rsp)
  mov    %r10,0x28(%rsp)
  mov    %dl,0x20(%rsp)
  mov    %r9,0x18(%rsp)
  call   <tolower@plt>
  mov    0x38(%rsp),%r8d
  mov    0x30(%rsp),%r11d
  mov    0x28(%rsp),%r10
  movzbl 0x20(%rsp),%edx
  movzbl %al,%ecx
  mov    0x18(%rsp),%r9
  jmp    L154
L234:
  mov    %rsi,(%r15)
  xor    %eax,%eax
  mov    %rbp,0x0(%r13)
  jmp    L111
L170:
  mov    %rbx,(%r15)
  mov    %rbp,0x0(%r13)
  movzbl (%rbx),%eax
  test   %al,%al
  je     L385
  test   %r8d,%r8d
  je     L120
L322:
  cmp    $0x2f,%al
  setne  %al
  movzbl %al,%eax
  jmp    L111
L303:
  mov    %rbx,(%r15)
  mov    %rbp,0x0(%r13)
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L322
L385:
  xor    %eax,%eax
  jmp    L111
```

assistant: ```c
int fnmatch_helper(pcur, scur, flags) const char **pcur;
const char **scur;
int flags;
{
  const int period = !(flags & 0x04);
  const int pathname = flags & 0x02;
  const int escape = !(flags & 0x01);
  const int nocase = flags & 0x08;
  const char *ptmp = 0;
  const char *stmp = 0;
  const char *p = *pcur;
  const char *s = *scur;
  if (period && *s == '.' && *(escape && *(p) == '\\' ? (p) + 1 : (p)) != '.')
    return *pcur = p, *scur = s, (1);
  ;
  while (1) {
    switch (*p) {
    case '*':
      do {
        p++;
      } while (*p == '*');
      if ((!*((escape && *(p) == '\\' ? (p) + 1 : (p))) || (pathname && *((escape && *(p) == '\\' ? (p) + 1 : (p))) == '/'))) {
        p = (escape && *(p) == '\\' ? (p) + 1 : (p));
        return *pcur = p, *scur = s, (0);
        ;
      }
      if ((!*(s) || (pathname && *(s) == '/')))
        return *pcur = p, *scur = s, (1);
      ;
      ptmp = p;
      stmp = s;
      continue;
    case '?':
      if ((!*(s) || (pathname && *(s) == '/')))
        return *pcur = p, *scur = s, (1);
      ;
      p++;
      (++(s));
      continue;
    case '[': {
      const char *t;
      if ((!*(s) || (pathname && *(s) == '/')))
        return *pcur = p, *scur = s, (1);
      ;
      if ((t = bracket(p + 1, s, flags)) != 0) {
        p = t;
        (++(s));
        continue;
      }
      goto failed;
    }
    }
    p = (escape && *(p) == '\\' ? (p) + 1 : (p));
    if ((!*(s) || (pathname && *(s) == '/')))
      return *pcur = p, *scur = s, ((!*(p) || (pathname && *(p) == '/')) ? 0 : 1);
    ;
    if ((!*(p) || (pathname && *(p) == '/')))
      goto failed;
    if (((((unsigned char)((nocase && (isascii((int)(unsigned char)(*(p))) && isupper((int)(unsigned char)(*(p)))) ? tolower(*(p)) : (*(p))))) - ((unsigned char)((nocase && (isascii((int)(unsigned char)(*(s))) && isupper((int)(unsigned char)(*(s)))) ? tolower(*(s)) : (*(s))))))) != 0)
      goto failed;
    (++(p));
    (++(s));
    continue;
  failed:
    if (ptmp && stmp) {
      p = ptmp;
      (++(stmp));
      s = stmp;
      continue;
    }
    return *pcur = p, *scur = s, (1);
    ;
  }
}
```