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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  cmp    $0x2,%edi
  je     L1
  lea    D12(%rip),%rdi
  call   <puts@plt>
  lea    D77(%rip),%rdi
  call   <puts@plt>
  lea    D82(%rip),%rdi
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
L0:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L18
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L1:
  mov    0x8(%rsi),%rdi
  mov    %rsi,%rbx
  lea    D80(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L58
  mov    0x8(%rbx),%rdi
  lea    0x10(%rsp),%r15
  lea    0xe(%rsp),%r13
  lea    D54(%rip),%rsi
  call   <strcat@plt>
  mov    %r15,%rdi
  mov    %eax,%esi
  call   <strcpy@plt>
  lea    D47(%rip),%rsi
  mov    %r15,%rdi
  call   <fopen@plt>
  mov    %rax,%r14
  jmp    L56
  xchg   %ax,%ax
L82:
  cmp    $0x1,%ebx
  je     L49
L56:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  jne    L106
  mov    %rbp,%rcx
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %r13,%rdi
  call   <fread@plt>
  lea    0xf(%rsp),%r12
  mov    %rbp,%rcx
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %r12,%rdi
  mov    %eax,%ebx
  call   <fread@plt>
  cmp    $0x1,%eax
  jne    L82
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %r12,%rdi
  call   <fwrite@plt>
  cmp    $0x1,%ebx
  jne    L56
L49:
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %r13,%rdi
  call   <fwrite@plt>
  jmp    L56
L106:
  mov    %r15,%rsi
  lea    D55(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r14,%rdi
  call   <fclose@plt>
  lea    D25(%rip),%rdi
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L0
L58:
  lea    D79(%rip),%rdi
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L0
L18:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D12
type: string
name: read_data
arguments: data_tag: D77
type: string
name: read_data
arguments: data_tag: D82
type: string
name: read_data
arguments: data_tag: D80
type: string
name: read_data
arguments: data_tag: D54
type: string
name: read_data
arguments: data_tag: D47
type: string
name: read_data
arguments: data_tag: D55
type: string
name: read_data
arguments: data_tag: D25
type: string
name: read_data
arguments: data_tag: D79
type: string

tool: D12: 
ERROR: Function requires 2 inputs.

tool: D77: Please try again.

tool: D82: Enter the name of 1) the program file and 2) the file to be scrambled.

tool: D80: r+

tool: D54: .sbl

tool: D47: w

tool: D55: 
The file has now been scrambled. 
See file "%s" in the directory

tool: D25: 
Files closed. Program Terminated.

tool: D79: 
ERROR: File could not be opened for reading.

assistant: ```c
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("\nERROR: Function requires 2 inputs.\n");
    printf("Please try again.\n");
    printf("Enter the name of 1) the program file and 2) the file to be scrambled.\n");
    exit(0);
  } else {
    FILE *fp_read;
    FILE *fp_write;
    char x, y;
    char newfile[50];
    fp_read = fopen(argv[1], "r+");
    if (fp_read == NULL) {
      printf("\nERROR: File could not be opened for reading.\n");
      exit(0);
    } else {
      strcpy(newfile, (strcat(argv[1], ".sbl")));
      fp_write = fopen(newfile, "w");
      if (fp_read == NULL) {
        printf("\nERROR: New scrambled file could not be opened for writing.\n");
        exit(0);
      } else {
        int i, j;
        while (feof(fp_read) == 0) {
          i = fread(&x, sizeof(x), 1, fp_read);
          j = fread(&y, sizeof(y), 1, fp_read);
          if (j == 1) {
            fwrite(&y, sizeof(char), 1, fp_write);
          }
          if (i == 1) {
            fwrite(&x, sizeof(char), 1, fp_write);
          }
        }
        printf("\nThe file has now been scrambled. \nSee file \"%s\" in the directory", newfile);
        fclose(fp_read);
        fclose(fp_write);
        printf("\nFiles closed. Program Terminated.\n");
        exit(0);
      }
    }
  }
}
```