user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<resolve>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbp
  call   <strlen@plt>
  mov    %rbp,%r13
  test   %eax,%eax
  je     L76
  mov    %rax,%rbx
  mov    %eax,%r15d
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rax,%r14
  mov    %r12,%r13
  test   %eax,%eax
  je     L76
  cmp    $0x1,%eax
  jle    L114
  cmpb   $0x5c,0x0(%rbp)
  je     L92
  movslq %ebx,%rax
  cmpb   $0x5c,-0x1(%r12,%rax,1)
  je     L102
  add    %r14d,%ebx
  movl   $0x0,0xc(%rsp)
  jmp    L115
L92:
  movl   $0x1,0xc(%rsp)
  cmpb   $0x5c,0x1(%rbp)
  jne    L79
  cmp    $0x2,%eax
  jne    L50
  movslq %ebx,%rbx
  cmpb   $0x5c,-0x1(%r12,%rbx,1)
  jne    L76
  mov    %r12,%rdi
  call   <strdup@plt>
  mov    %rax,%r13
  movb   $0x0,-0x1(%rax,%rbx,1)
  jmp    L76
L114:
  movl   $0x0,0xc(%rsp)
L79:
  movslq %ebx,%rax
  cmpb   $0x5c,-0x1(%r12,%rax,1)
  je     L45
L62:
  lea    (%r15,%r14,1),%ebx
  mov    0xc(%rsp),%eax
  sub    %eax,%ebx
  cltq
  add    %rax,%rbp
  cmpb   $0x5c,0x0(%rbp)
  je     L49
L115:
  lea    0x2(%rbx),%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    %r15d,%edx
  mov    %r12,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movslq %r15d,%r15
  movb   $0x5c,0x0(%r13,%r15,1)
  mov    %r14d,%edx
  sub    0xc(%rsp),%edx
  lea    0x1(%r13,%r15,1),%rdi
  mov    %rbp,%rsi
  call   <memcpy@plt>
  movslq %ebx,%rbx
  movb   $0x0,0x1(%r13,%rbx,1)
L76:
  mov    %r13,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L50:
  movl   $0x2,0xc(%rsp)
  jmp    L79
L102:
  movl   $0x0,0xc(%rsp)
L45:
  lea    -0x1(%rbx),%r15d
  jmp    L62
L49:
  lea    0x1(%rbx),%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    %r15d,%edx
  mov    %r12,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    %r14d,%edx
  sub    0xc(%rsp),%edx
  movslq %r15d,%rdi
  add    %r13,%rdi
  mov    %rbp,%rsi
  call   <memcpy@plt>
  movslq %ebx,%rbx
  movb   $0x0,0x0(%r13,%rbx,1)
  jmp    L76
```

assistant: ```c
char *resolve(const char *parent, const char *child) {
  char *c;
  char *theChars;
  int parentEnd, childStart, len;
  int pn = (int)strlen(parent);
  int cn = (int)strlen(child);
  if (pn == 0)
    return (char *)child;
  if (cn == 0)
    return (char *)parent;
  c = (char *)child;
  childStart = 0;
  parentEnd = pn;
  if ((cn > 1) && (c[0] == '\\')) {
    if (c[1] == '\\') {
      childStart = 2;
    } else {
      childStart = 1;
    }
    if (cn == childStart) {
      if (parent[pn - 1] == '\\') {
        char *str = strdup(parent);
        str[pn - 1] = '\0';
        return str;
      }
      return (char *)parent;
    }
  }
  if (parent[pn - 1] == '\\')
    parentEnd--;
  len = parentEnd + cn - childStart;
  if (child[childStart] == '\\') {
    theChars = (char *)malloc(len + 1);
    memcpy(theChars, parent, parentEnd);
    memcpy(theChars + parentEnd, child + childStart, (cn - childStart));
    theChars[len] = '\0';
  } else {
    theChars = (char *)malloc(len + 2);
    memcpy(theChars, parent, parentEnd);
    theChars[parentEnd] = '\\';
    memcpy(theChars + parentEnd + 1, child + childStart, (cn - childStart));
    theChars[len + 1] = '\0';
  }
  return theChars;
}
```