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

```asm
<process_e>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x440,%rsp
  mov    %rdi,-0x438(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x438(%rbp),%rax
  lea    D11(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x428(%rbp)
  cmpq   $0x0,-0x428(%rbp)
  jne    L103
  mov    -0x438(%rbp),%rax
  mov    %rax,%rsi
  lea    D95(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L4
L103:
  lea    D99(%rip),%rax
  mov    %rax,%rsi
  lea    D40(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x420(%rbp)
  cmpq   $0x0,-0x420(%rbp)
  jne    L47
  lea    D40(%rip),%rax
  mov    %rax,%rsi
  lea    D106(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L4
L28:
  movb   $0x0,-0x410(%rbp)
  mov    -0x428(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    $0x200,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  lea    D66(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  lea    -0x410(%rbp),%rax
  lea    D66(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L87
  lea    -0x410(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x410(%rbp),%rax
  lea    D33(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    D66(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x418(%rbp),%rax
  add    %rax,%rdx
  lea    -0x410(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
L87:
  lea    -0x410(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x42c(%rbp)
  movl   $0x0,-0x430(%rbp)
  jmp    L20
L109:
  mov    -0x430(%rbp),%eax
  cltq
  movzbl -0x410(%rbp,%rax,1),%eax
  cmp    $0x44,%al
  jne    L52
  mov    -0x430(%rbp),%eax
  cltq
  movb   $0x45,-0x410(%rbp,%rax,1)
L52:
  addl   $0x1,-0x430(%rbp)
L20:
  mov    -0x430(%rbp),%eax
  cmp    -0x42c(%rbp),%eax
  jl     L109
  mov    -0x420(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fputs@plt>
L47:
  mov    -0x428(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L28
  mov    -0x428(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x420(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  test   %rax,%rax
  je     L4
  lea    D40(%rip),%rax
  mov    %rax,%rsi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
L4:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D11
type: string
name: disassemble_data
arguments: tag: D95
type: string
name: disassemble_data
arguments: tag: D99
type: string
name: disassemble_data
arguments: tag: D40
type: string
name: disassemble_data
arguments: tag: D106
type: string
name: disassemble_data
arguments: tag: D66
type: string
name: disassemble_data
arguments: tag: D33
type: string
name: disassemble_data
arguments: tag: D24
type: string

tool: D11: r

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


tool: D99: w

tool: D40: prool.tmp

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


tool: D66: PERMANENT GROUP

tool: D33: gr

tool: D24: prool_process_e: can't close 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;
  }
}
```