//
// ssl3_cbc_remove_padding from 0x99fc68 to 0x99fcec (132 bytes)
//
// 2 xrefs:
// > ssl3_enc @ 0x99fe24
// > ??> @ 0x7450c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:06:47 +0000
//
int __fastcall ssl3_cbc_remove_padding(int a1, int a2, int a3)
{
unsigned int v3; // r12
unsigned int v4; // r2
int v5; // r3
int v6; // r1
v3 = *(_DWORD *)(a1 + 8);
v4 = a3 + 1;
if ( v4 > v3 )
return 0;
v5 = *(unsigned __int8 *)(*(_DWORD *)(a1 + 20) + v3 - 1);
v6 = ~((a2 ^ ((a2 - (v5 + 1)) ^ (v5 + 1) | (v5 + 1) ^ a2)) >> 31)
& ~((int)(((v3 - (v4 + v5)) ^ (v4 + v5) | (v4 + v5) ^ v3) ^ v3) >> 31);
*(_DWORD *)(a1 + 8) = v3 - ((v5 + 1) & v6);
return ~v6 | v6 & 1;
}