//
// sub_100157424 from 0x100157424 to 0x1001575a4 (384 bytes)
//
// 2 xrefs:
// > sub_100157708 @ 0x100157724
// > GJRotationControl::init @ 0x1001572a0
//
// 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 10:59:42 +0000
//
void __fastcall sub_100157424(__int64 a1)
{
const char *v2; // x0
double v3; // d8
float v4; // s0
float v5; // s8
float v6; // w8
float v7; // s9
float v8; // w8
__int64 v9; // x0
char *v10[2]; // [xsp+8h] [xbp-38h] BYREF
char v11; // [xsp+1Fh] [xbp-21h]
if ( *(_QWORD *)(a1 + 464) )
{
CCTextInputNode::getString(v10);
if ( v11 < 0 )
{
if ( v10[1] )
{
v2 = v10[0];
LABEL_7:
v3 = atof(v2);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 464) + 1160LL))(*(_QWORD *)(a1 + 464), 0);
v4 = v3;
v5 = fmodf(v4, 360.0);
if ( v5 <= 180.0 )
{
if ( v5 > -180.0 )
goto LABEL_13;
v6 = 360.0;
}
else
{
v6 = -360.0;
}
v5 = v5 + v6;
LABEL_13:
v7 = v5 - *(float *)(a1 + 436);
if ( v7 <= 180.0 )
{
if ( v7 > -180.0 )
goto LABEL_18;
v8 = 360.0;
}
else
{
v8 = -360.0;
}
v7 = v7 + v8;
LABEL_18:
if ( v7 != 0.0 )
{
v9 = *(_QWORD *)(a1 + 512);
if ( v9 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 8LL))(v9);
(***(void (__fastcall ****)(_QWORD, _QWORD, float))(a1 + 512))(
*(_QWORD *)(a1 + 512),
*(unsigned __int8 *)(a1 + 456),
v7);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 512) + 16LL))(*(_QWORD *)(a1 + 512));
}
}
sub_1001575C8(a1, v5);
goto LABEL_22;
}
}
else if ( v11 )
{
v2 = (const char *)v10;
goto LABEL_7;
}
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 464) + 1160LL))(*(_QWORD *)(a1 + 464), 0);
sub_10015764C(a1, *(float *)(a1 + 436));
LABEL_22:
if ( v11 < 0 )
operator delete(v10[0]);
}
}