void CmmRxRalinkFrameIndicate(int param_1,undefined4 param_2,int param_3,uint param_4)

{
  ushort uVar1;
  ushort uVar2;
  int iVar3;
  int iVar4;
  undefined4 uVar5;
  byte *pbVar6;
  short sVar7;
  undefined2 uVar8;
  void *__s2;
  void *__src;
  void *__src_00;
  undefined1 local_40;
  undefined1 local_3f;
  undefined1 auStack_3c [6];
  undefined1 auStack_36 [6];
  undefined1 auStack_30 [12];
  
  pbVar6 = *(byte **)(param_3 + 0x1c);
  uVar1 = (ushort)pbVar6[1] * 0x100 + (ushort)*pbVar6;
  param_4 = param_4 & 0xff;
  if (0x600 < uVar1) goto LAB_00022f28;
  if (*(ushort *)(param_3 + 0x20) <= uVar1) goto LAB_00022f28;
  *(byte **)(param_3 + 0x1c) = pbVar6 + 2;
  *(ushort *)(param_3 + 0x20) = *(ushort *)(param_3 + 0x20) - 2;
  if ((*(ushort *)(param_3 + 0x22) & 0x201) == 0) {
    iVar3 = *(int *)(param_3 + 0x14);
    if ((*(ushort *)(param_3 + 0x22) & 0x400) == 0) {
      __src_00 = (void *)(iVar3 + 10);
      __src = (void *)(iVar3 + 0x10);
    }
    else {
      __src_00 = (void *)(iVar3 + 0x10);
      __src = (void *)(iVar3 + 4);
    }
  }
  else {
    __src_00 = (void *)(*(int *)(param_3 + 0x14) + 0x18);
    __src = (void *)(*(int *)(param_3 + 0x14) + 0x10);
  }
  iVar3 = memcmp(&SNAP_802_1H,*(void **)(param_3 + 0x1c),6);
  if (iVar3 == 0) {
    iVar3 = *(int *)(param_3 + 0x1c);
LAB_00022d38:
    __s2 = (void *)(iVar3 + 6);
    iVar3 = memcmp(&IPX,__s2,2);
    if (((iVar3 == 0) || (iVar3 = memcmp(&APPLE_TALK,__s2,2), iVar3 == 0)) &&
       (iVar3 = memcmp(&SNAP_802_1H,*(void **)(param_3 + 0x1c),6), iVar3 == 0)) {
      uVar8 = *(undefined2 *)(param_3 + 0x20);
      goto LAB_00022df4;
    }
    memmove(auStack_3c,__src,6)   //possible issue identified - semgrep
    memmove(auStack_36,__src_00,6)   //possible issue identified - semgrep
    memmove(auStack_30,__s2,2)   //possible issue identified - semgrep
    *(short *)(param_3 + 0x20) = *(short *)(param_3 + 0x20) + -8;
    *(int *)(param_3 + 0x1c) = *(int *)(param_3 + 0x1c) + 8;
  }
  else {
    iVar3 = memcmp(&SNAP_BRIDGE_TUNNEL,*(void **)(param_3 + 0x1c),6);
    if (iVar3 == 0) {
      iVar3 = *(int *)(param_3 + 0x1c);
      goto LAB_00022d38;
    }
    uVar8 = *(undefined2 *)(param_3 + 0x20);
LAB_00022df4:
    local_40 = (undefined1)((ushort)uVar8 >> 8);
    local_3f = (undefined1)uVar8;
    memmove(auStack_3c,__src,6)   //possible issue identified - semgrep
    memmove(auStack_36,__src_00,6)   //possible issue identified - semgrep
    memmove(auStack_30,&local_40,2)   //possible issue identified - semgrep
  }
  if (*(int *)(param_3 + 0x18) == 0) {
    printk("<4>/home/eric/release/dir600b5/progs.priv/rt2860v2/build/rt2860v2_ap/../rt2860v2/common/cmm_data.c:%d assert pRxBlk->pRxPacketfailed\n"
           ,0xd01);
  }
  *(int *)(param_1 + 0x76750) = *(int *)(param_1 + 0x76750) + 1;
  uVar2 = *(short *)(param_3 + 0x20) - uVar1;
  iVar3 = *(int *)(param_3 + 0x1c) + uVar2 + 0xe;
  if ((param_4 < *(byte *)(param_1 + 0x51aa)) && (param_4 < 0x10)) {
    iVar4 = param_4 * 0x1140 + param_1;
    sVar7 = *(short *)(iVar4 + 0x5924)   //possible issue identified - semgrep
    uVar8 = 0;
    if (sVar7 != 0) {
      uVar8 = *(undefined2 *)(iVar4 + 0x5926);
    }
  }
  else {
    sVar7 = 0;
    uVar8 = 0;
  }
  uVar5 = get_netdev_from_bssid(param_1,param_4);
  iVar3 = duplicate_pkt_with_VLAN
                    (uVar5,sVar7,uVar8,iVar3 + -0xe,0xe,iVar3,uVar1 - 0xe,param_4,&TPID);
  if (iVar3 != 0) {
    *(ushort *)(param_3 + 0x20) = uVar2;
    sVar7 = 0;
    if (param_4 < *(byte *)(param_1 + 0x51aa)) {
      uVar8 = 0;
      if (param_4 < 0x10) {
        iVar4 = param_4 * 0x1140 + param_1;
        sVar7 = *(short *)(iVar4 + 0x5924)   //possible issue identified - semgrep
        if (sVar7 != 0) {
          uVar8 = *(undefined2 *)(iVar4 + 0x5926);
        }
      }
    }
    else {
      uVar8 = 0;
    }
    uVar5 = get_netdev_from_bssid(param_1,param_4);
    wlan_802_11_to_802_3_packet
              (uVar5,*(undefined1 *)(param_3 + 0x25),sVar7,uVar8,*(undefined4 *)(param_3 + 0x18),
               *(undefined4 *)(param_3 + 0x1c),*(undefined2 *)(param_3 + 0x20),auStack_3c,param_4,
               &TPID);
    Announce_or_Forward_802_3_Packet(param_1,*(undefined4 *)(param_3 + 0x18),param_4);
    Announce_or_Forward_802_3_Packet(param_1,iVar3,param_4);
    return;
  }
LAB_00022f28:
  RTMPFreeNdisPacket(param_1,*(undefined4 *)(param_3 + 0x18));
  return;
}