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

```asm
<abs2rel>:
  endbr64
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x8,%rsp
  cmpb   $0x2f,(%rdi)
  je     L249
  call   <strlen@plt>
  mov    %eax,%eax
  cmp    %r12,%rax
  jae    L255
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rax
L208:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L255:
  mov    D32(%rip),%rax
  mov    (%rax),%edx
  mov    D14(%rip),%rax
  mov    %edx,(%rax)
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L249:
  cmpb   $0x2f,(%rsi)
  mov    %rsi,%r8
  jne    L193
  test   %rcx,%rcx
  je     L193
  cmp    $0x1,%rcx
  je     L255
  lea    -0x1(%rdx,%rcx,1),%r12
  mov    %rdi,%rax
  mov    %rsi,%rcx
  jmp    L301
  nopl   0x0(%rax,%rax,1)
L36:
  test   %sil,%sil
  je     L259
  cmp    $0x2f,%dl
  cmove  %rax,%rdi
L301:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  add    $0x1,%rcx
  test   %dl,%dl
  je     L292
  movzbl (%rcx),%esi
  cmp    %sil,%dl
  je     L36
L259:
  cmp    $0x2f,%dl
  je     L90
L190:
  mov    %rdi,%rax
  sub    %rbp,%rax
  mov    %rbx,%rbp
  add    %r8,%rax
  movzbl (%rax),%edx
  test   %dl,%dl
  je     L176
  nopl   0x0(%rax)
L205:
  movzbl 0x1(%rax),%ecx
  cmp    $0x2f,%dl
  je     L95
L72:
  mov    %ecx,%edx
L35:
  add    $0x1,%rax
  test   %dl,%dl
  jne    L205
L176:
  cmp    %rbp,%r12
  jb     L255
  movb   $0x0,0x0(%rbp)
  cmpb   $0x0,(%rdi)
  je     L117
  lea    0x1(%rdi),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  cltq
  add    %rbp,%rax
  cmp    %rax,%r12
  jb     L255
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rax
  jmp    L208
  xchg   %ax,%ax
L193:
  mov    D29(%rip),%rax
  mov    (%rax),%edx
  mov    D14(%rip),%rax
  mov    %edx,(%rax)
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nop
L95:
  cmp    $0x2f,%cl
  je     L72
  test   %cl,%cl
  je     L72
  lea    0x3(%rbp),%rcx
  cmp    %rcx,%r12
  jb     L255
  mov    $0x2e2e,%edx
  movb   $0x2f,0x2(%rbp)
  mov    %dx,0x0(%rbp)
  mov    %rcx,%rbp
  movzbl 0x1(%rax),%edx
  jmp    L35
  nop
L292:
  movzbl (%rcx),%esi
  test   %sil,%sil
  je     L130
  cmp    $0x2f,%sil
  jne    L190
  cmpb   $0x0,0x1(%rcx)
  je     L130
  test   %dl,%dl
  cmove  %rax,%rdi
  jmp    L190
  nopl   0x0(%rax,%rax,1)
L130:
  movb   $0x2e,(%rbx)
  cmpb   $0x2f,(%rax)
  je     L189
  cmpb   $0x2f,-0x1(%rax)
  je     L189
  lea    0x1(%rbx),%rax
L272:
  cmp    %r12,%rax
  ja     L255
  movb   $0x0,(%rax)
  mov    %rbx,%rax
  jmp    L208
  xchg   %ax,%ax
L117:
  movb   $0x0,-0x1(%rbp)
  mov    %rbx,%rax
  jmp    L208
  nopl   0x0(%rax)
L189:
  movb   $0x2f,0x1(%rbx)
  lea    0x2(%rbx),%rax
  jmp    L272
  nopw   0x0(%rax,%rax,1)
L90:
  cmpb   $0x0,0x1(%rax)
  je     L292
  test   %sil,%sil
  cmove  %rax,%rdi
  jmp    L190
```

assistant: ```c
char *abs2rel(const char *path, const char *base, char *result, const size_t size) {
  const char *pp, *bp, *branch;
  const char *endp = result + size - 1;
  char *rp;
  if (*path != '/') {
    if ((unsigned int)strlen(path) >= size)
      goto erange;
    strcpy(result, path);
    goto finish;
  } else if (*base != '/' || !size) {
    errno = EINVAL;
    return (NULL);
  } else if (size == 1)
    goto erange;
  branch = path;
  for (pp = path, bp = base; *pp && *bp && *pp == *bp; pp++, bp++)
    if (*pp == '/')
      branch = pp;
  if ((*pp == 0 || (*pp == '/' && *(pp + 1) == 0)) && (*bp == 0 || (*bp == '/' && *(bp + 1) == 0))) {
    rp = result;
    *rp++ = '.';
    if (*pp == '/' || *(pp - 1) == '/')
      *rp++ = '/';
    if (rp > endp)
      goto erange;
    *rp = 0;
    goto finish;
  }
  if ((*pp == 0 && *bp == '/') || (*pp == '/' && *bp == 0))
    branch = pp;
  rp = result;
  for (bp = base + (branch - path); *bp; bp++)
    if (*bp == '/' && *(bp + 1) != 0 && *(bp + 1) != '/') {
      if (rp + 3 > endp)
        goto erange;
      *rp++ = '.';
      *rp++ = '.';
      *rp++ = '/';
    }
  if (rp > endp)
    goto erange;
  *rp = 0;
  if (*branch) {
    if (rp + (int)strlen(branch + 1) > endp)
      goto erange;
    strcpy(rp, branch + 1);
  } else
    *--rp = 0;
finish:
  return result;
erange:
  errno = ERANGE;
  return (NULL);
}
```