user: Converte this assembly snippet into its equivalent C code:

```asm
<_wild_match>:
  endbr64
  test   %rdi,%rdi
  je     L187
  push   %r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  test   %rsi,%rsi
  je     L72
  cmpb   $0x0,(%rdi)
  mov    %rdi,%rbp
  je     L72
  cmpb   $0x0,(%rsi)
  je     L72
  mov    %rdi,%rax
  nop
L169:
  mov    %rax,%rbx
  lea    0x1(%rax),%rax
  cmpb   $0x0,0x1(%rbx)
  jne    L169
  mov    %r14,%rax
L232:
  mov    %rax,%r15
  lea    0x1(%rax),%rax
  cmpb   $0x0,0x1(%r15)
  jne    L232
  cmp    %r14,%r15
  jb     L19
  movl   $0x1,0xc(%rsp)
  xor    %r13d,%r13d
  xor    %r12d,%r12d
  movq   $0x0,(%rsp)
L275:
  movzbl (%rbx),%edi
  cmp    %rbx,%rbp
  jae    L251
  cmpb   $0x5c,-0x1(%rbx)
  je     L103
L251:
  cmp    $0x2a,%dil
  je     L186
  cmp    $0x3f,%dil
  je     L166
  and    $0x7fff,%r13d
  mov    %r13d,0x8(%rsp)
L200:
  call   <rfc_toupper@plt>
  movzbl (%r15),%edi
  mov    %rax,%r13
  call   <rfc_toupper@plt>
  cmp    %rax,%r13
  je     L198
  test   %r12,%r12
  je     L72
  mov    (%rsp),%r15
  sub    $0x1,%r15
  cmp    %r15,%r14
  jbe    L233
  xor    %r13d,%r13d
  jmp    L104
  nopl   0x0(%rax)
L270:
  movzbl (%r12),%eax
  cmp    $0x2a,%al
  je     L189
  cmp    $0x25,%al
  jne    L280
L189:
  sub    $0x1,%r12
L104:
  cmp    %r12,%rbp
  jbe    L270
L111:
  mov    0xc(%rsp),%eax
  add    %r13d,%eax
  and    $0x7fff,%eax
  jmp    L214
  nopl   0x0(%rax)
L280:
  cmp    %r12,%rbp
  ja     L111
  nopl   (%rax)
L72:
  xor    %eax,%eax
L214:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L186:
  mov    %rbx,%rsi
  sub    $0x1,%rbx
  cmp    %rbx,%rbp
  ja     L130
  movzbl (%rbx),%eax
  cmp    $0x2a,%al
  je     L186
  cmp    $0x25,%al
  je     L186
  cmp    $0x5c,%al
  cmove  %rsi,%rbx
L130:
  add    %r13d,0xc(%rsp)
  mov    %rbx,%r12
  xor    %r13d,%r13d
  mov    %r15,(%rsp)
  jmp    L261
  xchg   %ax,%ax
L166:
  sub    $0x1,%rbx
  sub    $0x1,%r15
L261:
  cmp    %r14,%r15
  jae    L275
  mov    %rbx,%r12
  jmp    L104
  nopl   0x0(%rax)
L103:
  or     $0x8000,%r13d
  mov    %r13d,0x8(%rsp)
  jmp    L200
  nopl   0x0(%rax)
L233:
  mov    %r15,(%rsp)
  mov    %r12,%rbx
  xor    %r13d,%r13d
  jmp    L275
  nopw   0x0(%rax,%rax,1)
L187:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L198:
  mov    0x8(%rsp),%r13d
  mov    %rbx,%rax
  sub    $0x1,%r15
  xor    %ebx,%ebx
  add    $0x1,%r13d
  test   $0x8000,%r13d
  sete   %bl
  lea    -0x2(%rbx,%rax,1),%rbx
  jmp    L261
L19:
  movl   $0x1,0xc(%rsp)
  mov    %rbx,%r12
  xor    %r13d,%r13d
  jmp    L104
```

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