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

```asm
<process_e>:
  endbr64
  push   %r15
  lea    D66(%rip),%rsi
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x418,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  test   %rax,%rax
  je     L119
  lea    D22(%rip),%rsi
  lea    D19(%rip),%rdi
  mov    %rax,%rbp
  mov    %rsp,%rbx
  call   <fopen@plt>
  lea    D82(%rip),%r12
  lea    0x200(%rsp),%r15
  mov    %rax,%r13
  lea    D25(%rip),%r14
  test   %rax,%rax
  je     L7
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %eax,%eax
  jne    L32
  nopl   0x0(%rax,%rax,1)
L44:
  mov    %rbp,%rdx
  mov    $0x200,%esi
  mov    %rbx,%rdi
  movb   $0x0,(%rsp)
  call   <fgets@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    %rbx,%rdi
  mov    %eax,%edx
  call   <memcmp@plt>
  test   %rax,%rax
  je     L35
L88:
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L18
  sub    $0x1,%eax
  mov    %rbx,%rdx
  lea    0x1(%rsp,%rax,1),%rax
  nopl   0x0(%rax)
L113:
  cmpb   $0x44,(%rdx)
  jne    L63
  movb   $0x45,(%rdx)
L63:
  add    $0x1,%rdx
  cmp    %rax,%rdx
  jne    L113
L18:
  mov    %rbx,%rdi
  mov    %r13,%rsi
  call   <fputs@plt>
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L44
L32:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r13,%rdi
  call   <fclose@plt>
  test   %rax,%rax
  jne    L105
L132:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L148
  add    $0x418,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L35:
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <strcpy@plt>
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rbx,%rdi
  movslq %eax,%rsi
  call   <strcat@plt>
  jmp    L88
L119:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L148
  mov    %r12,%rsi
  lea    D72(%rip),%rdi
L66:
  add    $0x418,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1130 <printf@plt>
L105:
  lea    D19(%rip),%rsi
  lea    D96(%rip),%rdi
  call   <printf@plt>
  jmp    L132
L7:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L148
  lea    D19(%rip),%rsi
  lea    D33(%rip),%rdi
  jmp    L66
L148:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D66
datatype: string
name: retrieve_data
arguments: data_tag: D22
datatype: string
name: retrieve_data
arguments: data_tag: D19
datatype: string
name: retrieve_data
arguments: data_tag: D82
datatype: string
name: retrieve_data
arguments: data_tag: D25
datatype: string
name: retrieve_data
arguments: data_tag: D72
datatype: string
name: retrieve_data
arguments: data_tag: D96
datatype: string
name: retrieve_data
arguments: data_tag: D33
datatype: string

tool: D66: r

tool: D22: w

tool: D19: prool.tmp

tool: D82: PERMANENT GROUP

tool: D25: gr

tool: D72: prool_process_e: can't open input file `%s'


tool: D96: prool_process_e: can't close tmp file `%s'


tool: D33: prool_process_e: can't open tmp file `%s'


assistant: ```c
void process_e(char *filename) {
  FILE *f1, *f2;
  char buf[512], *pp;
  char tmp_buf[512];
  int i, len;
  f1 = fopen(filename, "r");
  if (f1 == NULL) {
    printf("prool_process_e: can't open input file `%s'\n", filename);
    return;
  }
  f2 = fopen("prool.tmp", "w");
  if (f2 == NULL) {
    printf("prool_process_e: can't open tmp file `%s'\n", "prool.tmp");
    return;
  }
  while (!feof(f1)) {
    buf[0] = 0;
    fgets(buf, 512, f1);
    if (memcmp(buf, "PERMANENT GROUP", strlen("PERMANENT GROUP")) == 0) {
      strcpy(tmp_buf, buf);
      strcpy(buf, "gr");
      strcat(buf, pp + strlen("PERMANENT GROUP"));
    }
    len = strlen(buf);
    for (i = 0; i < len; i++) {
      if (buf[i] == 'D')
        buf[i] = 'E';
    }
    fputs(buf, f2);
  }
  fclose(f1);
  if (fclose(f2)) {
    printf("prool_process_e: can't close tmp file `%s'\n", "prool.tmp");
    return;
  }
}
```