user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r15
  lea    D61(%rip),%rsi
  lea    D72(%rip),%rdi
  push   %r14
  lea    D53(%rip),%r14
  push   %r13
  lea    D45(%rip),%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  call   <fopen@plt>
  lea    D104(%rip),%rsi
  lea    D106(%rip),%rdi
  mov    %rax,%r12
  call   <fopen@plt>
  mov    %r12,%rdi
  mov    %rax,%rbp
  call   <assert@plt>
  mov    %rbp,%rdi
  call   <assert@plt>
  jmp    L12
  nopw   0x0(%rax,%rax,1)
L20:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rbp,%rcx
  mov    $0x33,%edx
  mov    %r14,%rdi
  mov    $0x1,%esi
  mov    %eax,%r15d
  call   <fwrite@plt>
  mov    %rbx,%rdx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D10(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    D103(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%edx
  xor    %eax,%eax
  call   <fprintf@plt>
  movsbl 0x1(%rsp),%ecx
  movsbl (%rsp),%edx
  xor    %eax,%eax
  lea    D116(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    -0x1(%r15),%eax
  lea    -0x2(%r15),%r8d
  mov    %rbp,%rdi
  cltq
  movslq %r8d,%r8
  lea    D9(%rip),%rsi
  movsbl (%rsp,%rax,1),%ecx
  movsbl (%rsp,%r8,1),%edx
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %rbp,%rcx
  mov    $0x34,%edx
  mov    %r13,%rdi
  mov    $0x1,%esi
  call   <fwrite@plt>
L12:
  mov    %r12,%rdx
  mov    $0x80,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L26
  cmpb   $0xa,(%rsp)
  jne    L20
  mov    %rbp,%rcx
  mov    %r14,%rdi
  mov    $0x33,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x15,%edx
  mov    $0x1,%esi
  lea    D56(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rbp,%rdi
  lea    D123(%rip),%rsi
  mov    %eax,%edx
  xor    %eax,%eax
  call   <fprintf@plt>
  movsbl (%rsp),%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D121(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbp,%rcx
  mov    $0x34,%edx
  mov    %r13,%rdi
  mov    $0x1,%esi
  call   <fwrite@plt>
  jmp    L20
L26:
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  add    $0x98,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L22:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D61
type_guessed: string
name: unpack_data
arguments: tag: D72
type_guessed: string
name: unpack_data
arguments: tag: D53
type_guessed: string
name: unpack_data
arguments: tag: D45
type_guessed: string
name: unpack_data
arguments: tag: D104
type_guessed: string
name: unpack_data
arguments: tag: D106
type_guessed: string
name: unpack_data
arguments: tag: D10
type_guessed: string
name: unpack_data
arguments: tag: D103
type_guessed: string
name: unpack_data
arguments: tag: D116
type_guessed: string
name: unpack_data
arguments: tag: D9
type_guessed: string
name: unpack_data
arguments: tag: D56
type_guessed: string
name: unpack_data
arguments: tag: D123
type_guessed: string
name: unpack_data
arguments: tag: D121
type_guessed: string

tool: D61: r

tool: D72: input.dat

tool: D53: ==================================================


tool: D45: ==================================================



tool: D104: w

tool: D106: output.dat

tool: D10: the line you've just entered is '%s'


tool: D103: the length of it is %d


tool: D116: first two chars '%c' and '%c'


tool: D9: last two chars '%c' and '%c'


tool: D56: this is a white line


tool: D123: the length of this line is %d


tool: D121: char is '%c'


assistant: ```c
int main(void) {
  char line[128];
  int len;
  FILE *in, *out;
  in = fopen("input.dat", "r");
  out = fopen("output.dat", "w");
  assert(in);
  assert(out);
  while (fgets(line, sizeof(line), in) != NULL) {
    if (line[0] == '\n') {
      fprintf(out, "==================================================\n");
      fprintf(out, "this is a white line\n");
      len = strlen(line);
      fprintf(out, "the length of this line is %d\n", len);
      fprintf(out, "char is '%c'\n", line[0]);
      fprintf(out, "==================================================\n\n");
    }
    len = strlen(line);
    fprintf(out, "==================================================\n");
    fprintf(out, "the line you've just entered is '%s'\n", line);
    fprintf(out, "the length of it is %d\n", strlen(line));
    fprintf(out, "first two chars '%c' and '%c'\n", line[0], line[1]);
    fprintf(out, "last two chars '%c' and '%c'\n", line[len - 2], line[len - 1]);
    fprintf(out, "==================================================\n\n");
  }
  fclose(in);
  fclose(out);
  return 0;
}
```