void APHandleRxMgmtFrame(int param_1,int param_2)

{
  byte bVar1;
  char cVar2;
  uint uVar3;
  int iVar4;
  char *pcVar5;
  ushort uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  byte *pbVar9;
  byte *pbVar10;
  undefined4 uVar11;
  short local_20 [4];
  
  pbVar9 = *(byte **)(param_2 + 0x10);
  pbVar10 = *(byte **)(param_2 + 0x14);
  uVar11 = *(undefined4 *)(param_2 + 0x18);
  if ((((*(byte *)(param_2 + 0xc) & 0x10) == 0) && ((*pbVar10 & 0xf0) != 0x80)) &&
     ((*pbVar10 & 0xf0) != 0x40)) goto LAB_000795d8;
  bVar1 = *pbVar10;
  if (*(char *)(param_1 + 0x165d9) == '\x01') {
    if (((bVar1 & 0xf0) != 0) && ((bVar1 & 0xf0) != 0xb0)) {
      bVar1 = *pbVar10;
      goto LAB_00079340;
    }
    if (RTDebugLevel < 3) goto LAB_000795d8;
    pcVar5 = "   Disallow new Association \n ";
    goto LAB_000793d4;
  }
LAB_00079340:
  if ((bVar1 & 0xf0) == 0xb0) {
    if ((pbVar10[1] & 0x40) == 0) {
      uVar6 = *(ushort *)(param_2 + 0x20);
    }
    else {
      if ((*(byte *)(param_2 + 0xe) & 1) == 0) {
        local_20[0] = ((ushort)((pbVar9[3] & 0xf) << 8) | (ushort)pbVar9[2]) - 0x18;
        if ((*pbVar9 < 0x20) && (iVar4 = (uint)*pbVar9 * 0xa20, param_1 + iVar4 + 0x5cf38 != 0)) {
          iVar4 = RTMPSoftDecryptWEP(param_1,param_1 + 0x75594 +
                                             (uint)*(byte *)(param_1 + iVar4 + 0x5cf69) * 0x10c +
                                             (pbVar9[1] & 3) * 0x43,pbVar10 + 0x18,local_20);
          if (iVar4 != 0) {
            if (RTDebugLevel < 3) {
              bVar1 = pbVar9[3];
            }
            else {
              printk("Descrypt AUTH seq#3 successfully\n");
              bVar1 = pbVar9[3];
            }
            uVar3 = ((bVar1 & 0xf) << 8 | (uint)pbVar9[2]) - 8 & 0xffff;
            pbVar9[3] = bVar1 & 0xf0 | (byte)((uVar3 << 0x14) >> 0x1c);
            pbVar9[2] = (byte)uVar3;
            uVar6 = *(ushort *)(param_2 + 0x20);
            goto LAB_000794b4;
          }
          if (RTDebugLevel == 0) goto LAB_000795d8;
          pcVar5 = "ERROR : SW decrypt WEP data fails.\n";
        }
        else {
          if (RTDebugLevel == 0) goto LAB_000795d8;
          pcVar5 = "ERROR : SW decrypt WEP data fails - the Entry is empty.\n";
        }
LAB_000793d4:
        printk(pcVar5);
        goto LAB_000795d8;
      }
      uVar6 = *(ushort *)(param_2 + 0x20);
    }
  }
  else {
    uVar6 = *(ushort *)(param_2 + 0x20);
  }
LAB_000794b4:
  if (uVar6 < 0x5f1) {
    if ((*pbVar10 & 0xf0) == 0xd0) {
      iVar4 = PACInquiry(param_1,*pbVar9);
      if (iVar4 != 0) {
        APPsIndicate(param_1,pbVar10 + 10,*(undefined2 *)(iVar4 + 0x27e),
                     ((uint)pbVar10[1] << 0x1b) >> 0x1f);
      }
      cVar2 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    else {
      cVar2 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    if (cVar2 == '\0') {
      uVar7 = *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x1120);
      uVar8 = *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x111c);
    }
    else {
      uVar8 = 0;
      uVar7 = 0;
    }
    MlmeEnqueueForRecv(param_1,*pbVar9,uVar7,uVar8,pbVar9[8],pbVar9[9],pbVar9[10],
                       (pbVar9[3] & 0xf) << 8 | (uint)pbVar9[2],pbVar10,0,1)   //possible issue identified - semgrep
  }
  else {
    if (RTDebugLevel < 3) {
      iVar4 = *(int *)(param_2 + 0x1c);
    }
    else {
      printk("DataSize  = %d\n");
      iVar4 = *(int *)(param_2 + 0x1c);
    }
    hex_dump("MGMT ???",pbVar10,iVar4 - (int)pbVar10);
  }
LAB_000795d8:
  RTMPFreeNdisPacket(param_1,uVar11);
  return;
}