void convert_reordering_packet_to_preAMSDU_or_802_3_packet(int param_1,int param_2,uint param_3)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  undefined2 uVar4;
  short sVar5;
  void *__s2;
  void *__src;
  void *__src_00;
  undefined1 local_38;
  undefined1 local_37;
  undefined1 auStack_34 [6];
  undefined1 auStack_2e [6];
  undefined1 auStack_28 [8];
  
  param_3 = param_3 & 0xff;
  if ((*(ushort *)(param_2 + 0x22) & 0x201) == 0) {
    iVar1 = *(int *)(param_2 + 0x14);
    if ((*(ushort *)(param_2 + 0x22) & 0x400) == 0) {
      __src_00 = (void *)(iVar1 + 10);
      __src = (void *)(iVar1 + 0x10);
    }
    else {
      __src_00 = (void *)(iVar1 + 0x10);
      __src = (void *)(iVar1 + 4);
    }
  }
  else {
    __src_00 = (void *)(*(int *)(param_2 + 0x14) + 0x18);
    __src = (void *)(*(int *)(param_2 + 0x14) + 0x10);
  }
  iVar1 = memcmp(&SNAP_802_1H,*(void **)(param_2 + 0x1c),6);
  if (iVar1 == 0) {
    iVar1 = *(int *)(param_2 + 0x1c);
LAB_0001f10c:
    __s2 = (void *)(iVar1 + 6);
    iVar1 = memcmp(&IPX,__s2,2);
    if (((iVar1 != 0) && (iVar1 = memcmp(&APPLE_TALK,__s2,2), iVar1 != 0)) ||
       (iVar1 = memcmp(&SNAP_802_1H,*(void **)(param_2 + 0x1c),6), iVar1 != 0)) {
      memmove(auStack_34,__src,6)   //possible issue identified - semgrep
      memmove(auStack_2e,__src_00,6)   //possible issue identified - semgrep
      memmove(auStack_28,__s2,2)   //possible issue identified - semgrep
      *(short *)(param_2 + 0x20) = *(short *)(param_2 + 0x20) + -8;
      *(int *)(param_2 + 0x1c) = *(int *)(param_2 + 0x1c) + 8;
      goto LAB_0001f20c;
    }
    uVar4 = *(undefined2 *)(param_2 + 0x20);
  }
  else {
    iVar1 = memcmp(&SNAP_BRIDGE_TUNNEL,*(void **)(param_2 + 0x1c),6);
    if (iVar1 == 0) {
      iVar1 = *(int *)(param_2 + 0x1c);
      goto LAB_0001f10c;
    }
    uVar4 = *(undefined2 *)(param_2 + 0x20);
  }
  local_38 = (undefined1)((ushort)uVar4 >> 8);
  local_37 = (undefined1)uVar4;
  memmove(auStack_34,__src,6)   //possible issue identified - semgrep
  memmove(auStack_2e,__src_00,6)   //possible issue identified - semgrep
  memmove(auStack_28,&local_38,2)   //possible issue identified - semgrep
LAB_0001f20c:
  if (*(int *)(param_2 + 0x18) == 0) {
    printk("<4>/home/eric/release/dir600b5/progs.priv/rt2860v2/build/rt2860v2_ap/../rt2860v2/common/ba_action.c:%d assert pRxBlk->pRxPacketfailed\n"
           ,0x655);
  }
  iVar1 = *(int *)(param_2 + 0x18);
  uVar2 = get_netdev_from_bssid(param_1,param_3);
  *(undefined4 *)(iVar1 + 0x14) = uVar2;
  *(undefined4 *)(iVar1 + 0x9c) = *(undefined4 *)(param_2 + 0x1c);
  *(uint *)(iVar1 + 0x4c) = (uint)*(ushort *)(param_2 + 0x20);
  *(uint *)(iVar1 + 0x90) = *(int *)(param_2 + 0x1c) + (uint)*(ushort *)(param_2 + 0x20);
  if ((*(ushort *)(param_2 + 0x22) & 2) == 0) {
    iVar3 = 0;
    if ((param_3 < *(byte *)(param_1 + 0x51aa)) && (param_3 < 0x10)) {
      param_1 = param_3 * 0x1140 + param_1;
      sVar5 = *(short *)(param_1 + 0x5924)   //possible issue identified - semgrep
      if (sVar5 == 0) {
        uVar4 = 0;
      }
      else {
        uVar4 = *(undefined2 *)(param_1 + 0x5926);
        iVar3 = 4;
      }
    }
    else {
      sVar5 = 0;
      uVar4 = 0;
    }
    uVar2 = skb_push(iVar1,iVar3 + 0xe);
    VLAN_8023_Header_Copy(sVar5,uVar4,auStack_34,0xe,uVar2,param_3,&TPID);
  }
  return;
}