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

```asm
<filt_f_message>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x150,%rsp
  mov    %rdi,-0x148(%rbp)
  mov    %rsi,-0x150(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x110(%rbp),%rax
  mov    %rax,-0x128(%rbp)
  movl   $0x0,-0x138(%rbp)
  mov    -0x148(%rbp),%rax
  mov    $0x3e,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x120(%rbp)
  mov    -0x148(%rbp),%rax
  mov    $0x3c,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x118(%rbp)
  mov    -0x148(%rbp),%rax
  lea    D74(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x130(%rbp)
  cmpq   $0x0,-0x130(%rbp)
  jne    L53
  mov    -0x148(%rbp),%rax
  mov    $0x28,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x130(%rbp)
  movl   $0x1,-0x138(%rbp)
L53:
  cmpq   $0x0,-0x130(%rbp)
  jne    L59
  mov    -0x148(%rbp),%rax
  lea    D21(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x130(%rbp)
  cmpq   $0x0,-0x130(%rbp)
  jne    L27
  mov    -0x148(%rbp),%rax
  lea    D69(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x130(%rbp)
L27:
  cmpq   $0x0,-0x130(%rbp)
  je     L59
  mov    -0x130(%rbp),%rax
  mov    $0x20,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x130(%rbp)
  movl   $0x2,-0x138(%rbp)
L59:
  cmpq   $0x0,-0x130(%rbp)
  jne    L7
  lea    D57(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x148(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x130(%rbp)
  movl   $0x3,-0x138(%rbp)
L7:
  mov    -0x120(%rbp),%rax
  sub    -0x118(%rbp),%rax
  add    $0x1,%eax
  mov    %eax,%edx
  mov    -0x148(%rbp),%rcx
  mov    -0x128(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x120(%rbp),%rax
  sub    -0x118(%rbp),%rax
  add    $0x1,%rax
  add    %rax,-0x128(%rbp)
  mov    -0x150(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  lea    0x5(%rax),%esi
  mov    -0x150(%rbp),%rdx
  mov    -0x128(%rbp),%rax
  mov    %rdx,%rcx
  lea    D34(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    -0x150(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    $0x4,%rax
  add    %rax,-0x128(%rbp)
  addq   $0x1,-0x120(%rbp)
  mov    -0x130(%rbp),%rax
  sub    -0x120(%rbp),%rax
  mov    %eax,%esi
  mov    -0x120(%rbp),%rdx
  mov    -0x128(%rbp),%rax
  mov    %rdx,%rcx
  lea    D67(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    %eax,-0x134(%rbp)
  mov    -0x130(%rbp),%rax
  sub    -0x120(%rbp),%rax
  sub    $0x1,%rax
  add    %rax,-0x128(%rbp)
  cmpl   $0x0,-0x138(%rbp)
  jne    L44
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x130(%rbp)
  jmp    L71
L44:
  mov    -0x130(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x130(%rbp)
  nop
L71:
  lea    -0x110(%rbp),%rdx
  mov    -0x128(%rbp),%rax
  sub    %rdx,%rax
  mov    %eax,%edx
  mov    $0x100,%eax
  sub    %edx,%eax
  mov    %eax,%esi
  mov    -0x130(%rbp),%rdx
  mov    -0x128(%rbp),%rax
  mov    %rdx,%rcx
  lea    D67(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    %eax,-0x134(%rbp)
  lea    -0x110(%rbp),%rcx
  mov    -0x148(%rbp),%rax
  mov    $0x100,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L33
  call   <__stack_chk_fail@plt>
L33:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D74
type_infered: string
name: read_data
arguments: label: D21
type_infered: string
name: read_data
arguments: label: D69
type_infered: string
name: read_data
arguments: label: D57
type_infered: string
name: read_data
arguments: label: D34
type_infered: string
name: read_data
arguments: label: D67
type_infered: string
name: read_data
arguments: label: D3
type_infered: string

tool: D74: EZP_

tool: D21: ]: 

tool: D69: : 

tool: D57: <13>Jul 27 11:27:46

tool: D34: 	<%s>	

tool: D67: %s

tool: D3: EZP_XXX

assistant: ```c
void filt_f_message(char *msg, char *keycat) {
  char *p1, *p2, *p3;
  char dst[256];
  char *cur = &dst[0];
  int n;
  int check_EZP = 0;
  p1 = strchr(msg, '>');
  p2 = strchr(msg, '<');
  p3 = strstr(msg, "EZP_");
  if (!p3) {
    p3 = strstr(msg, "(");
    check_EZP = 1;
  }
  if (!p3) {
    p3 = strstr(msg, "]: ");
    if (!p3) {
      p3 = strstr(msg, ": ");
    }
    if (p3) {
      p3 = strrchr(p3, ' ');
      check_EZP = 2;
    }
  }
  if (!p3) {
    p3 = msg + strlen("<13>Jul 27 11:27:46");
    check_EZP = 3;
  }
  strncpy(cur, msg, p1 - p2 + 1);
  cur = cur + (p1 - p2 + 1);
  snprintf(cur, strlen(keycat) + 5, "\t<%s>\t", keycat);
  cur = cur + (strlen(keycat) + 4);
  p1 += 1;
  n = snprintf(cur, p3 - p1, "%s", p1);
  cur = cur + (p3 - p1) - 1;
  switch (check_EZP) {
  case 0:
    p3 += strlen("EZP_XXX");
    break;
  case 1:
  case 2:
  default:
    p3 = strchr(p3, ':');
    break;
  }
  n = snprintf(cur, 256 - (cur - &dst[0]), "%s", p3);
  strncpy(msg, dst, 256);
}
```