rendered paste body//----- (00461BA0) --------------------------------------------------------
int __cdecl sub_461BA0(int a1, int a2)
{
int v2; // esi@1
int result; // eax@2
int v4; // eax@3
int v5; // edi@3
int v6; // [sp+8h] [bp-204h]@1
unsigned int v7; // [sp+208h] [bp-4h]@1
v7 = (unsigned int)&v6 ^ dword_128A30C;
v2 = a2;
if ( a2 )
{
*(_DWORD *)a2 = 1766877294;
sub_96FB80();
v4 = sub_461B20((int)&v6);
v5 = v4;
if ( !v4 )
{
if ( sub_48BFA0("iPhone", (int)&v6, v4) )
*(_DWORD *)v2 = 1766877294;
else
*(_DWORD *)v2 = -(sub_48BFA0("iPod", (int)&v6, 0) != 0) & 0x69506F64;
}
result = v5;
}
else
{
result = a2 - 50;
}
return result;
}
//----- (0056E8D0) --------------------------------------------------------
int __cdecl sub_56E8D0(signed int a1)
{
int v1; // edi@1
int result; // eax@2
int v3; // ebx@3
signed int v4; // ebp@4
int v5; // esi@5
int v6; // eax@8
int v7; // eax@3
int v8; // eax@5
int v9; // eax@6
int v10; // [sp+4h] [bp-10Ch]@1
unsigned int v11; // [sp+10Ch] [bp-4h]@1
int v12; // [sp+8h] [bp-108h]@3
const CHAR String1; // [sp+Ch] [bp-104h]@6
v11 = (unsigned int)&v10 ^ dword_128A30C;
v1 = 0;
v10 = 0;
if ( sub_460D20() )
{
result = 0;
}
else
{
sub_970030();
v12 = sub_40B560();
v7 = sub_40B590(v10);
v3 = v7;
if ( v7 > 0 )
{
v4 = a1;
do
{
v8 = sub_40B7B0(v10);
v5 = v8;
if ( v8 )
{
v9 = sub_96FB80();
if ( !sub_40C2D0(v5, v9, (int)&String1) || sub_487ED0(&String1, "iPhone", 0) )
v6 = 1766877294;
else
v6 = -(sub_487ED0(&String1, "iPod", 0) != 0) & 0x69506F64;
if ( v4 == v6 || v4 == 1 )
sub_40B660(v12, v5);
}
++v1;
}
while ( v1 < v3 );
}
sub_40B920(v10);
result = v12;
}
return result;
}
//----- (0057DCE0) --------------------------------------------------------
int __cdecl sub_57DCE0(int a1, int a2, signed int a3, void *a4, int a5)
{
int v5; // edi@1
int v6; // esi@1
int v7; // ebp@3
int v8; // eax@4
int v9; // ebp@4
int v11; // ebx@6
void *v12; // edi@9
const void *v13; // esi@9
signed int v14; // esi@15
char *v15; // ST1C_4@16
int v16; // ST20_4@16
int v17; // eax@29
int v18; // eax@3
int v19; // eax@10
int v20; // eax@14
char v21; // cf@28
unsigned __int8 v22; // zf@28
char v23; // cf@31
unsigned __int8 v24; // zf@31
int v25; // eax@33
int v26; // eax@39
int v27; // [sp+10h] [bp-850h]@1
unsigned int v28; // [sp+85Ch] [bp-4h]@1
void *v29; // [sp+18h] [bp-848h]@1
int v30; // [sp+25Ch] [bp-604h]@10
__int16 v31; // [sp+16h] [bp-84Ah]@15
__int16 v32; // [sp+14h] [bp-84Ch]@15
__int16 v33; // [sp+45Ch] [bp-404h]@15
int v34; // [sp+65Ch] [bp-204h]@16
__int16 v35; // [sp+660h] [bp-200h]@20
char v36; // [sp+1Ch] [bp-844h]@39
char v37; // [sp+30h] [bp-830h]@40
v28 = (unsigned int)&v27 ^ dword_128A30C;
v6 = a2;
v29 = a4;
v5 = a1;
v27 = a5;
if ( a5 )
*(_WORD *)a5 = 0;
v18 = sub_42D240(v5);
v7 = v18;
if ( sub_42CBE0(v18) != 33554432 )
{
v19 = sub_42F9B0(v5, 0, (int)&v30);
v11 = v19;
if ( v19 )
return v11;
if ( v27 )
sub_487FD0(&v30, v27);
if ( sub_4887A0((int)&v30, (int *)v6, 0) )
return v11;
sub_42C390(v7, v6, (int)&v30);
v20 = sub_42DB90(v7, (int)&v30);
v11 = v20;
if ( !v20 )
goto LABEL_38;
v31 = 0;
v32 = 0;
sub_487FD0(&v30, (int)&v33);
sub_48A1D0((signed int *)&v33, 32);
v14 = a3;
if ( a3 == 1885892462 )
{
v16 = (int)&v34;
v15 = "Phone";
}
else
{
if ( a3 == 1766877294 )
{
v16 = (int)&v34;
v15 = "iPhone";
}
else
{
v16 = (int)&v34;
v15 = "iPod";
}
}
sub_489310(v15, v16);
sub_486A60((int)&v33);
v34 = 538509314;
v35 = 115;
sub_486A60((int)&v33);
sub_42BE70((unsigned int *)&v33);
sub_48A1D0((signed int *)&v33, 95);
if ( v33 )
{
if ( v11 == -1410 || v11 == -37 )
{
sub_487FD0(&v30, (int)&v33);
v21 = (unsigned __int16)(v33 - 1) < 1u;
v22 = v33-- == 2;
if ( !(v21 | v22) )
{
do
{
v17 = sub_42DB90(v7, (int)&v33);
v11 = v17;
if ( v17 != -1410 && v17 != -37 )
break;
v23 = (unsigned __int16)(v33 - 1) < 1u;
v24 = v33-- == 2;
}
while ( !(v23 | v24) );
}
}
if ( !v11 || (sub_42BE70((unsigned int *)&v30), v25 = sub_42DB90(v7, (int)&v33), v11 = v25, !v25) )
goto LABEL_38;
if ( (_WORD)v30 <= 0xBu )
{
LABEL_37:
if ( v11 )
return v11;
LABEL_38:
v12 = v29;
if ( !v29 || (v26 = sub_42DB30(v7, 0, (int)&v36, v27), v11 = v26, v26) )
return v11;
v13 = &v37;
goto LABEL_41;
}
LOWORD(v30) = 11;
}
else
{
if ( v14 == 1766877294 )
{
sub_489310("iPhone", (int)&v30);
}
else
{
if ( v14 == 1885892462 )
sub_489310("Phone", (int)&v30);
else
sub_489310("iPod", (int)&v30);
}
}
v11 = sub_42DB90(v7, (int)&v30);
goto LABEL_37;
}
v8 = sub_4340B0(v7);
v9 = v8;
if ( !v8 )
return v8 - 50;
v11 = sub_461D90(v8, v6);
if ( v27 )
sub_461D70(v9, v27);
if ( v29 )
{
v13 = (const void *)v5;
v12 = v29;
LABEL_41:
memcpy(v12, v13, 0x214u);
}
return v11;
}