user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<ups_autolink__url>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  movq   $0x0,-0x10(%rbp)
  cmpq   $0x3,-0x48(%rbp)
  jbe    L129
  mov    -0x38(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L129
  mov    -0x38(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L28
L129:
  mov    $0x0,%eax
  jmp    L145
L21:
  addq   $0x1,-0x10(%rbp)
L28:
  mov    -0x10(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  jae    L144
  mov    -0x10(%rbp),%rax
  not    %rax
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L21
L144:
  mov    -0x48(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rax
  neg    %rax
  mov    %rax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <is_safe_link@plt>
  test   %eax,%eax
  jne    L107
  mov    $0x0,%eax
  jmp    L145
L107:
  movq   $0x3,-0x18(%rbp)
  mov    -0x48(%rbp),%rax
  sub    -0x18(%rbp),%rax
  mov    -0x38(%rbp),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <check_domain@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L83
  mov    $0x0,%eax
  jmp    L145
L83:
  mov    -0x8(%rbp),%rax
  add    %rax,-0x18(%rbp)
  jmp    L40
L120:
  addq   $0x1,-0x18(%rbp)
L40:
  mov    -0x18(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  jae    L127
  mov    -0x38(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %eax,%eax
  je     L120
L127:
  mov    -0x48(%rbp),%rcx
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <autolink_delim@plt>
  cltq
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L12
  mov    $0x0,%eax
  jmp    L145
L12:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rax
  neg    %rax
  mov    %rax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rax,%rcx
  mov    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <bufput@plt>
  mov    -0x28(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x18(%rbp),%rax
L145:
  leave
  ret
```

assistant: ```c
size_t ups_autolink__url(size_t *rewind_p, struct buf *link, char *data, size_t offset, size_t size) {
  size_t link_end, rewind = 0, domain_len;
  if (size < 4 || data[1] != '/' || data[2] != '/')
    return 0;
  while (rewind < offset && isalpha(data[-rewind - 1]))
    rewind++;
  if (!is_safe_link(data - rewind, size + rewind))
    return 0;
  link_end = (sizeof("://") - 1);
  domain_len = check_domain(data + link_end, size - link_end);
  if (domain_len == 0)
    return 0;
  link_end += domain_len;
  while (link_end < size && !isspace(data[link_end]))
    link_end++;
  link_end = autolink_delim(data, link_end, offset, size);
  if (link_end == 0)
    return 0;
  bufput(link, data - rewind, link_end + rewind);
  *rewind_p = rewind;
  return link_end;
}
```