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

```asm
<autokeycipher>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,%eax
  mov    %edx,-0x40(%rbp)
  mov    %al,-0x3c(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L59
L33:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L76
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    -0x38(%rbp),%rdx
  mov    (%rdx),%rcx
  mov    -0x28(%rbp),%edx
  movslq %edx,%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %al,(%rbx)
L76:
  addl   $0x1,-0x28(%rbp)
L59:
  mov    -0x28(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L33
  movsbl -0x3c(%rbp),%eax
  mov    %eax,%edi
  call   <toupper@plt>
  movsbl %al,%eax
  sub    $0x41,%eax
  mov    %eax,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L81
L94:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L20
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x40(%rbp)
  je     L50
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x41,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  lea    -0x41(%rax),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x4ec4ec4f,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x3,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x1a,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  lea    0x41(%rax),%ecx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L20
L50:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x41,%eax
  sub    -0x18(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x4ec4ec4f,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x3,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x1a,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  lea    0x41(%rdx),%eax
  mov    %eax,-0x14(%rbp)
  cmpl   $0x40,-0x14(%rbp)
  jg     L39
  mov    -0x14(%rbp),%eax
  add    $0x1a,%eax
  mov    %eax,%edx
  jmp    L80
L39:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edx
L80:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x20(%rbp),%eax
  cltq
  add    %rcx,%rax
  mov    %dl,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x41,%eax
  mov    %eax,-0x24(%rbp)
L20:
  addl   $0x1,-0x20(%rbp)
L81:
  mov    -0x20(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L94
  nop
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void autokeycipher(char **text, char key, int encrypt) {
  int textsize;
  textsize = strlen((*text));
  for (int i = 0; i < textsize; ++i) {
    if (isalpha((*text)[i])) {
      (*text)[i] = toupper((*text)[i]);
    }
  }
  int nextkey, keyvalue, result;
  nextkey = toupper(key) - 'A';
  for (int i = 0; i < textsize; ++i) {
    if (isalpha((*text)[i])) {
      keyvalue = nextkey;
      if (encrypt) {
        nextkey = (*text)[i] - 'A';
        (*text)[i] = ((*text)[i] - 'A' + keyvalue) % 26 + 'A';
      } else {
        result = ((*text)[i] - 'A' - keyvalue) % 26 + 'A';
        (*text)[i] = result < 'A' ? (result + 26) : (result);
        nextkey = (*text)[i] - 'A';
      }
    }
  }
}
```