user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x8000(%rsp),%r11
L20:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L20
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D42(%rip),%rax
  mov    %rax,-0x8038(%rbp)
  lea    D63(%rip),%rax
  mov    %rax,-0x8030(%rbp)
  lea    D69(%rip),%rax
  mov    %rax,-0x8028(%rbp)
  lea    D15(%rip),%rax
  mov    %rax,-0x8020(%rbp)
  lea    D66(%rip),%rax
  mov    %rax,-0x8018(%rbp)
  movb   $0x0,-0x8010(%rbp)
  lea    -0x8010(%rbp),%rcx
  mov    -0x8020(%rbp),%rdx
  mov    -0x8028(%rbp),%rsi
  mov    -0x8038(%rbp),%rax
  mov    %rax,%rdi
  call   <task1@plt>
  movzbl -0x8010(%rbp),%eax
  test   %al,%al
  jne    L34
  lea    D56(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L51
L34:
  lea    -0x8010(%rbp),%rax
  mov    %rax,%rsi
  lea    D78(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x8040(%rbp),%rcx
  lea    -0x4010(%rbp),%rdx
  mov    -0x8030(%rbp),%rsi
  lea    -0x8010(%rbp),%rax
  mov    %rax,%rdi
  call   <task2@plt>
  mov    -0x8040(%rbp),%eax
  test   %eax,%eax
  jle    L19
  mov    -0x8040(%rbp),%eax
  mov    %eax,%esi
  lea    D83(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x8040(%rbp),%edx
  lea    -0x4010(%rbp),%rax
  mov    %rax,%rsi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <write_file@plt>
  mov    -0x8040(%rbp),%ecx
  mov    -0x8018(%rbp),%rdx
  lea    -0x4010(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <task3@plt>
  mov    %eax,-0x803c(%rbp)
  mov    $0xa,%edi
  call   <putchar@plt>
  cmpl   $0x0,-0x803c(%rbp)
  jne    L5
  jmp    L62
L19:
  mov    $0x2,%eax
  jmp    L51
L62:
  mov    $0x3,%eax
  jmp    L51
L5:
  mov    $0x0,%eax
L51:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L8
  call   <__stack_chk_fail@plt>
L8:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D42
type_infered: string
name: retrieve_data
arguments: tag: D63
type_infered: string
name: retrieve_data
arguments: tag: D69
type_infered: string
name: retrieve_data
arguments: tag: D15
type_infered: string
name: retrieve_data
arguments: tag: D66
type_infered: string
name: retrieve_data
arguments: tag: D56
type_infered: string
name: retrieve_data
arguments: tag: D78
type_infered: string
name: retrieve_data
arguments: tag: D83
type_infered: string
name: retrieve_data
arguments: tag: D13
type_infered: string

tool: D42: s73331-cipher0%i.bin

tool: D63: s73331-key.bin

tool: D69: pubkey.pem

tool: D15: s73331-sig.bin

tool: D66: s73331-hash.bin

tool: D56: No signature matched.
Exiting.

tool: D78: 
Progressing with cipher file %s


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


tool: D13: plain.pdf

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;
}
```