user: Translate the below assembly code into C programming language:

```asm
<process_path_component>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdx,%rbx
  mov    %ecx,%r12d
  mov    %r8d,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    D48(%rip),%rax
  mov    (%rax),%r14d
  lea    0x1(%r14),%eax
  cltq
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L290:
  cmp    %rdx,%rsp
  je     L187
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L290
L187:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L63
  orq    $0x0,-0x8(%rsp,%rax,1)
L63:
  mov    %rsp,%r15
  test   %rsi,%rsi
  jne    L200
  test   %r12d,%r12d
  je     L36
L195:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L247
  mov    %rbx,%rax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L36:
  mov    D15(%rip),%rax
  mov    (%rax),%rdx
  mov    D0(%rip),%rax
  mov    %rdx,(%rax)
  mov    $0x0,%ebx
  jmp    L195
L200:
  cmp    $0x1,%rsi
  je     L289
  cmp    $0x2,%rsi
  jne    L149
  cmpb   $0x2e,(%rdi)
  je     L234
L149:
  mov    %rsi,%rdx
  mov    %rdi,%rsi
  mov    %rbx,%rdi
  call   <append_path_component@plt>
  test   %eax,%eax
  je     L232
  lea    -0x3c(%rbp),%rsi
  mov    %rbx,%rdi
  call   <lstat@plt>
  test   %rax,%rax
  jns    L158
  test   %r12d,%r12d
  je     L69
  mov    D0(%rip),%rdx
  mov    D15(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  mov    $0x0,%eax
  cmovne %rax,%rbx
  jmp    L195
L289:
  cmpb   $0x2e,(%rdi)
  jne    L149
  jmp    L195
L234:
  cmpb   $0x2e,0x1(%rdi)
  jne    L149
  mov    %rbx,%rdi
  call   <remove_last_path_component@plt>
  mov    %rax,%rbx
  jmp    L195
L158:
  mov    -0x3c(%rbp),%edi
  call   <S_ISLNK@plt>
  test   %rax,%rax
  jne    L152
L101:
  test   %r12d,%r12d
  jne    L195
  mov    -0x3c(%rbp),%edi
  call   <S_ISDIR@plt>
  test   %eax,%eax
  jne    L195
  mov    D52(%rip),%rax
  mov    (%rax),%rdx
  mov    D0(%rip),%rax
  mov    %rdx,(%rax)
  mov    $0x0,%ebx
  jmp    L195
L152:
  mov    %r14d,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <readlink@plt>
  movb   $0x0,(%r15,%rax,1)
  mov    %rbx,%rdi
  call   <remove_last_path_component@plt>
  lea    -0x1(%r13),%edx
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <realpath_recurse@plt>
  test   %eax,%eax
  je     L134
  lea    -0x3c(%rbp),%rsi
  mov    %rbx,%rdi
  call   <lstat@plt>
  test   %rax,%rax
  jns    L101
  test   %r12d,%r12d
  je     L51
  mov    D0(%rip),%rdx
  mov    D15(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  mov    $0x0,%eax
  cmovne %rax,%rbx
  jmp    L195
L232:
  mov    $0x0,%ebx
  jmp    L195
L69:
  mov    $0x0,%ebx
  jmp    L195
L134:
  mov    $0x0,%ebx
  jmp    L195
L51:
  mov    $0x0,%ebx
  jmp    L195
L247:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *process_path_component(const char *component, size_t component_length, char *resolved_name, int last_part, int max_depth) {
  char readlink_buffer[PATH_MAX + 1];
  ssize_t readlink_buffer_length;
  struct stat stat_buffer;
  if (!component_length) {
    if (last_part)
      return resolved_name;
    else {
      errno = ENOENT;
      return NULL;
    }
  }
  if (component_length == 1 && component[0] == '.')
    return resolved_name;
  if (component_length == 2 && component[0] == '.' && component[1] == '.')
    return remove_last_path_component(resolved_name);
  if (!append_path_component(resolved_name, component, component_length))
    return NULL;
  if (lstat(resolved_name, &stat_buffer) < 0) {
    if (last_part && errno == ENOENT)
      return resolved_name;
    else
      return NULL;
  }
  if (S_ISLNK(stat_buffer.st_mode)) {
    readlink_buffer_length = readlink(resolved_name, readlink_buffer, sizeof(readlink_buffer) - 1);
    if (readlink_buffer_length < 0)
      return NULL;
    readlink_buffer[readlink_buffer_length] = 0;
    remove_last_path_component(resolved_name);
    if (!realpath_recurse(readlink_buffer, resolved_name, max_depth - 1))
      return NULL;
    if (lstat(resolved_name, &stat_buffer) < 0) {
      if (last_part && errno == ENOENT)
        return resolved_name;
      else
        return NULL;
    }
  }
  if (!last_part && !S_ISDIR(stat_buffer.st_mode)) {
    errno = ENOTDIR;
    return NULL;
  }
  return resolved_name;
}
```