undefined4 FUN_004012c4(int param_1)

{
  ushort uVar1;
  ssize_t sVar2;
  int iVar3;
  char *pcVar4;
  undefined1 *__s;
  undefined1 *puVar5;
  int aiStack_60 [2];
  ushort auStack_54 [2];
  undefined4 local_50;
  undefined1 auStack_4c [16];
  undefined1 auStack_3c [32];
  
  iVar3 = -(max_udp_pdu_size + 0xeU & 0xfffffff8);
  __s = auStack_3c + iVar3 + -0x1c;
  local_50 = 0;
  memset(__s,0,max_udp_pdu_size);
  puVar5 = auStack_4c;
  if (param_1 == msockfd4) {
    local_50 = 0x10;
  }
  else {
    puVar5 = auStack_3c;
    if (param_1 != msockfd6) {
      pcVar4 = "%s: ERROR!!! sockfd: %d not match, should not happen...!!\n";
      goto LAB_004014cc;
    }
    local_50 = 0x1c;
  }
  *(undefined1 **)((int)aiStack_60 + iVar3) = puVar5;
  *(undefined4 **)((int)aiStack_60 + iVar3 + 4) = &local_50;
  sVar2 = recvfrom(param_1,__s,max_udp_pdu_size,0,*(sockaddr **)((int)aiStack_60 + iVar3),
                   *(socklen_t **)((int)aiStack_60 + iVar3 + 4))   //possible issue identified - semgrep
  if ((max_udp_pdu_size < sVar2) || (sVar2 < 1)) {
    pcVar4 = "%s: recvfrom() fail, max packet length exceed (max: %u)!!!\n";
    param_1 = max_udp_pdu_size;
LAB_004014cc:
    verbose(pcVar4,"llmnresp_recv",param_1);
    return 0xffffffff;
  }
  FUN_00400fdc(param_1,__s,puVar5);
  if ((*(ushort *)(auStack_3c + iVar3 + -0x1a) & 0xff) == 0 &&
      *(ushort *)(auStack_3c + iVar3 + -0x1a) >> 8 == 0) {
    pcVar4 = ">> %s: llmnrhdr conditions check fail, we don\'t process this packet!!\n";
    if (((*(ushort *)((int)auStack_54 + iVar3) & 0xff) << 8 |
        (uint)(*(ushort *)((int)auStack_54 + iVar3) >> 8)) != 1) goto LAB_004014a0;
    uVar1 = *(ushort *)((int)auStack_54 + iVar3 + 2);
    if (((uVar1 & 0xff) == 0 && uVar1 >> 8 == 0) &&
       ((*(ushort *)(auStack_4c + iVar3 + -4) & 0xff) == 0 &&
        *(ushort *)(auStack_4c + iVar3 + -4) >> 8 == 0)) {
      pcVar4 = ">> %s: llmnrhdr conditions check fail, we don\'t process this packet!!\n";
      if ((*(ushort *)(auStack_4c + iVar3 + -2) & 0xff) == 0 &&
          *(ushort *)(auStack_4c + iVar3 + -2) >> 8 == 0) {
        iVar3 = qrec_process(param_1,puVar5,&local_50,__s);
        if (iVar3 == 0) {
          return 0;
        }
        pcVar4 = ">> %s: qrec conditions check fail, we don\'t process this packet!!\n";
      }
      goto LAB_004014a0;
    }
  }
  pcVar4 = ">> %s: llmnrhdr conditions check fail, we don\'t process this packet!!\n";
LAB_004014a0:
  verbose(pcVar4,"llmnresp_recv");
  return 0;
}