L L4D2node

CBitRead::ReadBitCoordMP

0x0009f020 · 2168 bytes · __thiscall

_ZN8CBitRead14ReadBitCoordMPE13EBitCoordType

Decompiled

undefined (2 params)

/* CBitRead::ReadBitCoordMP(EBitCoordType) */

longdouble __thiscall CBitRead::ReadBitCoordMP(CBitRead *this,int param_2)

{
  uint *puVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  byte bVar4;
  uint uVar5;
  uint uVar6;
  uint *puVar7;
  int iVar8;
  int iVar9;
  uint uVar10;
  bool bVar11;
  float fVar12;
  double dVar13;
  double dVar14;
  double dVar15;
  uint local_1c;
  uint local_18;
  
  iVar8 = *(int *)(this + 0x14);
  uVar5 = *(uint *)(this + 0x10);
  iVar9 = iVar8 + -1;
  *(int *)(this + 0x14) = iVar9;
  if (iVar9 == 0) {
    puVar7 = *(uint **)(this + 0x18);
    *(undefined4 *)(this + 0x14) = 0x20;
    uVar6 = 0;
    if (puVar7 == *(uint **)(this + 0x1c)) {
      *(undefined4 *)(this + 0x14) = 1;
      uVar10 = 0;
      *(uint **)(this + 0x18) = puVar7 + 1;
      iVar8 = 0;
      *(undefined4 *)(this + 0x10) = 0;
      goto LAB_0009f12d;
    }
    if (puVar7 <= *(uint **)(this + 0x1c)) {
      *(uint **)(this + 0x18) = puVar7 + 1;
      uVar10 = *puVar7;
      iVar8 = 0x1f;
      *(uint *)(this + 0x10) = uVar10;
      uVar6 = uVar10 & 1;
      goto LAB_0009f12d;
    }
    uVar10 = 0;
    iVar8 = 0x1f;
    this[4] = (CBitRead)0x1;
    *(undefined4 *)(this + 0x10) = 0;
    *(undefined4 *)(this + 0x14) = 0x1f;
    if (param_2 != 2) goto LAB_0009f140;
LAB_0009f083:
    if (iVar8 == 0) {
      puVar3 = *(undefined4 **)(this + 0x18);
      *(undefined4 *)(this + 0x14) = 0x20;
      if (puVar3 == *(undefined4 **)(this + 0x1c)) {
        *(undefined4 *)(this + 0x14) = 1;
        *(undefined4 *)(this + 0x10) = 0;
        *(undefined4 **)(this + 0x18) = puVar3 + 1;
      }
      else if (*(undefined4 **)(this + 0x1c) < puVar3) {
        this[4] = (CBitRead)0x1;
        *(undefined4 *)(this + 0x10) = 0;
      }
      else {
        *(undefined4 **)(this + 0x18) = puVar3 + 1;
        *(undefined4 *)(this + 0x10) = *puVar3;
      }
    }
    else {
      *(uint *)(this + 0x10) = uVar10 >> 1;
    }
    fVar12 = 0.0;
    if (uVar6 == 0) goto LAB_0009f215;
    iVar8 = *(int *)(this + 0x14);
    iVar9 = iVar8 + -1;
    *(int *)(this + 0x14) = iVar9;
    local_1c = *(uint *)(this + 0x10) & 1;
    if (iVar9 == 0) {
      puVar1 = *(uint **)(this + 0x18);
      *(undefined4 *)(this + 0x14) = 0x20;
      puVar7 = *(uint **)(this + 0x1c);
      if (puVar1 == puVar7) {
        *(undefined4 *)(this + 0x14) = 1;
        *(undefined4 *)(this + 0x10) = 0;
        *(uint **)(this + 0x18) = puVar7 + 1;
        if ((uVar5 & 1) == 0) {
          iVar9 = 1;
          local_18 = 0;
LAB_0009f5bf:
          puVar1 = *(uint **)(this + 0x18);
          if (puVar1 == puVar7) {
LAB_0009f742:
            *(undefined4 *)(this + 0x14) = 1;
            *(undefined4 *)(this + 0x10) = 0;
            *(uint **)(this + 0x18) = puVar7 + 1;
            this[4] = (CBitRead)0x1;
          }
          else {
            if (puVar1 <= puVar7) {
              *(uint **)(this + 0x18) = puVar1 + 1;
              uVar5 = *puVar1;
              *(uint *)(this + 0x10) = uVar5;
              if (this[4] != (CBitRead)0x0) goto LAB_0009f75a;
              iVar8 = 0xe - iVar9;
              iVar9 = iVar9 + 0x12;
              local_18 = ((&CBitBuffer::s_nMaskTable)[iVar8] & uVar5) <<
                         ((byte)*(undefined4 *)(this + 0x14) & 0x1f) | local_18;
LAB_0009f57f:
              *(int *)(this + 0x14) = iVar9;
              *(uint *)(this + 0x10) = uVar5 >> ((byte)iVar8 & 0x1f);
              fVar12 = (float)(local_18 + 1 >> 0x10) * 65536.0 + (float)(local_18 + 1 & 0xffff);
              goto LAB_0009f203;
            }
LAB_0009f770:
            this[4] = (CBitRead)0x1;
            *(undefined4 *)(this + 0x10) = 0;
          }
        }
        else {
          iVar9 = 1;
          local_18 = 0;
LAB_0009f53e:
          puVar1 = *(uint **)(this + 0x18);
          if (puVar1 == puVar7) goto LAB_0009f742;
          if (puVar7 < puVar1) goto LAB_0009f770;
          *(uint **)(this + 0x18) = puVar1 + 1;
          uVar5 = *puVar1;
          *(uint *)(this + 0x10) = uVar5;
          if (this[4] == (CBitRead)0x0) {
            iVar8 = 0xb - iVar9;
            iVar9 = iVar9 + 0x15;
            local_18 = ((&CBitBuffer::s_nMaskTable)[iVar8] & uVar5) <<
                       ((byte)*(undefined4 *)(this + 0x14) & 0x1f) | local_18;
            goto LAB_0009f57f;
          }
        }
LAB_0009f75a:
        fVar12 = 1.0;
      }
      else {
        if (puVar1 < puVar7) {
          *(uint **)(this + 0x18) = puVar1 + 1;
          local_18 = *puVar1;
          *(uint *)(this + 0x10) = local_18;
        }
        else {
          this[4] = (CBitRead)0x1;
          local_18 = 0;
          *(undefined4 *)(this + 0x10) = 0;
        }
        if ((uVar5 & 1) != 0) {
          iVar9 = 0x20;
          goto LAB_0009f0f0;
        }
        *(undefined4 *)(this + 0x14) = 0x12;
        uVar5 = local_18 & 0x3fff;
LAB_0009f716:
        *(uint *)(this + 0x10) = local_18 >> 0xe;
        fVar12 = (float)(uVar5 + 1);
      }
    }
    else {
      local_18 = *(uint *)(this + 0x10) >> 1;
      *(uint *)(this + 0x10) = local_18;
      if ((uVar5 & 1) == 0) {
        if (iVar9 < 0xe) {
          puVar7 = *(uint **)(this + 0x1c);
          goto LAB_0009f5bf;
        }
        iVar8 = iVar8 + -0xf;
        uVar5 = local_18 & 0x3fff;
        *(int *)(this + 0x14) = iVar8;
        if (iVar8 != 0) goto LAB_0009f716;
        puVar3 = *(undefined4 **)(this + 0x18);
        *(undefined4 *)(this + 0x14) = 0x20;
        if (puVar3 == *(undefined4 **)(this + 0x1c)) {
          *(undefined4 *)(this + 0x14) = 1;
          *(undefined4 *)(this + 0x10) = 0;
          fVar12 = (float)(uVar5 + 1);
          *(undefined4 **)(this + 0x18) = puVar3 + 1;
        }
        else if (*(undefined4 **)(this + 0x1c) < puVar3) {
          this[4] = (CBitRead)0x1;
          *(undefined4 *)(this + 0x10) = 0;
          fVar12 = (float)(uVar5 + 1);
        }
        else {
          *(undefined4 **)(this + 0x18) = puVar3 + 1;
          fVar12 = (float)(uVar5 + 1);
          *(undefined4 *)(this + 0x10) = *puVar3;
        }
      }
      else {
        if (iVar9 < 0xb) {
          puVar7 = *(uint **)(this + 0x1c);
          goto LAB_0009f53e;
        }
LAB_0009f0f0:
        uVar5 = local_18 & 0x7ff;
        *(int *)(this + 0x14) = iVar9 + -0xb;
        if (iVar9 + -0xb == 0) {
          puVar3 = *(undefined4 **)(this + 0x18);
          *(undefined4 *)(this + 0x14) = 0x20;
          if (puVar3 == *(undefined4 **)(this + 0x1c)) {
            *(undefined4 *)(this + 0x14) = 1;
            *(undefined4 *)(this + 0x10) = 0;
            fVar12 = (float)(uVar5 + 1);
            *(undefined4 **)(this + 0x18) = puVar3 + 1;
          }
          else if (*(undefined4 **)(this + 0x1c) < puVar3) {
            this[4] = (CBitRead)0x1;
            *(undefined4 *)(this + 0x10) = 0;
            fVar12 = (float)(uVar5 + 1);
          }
          else {
            *(undefined4 **)(this + 0x18) = puVar3 + 1;
            fVar12 = (float)(uVar5 + 1);
            *(undefined4 *)(this + 0x10) = *puVar3;
          }
        }
        else {
          *(uint *)(this + 0x10) = local_18 >> 0xb;
          fVar12 = (float)(uVar5 + 1);
        }
      }
    }
  }
  else {
    uVar10 = uVar5 >> 1;
    iVar8 = iVar8 + -2;
    *(uint *)(this + 0x10) = uVar10;
    uVar6 = uVar10 & 1;
LAB_0009f12d:
    *(int *)(this + 0x14) = iVar8;
    if (param_2 == 2) goto LAB_0009f083;
LAB_0009f140:
    if (iVar8 == 0) {
      puVar1 = *(uint **)(this + 0x18);
      *(undefined4 *)(this + 0x14) = 0x20;
      puVar7 = *(uint **)(this + 0x1c);
      if (puVar1 == puVar7) {
        *(undefined4 *)(this + 0x10) = 0;
        local_1c = 0;
        *(uint **)(this + 0x18) = puVar7 + 1;
        goto LAB_0009f163;
      }
      if (puVar1 < puVar7) {
        *(uint **)(this + 0x18) = puVar1 + 1;
        uVar10 = *puVar1;
        local_1c = uVar10 & 1;
      }
      else {
        this[4] = (CBitRead)0x1;
        uVar10 = 0;
        local_1c = 0;
      }
      *(undefined4 *)(this + 0x14) = 0x1f;
      iVar8 = 0x1f;
LAB_0009f25c:
      uVar10 = uVar10 >> 1;
      *(uint *)(this + 0x10) = uVar10;
    }
    else {
      iVar8 = iVar8 + -1;
      uVar10 = uVar10 >> 1;
      *(uint *)(this + 0x10) = uVar10;
      local_1c = uVar10 & 1;
      *(int *)(this + 0x14) = iVar8;
      if (iVar8 != 0) goto LAB_0009f25c;
      puVar7 = *(uint **)(this + 0x1c);
LAB_0009f163:
      puVar1 = *(uint **)(this + 0x18);
      *(undefined4 *)(this + 0x14) = 0x20;
      if (puVar1 == puVar7) {
        uVar10 = 0;
        *(uint **)(this + 0x18) = puVar7 + 1;
        iVar8 = 1;
        *(undefined4 *)(this + 0x14) = 1;
        *(undefined4 *)(this + 0x10) = 0;
      }
      else if (puVar7 < puVar1) {
        uVar10 = 0;
        this[4] = (CBitRead)0x1;
        iVar8 = 0x20;
        *(undefined4 *)(this + 0x10) = 0;
      }
      else {
        *(uint **)(this + 0x18) = puVar1 + 1;
        uVar10 = *puVar1;
        *(uint *)(this + 0x10) = uVar10;
        iVar8 = 0x20;
      }
    }
    dVar14 = 0.0;
    if (uVar6 != 0) {
      bVar4 = (byte)iVar8;
      if ((uVar5 & 1) == 0) {
        if (iVar8 < 0xe) {
          puVar7 = *(uint **)(this + 0x18);
          if (puVar7 == *(uint **)(this + 0x1c)) goto LAB_0009f780;
          if (*(uint **)(this + 0x1c) < puVar7) goto LAB_0009f482;
          *(uint **)(this + 0x18) = puVar7 + 1;
          local_18 = *puVar7;
          *(uint *)(this + 0x10) = local_18;
          if (this[4] == (CBitRead)0x0) {
            iVar9 = 0xe - iVar8;
            iVar8 = iVar8 + 0x12;
            uVar5 = (local_18 & (&CBitBuffer::s_nMaskTable)[iVar9]) << (bVar4 & 0x1f);
            goto LAB_0009f4df;
          }
LAB_0009f927:
          dVar14 = 1.0;
          uVar10 = local_18;
        }
        else {
          iVar8 = iVar8 + -0xe;
          uVar5 = uVar10 & 0x3fff;
          *(int *)(this + 0x14) = iVar8;
          if (iVar8 == 0) goto LAB_0009f29b;
          uVar10 = uVar10 >> 0xe;
          dVar14 = (double)(uVar5 + 1);
          *(uint *)(this + 0x10) = uVar10;
        }
      }
      else if (iVar8 < 0xb) {
        puVar7 = *(uint **)(this + 0x18);
        if (puVar7 == *(uint **)(this + 0x1c)) {
LAB_0009f780:
          *(undefined4 *)(this + 0x14) = 1;
          iVar8 = 1;
          *(undefined4 *)(this + 0x10) = 0;
          *(uint **)(this + 0x18) = puVar7 + 1;
          this[4] = (CBitRead)0x1;
        }
        else {
          if (puVar7 < *(uint **)(this + 0x1c)) {
            *(uint **)(this + 0x18) = puVar7 + 1;
            local_18 = *puVar7;
            *(uint *)(this + 0x10) = local_18;
            if (this[4] != (CBitRead)0x0) goto LAB_0009f927;
            iVar9 = 0xb - iVar8;
            iVar8 = iVar8 + 0x15;
            uVar5 = (local_18 & (&CBitBuffer::s_nMaskTable)[iVar9]) << (bVar4 & 0x1f);
LAB_0009f4df:
            dVar14 = (double)(int)((uVar5 | uVar10) + 1);
            *(int *)(this + 0x14) = iVar8;
            uVar10 = local_18 >> ((byte)iVar9 & 0x1f);
            *(uint *)(this + 0x10) = uVar10;
            goto LAB_0009f1a0;
          }
LAB_0009f482:
          this[4] = (CBitRead)0x1;
          *(undefined4 *)(this + 0x10) = 0;
        }
        uVar10 = 0;
        dVar14 = 1.0;
      }
      else {
        iVar8 = iVar8 + -0xb;
        uVar5 = uVar10 & 0x7ff;
        *(int *)(this + 0x14) = iVar8;
        if (iVar8 == 0) {
LAB_0009f29b:
          puVar7 = *(uint **)(this + 0x18);
          *(undefined4 *)(this + 0x14) = 0x20;
          if (puVar7 == *(uint **)(this + 0x1c)) {
            *(undefined4 *)(this + 0x14) = 1;
            dVar14 = (double)(uVar5 + 1);
            *(uint **)(this + 0x18) = puVar7 + 1;
            *(undefined4 *)(this + 0x10) = 0;
            iVar8 = 1;
            uVar10 = 0;
          }
          else if (*(uint **)(this + 0x1c) < puVar7) {
            this[4] = (CBitRead)0x1;
            dVar14 = (double)(uVar5 + 1);
            *(undefined4 *)(this + 0x10) = 0;
            iVar8 = 0x20;
            uVar10 = 0;
          }
          else {
            dVar14 = (double)(uVar5 + 1);
            *(uint **)(this + 0x18) = puVar7 + 1;
            uVar10 = *puVar7;
            *(uint *)(this + 0x10) = uVar10;
            iVar8 = 0x20;
          }
        }
        else {
          dVar14 = (double)(uVar5 + 1);
          *(uint *)(this + 0x10) = uVar10 >> 0xb;
          uVar10 = uVar10 >> 0xb;
        }
      }
    }
LAB_0009f1a0:
    bVar11 = param_2 != 1;
    iVar9 = (-(uint)bVar11 & 2) + 3;
    if (iVar8 < iVar9) {
      puVar7 = *(uint **)(this + 0x18);
      if (puVar7 == *(uint **)(this + 0x1c)) {
        *(undefined4 *)(this + 0x14) = 1;
        *(undefined4 *)(this + 0x10) = 0;
        *(uint **)(this + 0x18) = puVar7 + 1;
        this[4] = (CBitRead)0x1;
      }
      else if (*(uint **)(this + 0x1c) < puVar7) {
        this[4] = (CBitRead)0x1;
        *(undefined4 *)(this + 0x10) = 0;
      }
      else {
        *(uint **)(this + 0x18) = puVar7 + 1;
        uVar5 = *puVar7;
        *(uint *)(this + 0x10) = uVar5;
        if (this[4] == (CBitRead)0x0) {
          iVar9 = iVar9 - iVar8;
          uVar6 = (&CBitBuffer::s_nMaskTable)[iVar9];
          uVar2 = *(undefined4 *)(this + 0x14);
          *(int *)(this + 0x14) = 0x20 - iVar9;
          *(uint *)(this + 0x10) = uVar5 >> ((byte)iVar9 & 0x1f);
          dVar13 = (double)(int)((uVar6 & uVar5) << ((byte)uVar2 & 0x1f) | uVar10);
          goto LAB_0009f1e1;
        }
      }
      dVar13 = 0.0;
      if (!bVar11) goto LAB_0009f1eb;
LAB_0009f3a3:
      dVar15 = 0.03125;
    }
    else {
      uVar5 = (&CBitBuffer::s_nMaskTable)[iVar9];
      *(int *)(this + 0x14) = iVar8 - iVar9;
      uVar5 = uVar5 & uVar10;
      if (iVar8 - iVar9 == 0) {
        puVar3 = *(undefined4 **)(this + 0x18);
        *(undefined4 *)(this + 0x14) = 0x20;
        if (puVar3 == *(undefined4 **)(this + 0x1c)) {
          *(undefined4 *)(this + 0x14) = 1;
          *(undefined4 *)(this + 0x10) = 0;
          *(undefined4 **)(this + 0x18) = puVar3 + 1;
          dVar13 = (double)(int)uVar5;
        }
        else if (*(undefined4 **)(this + 0x1c) < puVar3) {
          this[4] = (CBitRead)0x1;
          *(undefined4 *)(this + 0x10) = 0;
          dVar13 = (double)(int)uVar5;
        }
        else {
          *(undefined4 **)(this + 0x18) = puVar3 + 1;
          dVar13 = (double)(int)uVar5;
          *(undefined4 *)(this + 0x10) = *puVar3;
        }
      }
      else {
        *(uint *)(this + 0x10) = uVar10 >> (sbyte)iVar9;
        dVar13 = (double)(int)uVar5;
      }
LAB_0009f1e1:
      if (bVar11) goto LAB_0009f3a3;
LAB_0009f1eb:
      dVar15 = 0.125;
    }
    fVar12 = (float)(dVar13 * dVar15 + dVar14);
  }
LAB_0009f203:
  if (local_1c != 0) {
    fVar12 = -fVar12;
  }
LAB_0009f215:
  return (longdouble)fVar12;
}

SourceMod gamedata

paste into addons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)

Just a Signatures{} block, ready to drop into a gamedata file. Wire it up in your plugin however you like - SDKCall, DHooks, raw memory ops, or anything else.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)