user: 请从给定的汇编指令推导出C源代码:

```asm
<afs_cmu_StringToKey>:
  endbr64
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  mov    $0x8,%edx
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%r13
  mov    %r13,%rdi
  call   <strncpy@plt>
  mov    %rbx,%rdi
  movb   $0x0,0x10(%rsp)
  call   <strlen@plt>
  mov    $0x8,%edx
  cmp    %edx,%eax
  cmovle %eax,%edx
  test   %eax,%eax
  jle    L133
  cmp    $0x7,%eax
  jle    L96
  movq   (%rbx),%xmm0
  movq   (%r12),%xmm1
  mov    %edx,%eax
  and    $0xfffffff8,%eax
  pxor   %xmm1,%xmm0
  movq   %xmm0,0x8(%rsp)
  test   $0x7,%dl
  je     L133
L8:
  movslq %eax,%rcx
  movzbl (%rbx,%rcx,1),%esi
  xor    (%r12,%rcx,1),%sil
  mov    %sil,0x8(%rsp,%rcx,1)
  lea    0x1(%rax),%ecx
  cmp    %ecx,%edx
  jle    L133
  movslq %ecx,%rcx
  movzbl (%rbx,%rcx,1),%esi
  xor    (%r12,%rcx,1),%sil
  mov    %sil,0x8(%rsp,%rcx,1)
  lea    0x2(%rax),%ecx
  cmp    %ecx,%edx
  jle    L133
  movslq %ecx,%rcx
  movzbl (%rbx,%rcx,1),%esi
  xor    (%r12,%rcx,1),%sil
  mov    %sil,0x8(%rsp,%rcx,1)
  lea    0x3(%rax),%ecx
  cmp    %ecx,%edx
  jle    L133
  movslq %ecx,%rcx
  movzbl (%rbx,%rcx,1),%esi
  xor    (%r12,%rcx,1),%sil
  mov    %sil,0x8(%rsp,%rcx,1)
  lea    0x4(%rax),%ecx
  cmp    %ecx,%edx
  jle    L133
  movslq %ecx,%rcx
  movzbl (%rbx,%rcx,1),%esi
  xor    (%r12,%rcx,1),%sil
  mov    %sil,0x8(%rsp,%rcx,1)
  lea    0x5(%rax),%ecx
  cmp    %ecx,%edx
  jle    L133
  movslq %ecx,%rcx
  add    $0x6,%eax
  movzbl (%rbx,%rcx,1),%esi
  xor    (%r12,%rcx,1),%sil
  mov    %sil,0x8(%rsp,%rcx,1)
  cmp    %eax,%edx
  jle    L133
  cltq
  movzbl (%r12,%rax,1),%edx
  xor    (%rbx,%rax,1),%dl
  mov    %dl,0x8(%rsp,%rax,1)
L133:
  cmpb   $0x0,0x8(%rsp)
  jne    L177
  movb   $0x58,0x8(%rsp)
L177:
  cmpb   $0x0,0x9(%rsp)
  jne    L91
  movb   $0x58,0x9(%rsp)
L91:
  cmpb   $0x0,0xa(%rsp)
  jne    L183
  movb   $0x58,0xa(%rsp)
L183:
  cmpb   $0x0,0xb(%rsp)
  jne    L129
  movb   $0x58,0xb(%rsp)
L129:
  cmpb   $0x0,0xc(%rsp)
  jne    L119
  movb   $0x58,0xc(%rsp)
L119:
  cmpb   $0x0,0xd(%rsp)
  jne    L24
  movb   $0x58,0xd(%rsp)
L24:
  cmpb   $0x0,0xe(%rsp)
  jne    L123
  movb   $0x58,0xe(%rsp)
L123:
  cmpb   $0x0,0xf(%rsp)
  jne    L172
  movb   $0x58,0xf(%rsp)
L172:
  lea    D7(%rip),%rsi
  mov    %r13,%rdi
  call   <DES_crypt@plt>
  mov    %rbp,%rdi
  mov    $0x4,%edx
  lea    0x2(%rax),%rsi
  call   <strncpy@plt>
  shlb   0x0(%rbp)
  mov    %rbp,%rdi
  shlb   0x1(%rbp)
  shlb   0x2(%rbp)
  shlb   0x3(%rbp)
  shlb   0x4(%rbp)
  shlb   0x5(%rbp)
  shlb   0x6(%rbp)
  shlb   0x7(%rbp)
  call   <des_set_odd_parity@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L118
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L96:
  xor    %eax,%eax
  jmp    L8
L118:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D7
type_guessed: string

tool: D7: p1

assistant: ```c
void afs_cmu_StringToKey(char *str, char *cell, DES_cblock *key) {
  char password[8 + 1];
  int i;
  int passlen;
  strncpy(password, cell, 8);
  password[8] = '\0';
  passlen = strlen(str);
  if (passlen > 8)
    passlen = 8;
  for (i = 0; i < passlen; i++)
    password[i] = str[i] ^ cell[i];
  for (i = 0; i < 8; i++)
    if (password[i] == '\0')
      password[i] = 'X';
  strncpy((char *)key, DES_crypt(password, "p1") + 2, sizeof(DES_cblock));
  {
    char *keybytes = (char *)key;
    unsigned int temp;
    for (i = 0; i < 8; i++) {
      temp = (unsigned int)keybytes[i];
      keybytes[i] = (unsigned char)(temp << 1);
    }
  }
  des_set_odd_parity(key);
}
```