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

```asm
<get_cvs_passwd_from_file>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x18(%rsp)
  lea    D8(%rip),%rdi
  call   <getenv@plt>
  mov    %rax,(%rsp)
  test   %rax,%rax
  je     L94
L93:
  mov    (%rsp),%r13
  mov    %r13,%rdx
  lea    D67(%rip),%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <DEBUG@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  lea    0xb(%rax),%rdi
  call   <malloc@plt>
  mov    %rax,%r15
  mov    %rax,0x8(%rsp)
  mov    %r13,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    D11(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  lea    D13(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  lea    D92(%rip),%rsi
  mov    %r15,%rdi
  call   <fopen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L76
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rax,%r12
  mov    %r14,%rdi
  call   <strlen@plt>
  lea    0x3(%r12,%rax,1),%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    D64(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  lea    0x20(%rsp),%r15
  lea    0x18(%rsp),%r14
L130:
  mov    %r13,%rdx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <getline@plt>
  test   %eax,%eax
  js     L38
  mov    0x18(%rsp),%rbp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L130
  lea    D99(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L130
  mov    $0x20,%esi
  mov    %rbp,%rdi
  call   <rindex@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L130
  mov    $0x41,%esi
  mov    0x18(%rsp),%rdi
  call   <rindex@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L130
  mov    0x18(%rsp),%rdx
  lea    D54(%rip),%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <DEBUG@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    -0x2(%rax),%rdx
  lea    0x1(%rbx),%rsi
  mov    %rbp,%rdi
  call   <strncpy@plt>
  mov    %rbp,%rdi
  call   <scramble@plt>
  mov    %rax,%rbx
  cmpb   $0x0,(%rax)
  je     L6
L29:
  movzbl 0x1(%rax),%edx
  mov    %dl,(%rax)
  add    $0x1,%rax
  test   %dl,%dl
  jne    L29
L6:
  mov    %rbp,%rdi
  call   <free@plt>
  jmp    L130
L94:
  call   <getuid@plt>
  mov    %eax,%edi
  call   <getpwuid@plt>
  test   %rax,%rax
  je     L129
  mov    (%rax),%rdi
  test   %rdi,%rdi
  je     L129
  call   <strdup@plt>
  mov    %rax,(%rsp)
  jmp    L93
L129:
  lea    D3(%rip),%rsi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <DEBUG@plt>
  mov    (%rsp),%rbx
  jmp    L87
L38:
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    %rbx,%rdx
  lea    D19(%rip),%rsi
  mov    $0x3,%edi
  mov    $0x0,%eax
  call   <DEBUG@plt>
L87:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L144
  mov    %rbx,%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L76:
  mov    %rax,%rbx
  jmp    L87
L144:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D8
type_infered: string
name: retrieve_data
arguments: data_tag: D67
type_infered: string
name: retrieve_data
arguments: data_tag: D11
type_infered: string
name: retrieve_data
arguments: data_tag: D13
type_infered: string
name: retrieve_data
arguments: data_tag: D92
type_infered: string
name: retrieve_data
arguments: data_tag: D64
type_infered: string
name: retrieve_data
arguments: data_tag: D99
type_infered: string
name: retrieve_data
arguments: data_tag: D54
type_infered: string
name: retrieve_data
arguments: data_tag: D3
type_infered: string
name: retrieve_data
arguments: data_tag: D19
type_infered: string

tool: D8: HOME

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

tool: D11: /

tool: D13: .cvspass

tool: D92: r

tool: D64: @

tool: D99: pserver

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

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

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

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