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

```asm
<compare_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L117
  cmpq   $0x0,-0x30(%rbp)
  jne    L7
L117:
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L7
L146:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L44
  movl   $0x1,-0x18(%rbp)
  addq   $0x1,-0x8(%rbp)
  jmp    L68
L44:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L53
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L53
  movl   $0x1,-0x18(%rbp)
  addq   $0x2,-0x8(%rbp)
  jmp    L68
L53:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L24
  cmpl   $0x0,-0x14(%rbp)
  jne    L139
  mov    -0x10(%rbp),%rax
  sub    -0x28(%rbp),%rax
  mov    %eax,-0x14(%rbp)
L139:
  addq   $0x1,-0x8(%rbp)
  jmp    L58
L24:
  cmpl   $0x0,-0x18(%rbp)
  jne    L58
  movl   $0x0,-0x14(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
L58:
  addq   $0x1,-0x10(%rbp)
L68:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L7
  mov    -0x10(%rbp),%rax
  sub    -0x28(%rbp),%rax
  mov    %rax,%rsi
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L35
L7:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L146
  mov    -0x28(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L35:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D17
datatype: string
name: disassemble_data
arguments: data_tag: D4
datatype: string
name: disassemble_data
arguments: data_tag: D23
datatype: string

tool: D17: invalid string of NULL.

tool: D4: %s is substring to %s, start_index=%d, end_index=%d


tool: D23: %s is not substring to %s


assistant: ```c
void compare_string(char *str1, char *str2) {
  char *pstr1_tmp = str1;
  char *pstr2_tmp = str2;
  uint8_t star_mode_on = 0;
  uint16_t start_index = 0;
  if (str1 == NULL || str2 == NULL) {
    printf("invalid string of NULL.\n");
  }
  while (*pstr1_tmp != '\0') {
    if (*pstr2_tmp == '*') {
      star_mode_on = 1;
      pstr2_tmp += 1;
    } else if (*pstr2_tmp == '\\' && *(pstr2_tmp + 1) == '*') {
      star_mode_on = 1;
      pstr2_tmp += 2;
    } else {
      if (*pstr2_tmp == *pstr1_tmp) {
        if (start_index == 0) {
          start_index = pstr1_tmp - str1;
        }
        pstr2_tmp += 1;
      } else {
        if (star_mode_on == 0) {
          start_index = 0;
          pstr2_tmp = str2;
        }
      }
      pstr1_tmp += 1;
    }
    if (*pstr2_tmp == '\0') {
      printf("%s is substring to %s, start_index=%d, end_index=%d\n", str2, str1, start_index, pstr1_tmp - str1);
      return;
    }
  }
  printf("%s is not substring to %s\n", str2, str1);
}
```