clean up the following decompiled C code: 
void IppSendControl(undefined param_1,longlong param_2,longlong **param_3)

{
  longlong **pplVar1;
  int *piVar2;
  longlong *plVar3;
  longlong **pplVar4;
  longlong **pplVar5;
  int iVar6;
  longlong *plVar7;
  undefined4 uVar8;
  longlong *plVar9;
  undefined8 uVar10;
  longlong in_stack_ffffffffffffff78;
  uint uVar11;
  undefined8 in_stack_ffffffffffffff80;
  undefined4 uVar12;
  longlong *in_stack_ffffffffffffff88;
  undefined4 uVar13;
  longlong *local_58;
  longlong **local_50;
  longlong local_48;
  longlong *local_40;
  
  uVar8 = 0;
  uVar10 = 0;
  plVar9 = (longlong *)0x0;
  (*param_3)[0x12] = 0;
  local_50 = &local_58;
  local_58 = (longlong *)0x0;
  local_48 = 0;
  local_40 = &local_48;
  do {
    uVar12 = (undefined4)((ulonglong)in_stack_ffffffffffffff80 >> 0x20);
    uVar13 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);
    uVar11 = (uint)((ulonglong)in_stack_ffffffffffffff78 >> 0x20);
    plVar3 = *param_3;
    pplVar1 = param_3 + 0x18;
    pplVar4 = (longlong **)*pplVar1;
    *pplVar1 = (longlong *)0x0;
    if ((DAT_1c0208d8a & 8) != 0) {
      pplVar5 = (longlong **)param_3[4];
      uVar10 = 0;
      plVar9 = param_3[0x12];
      uVar8 = *(undefined4 *)(param_3 + 0x14);
      if (pplVar5 == (longlong **)0x0) {
        plVar7 = param_3[0xe];
        if (plVar7 == (longlong *)0x0) {
          if (param_3[0xc] != (longlong *)0x0) {
            uVar8 = *(undefined4 *)*param_3[0xc];
          }
          goto LAB_1c0075a6d;
        }
      }
      else {
        plVar7 = *pplVar5;
        plVar9 = pplVar5[2];
      }
      uVar10 = *(undefined8 *)plVar7[2];
      uVar8 = **(undefined4 **)plVar7[1];
    }
LAB_1c0075a6d:
    *(int *)(param_2 + 0x5370) = *(int *)(param_2 + 0x5370) + 1;
    iVar6 = IppAllocateAndFillIcmpHeader(param_2,param_3);
    *(int *)((longlong)plVar3 + 0x8c) = iVar6;
    if (iVar6 < 0) {
      in_stack_ffffffffffffff88 = (longlong *)CONCAT44(uVar13,uVar8);
      in_stack_ffffffffffffff80 = CONCAT44(uVar12,iVar6);
      in_stack_ffffffffffffff78 = (ulonglong)uVar11 << 0x20;
      LogEtwIcmpDrop(param_2,0,*(byte *)(param_3 + 0x19),*(undefined *)((longlong)param_3 + 0xc9),
                     in_stack_ffffffffffffff78,in_stack_ffffffffffffff80,in_stack_ffffffffffffff88,
                     uVar10,plVar9);
      *(int *)(param_2 + 0x5374) = *(int *)(param_2 + 0x5374) + 1;
      *local_40 = (longlong)plVar3;
      local_40 = plVar3;
    }
    else {
      piVar2 = (int *)(param_2 + 0x5378 + (ulonglong)*(byte *)(param_3 + 0x19) * 4);
      *piVar2 = *piVar2 + 1;
      in_stack_ffffffffffffff78 = CONCAT44(uVar11,uVar8);
      *local_50 = (longlong *)param_3;
      in_stack_ffffffffffffff80 = uVar10;
      in_stack_ffffffffffffff88 = plVar9;
      local_50 = pplVar1;
      LogEtwIcmpMessage(param_2,0,*(undefined *)(param_3 + 0x19),
                        *(undefined *)((longlong)param_3 + 0xc9),in_stack_ffffffffffffff78,uVar10,
                        plVar9);
    }
    param_3 = pplVar4;
    if (pplVar4 == (longlong **)0x0) {
      if (local_58 != (longlong *)0x0) {
        IppSendDatagramsCommon
                  (0,0,param_2,
                   *(undefined8 *)(param_2 + 0x230 + (ulonglong)*(ushort *)(local_58 + 7) * 0x48),
                   local_58);
      }
      if (local_48 != 0) {
        NetioDereferenceNetBufferListChain(local_48,param_1);
      }
      return;
    }
  } while( true );
}