//
// SHA1_Final from 0x105b6ac to 0x105b7ac (256 bytes)
//
// 7 xrefs:
// > sub_1029274 @ 0x10292b8
// > sub_10292F4 @ 0x10293e8
// > sub_10294C4 @ 0x10294e8
// > sub_1029500 @ 0x1029594
// > SHA1 @ 0x105b50c
// > sub_10DBAFC @ 0x10dbb20
// > ??> @ 0xe2c78
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:16:48 +0000
//
__int64 __fastcall SHA1_Final(_DWORD *a1, uint32x4_t *a2)
{
int8x16_t *v3; // x21
__int64 v4; // x1
__int64 v6; // x0
size_t v7; // x2
unsigned int v8; // w3
double v9; // d0
double v10; // d1
int32x4_t v11; // q2
double v13; // d0
double v14; // d1
int32x4_t v15; // q2
v3 = (uint32x4_t *)((char *)a2 + 28);
v4 = a2[5].n128_u32[3];
v6 = v4 + 1;
v3->n128_u8[v4] = 0x80;
if ( (unsigned __int64)(v4 + 1) > 0x38 )
{
memset((char *)v3 + v6, 0, 63 - v4);
sha1_block_data_order(a2, v3, 1, v13, v14, v15);
v7 = 56;
v6 = 0;
}
else
{
v7 = 55 - v4;
}
memset((char *)v3 + v6, 0, v7);
v8 = bswap32(a2[1].n128_u32[1]);
a2[5].n128_u32[1] = bswap32(a2[1].n128_u32[2]);
a2[5].n128_u32[2] = v8;
sha1_block_data_order(a2, v3, 1, v9, v10, v11);
a2[5].n128_u32[3] = 0;
OPENSSL_cleanse(v3, 0x40u);
*a1 = bswap32(a2->n128_u32[0]);
a1[1] = bswap32(a2->n128_u32[1]);
a1[2] = bswap32(a2->n128_u32[2]);
a1[3] = bswap32(a2->n128_u32[3]);
a1[4] = bswap32(a2[1].n128_u32[0]);
return 1;
}