user: 请将以下的汇编代码转换成C语言代码:

```asm
<_utils_searchexp>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rcx,0x8(%rsp)
  test   %rsi,%rsi
  je     L198
  mov    %rdi,%r14
  mov    %rsi,%rdi
  mov    %edx,%ebx
  cmpb   $0x0,(%rsi)
  setne  %r12b
  test   %r14,%r14
  setne  %al
  and    %al,%r12b
  je     L108
  mov    $0x0,%ebp
  mov    $0xfffffffc,%r15d
  jmp    L65
L287:
  add    $0x1,%rdi
  mov    %rbp,%r10
  jmp    L51
L215:
  add    $0x1,%rdi
  test   %ebx,%ebx
  setne  %sil
  lea    -0x41(%rdx),%r10d
  cmp    $0x19,%r10b
  ja     L219
  test   %sil,%sil
  jne    L5
L219:
  mov    %rcx,%r10
  mov    %rdi,%r8
  jmp    L274
L5:
  mov    %rax,%r10
L341:
  add    $0x20,%edx
  mov    %r12d,%esi
L214:
  test   %r10,%r10
  je     L10
  mov    %rdi,%r8
L274:
  movzbl (%r8),%ecx
  mov    %ecx,%edi
  lea    -0x41(%rcx),%r11d
  cmp    $0x19,%r11b
  ja     L194
  add    $0x20,%edi
  test   %sil,%sil
  cmovne %edi,%ecx
L194:
  test   %dl,%dl
  je     L183
  cmp    %dl,%cl
  jne    L183
  lea    0x1(%r8),%rdi
  mov    %rbp,%r10
L34:
  add    $0x1,%r9d
  movzbl (%rdi),%edx
  mov    %edx,%ecx
  and    $0xfffffff7,%ecx
  cmp    $0x24,%cl
  je     L230
  test   %dl,%dl
  je     L230
  add    $0x1,%rax
  cmpb   $0x0,(%rax)
  je     L210
L125:
  mov    %rax,%rcx
  movzbl (%rax),%edx
  cmpb   $0x2a,(%rdi)
  je     L215
  test   %ebx,%ebx
  setne  %sil
  lea    -0x41(%rdx),%ecx
  cmp    $0x19,%cl
  ja     L214
  test   %sil,%sil
  je     L214
  jmp    L341
L10:
  movzbl (%rdi),%ecx
  mov    %ecx,%r11d
  lea    -0x41(%rcx),%r13d
  cmp    $0x19,%r13b
  ja     L137
  add    $0x20,%r11d
  test   %sil,%sil
  cmovne %r11d,%ecx
L137:
  cmp    %cl,%dl
  jne    L98
  add    $0x1,%rdi
  jmp    L34
L183:
  mov    %r8,%rdi
  jmp    L34
L98:
  mov    %r8,%rdi
  mov    $0xfffffffc,%r13d
  jmp    L25
L230:
  mov    $0x0,%r13d
L25:
  cmpb   $0x2a,(%rdi)
  je     L258
L53:
  cmpb   $0x24,(%rdi)
  je     L69
L381:
  test   %r13d,%r13d
  jne    L338
L310:
  movzbl (%rdi),%eax
  mov    %eax,%edx
  and    $0xfffffff7,%edx
  cmp    $0x24,%dl
  je     L123
  test   %al,%al
  je     L123
  mov    $0xfffffffc,%r13d
L338:
  mov    $0x2c,%esi
  call   <strchr@plt>
  test   %rax,%rax
  je     L103
  lea    0x1(%rax),%rdi
L65:
  mov    %r14,%r10
  cmpb   $0x5e,(%rdi)
  je     L287
L51:
  mov    %r14,%rax
  mov    %rdi,%r8
  mov    $0x0,%r9d
  jmp    L125
L69:
  movslq %r9d,%r9
  cmpb   $0x0,(%r14,%r9,1)
  cmovne %r15d,%r13d
  add    $0x1,%rdi
  jmp    L381
L123:
  test   %r10,%r10
  setne  %cl
  mov    0x8(%rsp),%rbx
  test   %rbx,%rbx
  setne  %dl
  test   %dl,%cl
  je     L254
  cmp    $0x24,%al
  jne    L35
L254:
  mov    $0x0,%r13d
L103:
  mov    %r13d,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L35:
  mov    %r10,(%rbx)
  mov    $0x0,%r13d
  jmp    L103
L198:
  mov    $0xfffffffc,%r13d
  jmp    L103
L108:
  mov    $0xfffffffc,%r13d
  jmp    L103
L210:
  cmp    $0x2a,%dl
  jne    L310
  mov    $0x0,%r13d
L258:
  add    $0x1,%rdi
  jmp    L53
```

assistant: ```c
int _utils_searchexp(const char *haystack, const char *needleslist, int ignore_case, const char **rest) {
  int ret = -4;
  if (needleslist == NULL || needleslist[0] == '\0')
    return ret;
  if (haystack != NULL) {
    int i = -1;
    const char *needle = needleslist;
    while (needle != NULL) {
      i = 0;
      ret = -2;
      const char *wildcard = &(haystack[i]);
      if (*needle == '^') {
        wildcard = NULL;
        needle++;
      }
      const char *needle_entry = needle;
      do {
        ;
        char hay = haystack[i];
        if (*needle == '*') {
          wildcard = &(haystack[i]);
          needle++;
        }
        if (ignore_case && hay > 0x40 && hay < 0x5b)
          hay += 0x20;
        if (wildcard == NULL) {
          char lneedle = *needle;
          if (ignore_case && lneedle > 0x40 && lneedle < 0x5b)
            lneedle += 0x20;
          if (lneedle != hay) {
            ;
            needle = needle_entry;
            ret = -4;
            break;
          } else if (lneedle == hay) {
            ret = 0;
          }
          needle++;
        } else {
          char lneedle = *needle;
          if (ignore_case && lneedle > 0x40 && lneedle < 0x5b)
            lneedle += 0x20;
          needle_entry = needle;
          ret = 0;
          if (hay != '\0' && lneedle == hay) {
            wildcard = NULL;
            needle++;
          }
        }
        i++;
        if (*needle == ',' || *needle == '\0' || *needle == '$') {
          ;
          break;
        }
      } while (haystack[i] != '\0');
      if (*needle == '*')
        needle++;
      if (*needle == '$') {
        if (haystack[i] != '\0')
          ret = -4;
        needle++;
      };
      if (ret == 0) {
        if (*needle == ',' || *needle == '\0' || *needle == '$') {
          if (wildcard && (*needle != '$') && (rest != NULL))
            *rest = wildcard;
          break;
        } else
          ret = -4;
      }
      needle = strchr(needle, ',');
      if (needle != NULL)
        needle++;
      wildcard = 0;
    }
  }
  return ret;
}
```