//
// sub_18003A310 from 0x18003a310 to 0x18003a701 (1009 bytes)
//
// 3 xrefs:
// > sub_18003AC00 @ 0x18003aca0
// > sub_18003AC00 @ 0x18003af42
// > ??> @ 0x1801f7cf8
//
// This function is hookable on this platform (idp: pc, 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:53:08 +0000
//
__int64 __fastcall sub_18003A310(__int64 a1)
{
__int64 v2; // rcx
__int64 result; // rax
int v4; // eax
__int64 v5; // rcx
int v6; // eax
__int64 v7; // rcx
int v8; // eax
__int64 v9; // rcx
int v10; // eax
__int64 v11; // rcx
int v12; // eax
int v13; // eax
__int64 v14; // rcx
int v15; // eax
int v16; // [rsp+40h] [rbp-40h] BYREF
__int128 v17; // [rsp+48h] [rbp-38h] BYREF
__int64 v18; // [rsp+58h] [rbp-28h]
int v19; // [rsp+60h] [rbp-20h]
__int16 v20; // [rsp+64h] [rbp-1Ch]
char v21; // [rsp+66h] [rbp-1Ah]
_BYTE v22[8]; // [rsp+68h] [rbp-18h] BYREF
v18 = 0;
v19 = 0;
v2 = *(_QWORD *)(a1 + 368);
v20 = 0;
v21 = 0;
v17 = 0;
result = sub_1800B3470(v2, (unsigned int)&v17, 1, 30, (__int64)&v16);
if ( (_DWORD)result )
return result;
if ( v16 != 30 )
return 13;
if ( (unsigned int)sub_1800B7F50(&v17) )
{
v4 = sub_1800B7F50(&v17);
sub_180012590(a1, 1, (int)"TITLE", (int)&v17, v4 + 1, 3, 0);
}
v5 = *(_QWORD *)(a1 + 368);
v18 = 0;
v19 = 0;
v20 = 0;
v21 = 0;
v17 = 0;
result = sub_1800B3470(v5, (unsigned int)&v17, 1, 30, (__int64)&v16);
if ( (_DWORD)result )
return result;
if ( v16 != 30 )
return 13;
if ( (unsigned int)sub_1800B7F50(&v17) )
{
v6 = sub_1800B7F50(&v17);
sub_180012590(a1, 1, (int)"ARTIST", (int)&v17, v6 + 1, 3, 0);
}
v7 = *(_QWORD *)(a1 + 368);
v18 = 0;
v19 = 0;
v20 = 0;
v21 = 0;
v17 = 0;
result = sub_1800B3470(v7, (unsigned int)&v17, 1, 30, (__int64)&v16);
if ( (_DWORD)result )
return result;
if ( v16 != 30 )
return 13;
if ( (unsigned int)sub_1800B7F50(&v17) )
{
v8 = sub_1800B7F50(&v17);
sub_180012590(a1, 1, (int)"ALBUM", (int)&v17, v8 + 1, 3, 0);
}
v9 = *(_QWORD *)(a1 + 368);
v18 = 0;
v19 = 0;
v20 = 0;
v21 = 0;
v17 = 0;
result = sub_1800B3470(v9, (unsigned int)&v17, 1, 4, (__int64)&v16);
if ( (_DWORD)result )
return result;
if ( v16 != 4 )
return 13;
if ( (unsigned int)sub_1800B7F50(&v17) )
{
v10 = sub_1800B7F50(&v17);
sub_180012590(a1, 1, (int)"YEAR", (int)&v17, v10 + 1, 3, 0);
}
v11 = *(_QWORD *)(a1 + 368);
v18 = 0;
v19 = 0;
v20 = 0;
v21 = 0;
v17 = 0;
result = sub_1800B3470(v11, (unsigned int)&v17, 1, 30, (__int64)&v16);
if ( (_DWORD)result )
return result;
if ( v16 != 30 )
return 13;
if ( (unsigned int)sub_1800B7F50(&v17) )
{
v12 = sub_1800B7F50(&v17);
sub_180012590(a1, 1, (int)"COMMENT", (int)&v17, v12 + 1, 3, 0);
}
if ( !(_BYTE)v20 )
{
if ( HIBYTE(v20) )
{
sub_1800B7CA0(v22, 8, "%d", HIBYTE(v20));
v13 = sub_1800B7F50(v22);
sub_180012590(a1, 1, (int)"TRACK", (int)v22, v13 + 1, 3, 0);
}
}
v14 = *(_QWORD *)(a1 + 368);
v18 = 0;
v19 = 0;
v20 = 0;
v21 = 0;
v17 = 0;
result = sub_1800B3470(v14, (unsigned int)&v17, 1, 1, (__int64)&v16);
if ( !(_DWORD)result )
{
if ( v16 == 1 )
{
sub_1800B7CA0(v22, 8, "%d", (unsigned __int8)v17);
v15 = sub_1800B7F50(v22);
sub_180012590(a1, 1, (int)"GENRE", (int)v22, v15 + 1, 3, 0);
return 0;
}
return 13;
}
return result;
}