undefined4 FUN_0040c984(undefined4 param_1,undefined4 param_2,undefined4 param_3)

{
  char *__s;
  char *__nptr;
  char *__s_00;
  size_t sVar1;
  int iVar2;
  int iVar3;
  void *local_828;
  undefined1 local_824;
  undefined1 local_823;
  undefined1 auStack_822 [17];
  undefined1 auStack_811 [2033];
  
  memset(&local_824,0,0x800)   //possible issue identified - semgrep
  local_828 = (void *)0x0;
  __s = (char *)FUN_0040c5d0(param_3,"NewMessage");
  if ((((__s != (char *)0x0) &&
       (__nptr = (char *)FUN_0040c5d0(param_3,"NewWLANEventType"), __nptr != (char *)0x0)) &&
      (__s_00 = (char *)FUN_0040c5d0(param_3,"NewWLANEventMAC"), __s_00 != (char *)0x0)) &&
     (sVar1 = strlen(__s_00), sVar1 == 0x11)) {
    sVar1 = strlen(__s);
    sVar1 = base64decode(__s,sVar1,&local_828);
    if (sVar1 != 0) {
      iVar2 = FUN_0040c654(5,0);
      if (iVar2 != 0) {
        local_824 = 0xd;
        iVar3 = atoi(__nptr);
        local_823 = (undefined1)iVar3;
        memcpy(auStack_822,__s_00,0x11)   //possible issue identified - semgrep
        memcpy(auStack_811,local_828,sVar1)   //possible issue identified - semgrep
        free(local_828);
        local_828 = (void *)0x0;
        usock_send(iVar2,&local_824,sVar1 + 0x13,0x4000);
      }
      goto LAB_0040cb20;
    }
  }
  iVar2 = 0;
LAB_0040cb20:
  FUN_0040c1f0(200,param_1,param_2,0,0);
  if (local_828 != (void *)0x0) {
    free(local_828);
  }
  if (iVar2 != 0) {
    usock_close(iVar2);
  }
  return 0;
}