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     L14
  call   <strlen@plt>
  mov    %eax,%eax
  cmp    %r12,%rax
  jae    L97
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rax
L201:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L97:
  mov    D8(%rip),%rax
  mov    (%rax),%edx
  mov    D23(%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)
L14:
  cmpb   $0x2f,(%rsi)
  mov    %rsi,%r8
  jne    L130
  test   %rcx,%rcx
  je     L130
  cmp    $0x1,%rcx
  je     L97
  lea    -0x1(%rdx,%rcx,1),%r12
  mov    %rdi,%rax
  mov    %rsi,%rcx
  jmp    L58
  nopl   0x0(%rax,%rax,1)
L257:
  test   %sil,%sil
  je     L163
  cmp    $0x2f,%dl
  cmove  %rax,%rdi
L58:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  add    $0x1,%rcx
  test   %dl,%dl
  je     L266
  movzbl (%rcx),%esi
  cmp    %sil,%dl
  je     L257
L163:
  cmp    $0x2f,%dl
  je     L102
L156:
  mov    %rdi,%rax
  sub    %rbp,%rax
  mov    %rbx,%rbp
  add    %r8,%rax
  movzbl (%rax),%edx
  test   %dl,%dl
  je     L265
  nopl   0x0(%rax)
L142:
  movzbl 0x1(%rax),%ecx
  cmp    $0x2f,%dl
  je     L209
L134:
  mov    %ecx,%edx
L91:
  add    $0x1,%rax
  test   %dl,%dl
  jne    L142
L265:
  cmp    %rbp,%r12
  jb     L97
  movb   $0x0,0x0(%rbp)
  cmpb   $0x0,(%rdi)
  je     L286
  lea    0x1(%rdi),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  cltq
  add    %rbp,%rax
  cmp    %rax,%r12
  jb     L97
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rax
  jmp    L201
  xchg   %ax,%ax
L130:
  mov    D31(%rip),%rax
  mov    (%rax),%edx
  mov    D23(%rip),%rax
  mov    %edx,(%rax)
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nop
L209:
  cmp    $0x2f,%cl
  je     L134
  test   %cl,%cl
  je     L134
  lea    0x3(%rbp),%rcx
  cmp    %rcx,%r12
  jb     L97
  mov    $0x2e2e,%edx
  movb   $0x2f,0x2(%rbp)
  mov    %dx,0x0(%rbp)
  mov    %rcx,%rbp
  movzbl 0x1(%rax),%edx
  jmp    L91
  nop
L266:
  movzbl (%rcx),%esi
  test   %sil,%sil
  je     L236
  cmp    $0x2f,%sil
  jne    L156
  cmpb   $0x0,0x1(%rcx)
  je     L236
  test   %dl,%dl
  cmove  %rax,%rdi
  jmp    L156
  nopl   0x0(%rax,%rax,1)
L236:
  movb   $0x2e,(%rbx)
  cmpb   $0x2f,(%rax)
  je     L53
  cmpb   $0x2f,-0x1(%rax)
  je     L53
  lea    0x1(%rbx),%rax
L73:
  cmp    %r12,%rax
  ja     L97
  movb   $0x0,(%rax)
  mov    %rbx,%rax
  jmp    L201
  xchg   %ax,%ax
L286:
  movb   $0x0,-0x1(%rbp)
  mov    %rbx,%rax
  jmp    L201
  nopl   0x0(%rax)
L53:
  movb   $0x2f,0x1(%rbx)
  lea    0x2(%rbx),%rax
  jmp    L73
  nopw   0x0(%rax,%rax,1)
L102:
  cmpb   $0x0,0x1(%rax)
  je     L266
  test   %sil,%sil
  cmove  %rax,%rdi
  jmp    L156
```

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);
}
```