user: What is the c source code of the assembly code below:

```asm
<realpath>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    %rsi,-0x48(%rbp)
  mov    %rsp,%rcx
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  mov    D69(%rip),%rax
  movslq (%rax),%rax
  mov    %eax,-0x6c(%rbp)
  mov    %rax,-0x58(%rbp)
  lea    0xf(%rax,%rax,1),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L350
L303:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L303
L350:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L234
L258:
  mov    %rsp,-0x68(%rbp)
  test   %r15,%r15
  je     L342
  cmpq   $0x0,-0x48(%rbp)
  movq   $0x0,-0x78(%rbp)
  je     L138
L178:
  movzbl (%r15),%edx
  test   %dl,%dl
  je     L25
  mov    -0x48(%rbp),%rdi
  mov    %rdi,%r12
  cmp    $0x2f,%dl
  je     L267
  mov    D69(%rip),%rax
  mov    (%rax),%esi
  call   <getcwd@plt>
  test   %rax,%rax
  je     L230
  mov    -0x48(%rbp),%rdi
  call   <strlen@plt>
  cmp    $0x1,%rax
  jbe    L297
  mov    -0x48(%rbp),%rsi
  lea    (%rsi,%rax,1),%r12
L297:
  movzbl (%r15),%edx
L267:
  lea    -0x3c(%rbp),%rax
  movl   $0x0,-0x5c(%rbp)
  mov    %r15,%r14
  movl   $0x0,-0x60(%rbp)
  mov    %rax,-0x50(%rbp)
  nopl   0x0(%rax)
L278:
  cmp    $0x2f,%dl
  je     L94
L183:
  mov    -0x48(%rbp),%rbx
L432:
  test   %dl,%dl
  je     L206
  mov    %r14,%r15
L269:
  mov    %r15,%r13
  movzbl 0x1(%r15),%eax
  add    $0x1,%r15
  cmp    $0x2f,%al
  je     L194
  test   %al,%al
  jne    L269
L194:
  cmp    $0x2e,%dl
  je     L403
L11:
  mov    D69(%rip),%rcx
  mov    %r12,%rax
  sub    %rbx,%rax
  lea    0x1(%r15,%rax,1),%rax
  movslq (%rcx),%rdx
  sub    %r14,%rax
  cmp    %rdx,%rax
  jge    L305
  movb   $0x2f,(%r12)
  mov    %r15,%rdx
  mov    %r14,%rsi
  lea    0x1(%r12),%rdi
  sub    %r14,%rdx
  call   <memcpy@plt>
  lea    0x2(%r13),%rax
  mov    -0x50(%rbp),%rsi
  mov    %rbx,%rdi
  sub    %r14,%rax
  lea    (%r12,%rax,1),%r14
  movb   $0x0,(%r14)
  call   <lstat@plt>
  cmp    $0xffffffff,%eax
  je     L256
  mov    -0x3c(%rbp),%edi
  call   <S_ISLNK@plt>
  test   %rax,%rax
  je     L47
  mov    -0x5c(%rbp),%ecx
  lea    0x1(%rcx),%eax
  mov    %eax,-0x5c(%rbp)
  mov    D93(%rip),%rax
  cmp    %ecx,(%rax)
  jle    L174
  movslq -0x60(%rbp),%r14
  mov    -0x58(%rbp),%rbx
  mov    -0x68(%rbp),%rax
  mov    -0x48(%rbp),%rdi
  imul   %r14,%rbx
  lea    (%rax,%rbx,1),%r14
  mov    -0x6c(%rbp),%eax
  mov    %r14,%rsi
  lea    -0x1(%rax),%edx
  call   <readlink@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L65
  mov    %r15,%rdi
  call   <strlen@plt>
  lea    0x1(%r13,%rax,1),%rdx
  cmp    %rdx,-0x58(%rbp)
  jb     L288
  lea    0x1(%rax),%rdx
  lea    (%rbx,%r13,1),%rdi
  mov    %r15,%rsi
  add    -0x68(%rbp),%rdi
  call   <memcpy@plt>
  movzbl (%r14),%edx
  xorl   $0x1,-0x60(%rbp)
  cmp    $0x2f,%dl
  cmove  -0x48(%rbp),%r12
  cmp    $0x2f,%dl
  jne    L183
L94:
  movzbl 0x1(%r14),%edx
  add    $0x1,%r14
  jmp    L278
  nopw   0x0(%rax,%rax,1)
L47:
  movzbl (%r15),%edx
  mov    %r14,%r12
  mov    %r15,%r14
  cmp    $0x2f,%dl
  jne    L432
  mov    -0x3c(%rbp),%edi
  call   <S_ISDIR@plt>
  test   %eax,%eax
  je     L443
  movzbl 0x1(%r13),%edx
  jmp    L278
  nopl   (%rax)
L403:
  mov    %r15,%rdx
  sub    %r14,%rdx
  cmp    $0x1,%rdx
  je     L330
  cmpb   $0x2e,0x1(%r14)
  jne    L11
  cmp    $0x2,%rdx
  jne    L11
  cmp    %r12,-0x48(%rbp)
  je     L330
L100:
  sub    $0x1,%r12
  cmpb   $0x2f,(%r12)
  jne    L100
L330:
  mov    %eax,%edx
  mov    %r15,%r14
  jmp    L278
L25:
  mov    -0x48(%rbp),%rax
  movb   $0x0,(%rax)
  mov    D38(%rip),%rax
  mov    (%rax),%edx
  mov    D44(%rip),%rax
  mov    %edx,(%rax)
L256:
  mov    -0x78(%rbp),%rdi
  call   <free@plt>
  xor    %eax,%eax
L150:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L465
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L234:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L258
L206:
  cmp    %r12,-0x48(%rbp)
  je     L106
L179:
  movb   $0x0,(%r12)
  mov    -0x48(%rbp),%rax
  jmp    L150
L138:
  mov    -0x6c(%rbp),%edi
  call   <malloc@plt>
  mov    %rax,-0x48(%rbp)
  test   %rax,%rax
  je     L33
  mov    %rax,-0x78(%rbp)
  jmp    L178
L305:
  mov    D16(%rip),%rax
  mov    (%rax),%edx
  mov    D44(%rip),%rax
  mov    %edx,(%rax)
  cmp    %r12,-0x48(%rbp)
  je     L386
L430:
  movb   $0x0,(%r12)
  jmp    L256
L342:
  mov    D33(%rip),%rax
  mov    (%rax),%edx
  mov    D44(%rip),%rax
  mov    %edx,(%rax)
  xor    %eax,%eax
  jmp    L150
L174:
  mov    D42(%rip),%rax
  mov    (%rax),%edx
  mov    D44(%rip),%rax
  mov    %edx,(%rax)
  jmp    L256
L65:
  mov    D38(%rip),%rax
  mov    (%rax),%edx
  mov    D44(%rip),%rax
  mov    %edx,(%rax)
  jmp    L256
L288:
  mov    D16(%rip),%rax
  mov    (%rax),%edx
  mov    D44(%rip),%rax
  mov    %edx,(%rax)
  jmp    L256
L106:
  mov    -0x48(%rbp),%rax
  movb   $0x2f,(%rax)
  lea    0x1(%rax),%r12
  jmp    L179
L386:
  movb   $0x2f,(%r12)
  add    $0x1,%r12
  jmp    L430
L230:
  mov    -0x48(%rbp),%rax
  mov    $0x2e,%edx
  mov    %dx,(%rax)
  jmp    L256
L443:
  mov    D150(%rip),%rax
  mov    (%rax),%edx
  mov    D44(%rip),%rax
  mov    %edx,(%rax)
  jmp    L256
L33:
  xor    %eax,%eax
  jmp    L150
L465:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *realpath(const char *path, char *resolved) {
  struct stat sb;
  int idx = 0, nlnk = 0;
  const char *q;
  char *p, wbuf[2][MAXPATHLEN], *fres;
  size_t len;
  ssize_t n;
  if (path == NULL) {
    errno = EINVAL;
    return NULL;
  }
  if (resolved == NULL) {
    fres = resolved = malloc(MAXPATHLEN);
    if (resolved == NULL)
      return NULL;
  } else
    fres = NULL;
  p = resolved;
  if (*path == '\0') {
    *p = '\0';
    errno = ENOENT;
    goto out;
  }
  if (*path != '/') {
    if (resolved && getcwd(resolved, MAXPATHLEN) == NULL) {
      p[0] = '.';
      p[1] = '\0';
      goto out;
    }
    len = strlen(resolved);
    if (len > 1)
      p += len;
  }
loop:
  while (*path == '/')
    path++;
  if (*path == '\0') {
    if (p == resolved)
      *p++ = '/';
    *p = '\0';
    return resolved;
  }
  q = path;
  do
    q++;
  while (*q != '/' && *q != '\0');
  if (path[0] == '.') {
    if (q - path == 1) {
      path = q;
      goto loop;
    }
    if (path[1] == '.' && q - path == 2) {
      if (p != resolved)
        while (*--p != '/')
          continue;
      path = q;
      goto loop;
    }
  }
  if (p - resolved + 1 + q - path + 1 > MAXPATHLEN) {
    errno = ENAMETOOLONG;
    if (p == resolved)
      *p++ = '/';
    *p = '\0';
    goto out;
  }
  p[0] = '/';
  memcpy(&p[1], path, q - path);
  p[1 + q - path] = '\0';
  if (lstat(resolved, &sb) == -1)
    goto out;
  if (S_ISLNK(sb.st_mode)) {
    if (nlnk++ >= MAXSYMLINKS) {
      errno = ELOOP;
      goto out;
    }
    n = readlink(resolved, wbuf[idx], sizeof(wbuf[0]) - 1);
    if (n < 0)
      goto out;
    if (n == 0) {
      errno = ENOENT;
      goto out;
    }
    if (n + (len = strlen(q)) + 1 > sizeof(wbuf[0])) {
      errno = ENAMETOOLONG;
      goto out;
    }
    memcpy(&wbuf[idx][n], q, len + 1);
    path = wbuf[idx];
    idx ^= 1;
    if (*path == '/')
      p = resolved;
    goto loop;
  }
  if (*q == '/' && !S_ISDIR(sb.st_mode)) {
    errno = ENOTDIR;
    goto out;
  }
  p += 1 + q - path;
  path = q;
  goto loop;
out:
  free(fres);
  return NULL;
}
```