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

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  lea    -0x8000(%rsp),%r11
L18:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L18
  sub    $0x28,%rsp
  lea    D82(%rip),%rdx
  lea    D85(%rip),%rsi
  lea    D6(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x8018(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  movb   $0x0,0x10(%rsp)
  mov    %rbp,%rcx
  call   <task1@plt>
  cmpb   $0x0,0x10(%rsp)
  je     L53
  mov    %rbp,%rsi
  lea    D1(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x4010(%rsp),%r12
  lea    0xc(%rsp),%rcx
  mov    %rbp,%rdi
  lea    D9(%rip),%rsi
  mov    %r12,%rdx
  call   <task2@plt>
  mov    0xc(%rsp),%esi
  test   %esi,%esi
  jle    L49
  lea    D71(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%edx
  mov    %r12,%rsi
  lea    D56(%rip),%rdi
  call   <write_file@plt>
  mov    0xc(%rsp),%esi
  lea    D12(%rip),%rdx
  mov    %r12,%rdi
  call   <task3@plt>
  mov    $0xa,%edi
  mov    %eax,%ebp
  call   <putchar@plt>
  cmp    $0x1,%ebp
  sbb    %eax,%eax
  and    $0x3,%eax
L17:
  mov    0x8018(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L47
  add    $0x8028,%rsp
  pop    %rbp
  pop    %r12
  ret
L53:
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L17
L49:
  mov    $0x2,%eax
  jmp    L17
L47:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D82
type_infered: string
name: read_data
arguments: data_tag: D85
type_infered: string
name: read_data
arguments: data_tag: D6
type_infered: string
name: read_data
arguments: data_tag: D1
type_infered: string
name: read_data
arguments: data_tag: D9
type_infered: string
name: read_data
arguments: data_tag: D71
type_infered: string
name: read_data
arguments: data_tag: D56
type_infered: string
name: read_data
arguments: data_tag: D12
type_infered: string
name: read_data
arguments: data_tag: D0
type_infered: string

tool: D82: s73331-sig.bin

tool: D85: pubkey.pem

tool: D6: s73331-cipher0%i.bin

tool: D1: 
Progressing with cipher file %s


tool: D9: s73331-key.bin

tool: D71: 
Wrote %i bytes to file plain.pdf


tool: D56: plain.pdf

tool: D12: s73331-hash.bin

tool: D0: No signature matched.
Exiting.

assistant: ```c
int main() {
  char *cipher_file_name_template = "s73331-cipher0%i.bin";
  char *key_file_name = "s73331-key.bin";
  char *pubkey_file_name = "pubkey.pem";
  char *signature_file_name = "s73331-sig.bin";
  char *hash_output_file_name = "s73331-hash.bin";
  char right_cipher_file_name[16384];
  right_cipher_file_name[0] = 0;
  task1(cipher_file_name_template, pubkey_file_name, signature_file_name, right_cipher_file_name);
  if (right_cipher_file_name[0] == 0) {
    printf("No signature matched.\nExiting.");
    return 1;
  }
  printf("\nProgressing with cipher file %s\n", right_cipher_file_name);
  unsigned char buf_plain[16384];
  int bytes_out;
  task2(right_cipher_file_name, key_file_name, buf_plain, &bytes_out);
  if (bytes_out > 0) {
    printf("\nWrote %i bytes to file plain.pdf\n", bytes_out);
    write_file("plain.pdf", buf_plain, bytes_out);
  } else {
    return 2;
  }
  int result = task3(buf_plain, bytes_out, hash_output_file_name);
  printf("\n");
  if (result == 0)
    return 3;
  return 0;
}
```