CBitRead::ReadBitCoordMP
0x00b77610 · 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_00b7771d;
}
if (puVar7 <= *(uint **)(this + 0x1c)) {
*(uint **)(this + 0x18) = puVar7 + 1;
uVar10 = *puVar7;
iVar8 = 0x1f;
*(uint *)(this + 0x10) = uVar10;
uVar6 = uVar10 & 1;
goto LAB_00b7771d;
}
uVar10 = 0;
iVar8 = 0x1f;
this[4] = (CBitRead)0x1;
*(undefined4 *)(this + 0x10) = 0;
*(undefined4 *)(this + 0x14) = 0x1f;
if (param_2 != 2) goto LAB_00b77730;
LAB_00b77673:
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_00b77805;
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_00b77baf:
puVar1 = *(uint **)(this + 0x18);
if (puVar1 == puVar7) {
LAB_00b77d32:
*(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_00b77d4a;
iVar8 = 0xe - iVar9;
iVar9 = iVar9 + 0x12;
local_18 = (*(uint *)(CBitBuffer::s_nMaskTable + iVar8 * 4) & uVar5) <<
((byte)*(undefined4 *)(this + 0x14) & 0x1f) | local_18;
LAB_00b77b6f:
*(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_00b777f3;
}
LAB_00b77d60:
this[4] = (CBitRead)0x1;
*(undefined4 *)(this + 0x10) = 0;
}
}
else {
iVar9 = 1;
local_18 = 0;
LAB_00b77b2e:
puVar1 = *(uint **)(this + 0x18);
if (puVar1 == puVar7) goto LAB_00b77d32;
if (puVar7 < puVar1) goto LAB_00b77d60;
*(uint **)(this + 0x18) = puVar1 + 1;
uVar5 = *puVar1;
*(uint *)(this + 0x10) = uVar5;
if (this[4] == (CBitRead)0x0) {
iVar8 = 0xb - iVar9;
iVar9 = iVar9 + 0x15;
local_18 = (*(uint *)(CBitBuffer::s_nMaskTable + iVar8 * 4) & uVar5) <<
((byte)*(undefined4 *)(this + 0x14) & 0x1f) | local_18;
goto LAB_00b77b6f;
}
}
LAB_00b77d4a:
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_00b776e0;
}
*(undefined4 *)(this + 0x14) = 0x12;
uVar5 = local_18 & 0x3fff;
LAB_00b77d06:
*(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_00b77baf;
}
iVar8 = iVar8 + -0xf;
uVar5 = local_18 & 0x3fff;
*(int *)(this + 0x14) = iVar8;
if (iVar8 != 0) goto LAB_00b77d06;
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_00b77b2e;
}
LAB_00b776e0:
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_00b7771d:
*(int *)(this + 0x14) = iVar8;
if (param_2 == 2) goto LAB_00b77673;
LAB_00b77730:
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_00b77753;
}
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_00b7784c:
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_00b7784c;
puVar7 = *(uint **)(this + 0x1c);
LAB_00b77753:
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_00b77d70;
if (*(uint **)(this + 0x1c) < puVar7) goto LAB_00b77a72;
*(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 & *(uint *)(CBitBuffer::s_nMaskTable + iVar9 * 4)) << (bVar4 & 0x1f);
goto LAB_00b77acf;
}
LAB_00b77f17:
dVar14 = 1.0;
uVar10 = local_18;
}
else {
iVar8 = iVar8 + -0xe;
uVar5 = uVar10 & 0x3fff;
*(int *)(this + 0x14) = iVar8;
if (iVar8 == 0) goto LAB_00b7788b;
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_00b77d70:
*(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_00b77f17;
iVar9 = 0xb - iVar8;
iVar8 = iVar8 + 0x15;
uVar5 = (local_18 & *(uint *)(CBitBuffer::s_nMaskTable + iVar9 * 4)) << (bVar4 & 0x1f);
LAB_00b77acf:
dVar14 = (double)(int)((uVar5 | uVar10) + 1);
*(int *)(this + 0x14) = iVar8;
uVar10 = local_18 >> ((byte)iVar9 & 0x1f);
*(uint *)(this + 0x10) = uVar10;
goto LAB_00b77790;
}
LAB_00b77a72:
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_00b7788b:
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_00b77790:
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 = *(uint *)(CBitBuffer::s_nMaskTable + iVar9 * 4);
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_00b777d1;
}
}
dVar13 = 0.0;
if (!bVar11) goto LAB_00b777db;
LAB_00b77993:
dVar15 = 0.03125;
}
else {
uVar5 = *(uint *)(CBitBuffer::s_nMaskTable + iVar9 * 4);
*(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_00b777d1:
if (bVar11) goto LAB_00b77993;
LAB_00b777db:
dVar15 = 0.125;
}
fVar12 = (float)(dVar13 * dVar15 + dVar14);
}
LAB_00b777f3:
if (local_1c != 0) {
fVar12 = -fVar12;
}
LAB_00b77805:
return (longdouble)fVar12;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.