//
// sub_180137D7C from 0x180137d7c to 0x180137ec8 (332 bytes)
//
// 2 xrefs:
// > sub_180137FE0 @ 0x1801381d0
// > ??> @ 0x180203620
//
// 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
//
__int64 __fastcall sub_180137D7C(
__int64 *a1,
char *a2,
unsigned __int64 a3,
char *a4,
rsize_t a5,
int a6,
char a7,
unsigned int a8,
int a9,
struct __crt_locale_pointers *a10)
{
__int64 v11; // rcx
int v13; // eax
int v14; // r14d
char *v15; // rbx
__int64 result; // rax
int v17; // eax
__int128 v19; // [rsp+40h] [rbp-18h] BYREF
v11 = *a1;
v19 = 0;
v13 = _acrt_fltout(v11, a6, 0, (int)&v19, a4, a5);
v14 = DWORD1(v19) - 1;
v15 = &a2[(_DWORD)v19 == 45];
result = sub_18013DC24(v15, v13, a9);
if ( (_DWORD)result )
{
*a2 = 0;
}
else
{
v17 = DWORD1(v19) - 1;
if ( DWORD1(v19) - 1 < -4 || v17 >= a6 )
{
return fp_format_e_internal(a2, a3, a6, a7, a8, (struct _strflt *const)&v19, 1, a10);
}
else
{
if ( v14 < v17 )
{
while ( *v15++ )
;
*(v15 - 2) = 0;
}
return fp_format_f_internal(a2, a3, a6, (struct _strflt *const)&v19, 1, a10);
}
}
return result;
}