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

```asm
<autolink_delim>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %rsi,%rsi
  jne    L94
  jmp    L120
  nopw   0x0(%rax,%rax,1)
L296:
  add    $0x1,%r12
  cmp    %r12,%rsi
  je     L34
L94:
  cmpb   $0x3c,0x0(%rbp,%r12,1)
  jne    L296
  test   %r12,%r12
  je     L120
L34:
  lea    D3(%rip),%r14
  jmp    L289
  nopl   0x0(%rax,%rax,1)
L112:
  test   %r13,%r13
  je     L120
L295:
  mov    %r13,%r12
L289:
  lea    -0x1(%r12),%r13
  mov    %r14,%rdi
  lea    0x0(%rbp,%r13,1),%rbx
  movsbl (%rbx),%esi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L112
  movzbl (%rbx),%ecx
  cmp    $0x3b,%cl
  jne    L103
  sub    $0x2,%r12
  mov    %r12,%rbx
  jne    L58
  jmp    L295
  nopl   (%rax)
L48:
  sub    $0x1,%rbx
  je     L232
L58:
  movsbl 0x0(%rbp,%rbx,1),%edi
  lea    0x0(%rbp,%rbx,1),%r15
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L48
  cmp    %rbx,%r12
  jbe    L112
  cmpb   $0x26,(%r15)
  jne    L112
  mov    %rbx,%r13
  jmp    L295
  nopw   0x0(%rax,%rax,1)
L232:
  cmpb   $0x26,0x0(%rbp)
  jne    L112
L120:
  xor    %r12d,%r12d
L224:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L103:
  cmp    $0x29,%cl
  je     L128
  jle    L302
  cmp    $0x5d,%cl
  je     L18
  cmp    $0x7d,%cl
  jne    L224
  mov    $0x7b,%edi
L10:
  xor    %eax,%eax
  xor    %r8d,%r8d
  xor    %esi,%esi
  jmp    L285
  nopw   0x0(%rax,%rax,1)
L46:
  cmp    %dl,%cl
  sete   %dl
  add    $0x1,%rax
  movzbl %dl,%edx
  add    %rdx,%rsi
  cmp    %r12,%rax
  jae    L165
L285:
  movzbl 0x0(%rbp,%rax,1),%edx
  cmp    %dil,%dl
  jne    L46
  add    $0x1,%rax
  add    $0x1,%r8
  cmp    %r12,%rax
  jb     L285
L165:
  cmp    %rsi,%r8
  cmovne %r13,%r12
  jmp    L224
  nopl   0x0(%rax)
L302:
  cmp    $0x22,%cl
  je     L275
  cmp    $0x27,%cl
  jne    L224
  mov    $0x27,%edi
  jmp    L10
  nopl   0x0(%rax)
L275:
  mov    $0x22,%edi
  jmp    L10
  nop
L18:
  mov    $0x5b,%edi
  jmp    L10
L128:
  mov    $0x28,%edi
  jmp    L10
```

tool_calls: name: unpack_data
arguments: data_label: D3
data_type: string

tool: D3: ?!.,

assistant: ```c
size_t autolink_delim(char *data, size_t link_end, size_t offset, size_t size) {
  char cclose, copen = 0;
  size_t i;
  for (i = 0; i < link_end; ++i)
    if (data[i] == '<') {
      link_end = i;
      break;
    }
  while (link_end > 0) {
    if (strchr("?!.,", data[link_end - 1]) != NULL)
      link_end--;
    else if (data[link_end - 1] == ';') {
      size_t new_end = link_end - 2;
      while (new_end > 0 && isalpha(data[new_end]))
        new_end--;
      if (new_end < link_end - 2 && data[new_end] == '&')
        link_end = new_end;
      else
        link_end--;
    } else
      break;
  }
  if (link_end == 0)
    return 0;
  cclose = data[link_end - 1];
  switch (cclose) {
  case '"':
    copen = '"';
    break;
  case '\'':
    copen = '\'';
    break;
  case ')':
    copen = '(';
    break;
  case ']':
    copen = '[';
    break;
  case '}':
    copen = '{';
    break;
  }
  if (copen != 0) {
    size_t closing = 0;
    size_t opening = 0;
    size_t i = 0;
    while (i < link_end) {
      if (data[i] == copen)
        opening++;
      else if (data[i] == cclose)
        closing++;
      i++;
    }
    if (closing != opening)
      link_end--;
  }
  return link_end;
}
```