clean up the following decompiled C code: 
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

void IppSendDatagramsCommon
               (undefined8 param_1,byte param_2,undefined1 *param_3,undefined8 param_4,
               undefined8 param_5)

{
  ushort uVar1;
  ushort uVar2;
  longlong *plVar3;
  int *piVar4;
  undefined auVar5 [16];
  undefined auVar6 [16];
  int iVar7;
  longlong **pplVar8;
  bool bVar9;
  bool bVar10;
  bool bVar11;
  undefined uVar12;
  byte bVar13;
  char cVar14;
  int iVar15;
  int iVar16;
  int iVar17;
  undefined4 uVar18;
  int *piVar19;
  ulonglong uVar20;
  longlong *plVar21;
  int *piVar22;
  longlong lVar23;
  uint uVar24;
  undefined1 *puVar25;
  uint uVar26;
  longlong lVar27;
  int **ppiVar28;
  undefined4 uVar29;
  longlong *plVar30;
  longlong unaff_GS_OFFSET;
  undefined8 in_stack_fffffffffffffea8;
  int *piVar31;
  undefined8 *puVar32;
  undefined8 in_stack_fffffffffffffeb0;
  undefined8 uVar33;
  undefined4 uVar34;
  undefined8 in_stack_fffffffffffffec0;
  ulonglong in_stack_fffffffffffffec8;
  int local_f4;
  int local_e8;
  char local_e0;
  int local_cc;
  int *local_c8;
  uint local_c0;
  undefined8 local_b8;
  longlong *local_b0;
  longlong *local_a8;
  int *local_a0;
  int local_98;
  int *local_90;
  undefined8 local_88;
  undefined4 local_80;
  undefined local_7c;
  undefined8 local_78;
  undefined8 local_70;
  undefined4 local_68;
  longlong *local_60;
  undefined4 local_58;
  undefined local_54;
  undefined8 local_50;
  int local_48;
  
  uVar34 = (undefined4)((ulonglong)in_stack_fffffffffffffeb0 >> 0x20);
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffec0 >> 0x20);
  uVar29 = (undefined4)((ulonglong)in_stack_fffffffffffffea8 >> 0x20);
  piVar19 = (int *)0x0;
  local_f4 = 0;
  local_c8 = (int *)0x0;
  bVar9 = false;
  bVar10 = false;
  memset(&local_a8,0,0x68);
  pplVar8 = (longlong **)CONCAT62(param_5._2_6_,CONCAT11(param_5._1_1_,(char)param_5));
  iVar15 = 0x11c;
  local_b0 = (longlong *)0x0;
  bVar11 = false;
  plVar3 = *pplVar8;
  uVar12 = KfRaiseIrql(2);
  local_c0 = *(uint *)(unaff_GS_OFFSET + 0x1a4);
  cVar14 = '\x01';
  piVar4 = *(int **)(SendPerProcessorState + (ulonglong)local_c0 * 8);
  puVar25 = param_3;
  local_e0 = '\0';
  if (*(char *)((longlong)pplVar8 + 0xbc) != '\0') {
    piVar19 = (int *)IppSendBatchAllocatedRequest(param_3);
    local_e0 = '\0';
    if (piVar19 != (int *)0x0) {
      local_e0 = cVar14;
    }
  }
  iVar16 = *piVar4;
  if (iVar16 < 3) {
    if (local_e0 == '\0') {
      piVar19 = piVar4 + (longlong)iVar16 * 0x50 + 2;
    }
    local_c8 = piVar4 + (longlong)iVar16 * 0x26 + 0xf2;
    *piVar4 = iVar16 + 1;
  }
  else {
    if ((local_e0 == '\0') &&
       (piVar19 = (int *)FsbAllocateAtDpcLevel(*(undefined8 *)(puVar25 + 0x4ef8)),
       piVar19 == (int *)0x0)) {
      if ((DAT_1c0200d24 == 1) && ((DAT_1c0208d83 & 8) != 0)) {
        McTemplateK0z_EtwWriteTransfer(&MICROSOFT_TCPIP_PROVIDER_Context,&TCPIP_MEMORY_FAILURES);
      }
      *(undefined4 *)((longlong)plVar3 + 0x8c) = 0xc000009a;
      NetioDereferenceNetBufferListChain(plVar3,1);
      goto LAB_1c0041304;
    }
    bVar9 = true;
  }
  memset(piVar19,0,0x140);
  *(byte *)(piVar19 + 0x2c) = *(byte *)(piVar19 + 0x2c) | 0x10;
  piVar19[9] = -1;
  *(byte *)(piVar19 + 0x16) =
       *(byte *)(piVar19 + 0x16) ^ (param_2 * '\x02' ^ *(byte *)(piVar19 + 0x16)) & 4;
  piVar19[10] = 0xff;
  piVar19[0x1b] = -1;
  *(longlong **)(piVar19 + 2) = plVar3;
  *(byte *)((longlong)piVar19 + 0xb1) =
       (param_2 & 4 | 0x20) * '\x02' | *(byte *)((longlong)piVar19 + 0xb1) & 0xf7;
  *(byte *)((longlong)piVar19 + 0xb2) =
       *(byte *)((longlong)piVar19 + 0xb2) ^
       (param_2 * '\x02' ^ *(byte *)((longlong)piVar19 + 0xb2)) & 0x40;
  *(byte *)((longlong)piVar19 + 0xb2) =
       (*(char *)(pplVar8 + 0x17) << 2 ^ *(byte *)((longlong)piVar19 + 0xb2)) & 4 ^
       *(byte *)((longlong)piVar19 + 0xb2);
  uVar1 = *(ushort *)(param_3 + 0x1c);
  if (pplVar8[2] == (longlong *)0x0) {
    iVar16 = IppProcessRawData(param_3,pplVar8,piVar19);
    local_f4 = iVar16;
    if (-1 < iVar16) {
      bVar11 = true;
      if ((DAT_1c0208d82 & 4) != 0) {
        if (uVar1 == 2) {
          if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
LAB_1c00c2b5b:
            in_stack_fffffffffffffec8 = in_stack_fffffffffffffec8 & 0xffffffff00000000;
            McTemplateK0pqqqqqbr5qbr7qqq_EtwWriteTransfer
                      (&MICROSOFT_TCPIP_PROVIDER_Context,&TCPIP_SEND_SLOW_PATH);
          }
        }
        else if (DAT_1c0200d24 == 1) {
          IppGetPacketCount(*pplVar8);
          goto LAB_1c00c2b5b;
        }
      }
      goto LAB_1c0041014;
    }
    iVar15 = 0x10d;
LAB_1c004182a:
    plVar21 = (longlong *)0x0;
    if (((DAT_1c0208d86 & 4) != 0) && (iVar15 != 0x11c)) {
      plVar30 = pplVar8[0x12];
      if ((plVar30 == (longlong *)0x0) && (plVar30 = plVar21, pplVar8[4] != (longlong *)0x0)) {
        plVar30 = (longlong *)pplVar8[4][2];
      }
      if (*(longlong **)(piVar19 + 0x32) == (longlong *)0x0) {
        if (pplVar8[4] == (longlong *)0x0) {
          if (pplVar8[0xe] != (longlong *)0x0) {
            plVar21 = *(longlong **)pplVar8[0xe][2];
          }
        }
        else {
          plVar21 = **(longlong ***)(*pplVar8[4] + 0x10);
        }
      }
      else {
        plVar21 = **(longlong ***)(**(longlong **)(piVar19 + 0x32) + 0x10);
      }
      uVar18 = IppGetPacketCount(plVar3);
      IppLogPacketDiscard(*(undefined2 *)(param_3 + 0x1c),*(undefined2 *)(pplVar8 + 7),plVar21,
                          plVar30,CONCAT44(uVar29,iVar15),CONCAT44(uVar34,uVar18),plVar3);
      iVar16 = local_f4;
    }
    *(int *)((longlong)plVar3 + 0x8c) = iVar16;
    IppCleanupSendState(piVar19);
    IppCompleteAndFreePacketList(piVar19,1);
  }
  else {
    *(longlong *)(piVar19 + 0x2d) = *pplVar8[2];
    piVar19[0x2f] = *(int *)((longlong)pplVar8 + 0x3c);
LAB_1c0041014:
    plVar21 = pplVar8[0x12];
    if (plVar21 == (longlong *)0x0) {
      plVar21 = (longlong *)pplVar8[4][2];
    }
    piVar31 = piVar19 + 0x38;
    memcpy(piVar31,plVar21,*(undefined2 *)(*(longlong *)(param_3 + 0x10) + 6));
    if (*(int *)(pplVar8 + 9) != 0) {
      bVar11 = true;
      if ((DAT_1c0208d82 & 4) != 0) {
        if (uVar1 == 2) {
          if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
LAB_1c00c2c3d:
            in_stack_fffffffffffffec8 = in_stack_fffffffffffffec8 & 0xffffffff00000000;
            McTemplateK0pqqqqqbr5qbr7qqq_EtwWriteTransfer
                      (&MICROSOFT_TCPIP_PROVIDER_Context,&TCPIP_SEND_SLOW_PATH);
          }
        }
        else if (DAT_1c0200d24 == 1) {
          IppGetPacketCount(*pplVar8);
          goto LAB_1c00c2c3d;
        }
      }
      piVar22 = piVar19;
      local_f4 = IppProcessAncillaryData(param_3,pplVar8[10],*(undefined4 *)(pplVar8 + 9),1,piVar19)
      ;
      uVar29 = (undefined4)((ulonglong)piVar22 >> 0x20);
      if (local_f4 < 0) {
        FUN_1c00c2c59();
        return;
      }
    }
    plVar21 = pplVar8[3];
    if ((plVar21 != (longlong *)0x0) &&
       (local_b0 = plVar21, local_f4 = IppProcessSessionState(param_3,plVar21,piVar19), local_f4 < 0
       )) {
      FUN_1c00c2c68();
      return;
    }
    if (*(int *)(pplVar8 + 0x15) != 0) {
      bVar11 = true;
      if ((DAT_1c0208d82 & 4) != 0) {
        if (uVar1 == 2) {
          if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
LAB_1c00c2d3b:
            in_stack_fffffffffffffec8 = in_stack_fffffffffffffec8 & 0xffffffff00000000;
            McTemplateK0pqqqqqbr5qbr7qqq_EtwWriteTransfer
                      (&MICROSOFT_TCPIP_PROVIDER_Context,&TCPIP_SEND_SLOW_PATH);
          }
        }
        else if (DAT_1c0200d24 == 1) {
          IppGetPacketCount(*pplVar8);
          goto LAB_1c00c2d3b;
        }
      }
      piVar22 = piVar19;
      iVar16 = IppProcessAncillaryData
                         (param_3,pplVar8[0x16],*(undefined4 *)(pplVar8 + 0x15),0,piVar19);
      uVar29 = (undefined4)((ulonglong)piVar22 >> 0x20);
      local_f4 = iVar16;
      if (iVar16 < 0) {
        iVar15 = 0x10c;
        goto LAB_1c004182a;
      }
    }
    piVar22 = *(int **)(piVar19 + 0x3c);
    if (*(int **)(piVar19 + 0x3c) == (int *)0x0) {
      *(int **)(piVar19 + 0x3c) = piVar31;
      piVar22 = piVar31;
    }
    uVar2 = *(ushort *)(pplVar8 + 7);
    piVar19[8] = (uint)uVar2;
    plVar21 = pplVar8[4];
    *(longlong **)(piVar19 + 0x32) = plVar21;
    local_e8 = 0x11c;
    if (plVar21 == (longlong *)0x0) {
      if (pplVar8[5] != (longlong *)0x0) {
        *(longlong **)(piVar19 + 0x36) = pplVar8[0xe];
        *(longlong **)(piVar19 + 0x34) = pplVar8[5];
        goto LAB_1c00410bf;
      }
      if (((uVar2 == 6) && (*(int *)(pplVar8 + 9) == 0)) &&
         (plVar21 = pplVar8[0xe], plVar21 != (longlong *)0x0)) {
        local_cc = *(int *)(pplVar8 + 0x11);
        local_b8 = 0;
        cVar14 = IppCanonicalizeScopeId(*(undefined8 *)plVar21[1],piVar22,&local_cc);
        if (cVar14 == '\0') {
          local_f4 = -0x3ffffdf9;
        }
        else {
          plVar30 = plVar21;
          local_f4 = IppValidateRouteLookup
                               (*(undefined8 *)plVar21[1],*(undefined8 *)(piVar19 + 0x3c),&local_cc,
                                (undefined8 *)plVar21[1],plVar21);
          iVar16 = local_cc;
          uVar29 = (undefined4)((ulonglong)plVar30 >> 0x20);
          if (-1 < local_f4) {
            puVar32 = (undefined8 *)plVar21[1];
            plVar30 = plVar21;
            lVar27 = IppFindPath(*puVar32,0,*(undefined8 *)(piVar19 + 0x3c),local_cc,puVar32,plVar21
                                );
            uVar34 = (undefined4)((ulonglong)plVar30 >> 0x20);
            uVar29 = (undefined4)((ulonglong)puVar32 >> 0x20);
            *(longlong *)(piVar19 + 0x32) = lVar27;
            plVar30 = (longlong *)(piVar19 + 0x34);
            if (lVar27 == 0) {
              in_stack_fffffffffffffec8 = 0;
              uVar18 = 0;
              local_f4 = IppFindNextHopAndSource
                                   (*(undefined8 *)plVar21[1],(undefined8 *)plVar21[1],
                                    *(undefined8 *)(piVar19 + 0x3c),iVar16,plVar21,plVar30,&local_b8
                                    ,0,0);
              uVar34 = (undefined4)((ulonglong)plVar30 >> 0x20);
              uVar29 = (undefined4)((ulonglong)plVar21 >> 0x20);
              iVar15 = local_e8;
              if (local_f4 < 0) goto LAB_1c00c3c97;
              *(byte *)(piVar19 + 0x2c) = *(byte *)(piVar19 + 0x2c) | 0xc0;
              *(undefined8 *)(piVar19 + 0x36) = local_b8;
            }
            else {
              *(byte *)(piVar19 + 0x2c) = *(byte *)(piVar19 + 0x2c) | 0x20;
              lVar27 = IppGetNextHopFromPath(lVar27);
              *plVar30 = lVar27;
              if (lVar27 == 0) goto LAB_1c00c3c82;
              *(byte *)(piVar19 + 0x2c) = *(byte *)(piVar19 + 0x2c) | 0x80;
              *(undefined8 *)(piVar19 + 0x36) = **(undefined8 **)(piVar19 + 0x32);
            }
            goto LAB_1c00410bf;
          }
        }
      }
      else if ((local_c8 == (int *)0x0) &&
              (local_c8 = (int *)FsbAllocateAtDpcLevel(*(undefined8 *)(param_3 + 0x4f00)),
              local_c8 == (int *)0x0)) {
        if ((DAT_1c0200d24 == 1) && ((DAT_1c0208d83 & 8) != 0)) {
          McTemplateK0z_EtwWriteTransfer(&MICROSOFT_TCPIP_PROVIDER_Context,&TCPIP_MEMORY_FAILURES);
        }
        local_f4 = -0x3fffff66;
        iVar15 = 0x108;
      }
      else {
        memset(local_c8,0,0x98);
        iVar16 = *(int *)((longlong)pplVar8 + 0x9c);
        iVar17 = *(int *)(pplVar8 + 0x14);
        iVar7 = *(int *)((longlong)pplVar8 + 0xa4);
        *local_c8 = *(int *)(pplVar8 + 0x13);
        local_c8[1] = iVar16;
        local_c8[2] = iVar17;
        local_c8[3] = iVar7;
        *(longlong **)(local_c8 + 4) = pplVar8[3];
        local_c8[6] = *(int *)(pplVar8 + 9);
        *(longlong **)(local_c8 + 8) = pplVar8[10];
        iVar16 = *(int *)((longlong)pplVar8 + 100);
        iVar17 = *(int *)(pplVar8 + 0xd);
        iVar7 = *(int *)((longlong)pplVar8 + 0x6c);
        local_c8[10] = *(int *)(pplVar8 + 0xc);
        local_c8[0xb] = iVar16;
        local_c8[0xc] = iVar17;
        local_c8[0xd] = iVar7;
        local_c8[0xe] = *(int *)(pplVar8 + 0x11);
        *(undefined8 *)(local_c8 + 0x10) = *(undefined8 *)(piVar19 + 0x3c);
        iVar16 = *(int *)((longlong)pplVar8 + 0x74);
        iVar17 = *(int *)(pplVar8 + 0xf);
        iVar7 = *(int *)((longlong)pplVar8 + 0x7c);
        local_c8[0x12] = *(int *)(pplVar8 + 0xe);
        local_c8[0x13] = iVar16;
        local_c8[0x14] = iVar17;
        local_c8[0x15] = iVar7;
        *(longlong **)(local_c8 + 0x16) = pplVar8[0x10];
        local_f4 = IppJoinPath(param_3,local_c8);
        if (-1 < local_f4) {
          puVar32 = *(undefined8 **)(local_c8 + 0x1e);
          *(byte *)(piVar19 + 0x2c) = *(byte *)(piVar19 + 0x2c) | 0x20;
          *(undefined8 **)(piVar19 + 0x32) = puVar32;
          *(undefined8 *)(piVar19 + 0x36) = *puVar32;
          lVar27 = IppGetNextHopFromPath();
          *(longlong *)(piVar19 + 0x34) = lVar27;
          if (lVar27 == 0) goto LAB_1c00c3c82;
          *(byte *)(piVar19 + 0x2c) = *(byte *)(piVar19 + 0x2c) | 0x80;
          goto LAB_1c00410bf;
        }
      }
LAB_1c00c3c97:
      lVar27 = (ulonglong)local_c0 * 0xc0 + *(longlong *)(param_3 + 0x4f60);
      iVar16 = local_f4;
      iVar17 = IppGetPacketCount(plVar3);
      *(int *)(lVar27 + 0x94) = *(int *)(lVar27 + 0x94) + iVar17;
      if (iVar15 == 0x11c) {
        iVar15 = 0x10b;
      }
      goto LAB_1c004182a;
    }
    *(longlong *)(piVar19 + 0x36) = *plVar21;
    if (pplVar8[5] == (longlong *)0x0) {
      if (*(int *)(**(longlong **)(*plVar21 + 8) + 0x14) != *(int *)(plVar21 + 3)) {
        IppValidatePath(plVar21);
        plVar21 = *(longlong **)(piVar19 + 0x32);
      }
      lVar27 = IppGetNextHopFromPath(plVar21);
      *(longlong *)(piVar19 + 0x34) = lVar27;
      if (lVar27 == 0) {
LAB_1c00c3c82:
        local_f4 = -0x3ffffddb;
        iVar15 = local_e8;
        goto LAB_1c00c3c97;
      }
      *(byte *)(piVar19 + 0x2c) = *(byte *)(piVar19 + 0x2c) | 0x80;
    }
    else {
      *(longlong **)(piVar19 + 0x34) = pplVar8[5];
    }
LAB_1c00410bf:
    ppiVar28 = (int **)(piVar19 + 0x34);
    if ((((*(byte *)((longlong)piVar19 + 0xb1) & 0x10) != 0) && (**ppiVar28 == 0x656e7049)) &&
       (uVar20 = RtlCompareMemory(*ppiVar28 + 0x22,*(undefined8 *)(piVar19 + 0x3c),
                                  *(undefined2 *)(*(longlong *)(param_3 + 0x10) + 6)),
       uVar20 != *(ushort *)(*(longlong *)(param_3 + 0x10) + 6))) {
      local_f4 = -0x3ffffff3;
      iVar15 = local_e8;
      goto LAB_1c00c3c97;
    }
    if ((*(short *)((longlong)piVar19 + 0x32) != 0) || (*(short *)(piVar19 + 0xc) != 0)) {
      lVar27 = (*pplVar8)[0x14];
      if ((lVar27 != 0) &&
         ((((uint)lVar27 >> 0x1e & 1) == 0 &&
          (((byte)*(undefined4 *)(*(longlong *)(*ppiVar28 + 2) + 0x34c) & 0xc) != 4)))) {
        iVar16 = -0x3fffff45;
        local_f4 = -0x3fffff45;
        iVar15 = 0x10a;
        goto LAB_1c004182a;
      }
      if ((*pplVar8)[0x28] != 0) {
        FUN_1c00c2f10();
        return;
      }
    }
    piVar31 = *ppiVar28;
    lVar27 = *(longlong *)(*(longlong **)(piVar19 + 0x36))[1];
    *(longlong *)(piVar19 + 0x30) = lVar27;
    if (*piVar31 == 0x656e7049) {
      iVar15 = piVar31[9];
    }
    else if (*piVar31 == 0x616c7049) {
      iVar15 = piVar31[6];
    }
    else {
      iVar15 = 3;
    }
    piVar19[0x3e] = iVar15;
    if ((*(short *)(pplVar8 + 8) != 0) && (*(short *)(pplVar8 + 7) == 6)) {
      *(byte *)((longlong)piVar19 + 0x59) = *(byte *)((longlong)piVar19 + 0x59) | 1;
    }
    if ((*(longlong *)(piVar19 + 0x32) != 0) &&
       ((*(byte *)(*(longlong *)(piVar19 + 0x32) + 0x28) & 0x10) != 0)) {
      *(byte *)(piVar19 + 0x16) = *(byte *)(piVar19 + 0x16) & 0xfb;
      *(byte *)((longlong)piVar19 + 0x59) = *(byte *)((longlong)piVar19 + 0x59) | 8;
    }
    if (piVar19[9] == -1) {
      if (iVar15 == 3) {
        piVar19[9] = 1;
      }
      else {
        bVar13 = *(byte *)(*(longlong *)(piVar31 + 2) + 0x1d0);
        if (bVar13 == 0) {
          bVar13 = *(byte *)(lVar27 + 0x41);
        }
        piVar19[9] = (uint)bVar13;
      }
    }
    uVar29 = 0;
    if (piVar19[10] == 0xff) {
      piVar19[10] = 0;
    }
    if (*(char *)((longlong)pplVar8 + 0xba) == '\0') {
      local_98 = piVar19[0x3e];
      local_90 = *ppiVar28;
      local_88 = *(undefined8 *)(*ppiVar28 + 2);
      iVar15 = **ppiVar28;
      if ((iVar15 != 0x616c7049) && (iVar15 == 0x656e7049)) {
        uVar29 = *(undefined4 *)(*(longlong *)(*ppiVar28 + 4) + 0x18);
      }
      if (**ppiVar28 == 0x616c7049) {
        if (piVar19[0x3e] == 3) {
          if ((*(byte *)((longlong)piVar19 + 0xb2) & 0x10) == 0) goto LAB_1c00411e6;
          local_7c = 1;
        }
        else {
          if ((piVar19[0x3e] == 4) && ((*(byte *)((longlong)piVar19 + 0xb2) & 0x20) == 0))
          goto LAB_1c00411e6;
          local_7c = 1;
        }
      }
      else {
LAB_1c00411e6:
        local_7c = 0;
      }
      local_70 = *(undefined8 *)(piVar19 + 0x32);
      local_68 = *(undefined4 *)(pplVar8 + 0x11);
      local_60 = pplVar8[10];
      local_58 = *(undefined4 *)(pplVar8 + 9);
      local_50 = *(undefined8 *)(piVar19 + 0x10);
      local_48 = piVar19[0xb];
      if ((piVar19[8] == 6) && (pplVar8[2] != (longlong *)0x0)) {
        local_54 = 1;
      }
      else {
        local_54 = 0;
      }
      local_78 = *(undefined8 *)(piVar19 + 2);
      piVar31 = piVar19 + 0x2d;
      uVar33 = CONCAT44(uVar34,piVar19[0x2f]);
      local_a8 = *(longlong **)(piVar19 + 0x36);
      local_a0 = piVar19 + 0x38;
      local_80 = uVar29;
      iVar15 = IppInspectLocalDatagramsOut
                         (*(undefined4 *)(param_3 + 0x18),&local_a8,piVar19[8],param_4,piVar31,
                          uVar33);
      uVar34 = (undefined4)((ulonglong)uVar33 >> 0x20);
      uVar29 = (undefined4)((ulonglong)piVar31 >> 0x20);
      if (0 < iVar15) {
        if (iVar15 - 1U < 2) {
          iVar15 = 9;
          local_f4 = -0x3ffffde5;
          iVar16 = -0x3ffffde5;
        }
        else {
          iVar15 = 0x101;
          iVar16 = local_f4;
        }
        goto LAB_1c004182a;
      }
    }
    if ((*(byte *)((longlong)piVar19 + 0xb2) & 2) == 0) {
      if (*(longlong *)(*(longlong *)(piVar19 + 2) + 0xa8) != 0) {
        param_5._0_1_ = '\0';
        bVar13 = NetioQueryNetBufferListTrafficClass
                           (*(longlong *)(piVar19 + 2),
                            *(undefined4 *)
                             (*(longlong *)(*(longlong *)(*ppiVar28 + 2) + 0x30) + 0x1c),&param_5);
        if ((char)param_5 == '\0') {
          *(byte *)((longlong)piVar19 + 0xb2) = *(byte *)((longlong)piVar19 + 0xb2) | 2;
          piVar19[10] = (uint)bVar13;
        }
      }
      if ((*(byte *)((longlong)piVar19 + 0xb2) & 2) != 0) goto LAB_1c00c2fa7;
    }
    else {
LAB_1c00c2fa7:
      bVar11 = true;
      if ((DAT_1c0208d82 & 4) != 0) {
        if (uVar1 == 2) {
          if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
LAB_1c00c3066:
            in_stack_fffffffffffffec8 = in_stack_fffffffffffffec8 & 0xffffffff00000000;
            McTemplateK0pqqqqqbr5qbr7qqq_EtwWriteTransfer
                      (&MICROSOFT_TCPIP_PROVIDER_Context,&TCPIP_SEND_SLOW_PATH);
          }
        }
        else if (DAT_1c0200d24 == 1) {
          IppGetPacketCount(*pplVar8);
          goto LAB_1c00c3066;
        }
      }
    }
    if (*(char *)((longlong)pplVar8 + 0xb9) == '\0') goto LAB_1c00412b3;
    if ((*(uint *)(*(longlong *)(piVar19 + 2) + 0x88) & 0x400000) != 0) {
      if ((DAT_1c0208d82 & 4) != 0) {
        if (uVar1 == 2) {
          if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
            goto LAB_1c00c3c39;
          }
        }
        else if (DAT_1c0200d24 == 1) {
          IppGetPacketCount(*pplVar8);
          goto LAB_1c00c3c39;
        }
      }
      goto LAB_1c00412b3;
    }
    plVar21 = pplVar8[5];
    plVar30 = pplVar8[4];
    if ((plVar21 == (longlong *)0x0) || (plVar30 == (longlong *)0x0)) {
      if ((DAT_1c0208d82 & 4) != 0) {
        if (uVar1 == 2) {
          if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
            goto LAB_1c00c3c39;
          }
        }
        else if (DAT_1c0200d24 == 1) {
          IppGetPacketCount(*pplVar8);
          goto LAB_1c00c3c39;
        }
      }
      goto LAB_1c00412b3;
    }
    lVar27 = plVar21[1];
    if (*(int *)plVar21 == 0x656e7049) {
      if (*(int *)((longlong)plVar21 + 0x24) == 1) {
        uVar26 = *(uint *)(plVar21 + 8);
        auVar5._8_8_ = 0;
        auVar5._0_8_ = _DAT_fffff78000000008 / 10000;
        lVar23 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar5,8);
        iVar15 = (int)((_DAT_fffff78000000008 / 10000 - lVar23 >> 1) + lVar23 >> 8);
        if (uVar26 == 5) {
          if (*(uint *)(lVar27 + 0x1c4) < (uint)(iVar15 - *(int *)(plVar21 + 4))) {
LAB_1c00415f8:
            IppResolveNeighbor(plVar21,0,0,0);
            goto LAB_1c004140a;
          }
        }
        else if (uVar26 != 6) {
          if (uVar26 < 2) goto joined_r0x0001c00c318c;
          goto LAB_1c00415f8;
        }
        *(int *)((longlong)plVar21 + 0x1c) = iVar15;
      }
      else if (((((*(int *)((longlong)plVar21 + 0x24) != 3) || (*(int *)(plVar21 + 8) != 6)) ||
                (*(int *)(param_3 + 0x4ce8) < 1)) ||
               ((lVar27 != *(longlong *)(*plVar30 + 8) ||
                ((*(byte *)(*(longlong *)(*plVar30 + 8) + 0x19a) & 8) != 0)))) ||
              ((1 < *(uint *)(lVar27 + 0x28) || (piVar19[9] == 0)))) goto joined_r0x0001c00c318c;
LAB_1c004140a:
      iVar15 = *(int *)((longlong)plVar21 + 0x24);
    }
    else {
      bVar10 = true;
      if ((*(int *)(plVar21 + 3) != 1) || (*(char *)((longlong)pplVar8 + 0xbb) == '\0')) {
joined_r0x0001c00c318c:
        if ((DAT_1c0208d82 & 4) != 0) {
          if (uVar1 == 2) {
            if (DAT_1c0200d24 == 1) {
              IppGetPacketCount(*pplVar8);
              goto LAB_1c00c3c39;
            }
          }
          else if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
            goto LAB_1c00c3c39;
          }
        }
        goto LAB_1c00412b3;
      }
      iVar15 = 1;
    }
    if (local_b0 != (longlong *)0x0) {
      if (iVar15 == 1) {
        bVar13 = *(byte *)((longlong)local_b0 + 0x2d) & 0x10;
joined_r0x0001c00c3302:
        if (bVar13 != 0) goto LAB_1c004141a;
      }
      else if (iVar15 == 3) {
        bVar13 = *(byte *)((longlong)local_b0 + 0x2d) & 0x20;
        goto joined_r0x0001c00c3302;
      }
      if ((DAT_1c0208d82 & 4) != 0) {
        if (uVar1 == 2) {
          if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
            goto LAB_1c00c3c39;
          }
        }
        else if (DAT_1c0200d24 == 1) {
          IppGetPacketCount(*pplVar8);
          goto LAB_1c00c3c39;
        }
      }
      goto LAB_1c00412b3;
    }
LAB_1c004141a:
    uVar20 = (ulonglong)(uVar1 & 1);
    iVar15 = KfdIsLayerEmpty(*(undefined2 *)(&DAT_1c0203a02 + uVar20 * 0x10));
    if ((iVar15 == 0) ||
       ((*(int *)pplVar8[5] == 0x616c7049 &&
        (iVar15 = KfdIsLayerEmpty(*(undefined2 *)(&DAT_1c0203a00 + uVar20 * 0x10)), iVar15 == 0))))
    {
      if ((DAT_1c0208d82 & 4) != 0) {
        if (uVar1 == 2) {
          if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
            goto LAB_1c00c3c39;
          }
        }
        else if (DAT_1c0200d24 == 1) {
          IppGetPacketCount(*pplVar8);
          goto LAB_1c00c3c39;
        }
      }
      goto LAB_1c00412b3;
    }
    if (bVar10) goto LAB_1c0041489;
    if (*(int *)(*(longlong *)(lVar27 + 0x30) + 0x14) == 6) {
      if (*(short *)(pplVar8 + 7) == 6) {
        if ((*(byte *)(lVar27 + 0x80) & 0x20) == 0) {
          if ((DAT_1c0208d82 & 4) != 0) {
            if (uVar1 == 2) {
              if (DAT_1c0200d24 == 1) {
                IppGetPacketCount(*pplVar8);
                goto LAB_1c00c3c39;
              }
            }
            else if (DAT_1c0200d24 == 1) {
              IppGetPacketCount(*pplVar8);
              goto LAB_1c00c3c39;
            }
          }
          goto LAB_1c00412b3;
        }
      }
      else if ((*(byte *)(lVar27 + 0x19b) & 4) == 0) {
        if ((DAT_1c0208d82 & 4) != 0) {
          if (uVar1 == 2) {
            if (DAT_1c0200d24 == 1) {
              IppGetPacketCount(*pplVar8);
              goto LAB_1c00c3c39;
            }
          }
          else if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
            goto LAB_1c00c3c39;
          }
        }
        goto LAB_1c00412b3;
      }
LAB_1c0041489:
      if (*(int *)(lVar27 + 0x1b0) != 0) {
        if ((DAT_1c0208d82 & 4) != 0) {
          if (uVar1 == 2) {
            if (DAT_1c0200d24 == 1) {
              IppGetPacketCount(*pplVar8);
              goto LAB_1c00c3c39;
            }
          }
          else if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
            goto LAB_1c00c3c39;
          }
        }
        goto LAB_1c00412b3;
      }
      if ((((plVar3 == (longlong *)0x0) || (*plVar3 != 0)) || (plVar3[0xe] != 0)) ||
         ((plVar3[1] == 0 || (*(int *)((longlong)plVar3 + 0x8c) != 0)))) {
        if ((DAT_1c0208d82 & 4) != 0) {
          if (uVar1 == 2) {
            if (DAT_1c0200d24 == 1) {
              IppGetPacketCount(*pplVar8);
              goto LAB_1c00c3c39;
            }
          }
          else if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
            goto LAB_1c00c3c39;
          }
        }
        goto LAB_1c00412b3;
      }
      bVar13 = (&DAT_1c02039fa)[uVar20 * 0x10];
      uVar1 = *(ushort *)(param_3 + 0x1c);
      uVar26 = (uint)uVar1;
      param_5._0_1_ = (char)uVar1;
      param_5._1_1_ = (undefined)(uVar1 >> 8);
      puVar25 = param_3;
      if (!bVar10) {
        if (*(uint *)((longlong)plVar30 + 0x5c) < *(uint *)(plVar21[2] + 0x54)) {
          if ((param_3 != &Ipv4Global) || (uVar24 = 0xf0, (*(byte *)(plVar30 + 5) & 8) != 0)) {
            uVar24 = *(uint *)(lVar27 + 0x1cc);
          }
          auVar6._8_8_ = 0;
          auVar6._0_8_ = _DAT_fffff78000000008 / 10000;
          lVar23 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar6,8);
          if ((uint)((int)((_DAT_fffff78000000008 / 10000 - lVar23 >> 1) + lVar23 >> 8) -
                    *(int *)(plVar30 + 0xc)) < uVar24) goto LAB_1c0041510;
        }
        else {
LAB_1c0041510:
          if ((*(short *)(pplVar8 + 7) != 0x11) ||
             (uVar26 = (uint)uVar1,
             cVar14 = IppIsFragNeededForNbl
                                (plVar3,*(int *)((longlong)plVar30 + 0x5c) - (uint)bVar13),
             cVar14 == '\0')) goto LAB_1c004151c;
        }
        if ((DAT_1c0208d82 & 4) != 0) {
          if (uVar26 == 2) {
            if (DAT_1c0200d24 == 1) {
              IppGetPacketCount(*pplVar8);
LAB_1c00c3c39:
              McTemplateK0pqqqqqbr5qbr7qqq_EtwWriteTransfer
                        (&MICROSOFT_TCPIP_PROVIDER_Context,&TCPIP_SEND_SLOW_PATH);
            }
          }
          else if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
            goto LAB_1c00c3c39;
          }
        }
        goto LAB_1c00412b3;
      }
      iVar15 = WfpTlShimInspectFastLoopbackSendDatagram(pplVar8[1],uVar1,plVar3);
      if (iVar15 != 0) {
        if ((DAT_1c0208d82 & 4) != 0) {
          if (CONCAT11(param_5._1_1_,(char)param_5) == 2) {
            if (DAT_1c0200d24 == 1) {
              IppGetPacketCount(*pplVar8);
              goto LAB_1c00c3c39;
            }
          }
          else if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
            goto LAB_1c00c3c39;
          }
        }
        goto LAB_1c00412b3;
      }
LAB_1c004151c:
      if (bVar11) goto LAB_1c00412b3;
      if (bVar10) {
        piVar19[0x18] = *(int *)((longlong)pplVar8 + 0x34);
        *(undefined2 *)(piVar19 + 0x17) = *(undefined2 *)(pplVar8 + 6);
        IppPreparePacketChecksum(puVar25,piVar19);
        IpNlpFastContinueSendLoopbackDatagrams
                  (0,bVar13,lVar27,pplVar8,param_3,param_2,piVar19[9],piVar4,piVar19);
      }
      else {
        IpNlpFastContinueSendDatagrams
                  (0,bVar13,lVar27,pplVar8,puVar25,plVar21,param_2,CONCAT44(uVar18,piVar19[9]),
                   in_stack_fffffffffffffec8 & 0xffffffffffffff00);
      }
    }
    else {
      if ((DAT_1c0208d82 & 4) != 0) {
        if (uVar1 == 2) {
          if (DAT_1c0200d24 == 1) {
            IppGetPacketCount(*pplVar8);
            goto LAB_1c00c3c39;
          }
        }
        else if (DAT_1c0200d24 == 1) {
          IppGetPacketCount(*pplVar8);
          goto LAB_1c00c3c39;
        }
      }
LAB_1c00412b3:
      piVar19[0x18] = *(int *)((longlong)pplVar8 + 0x34);
      *(undefined2 *)(piVar19 + 0x17) = *(undefined2 *)(pplVar8 + 6);
      *(undefined2 *)(piVar19 + 0x1a) = *(undefined2 *)(pplVar8 + 7);
      piVar19[0x19] = *(int *)((longlong)pplVar8 + 0x44);
      if ((local_e0 == '\0') ||
         (iVar15 = IppBatchSendPacket(piVar19,*(undefined *)((longlong)pplVar8 + 0xbd),
                                      *(undefined *)((longlong)pplVar8 + 0xbe),
                                      *(undefined *)((longlong)pplVar8 + 0xbf)), iVar15 < 0)) {
        IppPacketizeDatagrams(piVar19,0);
      }
    }
  }
  if (bVar9) {
    if (local_e0 == '\0') {
      FsbFree(piVar19);
    }
    if (local_c8 != (int *)0x0) {
      FsbFree(local_c8);
    }
  }
  else {
    *piVar4 = *piVar4 + -1;
  }
  if (local_e0 != '\0') {
    IppSendBatchReturnRequest(param_3,local_c0);
  }
LAB_1c0041304:
  KeLowerIrql(uVar12);
  return;
}