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

```asm
<fnmatch>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  movzbl (%rdi),%ebx
  mov    %rsi,0x20(%rsp)
  mov    %edx,0x18(%rsp)
  test   %bl,%bl
  je     L1119
  mov    %edx,%eax
  mov    %rsi,%r15
  mov    %edx,%esi
  mov    %edx,%ebp
  and    $0x2,%eax
  and    $0x1,%esi
  mov    %r15,0x8(%rsp)
  mov    %rdi,%r14
  mov    %eax,0x1c(%rsp)
  mov    %edx,%eax
  lea    0x1(%rdi),%r13
  and    $0x10,%ebp
  shr    $0x2,%eax
  mov    %esi,0x28(%rsp)
  and    $0x1,%eax
  mov    %al,0x2e(%rsp)
  mov    %edx,%eax
  shr    %eax
  xor    $0x1,%eax
  and    $0x1,%eax
  mov    %al,0x4(%rsp)
  mov    %edx,%eax
  and    $0x1,%eax
  mov    %al,0x2d(%rsp)
L140:
  test   %ebp,%ebp
  je     L1088
  movzbl %bl,%r12d
  mov    %r12d,%edi
  call   <isupper@plt>
  test   %eax,%eax
  je     L1313
  mov    %r12d,%edi
  call   <tolower@plt>
  mov    %eax,%ebx
L1313:
  cmp    $0x5b,%bl
  je     L1351
  jg     L248
  cmp    $0x2a,%bl
  je     L415
  cmp    $0x3f,%bl
  jne    L533
L369:
  mov    0x8(%rsp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L1
  cmp    $0x2f,%al
  jne    L877
  cmpb   $0x0,0x2d(%rsp)
  jne    L1
L877:
  cmpb   $0x0,0x2e(%rsp)
  je     L927
  cmp    $0x2e,%al
  je     L416
L927:
  mov    %r13,%r14
L692:
  movzbl (%r14),%ebx
  addq   $0x1,0x8(%rsp)
  lea    0x1(%r14),%r13
  test   %bl,%bl
  jne    L140
  mov    0x8(%rsp),%r15
L1167:
  movzbl (%r15),%edx
  xor    %eax,%eax
  test   %dl,%dl
  je     L784
  mov    0x18(%rsp),%eax
  shr    $0x3,%eax
  cmp    $0x2f,%dl
  sete   %dl
  and    %edx,%eax
  xor    $0x1,%eax
  movzbl %al,%eax
  jmp    L784
  cs nopw 0x0(%rax,%rax,1)
L248:
  cmp    $0x5c,%bl
  jne    L533
  cmpl   $0x0,0x1c(%rsp)
  jne    L1377
  movzbl 0x1(%r14),%ebx
  lea    0x2(%r14),%r12
  test   %bl,%bl
  je     L1
  movzbl %bl,%r13d
  mov    %r13d,%edi
  call   <isupper@plt>
  test   %eax,%eax
  jne    L937
  movsbl %bl,%ebx
  mov    %r12,%r14
L650:
  mov    0x8(%rsp),%rax
  movzbl (%rax),%r13d
  mov    %r13d,%edi
  mov    %r13d,%r12d
  call   <isupper@plt>
  test   %eax,%eax
  je     L474
  mov    %r13d,%edi
  call   <tolower@plt>
  mov    %eax,%r12d
  jmp    L1165
  nopl   0x0(%rax,%rax,1)
L1088:
  cmp    $0x5b,%bl
  je     L1351
  jg     L124
  cmp    $0x2a,%bl
  je     L415
  cmp    $0x3f,%bl
  je     L369
  nopl   (%rax)
L955:
  mov    0x8(%rsp),%rax
  movsbl %bl,%ebx
  movzbl (%rax),%r12d
L1091:
  movsbl %r12b,%r12d
L283:
  cmp    %ebx,%r12d
  je     L927
  nopl   0x0(%rax)
L1:
  mov    $0x1,%eax
L784:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L124:
  cmp    $0x5c,%bl
  jne    L955
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  jne    L137
  movsbl 0x1(%r14),%ebx
  lea    0x2(%r14),%rax
  test   %bl,%bl
  je     L1
  mov    0x8(%rsp),%rcx
  mov    %rax,%r14
  movzbl (%rcx),%r12d
  jmp    L474
  nopw   0x0(%rax,%rax,1)
L1351:
  mov    0x8(%rsp),%rcx
  movzbl (%rcx),%eax
  mov    %al,0x2c(%rsp)
  test   %al,%al
  je     L1
  cmpb   $0x0,0x2e(%rsp)
  je     L843
  cmp    $0x2e,%al
  jne    L843
  cmp    %rcx,0x20(%rsp)
  je     L1
  mov    0x28(%rsp),%esi
  mov    %esi,%eax
  test   %esi,%esi
  jne    L151
L843:
  movzbl 0x1(%r14),%eax
  lea    0x2(%r14),%rcx
  cmp    $0x21,%al
  sete   %dl
  cmp    $0x5e,%al
  sete   %al
  or     %al,%dl
  cmovne %rcx,%r13
  movsbl 0x2c(%rsp),%ecx
  mov    %dl,0x2f(%rsp)
  movzbl 0x0(%r13),%r12d
  movzbl %cl,%eax
  lea    0x1(%r13),%r14
  mov    %ecx,0x14(%rsp)
  mov    %eax,0x10(%rsp)
  mov    %r12d,%r13d
  jmp    L642
  nopl   0x0(%rax,%rax,1)
L95:
  mov    0x10(%rsp),%r12d
  mov    %r12d,%edi
  call   <isupper@plt>
  test   %eax,%eax
  je     L1038
  mov    %r12d,%edi
  call   <tolower@plt>
  cmp    %ebx,%eax
  jl     L381
L1057:
  movsbl %r15b,%ecx
  cmp    %eax,%ecx
  jge    L208
L381:
  cmp    $0x5d,%r13b
  je     L510
L642:
  cmp    $0x5c,%r13b
  jne    L360
  cmpb   $0x0,0x4(%rsp)
  jne    L368
L360:
  test   %ebp,%ebp
  je     L1042
  movzbl %r13b,%r12d
  mov    %r12d,%edi
  call   <isupper@plt>
  test   %eax,%eax
  jne    L1028
  mov    %r14,%r12
  movsbl %r13b,%ebx
L568:
  test   %r13b,%r13b
  je     L1
L56:
  movzbl (%r12),%r15d
  add    $0x1,%r14
  mov    %r15d,%edi
  mov    %r15d,%r13d
  call   <isupper@plt>
  test   %eax,%eax
  je     L620
  mov    %r15d,%edi
  call   <tolower@plt>
  mov    %eax,%r13d
L620:
  cmp    $0x2f,%r13b
  jne    L922
  cmpb   $0x0,0x2d(%rsp)
  jne    L1
L922:
  mov    %ebx,%r15d
  cmp    $0x2d,%r13b
  je     L932
L411:
  test   %ebp,%ebp
  jne    L95
  cmp    %bl,0x2c(%rsp)
  jl     L381
  mov    0x14(%rsp),%eax
  jmp    L1057
  nopl   0x0(%rax)
L1042:
  test   %r13b,%r13b
  je     L1
L675:
  movzbl (%r14),%eax
  mov    %r14,%r12
  movsbl %r13b,%ebx
  add    $0x1,%r14
  mov    %eax,%r13d
  jmp    L620
  nopl   (%rax)
L932:
  movzbl 0x1(%r12),%r15d
  cmp    $0x5d,%r15b
  je     L963
  lea    0x2(%r12),%r13
  cmp    $0x5c,%r15b
  jne    L872
  cmpb   $0x0,0x4(%rsp)
  jne    L227
L872:
  test   %r15b,%r15b
  je     L1
  test   %ebp,%ebp
  je     L769
  movzbl %r15b,%r14d
  mov    %r14d,%edi
  call   <isupper@plt>
  test   %eax,%eax
  je     L769
  mov    %r14d,%edi
  call   <tolower@plt>
  mov    %eax,%r15d
L769:
  lea    0x1(%r13),%r14
  movzbl 0x0(%r13),%r13d
  jmp    L411
  nopl   0x0(%rax)
L1017:
  movzbl %bl,%r12d
  mov    %r12d,%edi
  call   <isupper@plt>
  test   %eax,%eax
  je     L635
  nopl   0x0(%rax)
L1028:
  mov    %r12d,%edi
  mov    %r14,%r12
  call   <tolower@plt>
  movsbl %al,%ebx
  jmp    L568
  nopl   0x0(%rax,%rax,1)
L1038:
  mov    0x14(%rsp),%eax
  cmp    %bl,0x2c(%rsp)
  jge    L1057
  cmp    $0x5d,%r13b
  jne    L642
  nopl   0x0(%rax,%rax,1)
L510:
  cmpb   $0x0,0x2f(%rsp)
  jne    L692
  jmp    L1
L368:
  movsbl (%r14),%ebx
  test   %bl,%bl
  je     L1
  add    $0x1,%r14
  test   %ebp,%ebp
  jne    L1017
  mov    %ebx,%r13d
  jmp    L675
  nopl   0x0(%rax)
L963:
  mov    %ebx,%r15d
  jmp    L411
  nopl   0x0(%rax,%rax,1)
L415:
  mov    0x8(%rsp),%r15
  testb  $0x4,0x18(%rsp)
  je     L534
  cmpb   $0x2e,(%r15)
  je     L1008
L534:
  lea    0x2(%r14),%rbx
  movzbl 0x1(%r14),%r14d
  cmp    $0x2a,%r14b
  je     L886
  cmp    $0x3f,%r14b
  jne    L275
L886:
  mov    0x18(%rsp),%edx
  and    $0x1,%edx
  nopw   0x0(%rax,%rax,1)
L543:
  cmp    $0x3f,%r14b
  je     L356
  movzbl (%rbx),%r14d
  add    $0x1,%rbx
  cmp    $0x3f,%r14b
  jne    L639
L356:
  movzbl (%r15),%eax
  test   %al,%al
  je     L1
  cmp    $0x2f,%al
  je     L832
L383:
  movzbl (%rbx),%r14d
  add    $0x1,%rbx
  add    $0x1,%r15
  cmp    $0x3f,%r14b
  je     L356
L639:
  cmp    $0x2a,%r14b
  je     L543
L275:
  test   %r14b,%r14b
  je     L442
  testb  $0x2,0x18(%rsp)
  jne    L1075
  cmp    $0x5c,%r14b
  je     L1114
L1075:
  mov    %r14b,0x2c(%rsp)
L595:
  test   %ebp,%ebp
  je     L24
  movzbl 0x2c(%rsp),%r13d
  mov    %r13d,%edi
  call   <isupper@plt>
  test   %eax,%eax
  jne    L731
L24:
  movzbl (%r15),%r12d
  sub    $0x1,%rbx
  test   %r12b,%r12b
  je     L1
  mov    0x18(%rsp),%r13d
  and    $0xfffffffb,%r13d
  mov    %r13d,%eax
  mov    %rbx,%r13
  mov    %r15,%rbx
  mov    %eax,%r15d
  jmp    L58
  nopl   0x0(%rax)
L455:
  movzbl %r12b,%edi
  mov    %edi,0x4(%rsp)
  call   <isupper@plt>
  test   %eax,%eax
  je     L1010
  mov    0x4(%rsp),%edi
  call   <tolower@plt>
  movsbl 0x2c(%rsp),%edx
  cmp    %eax,%edx
  je     L133
L1280:
  cmp    $0x2f,%r12b
  je     L482
L391:
  movzbl 0x1(%rbx),%r12d
  add    $0x1,%rbx
  test   %r12b,%r12b
  je     L1
L58:
  cmp    $0x5b,%r14b
  je     L133
  test   %ebp,%ebp
  jne    L455
L1010:
  movsbl 0x2c(%rsp),%edx
  movsbl %r12b,%eax
  cmp    %eax,%edx
  jne    L1280
L133:
  mov    %r15d,%edx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <fnmatch>
  test   %eax,%eax
  je     L784
  cmp    $0x2f,%r12b
  jne    L391
L482:
  mov    0x18(%rsp),%eax
  and    $0x1,%eax
  je     L391
  jmp    L784
  nopl   0x0(%rax)
L635:
  mov    %r14,%r12
  jmp    L56
  nopl   0x0(%rax,%rax,1)
L832:
  mov    %edx,%eax
  test   %edx,%edx
  je     L383
  jmp    L784
  nop
L227:
  movzbl 0x2(%r12),%r15d
  lea    0x3(%r12),%r13
  jmp    L872
L533:
  mov    0x8(%rsp),%rax
  movsbl %bl,%ebx
  movzbl (%rax),%r14d
  mov    %r14d,%edi
  mov    %r14d,%r12d
  call   <isupper@plt>
  test   %eax,%eax
  je     L1091
  mov    %r14d,%edi
  call   <tolower@plt>
  mov    %eax,%r12d
  jmp    L283
  nop
L442:
  mov    0x18(%rsp),%eax
  and    $0x9,%eax
  cmp    $0x1,%eax
  jne    L1181
  movzbl (%r15),%edx
  test   %dl,%dl
  je     L1181
  nopl   0x0(%rax)
L307:
  cmp    $0x2f,%dl
  je     L784
  movzbl 0x1(%r15),%edx
  add    $0x1,%r15
  test   %dl,%dl
  jne    L307
L1181:
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L137:
  mov    0x8(%rsp),%rax
  mov    %r13,%r14
  mov    $0x5c,%ebx
  movzbl (%rax),%r12d
L474:
  movsbl %r12b,%r12d
L1165:
  cmp    %ebx,%r12d
  je     L692
  jmp    L1
  nopl   0x0(%rax,%rax,1)
L151:
  cmpb   $0x2f,-0x1(%rcx)
  jne    L843
  jmp    L784
  nopw   0x0(%rax,%rax,1)
L1008:
  cmp    %r15,0x20(%rsp)
  je     L1
  mov    0x18(%rsp),%eax
  and    $0x1,%eax
  je     L534
  cmpb   $0x2f,-0x1(%r15)
  jne    L534
  jmp    L784
  nopl   0x0(%rax,%rax,1)
L416:
  mov    0x8(%rsp),%rax
  cmp    %rax,0x20(%rsp)
  je     L1
  cmpb   $0x0,0x2d(%rsp)
  je     L927
  cmpb   $0x2f,-0x1(%rax)
  jne    L927
  jmp    L1
  nopw   0x0(%rax,%rax,1)
L208:
  cmp    $0x5d,%r13b
  je     L1344
  test   %r13b,%r13b
  je     L1
  movzbl 0x4(%rsp),%ecx
  jmp    L1328
  cs nopw 0x0(%rax,%rax,1)
L285:
  mov    %rdx,%r14
L322:
  cmp    $0x5d,%al
  je     L1344
  test   %al,%al
  je     L1
L1328:
  movzbl (%r14),%eax
  lea    0x1(%r14),%rdx
  cmp    $0x5c,%al
  jne    L285
  test   %cl,%cl
  je     L285
L802:
  cmpb   $0x0,0x1(%r14)
  je     L1
  movzbl 0x2(%r14),%eax
  lea    0x2(%r14),%rdx
  cmp    $0x5c,%al
  je     L867
  add    $0x3,%r14
  jmp    L322
L731:
  mov    %r13d,%edi
  call   <tolower@plt>
  mov    %al,0x2c(%rsp)
  jmp    L24
L1344:
  cmpb   $0x0,0x2f(%rsp)
  je     L692
  jmp    L1
  xchg   %ax,%ax
L1114:
  movzbl (%rbx),%eax
  mov    %al,0x2c(%rsp)
  jmp    L595
L867:
  mov    %rdx,%r14
  jmp    L802
L1119:
  mov    0x20(%rsp),%r15
  jmp    L1167
L937:
  mov    %r13d,%edi
  mov    %r12,%r14
  call   <tolower@plt>
  movsbl %al,%ebx
  jmp    L650
L1377:
  mov    %r13,%r14
  mov    $0x5c,%ebx
  jmp    L650
```

assistant: ```c
int fnmatch(const char *pattern, const char *string, int flags) {
  register const char *p = pattern, *n = string;
  register char c;
  while ((c = *p++) != '\0') {
    c = ((flags & (1 << 4)) && (1 && isupper((unsigned char)(c))) ? tolower((unsigned char)(c)) : (c));
    switch (c) {
    case '?':
      if (*n == '\0')
        return 1;
      else if ((flags & (1 << 0)) && *n == '/')
        return 1;
      else if ((flags & (1 << 2)) && *n == '.' && (n == string || ((flags & (1 << 0)) && n[-1] == '/')))
        return 1;
      break;
    case '\\':
      if (!(flags & (1 << 1))) {
        c = *p++;
        if (c == '\0')
          return 1;
        c = ((flags & (1 << 4)) && (1 && isupper((unsigned char)(c))) ? tolower((unsigned char)(c)) : (c));
      }
      if (((flags & (1 << 4)) && (1 && isupper((unsigned char)(*n))) ? tolower((unsigned char)(*n)) : (*n)) != c)
        return 1;
      break;
    case '*':
      if ((flags & (1 << 2)) && *n == '.' && (n == string || ((flags & (1 << 0)) && n[-1] == '/')))
        return 1;
      for (c = *p++; c == '?' || c == '*'; c = *p++) {
        if (c == '?') {
          if (*n == '\0' || (*n == '/' && (flags & (1 << 0))))
            return 1;
          else
            ++n;
        }
      }
      if (c == '\0') {
        if ((flags & ((1 << 0) | (1 << 3))) == (1 << 0))
          for (; *n != '\0'; n++)
            if (*n == '/')
              return 1;
        return 0;
      }
      {
        char c1 = (!(flags & (1 << 1)) && c == '\\') ? *p : c;
        c1 = ((flags & (1 << 4)) && (1 && isupper((unsigned char)(c1))) ? tolower((unsigned char)(c1)) : (c1));
        for (--p; *n != '\0'; ++n)
          if ((c == '[' || ((flags & (1 << 4)) && (1 && isupper((unsigned char)(*n))) ? tolower((unsigned char)(*n)) : (*n)) == c1) && fnmatch(p, n, flags & ~(1 << 2)) == 0)
            return 0;
          else if (*n == '/' && (flags & (1 << 0)))
            break;
        return 1;
      }
    case '[': {
      register int not ;
      if (*n == '\0')
        return 1;
      if ((flags & (1 << 2)) && *n == '.' && (n == string || ((flags & (1 << 0)) && n[-1] == '/')))
        return 1;
      not = (*p == '!' || *p == '^');
      if (not )
        ++p;
      c = *p++;
      for (;;) {
        register char cstart = c, cend = c;
        if (!(flags & (1 << 1)) && c == '\\') {
          if (*p == '\0')
            return 1;
          cstart = cend = *p++;
        }
        cstart = cend = ((flags & (1 << 4)) && (1 && isupper((unsigned char)(cstart))) ? tolower((unsigned char)(cstart)) : (cstart));
        if (c == '\0')
          return 1;
        c = *p++;
        c = ((flags & (1 << 4)) && (1 && isupper((unsigned char)(c))) ? tolower((unsigned char)(c)) : (c));
        if ((flags & (1 << 0)) && c == '/')
          return 1;
        if (c == '-' && *p != ']') {
          cend = *p++;
          if (!(flags & (1 << 1)) && cend == '\\')
            cend = *p++;
          if (cend == '\0')
            return 1;
          cend = ((flags & (1 << 4)) && (1 && isupper((unsigned char)(cend))) ? tolower((unsigned char)(cend)) : (cend));
          c = *p++;
        }
        if (((flags & (1 << 4)) && (1 && isupper((unsigned char)(*n))) ? tolower((unsigned char)(*n)) : (*n)) >= cstart && ((flags & (1 << 4)) && (1 && isupper((unsigned char)(*n))) ? tolower((unsigned char)(*n)) : (*n)) <= cend)
          goto matched;
        if (c == ']')
          break;
      }
      if (!not )
        return 1;
      break;
    matched:;
      while (c != ']') {
        if (c == '\0')
          return 1;
        c = *p++;
        if (!(flags & (1 << 1)) && c == '\\') {
          if (*p == '\0')
            return 1;
          ++p;
        }
      }
      if (not )
        return 1;
    } break;
    default:
      if (c != ((flags & (1 << 4)) && (1 && isupper((unsigned char)(*n))) ? tolower((unsigned char)(*n)) : (*n)))
        return 1;
    }
    ++n;
  }
  if (*n == '\0')
    return 0;
  if ((flags & (1 << 3)) && *n == '/')
    return 0;
  return 1;
}
```