user: Please show me the C implementation that matches the assembly code listed below:

```asm
<string_has_highlight>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L292
  cmpb   $0x0,(%rdi)
  mov    %rdi,%r15
  je     L292
  mov    %rsi,%rbp
  test   %rsi,%rsi
  je     L292
  cmpb   $0x0,(%rsi)
  je     L292
  call   <strdup@plt>
  mov    %rax,0x28(%rsp)
  test   %rax,%rax
  je     L292
  mov    %rax,%rdi
  call   <string_tolower@plt>
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,0x20(%rsp)
  test   %rax,%rax
  je     L170
  mov    %rax,%rdi
  mov    %rax,%rbx
  call   <string_tolower@plt>
  lea    0x44(%rsp),%rax
  mov    %r15,0x18(%rsp)
  mov    %rbx,%rdi
  mov    %rax,0x10(%rsp)
L100:
  mov    D11(%rip),%rax
  mov    0x10(%rsp),%rdx
  movl   $0x0,0x44(%rsp)
  mov    (%rax),%esi
  call   <string_regex_flags@plt>
  mov    $0x2c,%esi
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <strchr@plt>
  movl   $0x0,0xc(%rsp)
  mov    %rax,%rbx
  test   %rax,%rax
  je     L271
L174:
  mov    D11(%rip),%rcx
  mov    0x44(%rsp),%eax
  mov    0x18(%rsp),%r12
  and    (%rcx),%eax
  jne    L204
L245:
  mov    %rbx,%rax
  movb   $0x0,(%rbx)
  sub    %rbp,%rax
  movslq %eax,%r13
  test   %eax,%eax
  jle    L51
  movzbl 0x0(%rbp),%edx
  movzbl -0x1(%rbx),%ecx
  cmp    $0x2a,%dl
  je     L44
  mov    %r12,%r15
  cmp    $0x2a,%cl
  jne    L188
L156:
  sub    $0x1,%r13d
  movb   $0x0,-0x1(%rbx)
  test   %r13d,%r13d
  jg     L252
  nop
L51:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jne    L74
  lea    0x1(%rbx),%rdi
  jmp    L100
  nopl   0x0(%rax)
L74:
  mov    0x28(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
L292:
  xor    %eax,%eax
L4:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L266
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L406:
  call   <string_is_word_char@plt>
  xor    %r14d,%r14d
  test   %eax,%eax
  sete   %r14b
  cmpb   $0x0,(%r15)
  jne    L375
  mov    $0x1,%eax
L313:
  test   %eax,%r14d
  jne    L443
L188:
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <strstr@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L51
  mov    %r12,%rdi
  mov    %rax,%rsi
  lea    (%r14,%r13,1),%r15
  call   <utf8_prev_char@plt>
  mov    %rax,%rdi
  lea    -0x1(%r14),%rax
  test   %rdi,%rdi
  cmove  %rax,%rdi
  cmp    %r14,%r12
  jne    L406
  cmpb   $0x0,(%r15)
  je     L443
  mov    $0x1,%r14d
L375:
  mov    %r15,%rdi
  call   <string_is_word_char@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  jmp    L313
  nopl   (%rax)
L252:
  cmp    $0x2a,%dl
  mov    $0x1,%edx
  sete   %r14b
  mov    %edx,0x30(%rsp)
  test   %r14b,%r14b
  je     L278
  test   %dl,%dl
  je     L278
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strstr@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L51
  mov    %r12,%rdi
  mov    %rax,%rsi
  movslq %r13d,%r13
  call   <utf8_prev_char@plt>
  mov    %rax,%rdi
  lea    -0x1(%r14),%rax
  test   %rdi,%rdi
  cmove  %rax,%rdi
  add    %r14,%r13
  cmp    %r14,%r12
  je     L439
  call   <string_is_word_char@plt>
L439:
  cmpb   $0x0,0x0(%r13)
  je     L443
  mov    %r13,%rdi
  call   <string_is_word_char@plt>
  nopl   0x0(%rax,%rax,1)
L443:
  mov    0x28(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    $0x1,%eax
  jmp    L4
  xchg   %ax,%ax
L44:
  add    $0x1,%rbp
  lea    -0x1(%rax),%r13d
  cmp    $0x2a,%cl
  je     L156
  test   %r13d,%r13d
  je     L51
  movl   $0x0,0x30(%rsp)
  mov    $0x1,%r14d
L278:
  mov    %rbx,0x38(%rsp)
  movslq %r13d,%r13
  mov    %r12,%rbx
  jmp    L426
  nopl   (%rax)
L101:
  test   %r14b,%r14b
  je     L335
  test   %al,%al
  jne    L443
L335:
  test   %ecx,0x30(%rsp)
  jne    L443
L426:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L140
  mov    %r12,%rdi
  mov    %rax,%rsi
  lea    (%r15,%r13,1),%rbx
  call   <utf8_prev_char@plt>
  mov    $0x1,%ecx
  mov    %rax,%rdi
  lea    -0x1(%r15),%rax
  test   %rdi,%rdi
  cmove  %rax,%rdi
  cmp    %r15,%r12
  je     L17
  call   <string_is_word_char@plt>
  xor    %ecx,%ecx
  test   %eax,%eax
  sete   %cl
L17:
  cmpb   $0x0,(%rbx)
  mov    $0x1,%eax
  je     L101
  mov    %rbx,%rdi
  mov    %ecx,0x34(%rsp)
  call   <string_is_word_char@plt>
  mov    0x34(%rsp),%ecx
  test   %eax,%eax
  sete   %al
  jmp    L101
  nopw   0x0(%rax,%rax,1)
L204:
  cmp    %rbx,%rbp
  jae    L264
  mov    %rbp,%rax
L244:
  movzbl (%rax),%edx
  lea    -0x41(%rdx),%ecx
  cmp    $0x19,%cl
  ja     L64
  add    $0x20,%edx
  mov    %dl,(%rax)
L64:
  add    $0x1,%rax
  cmp    %rbx,%rax
  jne    L244
L264:
  mov    0x28(%rsp),%r12
  jmp    L245
  nopl   0x0(%rax,%rax,1)
L271:
  xor    %esi,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L74
  movl   $0x1,0xc(%rsp)
  jmp    L174
  nopl   0x0(%rax,%rax,1)
L140:
  mov    0x38(%rsp),%rbx
  jmp    L51
L266:
  call   <__stack_chk_fail@plt>
L170:
  mov    0x28(%rsp),%rdi
  call   <free@plt>
  xor    %eax,%eax
  jmp    L4
```

assistant: ```c
int string_has_highlight(const char *string, const char *highlight_words) {
  char *msg, *highlight, *match, *match_pre, *match_post, *msg_pos;
  char *pos, *pos_end, *ptr_str, *ptr_string_ref;
  int end, length, startswith, endswith, wildcard_start, wildcard_end, flags;
  if (!string || !string[0] || !highlight_words || !highlight_words[0])
    return 0;
  msg = strdup(string);
  if (!msg)
    return 0;
  string_tolower(msg);
  highlight = strdup(highlight_words);
  if (!highlight) {
    free(msg);
    return 0;
  }
  string_tolower(highlight);
  pos = highlight;
  end = 0;
  while (!end) {
    ptr_string_ref = (char *)string;
    flags = 0;
    pos = (char *)string_regex_flags(pos, REG_ICASE, &flags);
    pos_end = strchr(pos, ',');
    if (!pos_end) {
      pos_end = strchr(pos, '\0');
      end = 1;
    }
    if (!pos_end) {
      free(msg);
      free(highlight);
      return 0;
    }
    if (flags & REG_ICASE) {
      for (ptr_str = pos; ptr_str < pos_end; ptr_str++) {
        if ((ptr_str[0] >= 'A') && (ptr_str[0] <= 'Z'))
          ptr_str[0] += ('a' - 'A');
      }
      ptr_string_ref = msg;
    }
    length = pos_end - pos;
    pos_end[0] = '\0';
    if (length > 0) {
      if ((wildcard_start = (pos[0] == '*'))) {
        pos++;
        length--;
      }
      if ((wildcard_end = (*(pos_end - 1) == '*'))) {
        *(pos_end - 1) = '\0';
        length--;
      }
    }
    if (length > 0) {
      msg_pos = ptr_string_ref;
      while ((match = strstr(msg_pos, pos)) != NULL) {
        match_pre = utf8_prev_char(ptr_string_ref, match);
        if (!match_pre)
          match_pre = match - 1;
        match_post = match + length;
        startswith = ((match == ptr_string_ref) || (!string_is_word_char(match_pre)));
        endswith = ((!match_post[0]) || (!string_is_word_char(match_post)));
        if ((wildcard_start && wildcard_end) || (!wildcard_start && !wildcard_end && startswith && endswith) || (wildcard_start && endswith) || (wildcard_end && startswith)) {
          free(msg);
          free(highlight);
          return 1;
        }
        msg_pos = match_post;
      }
    }
    if (!end)
      pos = pos_end + 1;
  }
  free(msg);
  free(highlight);
  return 0;
}
```