user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  cmpl   $0x4,-0x34(%rbp)
  je     L15
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L99
L15:
  mov    -0x40(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jg     L162
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L99
L162:
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L46
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L99
L46:
  mov    -0x1c(%rbp),%edx
  mov    -0x10(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x40(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x40(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  jg     L135
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L99
L135:
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L42
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L99
L42:
  mov    -0x18(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x40(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  movl   $0x0,-0x28(%rbp)
  jmp    L247
L62:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L166
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5a,%al
  jle    L29
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L166
L29:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7a,%al
  jle    L121
L166:
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L99
L121:
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L137
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7a,%al
  jg     L137
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  lea    -0x20(%rax),%ecx
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
L137:
  addl   $0x1,-0x28(%rbp)
L247:
  mov    -0x28(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L62
  mov    -0x40(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x64,%al
  jne    L131
  mov    $0xffffffff,%eax
  jmp    L104
L131:
  mov    $0x1,%eax
L104:
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L225
L124:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  lea    -0x41(%rax),%ecx
  mov    -0x24(%rbp),%eax
  cltd
  idivl  -0x1c(%rbp)
  mov    %edx,%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x41,%eax
  imul   -0x14(%rbp),%eax
  add    %ecx,%eax
  movslq %eax,%rdx
  imul   $0x4ec4ec4f,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x3,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  mov    %edx,-0x20(%rbp)
  mov    -0x20(%rbp),%edx
  imul   $0x1a,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L88
L73:
  addl   $0x1a,-0x20(%rbp)
L88:
  cmpl   $0x0,-0x20(%rbp)
  js     L73
  mov    -0x20(%rbp),%eax
  lea    0x41(%rax),%ecx
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x24(%rbp)
L225:
  mov    -0x24(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L124
  mov    -0x40(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  mov    -0x8(%rbp),%rcx
  mov    %rax,%rsi
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
L99:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D10
data_type: string
name: unpack_data
arguments: label: D52
data_type: string
name: unpack_data
arguments: label: D2
data_type: string
name: unpack_data
arguments: label: D0
data_type: string
name: unpack_data
arguments: label: D49
data_type: string
name: unpack_data
arguments: label: D35
data_type: string

tool: D10: Usage: vigenere -d[ecrypt]|-e[ncrypt] <Key> <Message>

tool: D52: Please provide a valid key.

tool: D2: Malloc failed. Please make sure enough memory is available.

tool: D0: Please provide a valid message.

tool: D49: Message does not contain valid characters!

tool: D35: Input: %s
Key: %s
Output:%s


assistant: ```c
int main(int argc, char **argv) {
  if (argc != 4) {
    printf("Usage: vigenere -d[ecrypt]|-e[ncrypt] <Key> <Message>\r\n");
    return -1;
  }
  int key_len = strlen(argv[2]);
  if (key_len <= 0) {
    printf("Please provide a valid key.\r\n");
    return -1;
  }
  char *key = malloc(sizeof(char) * key_len);
  if (!key) {
    printf("Malloc failed. Please make sure enough memory is available.\r\n");
    return -1;
  }
  memset(key, 0, key_len);
  strcpy(key, argv[2]);
  int len = strlen(argv[3]);
  if (len <= 0) {
    printf("Please provide a valid message.\r\n");
    return -1;
  }
  char *input = malloc(sizeof(char) * len);
  if (!input) {
    printf("Malloc failed. Please make sure enough memory is available.\r\n");
    return -1;
  }
  memset(input, 0, len);
  strcpy(input, argv[3]);
  int y;
  for (y = 0; y < len; y++) {
    if (input[y] < 65 || (input[y] > 90 && input[y] < 97) || (input[y] > 122)) {
      printf("Message does not contain valid characters!\r\n");
      return -1;
    }
    if (input[y] >= 97 && input[y] <= 122)
      input[y] = input[y] - 32;
  }
  int x;
  int modifier = (argv[1][1] == 'd' ? -1 : 1);
  int val = 0;
  for (x = 0; x < len; x++) {
    val = (((input[x] - 65) + (modifier * (key[x % key_len] - 65))) % 26);
    while (val < 0)
      val += 26;
    input[x] = val + 65;
  }
  printf("Input: %s\r\nKey: %s\r\nOutput:%s\r\n", argv[3], argv[2], input);
  free(key);
  free(input);
}
```