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

```asm
<match>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x20(%rbp)
  mov    -0x20(%rbp),%edi
  mov    -0x20(%rbp),%esi
  mov    -0x18(%rbp),%rcx
  mov    -0x1c(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  sub    $0x8,%rsp
  push   -0x28(%rbp)
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <debug@plt>
  add    $0x10,%rsp
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    $0x2a,%esi
  mov    %rax,%rdi
  call   <memchr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L151
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jne    L181
  mov    -0x20(%rbp),%edx
  mov    -0x28(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L181
  jmp    L157
L151:
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x20(%rbp)
  jl     L82
  mov    -0x8(%rbp),%rax
  sub    -0x18(%rbp),%rax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L180
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L130
  subl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L133
  jmp    L157
L180:
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L7
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L168
  addq   $0x1,-0x8(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    -0xc(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%eax
  sub    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L92
  jmp    L47
L181:
  nop
  jmp    L47
L82:
  nop
  jmp    L47
L133:
  nop
  jmp    L47
L7:
  nop
L47:
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <debug@plt>
  mov    $0x0,%eax
  jmp    L100
L130:
  nop
  jmp    L157
L168:
  nop
  jmp    L157
L92:
  nop
L157:
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <debug@plt>
  mov    $0x1,%eax
L100:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D12
data_type: string
name: disassemble_data
arguments: tag: D29
data_type: string
name: disassemble_data
arguments: tag: D13
data_type: string

tool: D12: match(%*.*s,%*.*s)


tool: D29:  = no


tool: D13:  = yes


assistant: ```c
int match(const char *pattern, int plen, const char *datum, int dlen) {
  const char *asterisk;
  int n;
  debug("match(%*.*s,%*.*s)\n", plen, plen, pattern, dlen, dlen, datum);
  asterisk = memchr(pattern, '*', plen);
  if (!asterisk) {
    if (plen == dlen && memcmp(pattern, datum, dlen) == 0)
      goto yes;
    goto no;
  }
  if (dlen < plen - 1)
    goto no;
  n = asterisk - pattern;
  if (n == 0) {
    pattern++;
    if (!*pattern)
      goto yes;
    plen--;
    if (memcmp(pattern, datum + (dlen - plen), plen) == 0)
      goto yes;
    goto no;
  }
  if (memcmp(pattern, datum, n) != 0)
    goto no;
  if (!asterisk[1])
    goto yes;
  asterisk++;
  n = plen - n - 1;
  if (memcmp(pattern, datum + (dlen - n), n) == 0)
    goto yes;
no:
  debug(" = no\n");
  return 0;
yes:
  debug(" = yes\n");
  return 1;
}
```