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

```asm
<get_cvs_passwd_from_file>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  lea    D41(%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     L135
L64:
  mov    (%rsp),%rbp
  lea    D5(%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    D8(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  lea    D34(%rip),%rsi
  mov    %r15,%rdi
  call   <strcat@plt>
  lea    D84(%rip),%rsi
  mov    %r15,%rdi
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L99
  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    D23(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  lea    0x18(%rsp),%rbx
  call   <strcat@plt>
  jmp    L35
  nopl   (%rax)
L140:
  mov    0x18(%rsp),%r13
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L151
  lea    D40(%rip),%rsi
  mov    %r13,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L151
  mov    $0x20,%esi
  mov    %r13,%rdi
  call   <rindex@plt>
  test   %rax,%rax
  je     L151
  mov    0x18(%rsp),%rdi
  mov    $0x41,%esi
  call   <rindex@plt>
  mov    %rax,%r13
  test   %rax,%rax
  jne    L165
  nopw   0x0(%rax,%rax,1)
L151:
  xor    %r13d,%r13d
L35:
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <getline@plt>
  test   %eax,%eax
  jns    L140
  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    D47(%rip),%rsi
  call   <DEBUG@plt>
L57:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L67
  add    $0x38,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L165:
  mov    0x18(%rsp),%rdx
  lea    D97(%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     L95
  xchg   %ax,%ax
L129:
  movzbl 0x1(%rax),%edx
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  test   %dl,%dl
  jne    L129
L95:
  mov    %r8,%rdi
  call   <free@plt>
  jmp    L35
  nopl   0x0(%rax)
L135:
  call   <getuid@plt>
  mov    %eax,%edi
  call   <getpwuid@plt>
  test   %rax,%rax
  je     L130
  mov    (%rax),%rdi
  test   %rdi,%rdi
  je     L130
  call   <strdup@plt>
  mov    %rax,(%rsp)
  jmp    L64
  nopw   0x0(%rax,%rax,1)
L130:
  lea    D33(%rip),%rsi
  mov    $0x2,%edi
  xor    %eax,%eax
  xor    %r13d,%r13d
  call   <DEBUG@plt>
  jmp    L57
  nopl   0x0(%rax,%rax,1)
L99:
  xor    %r13d,%r13d
  jmp    L57
L67:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D41
type: string
name: extract_symbolic_data
arguments: tag: D5
type: string
name: extract_symbolic_data
arguments: tag: D8
type: string
name: extract_symbolic_data
arguments: tag: D34
type: string
name: extract_symbolic_data
arguments: tag: D84
type: string
name: extract_symbolic_data
arguments: tag: D23
type: string
name: extract_symbolic_data
arguments: tag: D40
type: string
name: extract_symbolic_data
arguments: tag: D47
type: string
name: extract_symbolic_data
arguments: tag: D97
type: string
name: extract_symbolic_data
arguments: tag: D33
type: string

tool: D41: HOME

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

tool: D8: /

tool: D34: .cvspass

tool: D84: r

tool: D23: @

tool: D40: pserver

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

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

tool: D33: [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;
}
```