user: 请将以下的汇编代码转换成C语言代码:

```asm
<link_path>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x428,%rsp
  mov    %rdi,%r13
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %eax,%r12d
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmpb   $0x2f,0x0(%rbp)
  je     L12
  lea    0x2(%r12,%rax,1),%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    %rax,(%rsp)
  mov    %r13,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  test   %r12d,%r12d
  jle    L23
  movslq %r12d,%rdx
  lea    (%rdx,%rbx,1),%rax
  sub    $0x1,%rdx
  lea    -0x1(%r12),%ecx
  sub    %rcx,%rdx
  add    %rbx,%rdx
L36:
  cmpb   $0x2f,(%rax)
  je     L23
  movb   $0x0,(%rax)
  sub    $0x1,%rax
  cmp    %rdx,%rax
  jne    L36
L23:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
L5:
  mov    (%rsp),%rsi
  mov    %rsi,%rax
  movzbl (%rsi),%edx
  test   %dl,%dl
  je     L54
  mov    $0x0,%ecx
  mov    $0x1,%edi
  sub    %esi,%edi
  jmp    L66
L12:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,(%rsp)
  jmp    L5
L166:
  add    $0x1,%rax
  movzbl (%rax),%edx
  test   %dl,%dl
  je     L215
L66:
  cmp    $0x2f,%dl
  jne    L166
  movslq %ecx,%rdx
  lea    (%rdi,%rax,1),%esi
  mov    %esi,0x10(%rsp,%rdx,4)
  movb   $0x0,(%rax)
  lea    0x1(%rcx),%ecx
  jmp    L166
L215:
  test   %ecx,%ecx
  jle    L54
  lea    0x10(%rsp),%rbp
  lea    0x14(%rsp),%rdi
  mov    %rdi,0x8(%rsp)
  lea    -0x1(%rcx),%eax
  lea    (%rdi,%rax,4),%r14
  mov    %rbp,%r12
  mov    $0x0,%r15d
  jmp    L178
L235:
  test   %r15d,%r15d
  setg   %al
  movzbl %al,%eax
  sub    %eax,%r15d
L193:
  add    $0x4,%r12
  cmp    %r14,%r12
  je     L165
L178:
  mov    (%r12),%r13d
  movslq %r13d,%rbx
  add    (%rsp),%rbx
  cmpb   $0x0,(%rbx)
  je     L193
  lea    D18(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L193
  lea    D10(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L235
  movslq %r15d,%rax
  mov    %r13d,0x10(%rsp,%rax,4)
  lea    0x1(%r15),%r15d
  jmp    L193
L165:
  test   %r15d,%r15d
  jle    L54
  lea    -0x1(%r15),%eax
  mov    0x8(%rsp),%rdi
  lea    (%rdi,%rax,4),%rsi
  mov    (%rsp),%rdx
L140:
  movslq 0x0(%rbp),%rax
  add    (%rsp),%rax
  lea    0x1(%rdx),%rcx
  movb   $0x2f,(%rdx)
  movzbl (%rax),%edx
  test   %dl,%dl
  je     L247
L7:
  add    $0x1,%rax
  add    $0x1,%rcx
  mov    %dl,-0x1(%rcx)
  movzbl (%rax),%edx
  test   %dl,%dl
  jne    L7
  mov    %rcx,%rdx
L62:
  add    $0x4,%rbp
  cmp    %rsi,%rbp
  jne    L140
  cmp    %rdx,(%rsp)
  je     L49
L153:
  movb   $0x0,(%rdx)
  mov    0x418(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  mov    (%rsp),%rax
  add    $0x428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L247:
  mov    %rcx,%rdx
  jmp    L62
L54:
  mov    (%rsp),%rdx
L49:
  movb   $0x2f,(%rdx)
  lea    0x1(%rdx),%rdx
  jmp    L153
L10:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D18
type_infered: string
name: unpack_data
arguments: label: D10
type_infered: string

tool: D18: .

tool: D10: ..

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