//
// ssl3_cbc_remove_padding from 0x78b064 to 0x78b0e8 (132 bytes)
//
// 2 xrefs:
// > ssl3_enc @ 0x78b220
// > ??> @ 0x5aa8c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
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;
}