user: 下面的汇编指令对应的C源代码是什么:

```asm
<resolve_path>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r14
  mov    %rdx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  cmpb   $0x2f,(%rdi)
  je     L232
L242:
  movb   $0x0,0x0(%r13)
  mov    $0x0,%eax
  cmpb   $0x0,(%r12)
  je     L48
  mov    $0x0,%r15d
  jmp    L155
L232:
  movb   $0x2f,(%rsi)
  lea    0x1(%rsi),%r13
  add    $0x1,%r12
  jmp    L242
L87:
  cmpb   $0x0,0x2(%r12)
  jne    L144
  lea    -0x1(%r13),%rax
  cmp    %rax,%r14
  je     L279
L7:
  sub    $0x1,%rax
  cmpb   $0x2f,(%rax)
  jne    L7
  jmp    L279
L107:
  lea    -0x1(%r13),%rax
  jmp    L279
L178:
  mov    %rsi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L145
  orq    $0x0,-0x8(%rsp,%rax,1)
L145:
  mov    %rsp,-0x50(%rbp)
  mov    %rsp,%rsi
  mov    %r14,%rdi
  call   <readlink@plt>
  test   %rax,%rax
  js     L1
  movb   $0x0,0x0(%r13)
  test   %rbx,%rbx
  je     L170
  movb   $0x2f,(%rbx)
  mov    %rbx,%rsi
  mov    -0x50(%rbp),%rdi
  call   <strcat@plt>
L170:
  mov    -0x50(%rbp),%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  cmpb   $0x2f,(%r12)
  je     L12
L58:
  mov    $0x0,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  mov    %rax,%r13
  mov    -0x48(%rbp),%rsp
  jmp    L155
L1:
  mov    -0x48(%rbp),%rsp
L153:
  mov    $0xffffffff,%eax
  jmp    L48
L12:
  movb   $0x0,0x1(%r14)
  jmp    L58
L49:
  mov    $0x0,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  jmp    L279
L80:
  movb   $0x0,(%rax)
  mov    $0x0,%eax
L48:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L125
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L166:
  mov    %r15,%rbx
L34:
  lea    -0x1(%r13),%rax
L279:
  test   %rbx,%rbx
  je     L80
  lea    0x1(%rax),%r13
  movb   $0x2f,(%rax)
  lea    0x1(%rbx),%r12
  movb   $0x0,0x1(%rax)
L155:
  cmpb   $0x0,(%r12)
  je     L166
  mov    $0x2f,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L131
  movb   $0x0,(%rax)
L131:
  movzbl (%r12),%eax
  test   %al,%al
  je     L34
  cmp    $0x2e,%al
  jne    L144
  movzbl 0x1(%r12),%eax
  test   %al,%al
  je     L107
  cmp    $0x2e,%al
  je     L87
L144:
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <strcpy@plt>
  lea    -0x3c(%rbp),%rsi
  mov    %r14,%rdi
  call   <lstat@plt>
  test   %rax,%rax
  js     L153
  mov    -0x3c(%rbp),%edi
  call   <S_ISLNK@plt>
  test   %rax,%rax
  je     L49
  mov    %rsp,-0x48(%rbp)
  mov    D4(%rip),%rax
  mov    (%rax),%edx
  movslq %edx,%rax
  add    $0xf,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L202:
  cmp    %rcx,%rsp
  je     L178
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L202
L125:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int resolve_path(char *path, char *result, char *pos) {
  if (*path == '/') {
    *result = '/';
    pos = result + 1;
    path++;
  }
  *pos = 0;
  if (!*path)
    return 0;
  while (1) {
    char *slash;
    struct stat st;
    slash = *path ? strchr(path, '/') : NULL;
    if (slash)
      *slash = 0;
    if (!path[0] || (path[0] == '.' && (!path[1] || (path[1] == '.' && !path[2])))) {
      pos--;
      if (pos != result && path[0] && path[1])
        while (*--pos != '/')
          ;
    } else {
      strcpy(pos, path);
      if (lstat(result, &st) < 0)
        return -1;
      if (S_ISLNK(st.st_mode)) {
        char buf[PATH_MAX];
        if (readlink(result, buf, sizeof(buf)) < 0)
          return -1;
        *pos = 0;
        if (slash) {
          *slash = '/';
          strcat(buf, slash);
        }
        strcpy(path, buf);
        if (*path == '/')
          result[1] = 0;
        pos = strchr(result, 0);
        continue;
      }
      pos = strchr(result, 0);
    }
    if (slash) {
      *pos++ = '/';
      path = slash + 1;
    }
    *pos = 0;
    if (!slash)
      break;
  }
  return 0;
}
```