user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<_wild_match>:
  endbr64
  test   %rdi,%rdi
  je     L113
  push   %r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  test   %rsi,%rsi
  je     L102
  cmpb   $0x0,(%rdi)
  mov    %rdi,%rbp
  je     L102
  cmpb   $0x0,(%rsi)
  je     L102
  mov    %rdi,%rax
  nop
L234:
  mov    %rax,%rbx
  lea    0x1(%rax),%rax
  cmpb   $0x0,0x1(%rbx)
  jne    L234
  mov    %r14,%rax
L27:
  mov    %rax,%r15
  lea    0x1(%rax),%rax
  cmpb   $0x0,0x1(%r15)
  jne    L27
  cmp    %r14,%r15
  jb     L228
  movl   $0x1,0xc(%rsp)
  xor    %r13d,%r13d
  xor    %r12d,%r12d
  movq   $0x0,(%rsp)
L76:
  movzbl (%rbx),%edi
  cmp    %rbx,%rbp
  jae    L247
  cmpb   $0x5c,-0x1(%rbx)
  je     L280
L247:
  cmp    $0x2a,%dil
  je     L99
  cmp    $0x3f,%dil
  je     L262
  and    $0x7fff,%r13d
  mov    %r13d,0x8(%rsp)
L2:
  call   <rfc_toupper@plt>
  movzbl (%r15),%edi
  mov    %rax,%r13
  call   <rfc_toupper@plt>
  cmp    %rax,%r13
  je     L222
  test   %r12,%r12
  je     L102
  mov    (%rsp),%r15
  sub    $0x1,%r15
  cmp    %r15,%r14
  jbe    L210
  xor    %r13d,%r13d
  jmp    L153
  nopl   0x0(%rax)
L65:
  movzbl (%r12),%eax
  cmp    $0x2a,%al
  je     L265
  cmp    $0x25,%al
  jne    L71
L265:
  sub    $0x1,%r12
L153:
  cmp    %r12,%rbp
  jbe    L65
L236:
  mov    0xc(%rsp),%eax
  add    %r13d,%eax
  and    $0x7fff,%eax
  jmp    L266
  nopl   0x0(%rax)
L71:
  cmp    %r12,%rbp
  ja     L236
  nopl   (%rax)
L102:
  xor    %eax,%eax
L266:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L99:
  mov    %rbx,%rsi
  sub    $0x1,%rbx
  cmp    %rbx,%rbp
  ja     L56
  movzbl (%rbx),%eax
  cmp    $0x2a,%al
  je     L99
  cmp    $0x25,%al
  je     L99
  cmp    $0x5c,%al
  cmove  %rsi,%rbx
L56:
  add    %r13d,0xc(%rsp)
  mov    %rbx,%r12
  xor    %r13d,%r13d
  mov    %r15,(%rsp)
  jmp    L79
  xchg   %ax,%ax
L262:
  sub    $0x1,%rbx
  sub    $0x1,%r15
L79:
  cmp    %r14,%r15
  jae    L76
  mov    %rbx,%r12
  jmp    L153
  nopl   0x0(%rax)
L280:
  or     $0x8000,%r13d
  mov    %r13d,0x8(%rsp)
  jmp    L2
  nopl   0x0(%rax)
L210:
  mov    %r15,(%rsp)
  mov    %r12,%rbx
  xor    %r13d,%r13d
  jmp    L76
  nopw   0x0(%rax,%rax,1)
L113:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L222:
  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    L79
L228:
  movl   $0x1,0xc(%rsp)
  mov    %rbx,%r12
  xor    %r13d,%r13d
  jmp    L153
```

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