user: What is the c source code of the assembly code below?

```asm
<_wild_match>:
  endbr64
  test   %rdi,%rdi
  je     L318
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r12
  test   %rsi,%rsi
  je     L158
  mov    $0x0,%eax
  cmpb   $0x0,(%rdi)
  je     L221
  cmpb   $0x0,(%rsi)
  je     L221
  mov    %rdi,%rax
L129:
  mov    %rax,%rbx
  add    $0x1,%rax
  cmpb   $0x0,(%rax)
  jne    L129
  mov    %r12,%rax
L233:
  mov    %rax,%r13
  add    $0x1,%rax
  cmpb   $0x0,(%rax)
  jne    L233
  cmp    %r12,%r13
  jb     L193
  mov    $0x0,%ecx
  movl   $0x1,0xc(%rsp)
  mov    $0x0,%r15d
  mov    $0x0,%r14d
  jmp    L229
L53:
  mov    %rbx,%rdx
  sub    $0x1,%rbx
  cmp    %rbx,%rbp
  ja     L118
  movzbl (%rbx),%eax
  cmp    $0x2a,%al
  je     L53
  cmp    $0x25,%al
  je     L53
  cmp    $0x5c,%al
  cmove  %rdx,%rbx
L118:
  add    %ecx,0xc(%rsp)
  mov    %r13,%r15
  mov    %rbx,%r14
  mov    $0x0,%ecx
L203:
  cmp    %r13,%r12
  ja     L30
L229:
  cmp    %rbx,%rbp
  jae    L242
  cmpb   $0x5c,-0x1(%rbx)
  je     L320
L242:
  movzbl (%rbx),%eax
  cmp    $0x2a,%al
  je     L53
  cmp    $0x3f,%al
  je     L321
  and    $0x7fff,%ecx
  mov    %ecx,0x8(%rsp)
L75:
  movzbl (%rbx),%edi
  call   <rfc_toupper@plt>
  mov    %rax,(%rsp)
  movzbl 0x0(%r13),%edi
  call   <rfc_toupper@plt>
  cmp    %rax,(%rsp)
  je     L172
  test   %r14,%r14
  je     L32
  sub    $0x1,%r15
  cmp    %r15,%r12
  ja     L328
  mov    %r15,%r13
  mov    %r14,%rbx
  mov    $0x0,%ecx
  jmp    L229
L321:
  sub    $0x1,%rbx
  sub    $0x1,%r13
  jmp    L203
L320:
  or     $0x80,%ch
  mov    %ecx,0x8(%rsp)
  jmp    L75
L172:
  sub    $0x1,%r13
  mov    0x8(%rsp),%ecx
  add    $0x1,%ecx
  mov    %rbx,%rax
  test   $0x80,%ch
  sete   %bl
  movzbl %bl,%ebx
  lea    -0x2(%rbx,%rax,1),%rbx
  jmp    L203
L193:
  mov    %rbx,%r14
  mov    $0x0,%ecx
  movl   $0x1,0xc(%rsp)
  jmp    L187
L328:
  mov    $0x0,%ecx
L187:
  cmp    %r14,%rbp
  jbe    L279
L304:
  mov    0xc(%rsp),%eax
  add    %ecx,%eax
  and    $0x7fff,%eax
  jmp    L221
L30:
  mov    %rbx,%r14
  jmp    L187
L29:
  sub    $0x1,%r14
  cmp    %r14,%rbp
  ja     L304
L279:
  movzbl (%r14),%eax
  cmp    $0x2a,%al
  je     L29
  cmp    $0x25,%al
  je     L29
  cmp    %r14,%rbp
  ja     L304
  mov    $0x0,%eax
  jmp    L221
L158:
  mov    $0x0,%eax
L221:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L32:
  mov    $0x0,%eax
  jmp    L221
L318:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int _wild_match(register unsigned char *m, register unsigned char *n) {
  unsigned char *ma = m, *na = n, *lsm = 0, *lsn = 0;
  int match = 1;
  register int sofar = 0;
  if ((ma == 0) || (na == 0) || (!*ma) || (!*na))
    return 0;
  while (*(++m))
    ;
  m--;
  while (*(++n))
    ;
  n--;
  while (n >= na) {
    if ((m <= ma) || (m[-1] != '\\')) {
      switch (*m) {
      case '*':
        do
          m--;
        while ((m >= ma) && ((*m == '*') || (*m == '%')));
        if ((m >= ma) && (*m == '\\'))
          m++;
        lsm = m;
        lsn = n;
        match += sofar;
        sofar = 0;
        continue;
      case '?':
        m--;
        n--;
        continue;
      }
      sofar &= (0x7FFF);
    } else
      sofar |= (0x8000);
    if (rfc_toupper(*m) == rfc_toupper(*n)) {
      m--;
      n--;
      sofar++;
      if (sofar & (0x8000))
        m--;
      continue;
    }
    if (lsm) {
      n = --lsn;
      m = lsm;
      if (n < na)
        lsm = 0;
      sofar = 0;
      continue;
    }
    return 0;
  }
  while ((m >= ma) && ((*m == '*') || (*m == '%')))
    m--;
  return (m >= ma) ? 0 : ((match + sofar) & (0x7FFF));
}
```