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

```asm
<filt_w_message>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x440,%rsp
  mov    %rdi,-0x438(%rbp)
  mov    %rsi,-0x440(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x410(%rbp),%rax
  mov    %rax,-0x428(%rbp)
  mov    -0x438(%rbp),%rax
  mov    $0x3e,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x420(%rbp)
  mov    -0x438(%rbp),%rax
  lea    D59(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x418(%rbp)
  cmpq   $0x0,-0x420(%rbp)
  je     L52
  cmpq   $0x0,-0x418(%rbp)
  je     L52
  addq   $0x1,-0x420(%rbp)
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x418(%rbp)
  mov    -0x428(%rbp),%rax
  lea    D131(%rip),%rdx
  mov    $0x200,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %eax,-0x42c(%rbp)
  mov    -0x42c(%rbp),%eax
  cltq
  add    %rax,-0x428(%rbp)
  mov    -0x420(%rbp),%rcx
  mov    -0x428(%rbp),%rax
  mov    $0x10,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  addq   $0x10,-0x428(%rbp)
  lea    -0x410(%rbp),%rax
  add    $0x200,%rax
  sub    -0x428(%rbp),%rax
  mov    %eax,%esi
  mov    -0x418(%rbp),%rdx
  mov    -0x428(%rbp),%rax
  mov    %rdx,%rcx
  lea    D23(%rip),%rdx
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  lea    -0x410(%rbp),%rcx
  mov    -0x438(%rbp),%rax
  mov    $0x200,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x418(%rbp),%rax
  lea    D138(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L70
  mov    -0x418(%rbp),%rax
  lea    D44(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L48
L70:
  lea    -0x210(%rbp),%rax
  mov    $0x0,%r9d
  mov    $0x200,%r8d
  mov    %rax,%rcx
  lea    D24(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%esi
  lea    D119(%rip),%rax
  mov    %rax,%rdi
  call   <ezplib_get_attr_val@plt>
  lea    -0x210(%rbp),%rax
  lea    D38(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L62
  lea    -0x210(%rbp),%rax
  lea    D76(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L48
L62:
  lea    D76(%rip),%rax
  mov    %rax,%rcx
  lea    D47(%rip),%rax
  mov    %rax,%rdx
  mov    $0x0,%esi
  lea    D33(%rip),%rax
  mov    %rax,%rdi
  call   <ezplib_replace_attr@plt>
L48:
  mov    -0x438(%rbp),%rax
  mov    %rax,%rsi
  lea    D136(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L11
L52:
  nop
L11:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D59
type_guessed: string
name: parse_data
arguments: label: D131
type_guessed: string
name: parse_data
arguments: label: D23
type_guessed: string
name: parse_data
arguments: label: D138
type_guessed: string
name: parse_data
arguments: label: D44
type_guessed: string
name: parse_data
arguments: label: D24
type_guessed: string
name: parse_data
arguments: label: D119
type_guessed: string
name: parse_data
arguments: label: D38
type_guessed: string
name: parse_data
arguments: label: D76
type_guessed: string
name: parse_data
arguments: label: D47
type_guessed: string
name: parse_data
arguments: label: D33
type_guessed: string
name: parse_data
arguments: label: D136
type_guessed: string

tool: D59: WIFIConnect

tool: D131: <SYS>	

tool: D23: WIFI Connect: %s

tool: D138: wrong

tool: D44: encryption

tool: D24: state

tool: D119: wan_status_rule

tool: D38: 0

tool: D76: 1

tool: D47: wisp

tool: D33: plug_rule

tool: D136: msg:%s


assistant: ```c
void filt_w_message(char *msg, char *keycat) {
  char dst[512], wan_status[512];
  char *cur = &dst[0];
  char *p1, *p3;
  int n;
  p1 = strchr(msg, '>');
  p3 = strstr(msg, "WIFIConnect");
  if (!p1 || !p3)
    return;
  p1 += 1;
  p3 += strlen("WIFIConnect");
  n = snprintf(cur, 512, "<SYS>\t");
  cur = cur + n;
  memcpy(cur, p1, sizeof("Dec  8 11:12:58 ") - 1);
  cur = cur + (sizeof("Dec  8 11:12:58 ") - 1);
  snprintf(cur, (&dst[0]) + 512 - cur, "WIFI Connect: %s", p3);
  strncpy(msg, dst, 512);
  if (strstr(p3, "wrong") || strstr(p3, "encryption")) {
    ezplib_get_attr_val("wan_status_rule", 0, "state", wan_status, sizeof(wan_status), 0);
    if (!strcmp(wan_status, "0") || !strcmp(wan_status, "1"))
      ezplib_replace_attr("plug_rule", 0, "wisp", "1");
  }
  printf("msg:%s\n", msg);
}
```