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

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x400,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3f8(%rsp)
  xor    %eax,%eax
  lea    D14(%rip),%rsi
  lea    D3(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbx
  lea    D28(%rip),%rsi
  lea    D92(%rip),%rdi
  call   <fopen@plt>
  test   %rbx,%rbx
  je     L1
  mov    %rax,%rbp
  test   %rax,%rax
  je     L45
  lea    D102(%rip),%rdi
  call   <puts@plt>
  jmp    L88
L1:
  lea    D64(%rip),%rdi
  call   <puts@plt>
  lea    D60(%rip),%rdi
  call   <system@plt>
  jmp    L41
L45:
  lea    D86(%rip),%rdi
  call   <puts@plt>
  lea    D60(%rip),%rdi
  call   <system@plt>
  jmp    L41
L51:
  mov    %rbx,%rdi
  call   <fgetc@plt>
  movsbl %al,%edi
  call   <putchar@plt>
L88:
  mov    %rbx,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L51
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <copiar@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  lea    D14(%rip),%rsi
  lea    D3(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbx
  lea    D95(%rip),%rdi
  call   <puts@plt>
  lea    D130(%rip),%r12
  jmp    L80
L26:
  mov    %rsp,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L80:
  mov    %rsp,%rdi
  mov    %rbx,%rdx
  mov    $0x3e9,%esi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L26
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D60(%rip),%rdi
  call   <system@plt>
L41:
  mov    0x3f8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  mov    $0x0,%eax
  add    $0x400,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L22:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D14
data_type: string
name: read_data
arguments: data_tag: D3
data_type: string
name: read_data
arguments: data_tag: D28
data_type: string
name: read_data
arguments: data_tag: D92
data_type: string
name: read_data
arguments: data_tag: D102
data_type: string
name: read_data
arguments: data_tag: D64
data_type: string
name: read_data
arguments: data_tag: D60
data_type: string
name: read_data
arguments: data_tag: D86
data_type: string
name: read_data
arguments: data_tag: D95
data_type: string
name: read_data
arguments: data_tag: D130
data_type: string

tool: D14: r

tool: D3: input.txt

tool: D28: w

tool: D92: output.txt

tool: D102: 	Texto presente no arquivo A.txt:


tool: D64: 
Erro na abertura do arquivo A!!!


tool: D60: pause

tool: D86: 
Erro na abertura do arquivo B!!!


tool: D95: 

	Texto copiado para o arquivo B.txt:


tool: D130: %s

assistant: ```c
int main() {
  FILE *tx, *tx2;
  char c, texto[1001];
  tx = fopen("input.txt", "r");
  tx2 = fopen("output.txt", "w");
  if (!tx) {
    printf("\nErro na abertura do arquivo A!!!\n\n");
    system("pause");
    return (0);
  }
  if (!tx2) {
    printf("\nErro na abertura do arquivo B!!!\n\n");
    system("pause");
    return (0);
  }
  printf("\tTexto presente no arquivo A.txt:\n\n");
  while (!feof(tx)) {
    c = fgetc(tx);
    printf("%c", c);
  }
  copiar(tx, tx2);
  fclose(tx);
  tx = fopen("input.txt", "r");
  printf("\n\n\tTexto copiado para o arquivo B.txt:\n\n");
  while (fgets(texto, 1001, tx) != NULL)
    printf("%s", texto);
  printf("\n");
  fclose(tx);
  fclose(tx2);
  system("pause");
  return (0);
}
```