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

```asm
<link_path>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x428,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  cmpb   $0x2f,0x0(%rbp)
  je     L5
  lea    0x2(%rbx,%rax,1),%edi
  call   <malloc@plt>
  mov    %r12,%rsi
  mov    %rax,%rdi
  mov    %rax,%r15
  call   <strcpy@plt>
  test   %ebx,%ebx
  jle    L42
  movslq %ebx,%rdx
  lea    -0x1(%rbx),%ecx
  lea    (%rdx,%r15,1),%rax
  sub    $0x1,%rdx
  sub    %rcx,%rdx
  add    %r15,%rdx
  jmp    L33
  nopl   0x0(%rax,%rax,1)
L3:
  movb   $0x0,(%rax)
  sub    $0x1,%rax
  cmp    %rdx,%rax
  je     L42
L33:
  cmpb   $0x2f,(%rax)
  jne    L3
L42:
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
L87:
  movzbl (%r15),%edx
  test   %dl,%dl
  je     L75
  mov    $0x1,%edi
  mov    %r15,%rax
  xor    %esi,%esi
  sub    %r15d,%edi
  nopl   (%rax)
L34:
  lea    (%rdi,%rax,1),%ecx
  cmp    $0x2f,%dl
  jne    L11
  movslq %esi,%rdx
  movb   $0x0,(%rax)
  add    $0x1,%esi
  mov    %ecx,0x10(%rsp,%rdx,4)
L11:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  test   %dl,%dl
  jne    L34
  test   %esi,%esi
  je     L75
  lea    0x14(%rsp),%rbx
  lea    -0x1(%rsi),%eax
  xor    %r12d,%r12d
  lea    (%rbx,%rax,4),%rax
  lea    0x10(%rsp),%r14
  mov    %rbx,0x8(%rsp)
  mov    %rax,(%rsp)
  mov    %r14,%rbx
  nopl   0x0(%rax)
L157:
  movslq (%rbx),%rbp
  mov    %rbp,%r13
  add    %r15,%rbp
  cmpb   $0x0,0x0(%rbp)
  je     L39
  lea    D15(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L39
  lea    D11(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L210
  movslq %r12d,%rax
  add    $0x1,%r12d
  mov    %r13d,0x10(%rsp,%rax,4)
  nop
L39:
  add    $0x4,%rbx
  cmp    (%rsp),%rbx
  jne    L157
  test   %r12d,%r12d
  je     L75
  mov    0x8(%rsp),%rdi
  lea    -0x1(%r12),%eax
  mov    %r15,%rdx
  lea    (%rdi,%rax,4),%rdi
  nopl   0x0(%rax)
L97:
  movslq (%r14),%rax
  movb   $0x2f,(%rdx)
  lea    0x1(%rdx),%rsi
  mov    %rsi,%rdx
  add    %r15,%rax
  movzbl (%rax),%ecx
  test   %cl,%cl
  je     L214
  nop
L95:
  add    $0x1,%rax
  mov    %cl,(%rdx)
  add    $0x1,%rdx
  movzbl (%rax),%ecx
  test   %cl,%cl
  jne    L95
L214:
  add    $0x4,%r14
  cmp    %r14,%rdi
  jne    L97
  cmp    %rdx,%r15
  je     L176
L72:
  movb   $0x0,(%rdx)
  mov    0x418(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L182
  add    $0x428,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L210:
  cmp    $0x1,%r12d
  adc    $0xffffffff,%r12d
  jmp    L39
L75:
  mov    %r15,%rdx
L176:
  movb   $0x2f,(%rdx)
  add    $0x1,%rdx
  jmp    L72
L5:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,%r15
  jmp    L87
L182:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D15
type: string
name: unpack_data
arguments: label: D11
type: string

tool: D15: .

tool: D11: ..

assistant: ```c
char *link_path(char *path, char *link) {
  int lp = strlen(path);
  int ll = strlen(link);
  int i, ncomp, nkeep, comp[256];
  char *ret, *cp, *cp2;
  if (link[0] == '/') {
    ret = strdup(link);
    goto cleanup;
  }
  ret = (char *)malloc(lp + ll + 2);
  strcpy(ret, path);
  for (i = lp; i > 0 && ret[i] != '/'; i--)
    ret[i] = 0;
  strcat(ret, link);
cleanup:
  ncomp = 0;
  for (i = 0; ret[i]; i++)
    if (ret[i] == '/') {
      comp[ncomp++] = i + 1;
      ret[i] = 0;
    }
  nkeep = 0;
  for (i = 0; i < ncomp; i++) {
    cp = ret + comp[i];
    if (*cp == 0)
      continue;
    if (strcmp(cp, ".") == 0)
      continue;
    if (strcmp(cp, "..") == 0) {
      if (nkeep > 0)
        nkeep--;
      continue;
    }
    comp[nkeep++] = comp[i];
  }
  cp = ret;
  for (i = 0; i < nkeep; i++) {
    cp2 = ret + comp[i];
    *cp++ = '/';
    while (*cp2) {
      *cp++ = *cp2++;
    }
  }
  if (cp == ret)
    *cp++ = '/';
  *cp = 0;
  return ret;
}
```