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

```asm
<string_has_highlight>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpq   $0x0,-0x78(%rbp)
  je     L42
  mov    -0x78(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L42
  cmpq   $0x0,-0x80(%rbp)
  je     L42
  mov    -0x80(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L369
L42:
  mov    $0x0,%eax
  jmp    L38
L369:
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L258
  mov    $0x0,%eax
  jmp    L38
L258:
  mov    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  jne    L148
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L38
L148:
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  movl   $0x0,-0x60(%rbp)
  jmp    L100
L418:
  movl   $0x0,-0x64(%rbp)
  mov    D1(%rip),%rax
  mov    (%rax),%ecx
  lea    -0x64(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <string_regex_flags@plt>
  mov    %rax,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    $0x2c,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  jne    L239
  mov    -0x38(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x30(%rbp)
  movl   $0x1,-0x60(%rbp)
L239:
  cmpq   $0x0,-0x30(%rbp)
  jne    L17
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L38
L17:
  mov    -0x30(%rbp),%rax
  sub    -0x38(%rbp),%rax
  mov    %eax,-0x5c(%rbp)
  mov    -0x30(%rbp),%rax
  movb   $0x0,(%rax)
  cmpl   $0x0,-0x5c(%rbp)
  jle    L52
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  sete   %al
  movzbl %al,%eax
  mov    %eax,-0x58(%rbp)
  cmpl   $0x0,-0x58(%rbp)
  je     L250
  addq   $0x1,-0x38(%rbp)
  subl   $0x1,-0x5c(%rbp)
L250:
  mov    -0x30(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  sete   %al
  movzbl %al,%eax
  mov    %eax,-0x54(%rbp)
  cmpl   $0x0,-0x54(%rbp)
  je     L52
  mov    -0x30(%rbp),%rax
  sub    $0x1,%rax
  movb   $0x0,(%rax)
  subl   $0x1,-0x5c(%rbp)
L52:
  cmpl   $0x0,-0x5c(%rbp)
  jle    L211
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x40(%rbp)
L222:
  mov    -0x64(%rbp),%edx
  mov    D1(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L380
  mov    -0x38(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <string_strcasestr@plt>
  jmp    L278
L380:
  mov    -0x38(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
L278:
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L311
  mov    -0x18(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <utf8_prev_char@plt>
  mov    %rax,-0x48(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  jne    L45
  mov    -0x18(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x48(%rbp)
L45:
  mov    -0x5c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  je     L252
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <string_is_word_char@plt>
  test   %eax,%eax
  jne    L181
L252:
  mov    $0x1,%eax
  jmp    L264
L181:
  mov    $0x0,%eax
L264:
  mov    %eax,-0x50(%rbp)
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L195
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <string_is_word_char@plt>
  test   %eax,%eax
  jne    L96
L195:
  mov    $0x1,%eax
  jmp    L161
L96:
  mov    $0x0,%eax
L161:
  mov    %eax,-0x4c(%rbp)
  cmpl   $0x0,-0x58(%rbp)
  je     L221
  cmpl   $0x0,-0x54(%rbp)
  jne    L160
L221:
  cmpl   $0x0,-0x58(%rbp)
  jne    L165
  cmpl   $0x0,-0x54(%rbp)
  jne    L165
  cmpl   $0x0,-0x50(%rbp)
  je     L165
  cmpl   $0x0,-0x4c(%rbp)
  jne    L160
L165:
  cmpl   $0x0,-0x58(%rbp)
  je     L36
  cmpl   $0x0,-0x4c(%rbp)
  jne    L160
L36:
  cmpl   $0x0,-0x54(%rbp)
  je     L275
  cmpl   $0x0,-0x50(%rbp)
  je     L275
L160:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x1,%eax
  jmp    L38
L275:
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  jmp    L222
L311:
  nop
L211:
  cmpl   $0x0,-0x60(%rbp)
  jne    L100
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x38(%rbp)
L100:
  cmpl   $0x0,-0x60(%rbp)
  je     L418
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
L38:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L381
  call   <__stack_chk_fail@plt>
L381:
  leave
  ret
```

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;
  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;
  highlight = strdup(highlight_words);
  if (!highlight) {
    free(msg);
    return 0;
  }
  pos = highlight;
  end = 0;
  while (!end) {
    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;
    }
    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 = msg;
      while (1) {
        match = (flags & REG_ICASE) ? string_strcasestr(msg_pos, pos) : strstr(msg_pos, pos);
        if (!match)
          break;
        match_pre = utf8_prev_char(msg, match);
        if (!match_pre)
          match_pre = match - 1;
        match_post = match + length;
        startswith = ((match == msg) || (!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;
}
```