user: What would the C source look like for the assembly code provided here?

```asm
<fnmatch_helper>:
  endbr64
  push   %r15
  mov    %edx,%r8d
  mov    %edx,%eax
  xor    %r10d,%r10d
  push   %r14
  mov    %edx,%r14d
  and    $0x8,%eax
  and    $0x2,%r8d
  push   %r13
  and    $0x1,%r14d
  xor    %r9d,%r9d
  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    L482
  cmpb   $0x2e,0x0(%rbp)
  je     L256
L482:
  xor    $0x1,%r14d
L226:
  cmp    $0x3f,%al
  je     L326
L128:
  cmp    $0x5b,%al
  je     L4
  cmp    $0x2a,%al
  je     L527
  cmp    $0x5c,%al
  jne    L162
  mov    %r14d,%eax
  and    $0x1,%eax
  cmp    $0x1,%al
  sbb    $0xffffffffffffffff,%rbx
L162:
  movzbl 0x0(%rbp),%edx
  test   %dl,%dl
  je     L341
  test   %r8d,%r8d
  je     L475
  cmp    $0x2f,%dl
  je     L25
  movzbl (%rbx),%esi
  test   %sil,%sil
  je     L453
  cmp    $0x2f,%sil
  jne    L166
  nopl   0x0(%rax,%rax,1)
L453:
  test   %r9,%r9
  je     L319
  test   %r10,%r10
  jne    L63
L319:
  mov    %rbx,(%r15)
  mov    %rbp,0x0(%r13)
L510:
  mov    $0x1,%eax
L375:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L527:
  mov    %rbx,%rdx
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  cmp    $0x2a,%al
  je     L527
  test   %r14d,%r14d
  je     L301
  cmp    $0x5c,%al
  je     L299
L301:
  mov    %eax,%edx
  mov    %rbx,%rsi
L26:
  test   %dl,%dl
  je     L21
  test   %r8d,%r8d
  je     L380
  cmp    $0x2f,%dl
  je     L21
  movzbl 0x0(%rbp),%edx
  test   %dl,%dl
  je     L319
  cmp    $0x2f,%dl
  je     L319
  mov    %rbp,%r10
  mov    %rbx,%r9
L64:
  cmp    $0x3f,%al
  jne    L128
  cs nopw 0x0(%rax,%rax,1)
L326:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L319
  cmp    $0x2f,%al
  jne    L250
  test   %r8d,%r8d
  jne    L319
L250:
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbp
  add    $0x1,%rbx
  jmp    L226
  nopw   0x0(%rax,%rax,1)
L4:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L319
  cmp    $0x2f,%al
  jne    L160
  test   %r8d,%r8d
  jne    L319
L160:
  xor    %eax,%eax
  lea    0x1(%rbx),%rdi
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %r8d,0x20(%rsp)
  mov    %r9,0x18(%rsp)
  mov    %r10,0x10(%rsp)
  call   <bracket@plt>
  mov    0x10(%rsp),%r10
  mov    0x18(%rsp),%r9
  test   %eax,%eax
  mov    0x20(%rsp),%r8d
  je     L453
  movslq %eax,%rbx
  add    $0x1,%rbp
  movzbl (%rbx),%eax
  jmp    L226
  nop
L380:
  cmpb   $0x0,0x0(%rbp)
  je     L319
  mov    %rbp,%r10
  mov    %rbx,%r9
  jmp    L64
  nopl   (%rax)
L475:
  movzbl (%rbx),%esi
  test   %sil,%sil
  je     L453
L166:
  mov    0xc(%rsp),%eax
  mov    %sil,0x10(%rsp)
  movzbl %dl,%r11d
  movzbl %sil,%ecx
  test   %eax,%eax
  je     L37
  test   $0x80,%cl
  jne    L350
  mov    %ecx,%edi
  mov    %r8d,0x3c(%rsp)
  mov    %r11d,0x38(%rsp)
  mov    %r9,0x30(%rsp)
  mov    %dl,0x28(%rsp)
  mov    %r10,0x20(%rsp)
  mov    %ecx,0x18(%rsp)
  call   <isupper@plt>
  mov    0x18(%rsp),%ecx
  mov    0x20(%rsp),%r10
  test   %eax,%eax
  movzbl 0x28(%rsp),%edx
  mov    0x30(%rsp),%r9
  mov    0x38(%rsp),%r11d
  mov    0x3c(%rsp),%r8d
  jne    L479
L350:
  mov    %dl,0x10(%rsp)
  test   $0x80,%r11b
  jne    L37
  mov    %r11d,%edi
  mov    %ecx,0x38(%rsp)
  mov    %r8d,0x30(%rsp)
  mov    %r9,0x28(%rsp)
  mov    %r10,0x20(%rsp)
  mov    %r11d,0x18(%rsp)
  call   <isupper@plt>
  mov    0x18(%rsp),%r11d
  mov    0x20(%rsp),%r10
  test   %eax,%eax
  mov    0x28(%rsp),%r9
  mov    0x30(%rsp),%r8d
  mov    0x38(%rsp),%ecx
  je     L37
  movsbl 0x10(%rsp),%edi
  mov    %ecx,0x30(%rsp)
  mov    %r8d,0x28(%rsp)
  mov    %r9,0x20(%rsp)
  mov    %r10,0x18(%rsp)
  call   <tolower@plt>
  mov    0x30(%rsp),%ecx
  mov    0x28(%rsp),%r8d
  mov    0x20(%rsp),%r9
  mov    0x18(%rsp),%r10
  movzbl %al,%r11d
  nopl   0x0(%rax)
L37:
  cmp    %ecx,%r11d
  jne    L453
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbp
  add    $0x1,%rbx
  jmp    L226
  nopw   0x0(%rax,%rax,1)
L63:
  add    $0x1,%r10
  movzbl (%r9),%eax
  mov    %r9,%rbx
  mov    %r10,%rbp
  jmp    L226
  nopl   0x0(%rax,%rax,1)
L256:
  mov    %eax,%edx
  test   %r14d,%r14d
  jne    L95
  cmp    $0x5c,%al
  jne    L95
  movzbl 0x1(%rbx),%edx
  nop
L95:
  cmp    $0x2e,%dl
  jne    L510
  xor    %r10d,%r10d
  xor    %r9d,%r9d
  jmp    L482
  nopl   0x0(%rax)
L299:
  lea    0x2(%rdx),%rsi
  movzbl 0x2(%rdx),%edx
  jmp    L26
L479:
  movsbl 0x10(%rsp),%edi
  mov    %r8d,0x38(%rsp)
  mov    %r11d,0x30(%rsp)
  mov    %r9,0x28(%rsp)
  mov    %dl,0x20(%rsp)
  mov    %r10,0x18(%rsp)
  call   <tolower@plt>
  mov    0x38(%rsp),%r8d
  mov    0x30(%rsp),%r11d
  mov    0x28(%rsp),%r9
  movzbl 0x20(%rsp),%edx
  movzbl %al,%ecx
  mov    0x18(%rsp),%r10
  jmp    L350
L21:
  mov    %rsi,(%r15)
  xor    %eax,%eax
  mov    %rbp,0x0(%r13)
  jmp    L375
L341:
  mov    %rbx,(%r15)
  mov    %rbp,0x0(%r13)
  movzbl (%rbx),%eax
  test   %al,%al
  je     L464
  test   %r8d,%r8d
  je     L510
L334:
  cmp    $0x2f,%al
  setne  %al
  movzbl %al,%eax
  jmp    L375
L25:
  mov    %rbx,(%r15)
  mov    %rbp,0x0(%r13)
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L334
L464:
  xor    %eax,%eax
  jmp    L375
```

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