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

```asm
<fnmatch_helper>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rsi,0x20(%rsp)
  mov    %edx,%r12d
  mov    %edx,%r14d
  and    $0x2,%r14d
  mov    %edx,%eax
  and    $0x1,%eax
  mov    %eax,0x28(%rsp)
  mov    %edx,%eax
  and    $0x8,%eax
  mov    %eax,0x2c(%rsp)
  mov    (%rdi),%rbx
  mov    (%rsi),%rbp
  test   $0x4,%dl
  jne    L291
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x8(%rsp)
  cmpb   $0x2e,0x0(%rbp)
  jne    L204
  mov    %rbx,%rdx
  cmpl   $0x0,0x28(%rsp)
  jne    L201
  cmpb   $0x5c,(%rbx)
  sete   %dl
  movzbl %dl,%edx
  add    %rbx,%rdx
L201:
  mov    $0x1,%eax
  cmpb   $0x2e,(%rdx)
  jne    L446
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x8(%rsp)
  jmp    L204
L291:
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x8(%rsp)
L204:
  movzbl (%rbx),%eax
  cmp    $0x3f,%al
  je     L157
  cmp    $0x5b,%al
  je     L388
  cmp    $0x2a,%al
  je     L410
  cmp    $0x5c,%al
  jne    L412
  cmpl   $0x0,0x28(%rsp)
  sete   %al
  cmp    $0x1,%al
  sbb    $0xffffffffffffffff,%rbx
L412:
  movzbl 0x0(%rbp),%r13d
  test   %r13b,%r13b
  je     L42
  test   %r14d,%r14d
  setne  %al
  cmp    $0x2f,%r13b
  jne    L221
  test   %al,%al
  jne    L42
L221:
  movzbl (%rbx),%r15d
  test   %r15b,%r15b
  je     L305
  cmp    $0x2f,%r15b
  jne    L354
  test   %al,%al
  jne    L305
L354:
  cmpl   $0x0,0x2c(%rsp)
  je     L112
  movzbl %r15b,%edi
  test   $0x80,%r15b
  jne    L142
  call   <isupper@plt>
  test   %eax,%eax
  je     L142
  movsbl %r15b,%edi
  call   <tolower@plt>
  movzbl %al,%r15d
  jmp    L350
L410:
  mov    %rbx,%rdx
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  cmp    $0x2a,%al
  je     L410
  cmp    $0x5c,%al
  sete   %al
  cmpl   $0x0,0x28(%rsp)
  sete   %sil
  lea    0x2(%rdx),%rcx
  and    %sil,%al
  cmove  %rbx,%rcx
  cmpb   $0x0,(%rcx)
  je     L461
  test   %r14d,%r14d
  je     L399
  lea    0x2(%rdx),%rcx
  test   %al,%al
  cmove  %rbx,%rcx
  cmpb   $0x2f,(%rcx)
  je     L461
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L150
  cmp    $0x2f,%al
  je     L150
  mov    %rbp,0x10(%rsp)
  mov    %rbx,0x8(%rsp)
  jmp    L204
L461:
  add    $0x2,%rdx
  test   %al,%al
  cmovne %rdx,%rbx
  mov    0x18(%rsp),%rax
  mov    %rbx,(%rax)
  mov    0x20(%rsp),%rax
  mov    %rbp,(%rax)
  mov    $0x0,%eax
  jmp    L446
L150:
  mov    0x18(%rsp),%rax
  mov    %rbx,(%rax)
  mov    0x20(%rsp),%rax
  mov    %rbp,(%rax)
  mov    $0x1,%eax
  jmp    L446
L157:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L442
  cmp    $0x2f,%al
  jne    L383
  test   %r14d,%r14d
  jne    L442
L383:
  add    $0x1,%rbx
  add    $0x1,%rbp
  jmp    L204
L442:
  mov    0x18(%rsp),%rax
  mov    %rbx,(%rax)
  mov    0x20(%rsp),%rax
  mov    %rbp,(%rax)
  mov    $0x1,%eax
  jmp    L446
L388:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L231
  cmp    $0x2f,%al
  jne    L453
  test   %r14d,%r14d
  jne    L231
L453:
  lea    0x1(%rbx),%rdi
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    $0x0,%eax
  call   <bracket@plt>
  test   %eax,%eax
  jne    L470
L305:
  mov    0x8(%rsp),%rax
  test   %rax,%rax
  je     L254
  mov    0x10(%rsp),%rcx
  test   %rcx,%rcx
  jne    L319
L254:
  mov    0x18(%rsp),%rax
  mov    %rbx,(%rax)
  mov    0x20(%rsp),%rax
  mov    %rbp,(%rax)
  mov    $0x1,%eax
L446:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L231:
  mov    0x18(%rsp),%rax
  mov    %rbx,(%rax)
  mov    0x20(%rsp),%rax
  mov    %rbp,(%rax)
  mov    $0x1,%eax
  jmp    L446
L470:
  movslq %eax,%rbx
  add    $0x1,%rbp
  jmp    L204
L42:
  mov    0x18(%rsp),%rax
  mov    %rbx,(%rax)
  mov    0x20(%rsp),%rax
  mov    %rbp,(%rax)
  movzbl (%rbx),%edx
  mov    $0x0,%eax
  test   %dl,%dl
  je     L446
  cmp    $0x2f,%dl
  setne  %al
  test   %r14d,%r14d
  sete   %dl
  or     %edx,%eax
  movzbl %al,%eax
  jmp    L446
L319:
  add    $0x1,%rcx
  mov    %rcx,0x10(%rsp)
  mov    %rcx,%rbp
  mov    %rax,%rbx
  jmp    L204
L399:
  cmpb   $0x0,0x0(%rbp)
  je     L150
  mov    %rbp,0x10(%rsp)
  mov    %rbx,0x8(%rsp)
  jmp    L204
L142:
  movzbl %r15b,%r15d
L350:
  movzbl %r13b,%edi
  test   $0x80,%r13b
  jne    L242
  call   <isupper@plt>
  test   %eax,%eax
  je     L242
  movsbl %r13b,%edi
  call   <tolower@plt>
  movzbl %al,%r13d
  jmp    L7
L112:
  movzbl %r15b,%r15d
L242:
  movzbl %r13b,%r13d
L7:
  cmp    %r15d,%r13d
  jne    L305
  add    $0x1,%rbx
  add    $0x1,%rbp
  jmp    L204
```

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