user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<string_match>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  je     L159
  cmpq   $0x0,-0x40(%rbp)
  je     L159
  mov    -0x40(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L265
L159:
  mov    $0x0,%eax
  jmp    L22
L265:
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L205
L97:
  movl   $0x0,-0x30(%rbp)
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L18
  movl   $0x1,-0x30(%rbp)
  addq   $0x1,-0x20(%rbp)
  jmp    L7
L92:
  addq   $0x1,-0x20(%rbp)
L7:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  je     L92
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L18
  mov    $0x1,%eax
  jmp    L22
L18:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L5
  mov    $0x0,%eax
  jmp    L22
L5:
  mov    -0x20(%rbp),%rax
  mov    $0x2a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L34
  mov    -0x18(%rbp),%rax
  sub    -0x20(%rbp),%rax
  mov    %eax,-0x2c(%rbp)
  jmp    L57
L34:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
L57:
  mov    -0x2c(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <string_strndup@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L243
  mov    $0x0,%eax
  jmp    L22
L243:
  cmpl   $0x0,-0x30(%rbp)
  je     L71
  cmpl   $0x0,-0x44(%rbp)
  je     L261
  mov    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  jmp    L48
L261:
  mov    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <string_strcasestr@plt>
L48:
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L6
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L22
L6:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  jmp    L279
L71:
  cmpl   $0x0,-0x44(%rbp)
  je     L93
  mov    -0x2c(%rbp),%edx
  mov    -0x10(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L224
L93:
  cmpl   $0x0,-0x44(%rbp)
  jne    L263
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <utf8_strlen@plt>
  mov    %eax,%edx
  mov    -0x10(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <string_strncasecmp@plt>
  test   %rax,%rax
  je     L263
L224:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L22
L263:
  mov    -0x2c(%rbp),%eax
  cltq
  add    %rax,-0x28(%rbp)
L279:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x20(%rbp)
L205:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L97
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L49
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L49
  mov    $0x1,%eax
  jmp    L22
L49:
  mov    $0x0,%eax
L22:
  leave
  ret
```

assistant: ```c
int string_match(const char *string, const char *mask, int case_sensitive) {
  const char *ptr_string, *ptr_mask, *pos_word, *pos_end;
  char *word;
  int wildcard, length_word;
  if (!string || !mask || !mask[0])
    return 0;
  ptr_string = string;
  ptr_mask = mask;
  while (ptr_mask[0]) {
    wildcard = 0;
    if (ptr_mask[0] == '*') {
      wildcard = 1;
      ptr_mask++;
      while (ptr_mask[0] == '*') {
        ptr_mask++;
      }
      if (!ptr_mask[0])
        return 1;
    }
    if (!string[0])
      return 0;
    pos_end = strchr(ptr_mask, '*');
    if (pos_end) {
      length_word = pos_end - ptr_mask;
    } else {
      length_word = strlen(ptr_mask);
      pos_end = ptr_mask + length_word;
    }
    word = string_strndup(ptr_mask, length_word);
    if (!word)
      return 0;
    if (wildcard) {
      pos_word = (case_sensitive) ? strstr(ptr_string, word) : string_strcasestr(ptr_string, word);
      if (!pos_word) {
        free(word);
        return 0;
      }
      ptr_string = pos_word + length_word;
    } else {
      if ((case_sensitive && (strncmp(ptr_string, word, length_word) != 0)) || (!case_sensitive && (string_strncasecmp(ptr_string, word, utf8_strlen(word)) != 0))) {
        free(word);
        return 0;
      }
      ptr_string += length_word;
    }
    free(word);
    ptr_mask = pos_end;
  }
  if (!ptr_string[0] && !ptr_mask[0])
    return 1;
  return 0;
}
```