user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmpq   $0x0,0x8(%rsi)
  je     L120
  mov    %rsi,%rbx
  cmpq   $0x0,0x10(%rsi)
  je     L120
  cmpq   $0x0,0x18(%rsi)
  je     L120
  cmpq   $0x0,0x20(%rsi)
  je     L120
  mov    $0x0,%eax
  call   <OpenSSL_add_all_algorithms@plt>
  mov    0x8(%rbx),%rdi
  lea    D8(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L32
  mov    0x18(%rbx),%r13
  mov    0x20(%rbx),%r12
L77:
  lea    D28(%rip),%rdi
  call   <printf@plt>
  movl   $0x0,0x4(%rsp)
  lea    0x4(%rsp),%rdx
  mov    0x10(%rbx),%rdi
  lea    D79(%rip),%rsi
  call   <sscanf@plt>
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    0x4(%rsp),%edi
  call   <genkey@plt>
  mov    $0x0,%eax
  jmp    L21
L120:
  lea    D19(%rip),%rdi
  call   <printf@plt>
  lea    D5(%rip),%rdi
  call   <printf@plt>
  lea    D53(%rip),%rdi
  call   <printf@plt>
  lea    D106(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
L21:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L124
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L32:
  mov    0x8(%rbx),%rdi
  lea    D39(%rip),%rsi
  call   <strcmp@plt>
  mov    $0x2,%ebp
  test   %rax,%rax
  jne    L59
L41:
  mov    0x18(%rbx),%r13
  mov    0x20(%rbx),%r12
  jmp    L89
L59:
  mov    0x8(%rbx),%rdi
  lea    D2(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L146
  mov    0x18(%rbx),%r13
  mov    0x20(%rbx),%r12
  cmp    $0x1,%ebp
  je     L77
L89:
  mov    0x10(%rbx),%rbx
  cmp    $0x2,%ebp
  je     L128
  lea    D61(%rip),%rdi
  call   <printf@plt>
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <decrypt@plt>
  mov    $0x0,%eax
  jmp    L21
L128:
  lea    D82(%rip),%rdi
  call   <printf@plt>
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <encrypt@plt>
  mov    $0x0,%eax
  jmp    L21
L146:
  mov    $0x3,%ebp
  jmp    L41
L124:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D8
data_type: string
name: extract_symbolic_data
arguments: data_tag: D28
data_type: string
name: extract_symbolic_data
arguments: data_tag: D79
data_type: string
name: extract_symbolic_data
arguments: data_tag: D19
data_type: string
name: extract_symbolic_data
arguments: data_tag: D5
data_type: string
name: extract_symbolic_data
arguments: data_tag: D53
data_type: string
name: extract_symbolic_data
arguments: data_tag: D106
data_type: string
name: extract_symbolic_data
arguments: data_tag: D39
data_type: string
name: extract_symbolic_data
arguments: data_tag: D2
data_type: string
name: extract_symbolic_data
arguments: data_tag: D61
data_type: string
name: extract_symbolic_data
arguments: data_tag: D82
data_type: string

tool: D8: genkey

tool: D28: Start generating private and public key pair ...


tool: D79: %d

tool: D19: Upss, something is wrong, check your parameters!


tool: D5: Correct format for key generation: genkey 2048 private.pem public.pem


tool: D53: Correct format for encryption: encrypt public.pem input encrypted


tool: D106: Correct format for decryption: decrypt private.pem encrypted decrypted


tool: D39: encrypt

tool: D2: decrypt

tool: D61: Start decrypting ...


tool: D82: Start encrypting ...


assistant: ```c
int main(int argc, char *argv[]) {
  if (argv[1] == NULL || argv[2] == NULL || argv[3] == NULL || argv[4] == NULL) {
    printf("Upss, something is wrong, check your parameters!\n");
    printf("Correct format for key generation: genkey 2048 private.pem public.pem\n");
    printf("Correct format for encryption: encrypt public.pem input encrypted\n");
    printf("Correct format for decryption: decrypt private.pem encrypted decrypted\n");
    return 1;
  }
  OpenSSL_add_all_algorithms();
  int mode;
  if (strcmp(argv[1], "genkey") == 0) {
    mode = 1;
  } else if (strcmp(argv[1], "encrypt") == 0) {
    mode = 2;
  } else if (strcmp(argv[1], "decrypt") == 0) {
    mode = 3;
  }
  char *inFile = argv[3];
  char *outFile = argv[4];
  if (mode == 1) {
    printf("Start generating private and public key pair ...\n");
    int keyLength = 0;
    sscanf(argv[2], "%d", &keyLength);
    genkey(keyLength, inFile, outFile);
    return 0;
  }
  char *keyFile = argv[2];
  if (mode == 2) {
    printf("Start encrypting ...\n");
    encrypt(keyFile, inFile, outFile);
    return 0;
  }
  if (mode == 3) {
    printf("Start decrypting ...\n");
    decrypt(keyFile, inFile, outFile);
    return 0;
  }
  return 1;
}
```