void PeerPublicAction(int param_1,int param_2)

{
  byte bVar1;
  bool bVar2;
  code *pcVar3;
  int iVar4;
  undefined4 uVar5;
  uint uVar6;
  int iVar7;
  uint uVar8;
  byte *pbVar9;
  byte *pbVar10;
  undefined1 auStack_30 [2];
  byte local_2e;
  byte local_2d;
  
  if ((*(byte *)(param_2 + 0x65d) < 0x20) && (*(char *)(param_2 + 0x19) == '\0')) {
    if (*(uint *)(param_2 + 0x648) < 0x1c) {
      if (RTDebugLevel != 0) {
        printk("ACTION - 20/40 BSS Coexistence Management Frame length too short! len = %ld!\n");
      }
    }
    else {
      if (RTDebugLevel < 3) {
        uVar5 = *(undefined4 *)(param_2 + 0x648);
      }
      else {
        printk("ACTION - 20/40 BSS Coexistence Management action----> \n");
        uVar5 = *(undefined4 *)(param_2 + 0x648);
      }
      hex_dump("CoexistenceMgmtFrame",param_2,uVar5);
      iVar4 = 0;
      if (0x1d < *(uint *)(param_2 + 0x648)) {
        iVar4 = param_2 + 0x1d;
      }
      if ((*(char *)(param_1 + 0x16b30) == '\0') || (*(char *)(param_1 + 0x16e07) == '\x01')) {
        if (2 < RTDebugLevel) {
          printk("20/40 BSS CoexMgmt=%d, bForty_Mhz_Intolerant=%d, ignore this action!!\n",
                 *(char *)(param_1 + 0x16b30),*(undefined1 *)(param_1 + 0x16e07));
        }
      }
      else {
        bVar1 = *(byte *)(param_2 + 0x1c);
        if ((bVar1 & 6) == 0) {
          if (iVar4 == 0) {
            return;
          }
          if (*(byte *)(iVar4 + 1) < 2) {
            return;
          }
          pbVar10 = (byte *)(iVar4 + 3);
          if (2 < RTDebugLevel) {
            printk("The pIntolerantReport len = %d, chlist=");
          }
          iVar7 = 0;
          pbVar9 = pbVar10;
          while (bVar2 = iVar7 < (int)(*(byte *)(iVar4 + 1) - 1), iVar7 = iVar7 + 1, bVar2) {
            if (RTDebugLevel < 3) {
              pbVar9 = pbVar9 + 1;
            }
            else {
              printk(&_LC30,*pbVar9)   //possible issue identified - semgrep
              pbVar9 = pbVar9 + 1;
            }
          }
          if (2 < RTDebugLevel) {
            printk(&_LC31)   //possible issue identified - semgrep
          }
          iVar7 = GetBssCoexEffectedChRange(param_1,auStack_30);
          if (iVar7 == 1) {
            uVar8 = (uint)local_2d;
            if (2 < RTDebugLevel) {
              printk("Check IntolerantReport Channel List in our effectedChList(%d~%d)\n",
                     *(undefined1 *)((uint)local_2e * 10 + param_1 + 0x4e3e),
                     *(undefined1 *)(uVar8 * 10 + param_1 + 0x4e3e));
              uVar8 = (uint)local_2d;
            }
            iVar7 = 0;
            do {
              bVar2 = (int)(*(byte *)(iVar4 + 1) - 1) <= iVar7;
              iVar7 = iVar7 + 1;
              if (bVar2) {
                iVar4 = 0;
                goto LAB_0001df80;
              }
              bVar1 = *pbVar10;
              pbVar10 = pbVar10 + 1;
            } while ((bVar1 < *(byte *)((uint)local_2e * 10 + param_1 + 0x4e3e)) ||
                    (*(byte *)(uVar8 * 10 + param_1 + 0x4e3e) < bVar1));
            iVar4 = 1;
            if (2 < RTDebugLevel) {
              printk("Found Intolerant channel in effect range=%d!\n");
              iVar4 = 1;
            }
LAB_0001df80:
            if (2 < RTDebugLevel) {
              printk("After CoexChRange Check, bNeedFallBack=%d!\n",iVar4);
            }
            if (iVar4 == 0) {
              return;
            }
            bVar1 = *(byte *)(param_2 + 0x1c);
          }
          else {
            bVar1 = *(byte *)(param_2 + 0x1c);
          }
          *(byte *)(param_2 + 0x1c) = bVar1 & 0xf9 | 6;
        }
        else if (2 < RTDebugLevel) {
          printk("BSS_2040_COEXIST: BSS20WidthReq=%d, Intolerant40=%d!\n",
                 ((uint)bVar1 << 0x1d) >> 0x1f,((uint)bVar1 << 0x1e) >> 0x1f);
        }
        memmove((void *)(param_1 + 0x16b74),(void *)(param_2 + 0x1c),1)   //possible issue identified - semgrep
        bVar1 = *(byte *)(param_1 + 0x16b33);
        *(byte *)(param_1 + 0x16b33) = bVar1 | 2;
        if ((bVar1 & 1) == 0) {
          if (2 < RTDebugLevel) {
            printk("Fire the Bss2040CoexistTimer with timeout=%ld!\n",
                   *(undefined4 *)(param_1 + 0x16b6c));
          }
          iVar4 = *(int *)(param_1 + 0x16b6c);
          *(byte *)(param_1 + 0x16b33) = *(byte *)(param_1 + 0x16b33) | 1;
          pcVar3 = RTMPSetTimer;
        }
        else {
          if (2 < RTDebugLevel) {
            printk("Already fallback to 20MHz, Extend the timeout of Bss2040CoexistTimer!\n");
          }
          iVar4 = *(int *)(param_1 + 0x16b6c);
          pcVar3 = RTMPModTimer;
        }
        uVar8 = 0;
        (*pcVar3)(param_1 + 0x16b34,iVar4 * 1000 + 5000);
        while( true ) {
          uVar6 = uVar8 & 0xff;
          bVar2 = (int)(uint)*(byte *)(param_1 + 0x51aa) <= (int)uVar8;
          uVar8 = uVar8 + 1;
          if (bVar2) break;
          SendBSS2040CoexistMgmtAction(param_1,0,uVar6,0);
        }
      }
    }
  }
  return;
}