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

```asm
<get_cvs_passwd_from_file>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  lea    D64(%rip),%rdi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x18(%rsp)
  call   <getenv@plt>
  mov    %rax,(%rsp)
  test   %rax,%rax
  je     L38
L166:
  mov    (%rsp),%rbp
  lea    D16(%rip),%rsi
  mov    $0x3,%edi
  xor    %eax,%eax
  mov    %rbp,%rdx
  call   <DEBUG@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    0xb(%rax),%rdi
  call   <malloc@plt>
  mov    %rbp,%rsi
  mov    %rax,%r15
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    D68(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  lea    D57(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  lea    D73(%rip),%rsi
  mov    %r15,%rdi
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L88
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %rbx,%rdi
  mov    %rax,%rbp
  call   <strlen@plt>
  lea    0x3(%rbp,%rax,1),%rdi
  call   <malloc@plt>
  mov    %r14,%rsi
  lea    0x20(%rsp),%r14
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    D83(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  lea    0x18(%rsp),%rbx
  call   <strcat@plt>
  jmp    L24
  nopl   (%rax)
L28:
  mov    0x18(%rsp),%r13
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L70
  lea    D65(%rip),%rsi
  mov    %r13,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L70
  mov    $0x20,%esi
  mov    %r13,%rdi
  call   <rindex@plt>
  test   %rax,%rax
  je     L70
  mov    0x18(%rsp),%rdi
  mov    $0x41,%esi
  call   <rindex@plt>
  mov    %rax,%r13
  test   %rax,%rax
  jne    L95
  nopw   0x0(%rax,%rax,1)
L70:
  xor    %r13d,%r13d
L24:
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <getline@plt>
  test   %eax,%eax
  jns    L28
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r13,%rdx
  mov    $0x3,%edi
  xor    %eax,%eax
  lea    D45(%rip),%rsi
  call   <DEBUG@plt>
L106:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L151
  add    $0x38,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L95:
  mov    0x18(%rsp),%rdx
  lea    D40(%rip),%rsi
  mov    $0x3,%edi
  xor    %eax,%eax
  call   <DEBUG@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %r13,%rdi
  mov    %rax,0x8(%rsp)
  call   <strlen@plt>
  mov    0x8(%rsp),%rdi
  lea    0x1(%r13),%rsi
  lea    -0x2(%rax),%rdx
  call   <strncpy@plt>
  mov    0x8(%rsp),%rdi
  call   <scramble@plt>
  mov    0x8(%rsp),%r8
  cmpb   $0x0,(%rax)
  mov    %rax,%r13
  je     L83
  xchg   %ax,%ax
L39:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  test   %dl,%dl
  jne    L39
L83:
  mov    %r8,%rdi
  call   <free@plt>
  jmp    L24
  nopl   0x0(%rax)
L38:
  call   <getuid@plt>
  mov    %eax,%edi
  call   <getpwuid@plt>
  test   %rax,%rax
  je     L20
  mov    (%rax),%rdi
  test   %rdi,%rdi
  je     L20
  call   <strdup@plt>
  mov    %rax,(%rsp)
  jmp    L166
  nopw   0x0(%rax,%rax,1)
L20:
  lea    D3(%rip),%rsi
  mov    $0x2,%edi
  xor    %eax,%eax
  xor    %r13d,%r13d
  call   <DEBUG@plt>
  jmp    L106
  nopl   0x0(%rax,%rax,1)
L88:
  xor    %r13d,%r13d
  jmp    L106
L151:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D64
type_infered: string
name: unpack_data
arguments: data_tag: D16
type_infered: string
name: unpack_data
arguments: data_tag: D68
type_infered: string
name: unpack_data
arguments: data_tag: D57
type_infered: string
name: unpack_data
arguments: data_tag: D73
type_infered: string
name: unpack_data
arguments: data_tag: D83
type_infered: string
name: unpack_data
arguments: data_tag: D65
type_infered: string
name: unpack_data
arguments: data_tag: D45
type_infered: string
name: unpack_data
arguments: data_tag: D40
type_infered: string
name: unpack_data
arguments: data_tag: D3
type_infered: string

tool: D64: HOME

tool: D16: [get_cvs_passwd_from_file] home dir: %s

tool: D68: /

tool: D57: .cvspass

tool: D73: r

tool: D83: @

tool: D65: pserver

tool: D45: [get_cvs_passwd_from_file] returning password: %s

tool: D40: [get_cvs_passwd_from_file] password line .cvspass: 
	%s

tool: D3: [get_cvs_passwd_from_file] Could not find home dir

assistant: ```c
char *get_cvs_passwd_from_file(char *user, char *hostname) {
  char *home = NULL;
  char *home_env = NULL;
  struct passwd *pw;
  char *passfile = NULL;
  FILE *fp;
  char *user_at_host;
  int line_length;
  long line = 0;
  char *linebuf = NULL;
  size_t linebuf_len;
  char *passwd_chunk;
  char *password_tmp;
  char *password;
  int i = 0;
  if ((home_env = getenv("HOME")) != NULL) {
    home = home_env;
  } else if ((pw = (struct passwd *)getpwuid(getuid())) && pw->pw_dir) {
    home = strdup(pw->pw_dir);
  } else {
    DEBUG(2, "[get_cvs_passwd_from_file] Could not find home dir");
    return NULL;
  }
  DEBUG(3, "[get_cvs_passwd_from_file] home dir: %s", home);
  passfile = malloc(strlen(home) + strlen(".cvspass") + 3);
  strcpy(passfile, home);
  strcat(passfile, "/");
  strcat(passfile, ".cvspass");
  fp = fopen(passfile, "r");
  if (fp == NULL) {
    return NULL;
  }
  user_at_host = malloc(strlen(user) + strlen(hostname) + 3);
  strcat(user_at_host, user);
  strcat(user_at_host, "@");
  strcat(user_at_host, hostname);
  while ((line_length = getline(&linebuf, &linebuf_len, fp)) >= 0) {
    line++;
    if ((strstr(linebuf, user_at_host) != NULL) && ((strstr(linebuf, "pserver") != NULL)) && ((passwd_chunk = rindex(linebuf, ' ')) != NULL) && ((passwd_chunk = rindex(linebuf, 'A')) != NULL)) {
      DEBUG(3, "[get_cvs_passwd_from_file] password line .cvspass: \n\t%s", linebuf);
      password_tmp = malloc(strlen(passwd_chunk));
      strncpy(password_tmp, passwd_chunk + 1, strlen(passwd_chunk) - 2);
      password = scramble(password_tmp);
      for (i = 0; password[i]; i++)
        password[i] = password[i + 1];
      free(password_tmp);
    } else {
      password = NULL;
    }
  }
  if (fclose(fp) < 0) {
  }
  free(home);
  free(passfile);
  free(user_at_host);
  DEBUG(3, "[get_cvs_passwd_from_file] returning password: %s", password);
  return password;
}
```