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

```asm
<wild_match>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  test   %rsi,%rsi
  je     L250
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  test   %rdi,%rdi
  je     L250
  movzbl (%rsi),%edx
  test   %dl,%dl
  je     L274
  mov    $0x0,%r12d
  movl   $0x0,0x4(%rsp)
  mov    $0x0,%r13d
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%r15d
  mov    $0x1,%r14d
  jmp    L93
L274:
  movl   $0x0,0xc(%rsp)
  jmp    L152
L35:
  lea    0x1(%rbp),%rax
  cmpb   $0x0,0x1(%rbp)
  je     L46
  mov    %rax,%rbp
  mov    %r14d,%r12d
L146:
  movzbl (%rbx),%edx
  test   %dl,%dl
  je     L51
L93:
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L51
  cmp    $0x2a,%al
  je     L35
  cmp    $0x3f,%al
  jne    L85
  add    $0x1,%rbp
  add    $0x1,%rbx
  jmp    L146
L46:
  mov    0x4(%rsp),%eax
  lea    0x1(%r13,%rax,1),%eax
  mov    %eax,0xc(%rsp)
  jmp    L152
L85:
  cmp    $0x5c,%al
  sete   %al
  movzbl %al,%eax
  add    %rax,%rbp
  test   %r12d,%r12d
  jne    L14
  movsbl 0x0(%rbp),%edi
  call   <toupper@plt>
  mov    %eax,0x8(%rsp)
  movsbl (%rbx),%edi
  call   <toupper@plt>
  cmp    %eax,0x8(%rsp)
  je     L125
  test   %r15,%r15
  je     L47
L153:
  lea    -0x1(%r15),%rbp
  mov    0x4(%rsp),%r13d
  jmp    L146
L14:
  cmpb   $0x0,(%rbx)
  je     L29
L128:
  movsbl 0x0(%rbp),%edi
  call   <toupper@plt>
  mov    %eax,%r15d
  movsbl (%rbx),%edi
  call   <toupper@plt>
  cmp    %eax,%r15d
  je     L79
  add    $0x1,%rbx
  cmpb   $0x0,(%rbx)
  jne    L128
L29:
  mov    %r13d,0x4(%rsp)
  mov    $0x0,%r13d
L145:
  mov    $0x0,%edx
L38:
  mov    0x4(%rsp),%eax
  lea    0x1(%r13,%rax,1),%ecx
  or     0x0(%rbp),%dl
  mov    $0x0,%eax
  cmove  %ecx,%eax
  mov    %eax,0xc(%rsp)
  jmp    L152
L79:
  cmpb   $0x0,(%rbx)
  je     L214
  movsbl 0x0(%rbp),%edi
  call   <toupper@plt>
  mov    %eax,%r15d
  movsbl (%rbx),%edi
  call   <toupper@plt>
  cmp    %eax,%r15d
  je     L165
  mov    %r13d,0x4(%rsp)
  mov    %rbp,%r15
  movl   $0x0,0xc(%rsp)
  jmp    L153
L51:
  cmpl   $0x0,0xc(%rsp)
  je     L152
  jmp    L38
L250:
  movl   $0x0,0xc(%rsp)
L152:
  mov    0xc(%rsp),%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L47:
  mov    %r12d,0xc(%rsp)
  jmp    L152
L214:
  mov    %r13d,0x4(%rsp)
  mov    $0x0,%r13d
  jmp    L145
L165:
  mov    %r13d,0x4(%rsp)
  mov    %rbp,%r15
  mov    $0x0,%r13d
L125:
  add    $0x1,%r13d
  cmpb   $0x1,0x0(%rbp)
  sbb    $0xffffffffffffffff,%rbp
  cmpb   $0x0,(%rbx)
  je     L145
  add    $0x1,%rbx
  mov    $0x0,%r12d
  mov    %r14d,0xc(%rsp)
  jmp    L146
```

assistant: ```c
int wild_match(char *wild, char *matchtext) {
  char *fallback = 0;
  int match = 0, count = 0, saved = 0, wildcard = 0;
  if (!matchtext || !wild)
    return 0;
  while (*matchtext && *wild) {
    switch (*wild) {
    case '?':
      wild++;
      matchtext++;
      break;
      while ((*(matchtext++) == ' '))
        ;
      break;
    case '*':
      if (!*++wild)
        return (count + saved + 1);
      wildcard = 1;
      break;
    default:
      if (*wild == '\\')
        wild++;
      if (wildcard) {
        saved = count;
        match = count = 0;
        fallback = wild;
        while (*matchtext && (toupper(*wild) != toupper(*matchtext)))
          matchtext++;
        if (!*matchtext) {
          match = 1;
          break;
        }
      }
      if (toupper(*wild) != toupper(*matchtext)) {
        if (!fallback)
          return 0;
        count = saved;
        wild = fallback - 1;
        break;
      }
      wildcard = 0;
      count++;
      match = 1;
      if (*wild)
        wild++;
      if (*matchtext)
        matchtext++;
    }
  }
  return (!match || *wild || *matchtext) ? 0 : (count + saved + 1);
}
```