//
// sub_100749B9C from 0x100749b9c to 0x100749e1c (640 bytes)
//
// 2 xrefs:
// > sub_100749AFC @ 0x100749b98
// > sub_10074A804 @ 0x10074a818
//
// 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 11:13:24 +0000
//
__int64 __fastcall sub_100749B9C(__int64 a1, __int64 *a2, __int64 *a3, __int64 a4)
{
int v8; // w0
__int16 v9; // w2
int v10; // w4
int v11; // w0
__int16 v12; // w2
int v13; // w4
int v15; // w1
__int64 v16; // x24
__int64 v17; // x27
__int64 v18; // x28
__int64 v19; // x25
__int64 v20; // x0
int v21; // w0
int v22; // w0
int v23; // w8
unsigned int v24; // [xsp+14h] [xbp-6Ch]
__int64 v25; // [xsp+18h] [xbp-68h]
unsigned int (__fastcall *v26)(__int64, __int64, _QWORD, __int64, __int64, __int64, __int64, _QWORD, int *); // [xsp+20h] [xbp-60h]
int v27; // [xsp+2Ch] [xbp-54h] BYREF
v27 = 0;
if ( !qword_100A0F740 )
{
v11 = dword_100A0F724;
if ( !dword_100A0F724 )
{
v11 = sub_100707AE4();
dword_100A0F724 = v11;
}
v12 = 105;
v13 = 573;
goto LABEL_9;
}
v27 = sub_1006D0D88(a4);
if ( v27 > dword_1009F1340 )
{
v8 = dword_100A0F724;
if ( !dword_100A0F724 )
{
v8 = sub_100707AE4();
dword_100A0F724 = v8;
}
v9 = 107;
v10 = 580;
LABEL_20:
sub_100706FB0(v8, 106, v9, (__int64)"e_ubsec.c", v10);
return sub_1006CF400(a1, (__int64)a2, (__int64)a3, a4);
}
v15 = *(_DWORD *)(a4 + 8);
if ( v15 > *(_DWORD *)(a1 + 12) && !sub_1006D10FC(a1, v15) )
{
v11 = dword_100A0F724;
if ( !dword_100A0F724 )
{
v11 = sub_100707AE4();
dword_100A0F724 = v11;
}
v12 = 101;
v13 = 585;
LABEL_9:
sub_100706FB0(v11, 106, v12, (__int64)"e_ubsec.c", v13);
return 0;
}
v16 = xmmword_100A0F728("/dev/ubskey");
if ( (int)v16 <= 0 )
{
v8 = dword_100A0F724;
if ( !dword_100A0F724 )
{
v8 = sub_100707AE4();
dword_100A0F724 = v8;
}
v9 = 108;
v10 = 591;
goto LABEL_20;
}
v26 = (unsigned int (__fastcall *)(__int64, __int64, _QWORD, __int64, __int64, __int64, __int64, _QWORD, int *))qword_100A0F748;
v25 = *a2;
v24 = sub_1006D0D88((__int64)a2);
v17 = *(_QWORD *)a4;
v18 = sub_1006D0D88(a4);
v19 = *a3;
v20 = sub_1006D0D88((__int64)a3);
if ( v26(v16, v25, v24, v17, v18, v19, v20, *(_QWORD *)a1, &v27) )
{
v21 = dword_100A0F724;
if ( !dword_100A0F724 )
{
v21 = sub_100707AE4();
dword_100A0F724 = v21;
}
sub_100706FB0(v21, 106, 106, (__int64)"e_ubsec.c", 599);
off_100A0F738(v16);
return sub_1006CF400(a1, (__int64)a2, (__int64)a3, a4);
}
else
{
off_100A0F738(v16);
v22 = sub_1006D0D88(a4);
v23 = v22 + 63;
if ( v22 + 63 < 0 )
v23 = v22 + 126;
*(_DWORD *)(a1 + 8) = v23 >> 6;
return 1;
}
}