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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  cmp    $0x2,%edi
  je     L106
  lea    D33(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
L98:
  mov    0x68(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L60
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L106:
  mov    0x8(%rsi),%rdi
  mov    %rsi,%rbp
  call   <strlen@plt>
  test   %eax,%eax
  jle    L55
  movslq %eax,%r12
  xor    %ebx,%ebx
  jmp    L59
  nopw   0x0(%rax,%rax,1)
L85:
  add    $0x1,%rbx
  cmp    %r12,%rbx
  je     L55
L59:
  mov    0x8(%rbp),%rax
  movsbl (%rax,%rbx,1),%edi
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L85
  lea    D3(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L98
L55:
  lea    D47(%rip),%rdi
  xor    %eax,%eax
  mov    %rsp,%rbx
  call   <printf@plt>
  mov    %rbx,%rsi
  lea    D24(%rip),%rdi
  call   <scanf@plt>
  mov    0x8(%rbp),%r14
  mov    %r14,%rdi
  call   <strlen@plt>
  lea    D23(%rip),%rdi
  mov    %eax,%r13d
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L49
  sub    $0x1,%eax
  xor    %r12d,%r12d
  lea    0x1(%rsp,%rax,1),%r15
  jmp    L133
  nopl   0x0(%rax)
L48:
  movsbl (%rbx),%edi
  sub    $0x61,%ebp
  call   <isupper@plt>
  test   %rax,%rax
  je     L107
  movsbl (%rbx),%eax
  mov    $0x1a,%ecx
  add    $0x1,%r12d
  lea    -0x41(%rbp,%rax,1),%eax
  cltd
  idiv   %ecx
  lea    0x41(%rdx),%edi
  call   <putchar@plt>
L21:
  add    $0x1,%rbx
  cmp    %r15,%rbx
  je     L49
L133:
  mov    %r12d,%eax
  cltd
  idiv   %r13d
  movslq %edx,%rdx
  movsbl (%r14,%rdx,1),%edi
  call   <tolower@plt>
  movsbl (%rbx),%edi
  mov    %eax,%ebp
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L48
  movsbl (%rbx),%edi
  add    $0x1,%rbx
  call   <putchar@plt>
  cmp    %r15,%rbx
  jne    L133
L49:
  mov    $0xa,%edi
  call   <putchar@plt>
  xor    %eax,%eax
  jmp    L98
L107:
  movsbl (%rbx),%edi
  call   <islower@plt>
  test   %rax,%rax
  je     L21
  movsbl (%rbx),%eax
  mov    $0x1a,%ecx
  add    $0x1,%r12d
  lea    -0x61(%rbp,%rax,1),%eax
  cltd
  idiv   %ecx
  lea    0x61(%rdx),%edi
  call   <putchar@plt>
  jmp    L21
L60:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D33
data_type: string
name: retrieve_data
arguments: data_tag: D3
data_type: string
name: retrieve_data
arguments: data_tag: D47
data_type: string
name: retrieve_data
arguments: data_tag: D24
data_type: string
name: retrieve_data
arguments: data_tag: D23
data_type: string

tool: D33: Enter the Valid Key

tool: D3: Enter only Alphabets

tool: D47: plaintext:  

tool: D24: %s

tool: D23: ciphertext: 

assistant: ```c
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("Enter the Valid Key");
    return 1;
  } else {
    for (int i = 0, n = strlen(argv[1]); i < n; i++) {
      if (!isalpha(argv[1][i])) {
        printf("Enter only Alphabets");
        return 1;
      }
    }
  }
  printf("plaintext:  ");
  char s[100];
  scanf("%s", s);
  char *k = argv[1];
  int klen = strlen(k);
  printf("ciphertext: ");
  for (int i = 0, j = 0, n = strlen(s); i < n; i++) {
    int key = tolower(k[j % klen]) - 97;
    if (isalpha(s[i])) {
      if (isupper(s[i])) {
        printf("%c", ((s[i] - 65 + key) % 26) + 65);
        j++;
      } else if (islower(s[i])) {
        printf("%c", ((s[i] - 97 + key) % 26) + 97);
        j++;
      }
    } else {
      printf("%c", s[i]);
    }
  }
  printf("\n");
  return 0;
}
```