user: Converte this assembly snippet into its equivalent C code:

```asm
<pdecrypt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  mov    %rsp,%rcx
  mov    %eax,-0x44(%rbp)
  movslq %ebx,%rax
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L34
L105:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L105
L34:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L119
L145:
  movslq -0x44(%rbp),%rax
  mov    %rsp,%rcx
  mov    %rsp,%r15
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L86
L62:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L62
L86:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L77
L36:
  lea    0x1(%rbx),%edx
  mov    %r13,%rsi
  mov    %r15,%rdi
  mov    %rsp,-0x50(%rbp)
  call   <strncpy@plt>
  mov    -0x44(%rbp),%eax
  mov    %r12,%rsi
  mov    %rsp,%rdi
  lea    0x1(%rax),%edx
  call   <strncpy@plt>
  test   %ebx,%ebx
  jle    L39
  lea    -0x1(%rbx),%eax
  mov    %r15,%r14
  xor    %r12d,%r12d
  lea    0x1(%r15,%rax,1),%r13
  jmp    L148
  nopw   0x0(%rax,%rax,1)
L167:
  add    $0x1,%r14
  cmp    %r13,%r14
  je     L108
L148:
  movsbl (%r14),%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L167
  movsbl (%r14),%edi
  call   <toupper@plt>
  mov    %eax,%ebx
  mov    %r12d,%eax
  cltd
  idivl  -0x44(%rbp)
  mov    -0x50(%rbp),%rax
  movslq %edx,%rdx
  movsbl (%rax,%rdx,1),%edi
  call   <toupper@plt>
  sub    %al,%bl
  js     L90
  movsbl %bl,%eax
  mov    %rax,%rbx
  imul   $0x4ec4ec4f,%rax,%rax
  shr    $0x23,%rax
  imul   $0x1a,%eax,%eax
  sub    %eax,%ebx
  add    $0x41,%ebx
L14:
  movslq %r12d,%rax
  add    $0x1,%r14
  add    $0x1,%r12d
  mov    %bl,(%r15,%rax,1)
  cmp    %r13,%r14
  jne    L148
L108:
  movslq %r12d,%r12
  mov    %r15,%rsi
  lea    D9(%rip),%rdi
  movb   $0x0,(%r15,%r12,1)
  call   <printf@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L43
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L119:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L145
  nopl   0x0(%rax,%rax,1)
L90:
  add    $0x1a,%ebx
  movsbl %bl,%edx
  movsbq %bl,%rbx
  imul   $0x4ec4ec4f,%rbx,%rax
  mov    %edx,%esi
  sar    $0x1f,%esi
  sar    $0x23,%rax
  sub    %esi,%eax
  imul   $0x1a,%eax,%eax
  sub    %eax,%edx
  lea    0x41(%rdx),%ebx
  jmp    L14
L39:
  xor    %r12d,%r12d
  jmp    L108
L77:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L36
L43:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D9
type: string

tool: D9: %s


assistant: ```c
int pdecrypt(const char *cipher, const char *k) {
  int length = strlen(cipher);
  int keylength = strlen(k);
  char plain[length];
  char key[keylength];
  strncpy(plain, cipher, length + 1);
  strncpy(key, k, keylength + 1);
  int i, j;
  for (i = j = 0; i < length; i++, j++) {
    if (!isspace(plain[i])) {
      char p = ((toupper(plain[i]) - 65) - (toupper(key[(j % keylength)]) - 65));
      plain[j] = (p < 0 ? p + 26 : p) % 26 + 65;
    } else
      j--;
  }
  plain[j] = '\0';
  printf("%s\n", plain);
  return 0;
}
```