L L4D2node

CBitRead::ReadBitCoord

0x00b77170 · 1069 bytes · __thiscall

_ZN8CBitRead12ReadBitCoordEv

Decompiled

undefined (1 param)

/* CBitRead::ReadBitCoord() */

longdouble __thiscall CBitRead::ReadBitCoord(CBitRead *this)

{
  int iVar1;
  CBitRead *pCVar2;
  uint *puVar3;
  undefined4 *puVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  int iVar9;
  uint *puVar10;
  uint uVar11;
  float fVar12;
  double dVar13;
  double dVar14;
  byte local_18;
  
  iVar9 = *(int *)(this + 0x14);
  uVar11 = *(uint *)(this + 0x10);
  iVar1 = iVar9 + -1;
  *(int *)(this + 0x14) = iVar1;
  if (iVar1 == 0) {
    puVar3 = *(uint **)(this + 0x18);
    *(undefined4 *)(this + 0x14) = 0x20;
    puVar10 = *(uint **)(this + 0x1c);
    if (puVar3 != puVar10) {
      if (puVar10 < puVar3) {
        this[4] = (CBitRead)0x1;
        uVar8 = 0;
        uVar7 = 0;
      }
      else {
        *(uint **)(this + 0x18) = puVar3 + 1;
        uVar8 = *puVar3;
        uVar7 = uVar8 & 1;
      }
      *(undefined4 *)(this + 0x14) = 0x1f;
      goto LAB_00b771b6;
    }
    *(undefined4 *)(this + 0x10) = 0;
    *(uint **)(this + 0x18) = puVar10 + 1;
    uVar8 = 0;
    uVar7 = 0;
LAB_00b771f5:
    puVar3 = *(uint **)(this + 0x18);
    *(undefined4 *)(this + 0x14) = 0x20;
    if (puVar3 == puVar10) {
      *(undefined4 *)(this + 0x14) = 1;
      *(undefined4 *)(this + 0x10) = 0;
      *(uint **)(this + 0x18) = puVar10 + 1;
    }
    else if (puVar10 < puVar3) {
      this[4] = (CBitRead)0x1;
      *(undefined4 *)(this + 0x10) = 0;
    }
    else {
      *(uint **)(this + 0x18) = puVar3 + 1;
      *(uint *)(this + 0x10) = *puVar3;
    }
  }
  else {
    iVar9 = iVar9 + -2;
    uVar8 = uVar11 >> 1;
    *(int *)(this + 0x14) = iVar9;
    *(uint *)(this + 0x10) = uVar8;
    uVar7 = uVar8 & 1;
    if (iVar9 == 0) {
      puVar10 = *(uint **)(this + 0x1c);
      goto LAB_00b771f5;
    }
LAB_00b771b6:
    *(uint *)(this + 0x10) = uVar8 >> 1;
  }
  fVar12 = 0.0;
  if (((uVar8 | uVar11) & 1) == 0) goto LAB_00b771c5;
  uVar8 = *(uint *)(this + 0x10);
  pCVar2 = this + 0x14;
  *(int *)pCVar2 = *(int *)pCVar2 + -1;
  if (*(int *)pCVar2 == 0) {
    puVar4 = *(undefined4 **)(this + 0x18);
    *(undefined4 *)(this + 0x14) = 0x20;
    if (puVar4 == *(undefined4 **)(this + 0x1c)) {
      *(undefined4 *)(this + 0x14) = 1;
      *(undefined4 *)(this + 0x10) = 0;
      *(undefined4 **)(this + 0x18) = puVar4 + 1;
      goto LAB_00b772d5;
    }
    if (puVar4 <= *(undefined4 **)(this + 0x1c)) {
      *(undefined4 **)(this + 0x18) = puVar4 + 1;
      *(undefined4 *)(this + 0x10) = *puVar4;
      goto LAB_00b772d5;
    }
    this[4] = (CBitRead)0x1;
    *(undefined4 *)(this + 0x10) = 0;
    if ((uVar11 & 1) != 0) goto LAB_00b772da;
LAB_00b7725d:
    dVar14 = 0.0;
  }
  else {
    *(uint *)(this + 0x10) = uVar8 >> 1;
LAB_00b772d5:
    if ((uVar11 & 1) == 0) goto LAB_00b7725d;
LAB_00b772da:
    iVar1 = *(int *)(this + 0x14);
    if (iVar1 < 0xe) {
      puVar10 = *(uint **)(this + 0x18);
      uVar11 = *(uint *)(this + 0x10);
      if (puVar10 == *(uint **)(this + 0x1c)) {
        *(undefined4 *)(this + 0x14) = 1;
        *(undefined4 *)(this + 0x10) = 0;
        *(uint **)(this + 0x18) = puVar10 + 1;
        this[4] = (CBitRead)0x1;
      }
      else if (*(uint **)(this + 0x1c) < puVar10) {
        this[4] = (CBitRead)0x1;
        *(undefined4 *)(this + 0x10) = 0;
      }
      else {
        *(uint **)(this + 0x18) = puVar10 + 1;
        uVar6 = *puVar10;
        *(uint *)(this + 0x10) = uVar6;
        if (this[4] == (CBitRead)0x0) {
          uVar5 = *(uint *)(CBitBuffer::s_nMaskTable + (0xe - iVar1) * 4);
          *(int *)(this + 0x14) = iVar1 + 0x12;
          local_18 = (byte)(0xe - iVar1);
          dVar14 = (double)(int)(((uVar6 & uVar5) << ((byte)iVar1 & 0x1f) | uVar11) + 1);
          *(uint *)(this + 0x10) = uVar6 >> (local_18 & 0x1f);
          goto LAB_00b77261;
        }
      }
      dVar14 = 1.0;
    }
    else {
      *(int *)(this + 0x14) = iVar1 + -0xe;
      uVar11 = *(uint *)(this + 0x10) & 0x3fff;
      if (iVar1 + -0xe == 0) {
        puVar4 = *(undefined4 **)(this + 0x18);
        *(undefined4 *)(this + 0x14) = 0x20;
        if (puVar4 == *(undefined4 **)(this + 0x1c)) {
          *(undefined4 *)(this + 0x14) = 1;
          dVar14 = (double)(uVar11 + 1);
          *(undefined4 *)(this + 0x10) = 0;
          *(undefined4 **)(this + 0x18) = puVar4 + 1;
        }
        else if (*(undefined4 **)(this + 0x1c) < puVar4) {
          this[4] = (CBitRead)0x1;
          dVar14 = (double)(uVar11 + 1);
          *(undefined4 *)(this + 0x10) = 0;
        }
        else {
          dVar14 = (double)(uVar11 + 1);
          *(undefined4 **)(this + 0x18) = puVar4 + 1;
          *(undefined4 *)(this + 0x10) = *puVar4;
        }
      }
      else {
        dVar14 = (double)(uVar11 + 1);
        *(uint *)(this + 0x10) = *(uint *)(this + 0x10) >> 0xe;
      }
    }
  }
LAB_00b77261:
  if (uVar7 == 0) {
LAB_00b77298:
    dVar13 = 0.0;
  }
  else {
    iVar1 = *(int *)(this + 0x14);
    if (iVar1 < 5) {
      puVar10 = *(uint **)(this + 0x18);
      uVar11 = *(uint *)(this + 0x10);
      if (puVar10 == *(uint **)(this + 0x1c)) {
        *(undefined4 *)(this + 0x14) = 1;
        *(undefined4 *)(this + 0x10) = 0;
        *(uint **)(this + 0x18) = puVar10 + 1;
        this[4] = (CBitRead)0x1;
      }
      else if (*(uint **)(this + 0x1c) < puVar10) {
        this[4] = (CBitRead)0x1;
        *(undefined4 *)(this + 0x10) = 0;
      }
      else {
        *(uint **)(this + 0x18) = puVar10 + 1;
        uVar7 = *puVar10;
        *(uint *)(this + 0x10) = uVar7;
        if (this[4] == (CBitRead)0x0) {
          uVar6 = *(uint *)(CBitBuffer::s_nMaskTable + (5 - iVar1) * 4);
          *(int *)(this + 0x14) = iVar1 + 0x1b;
          *(uint *)(this + 0x10) = uVar7 >> ((byte)(5 - iVar1) & 0x1f);
          dVar13 = (double)(int)((uVar6 & uVar7) << ((byte)iVar1 & 0x1f) | uVar11) * 0.03125;
          goto LAB_00b7729c;
        }
      }
      goto LAB_00b77298;
    }
    *(int *)(this + 0x14) = iVar1 + -5;
    uVar11 = *(uint *)(this + 0x10) & 0x1f;
    if (iVar1 + -5 == 0) {
      puVar4 = *(undefined4 **)(this + 0x18);
      *(undefined4 *)(this + 0x14) = 0x20;
      if (puVar4 == *(undefined4 **)(this + 0x1c)) {
        *(undefined4 *)(this + 0x14) = 1;
        *(undefined4 *)(this + 0x10) = 0;
        *(undefined4 **)(this + 0x18) = puVar4 + 1;
        dVar13 = (double)uVar11 * 0.03125;
      }
      else if (*(undefined4 **)(this + 0x1c) < puVar4) {
        this[4] = (CBitRead)0x1;
        *(undefined4 *)(this + 0x10) = 0;
        dVar13 = (double)uVar11 * 0.03125;
      }
      else {
        *(undefined4 **)(this + 0x18) = puVar4 + 1;
        dVar13 = (double)uVar11 * 0.03125;
        *(undefined4 *)(this + 0x10) = *puVar4;
      }
    }
    else {
      *(uint *)(this + 0x10) = *(uint *)(this + 0x10) >> 5;
      dVar13 = (double)uVar11 * 0.03125;
    }
  }
LAB_00b7729c:
  fVar12 = (float)(dVar13 + dVar14);
  if ((uVar8 & 1) != 0) {
    return (longdouble)-fVar12;
  }
LAB_00b771c5:
  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)