char *__thiscall sub_4635D0(
int this,
int a2,
int a3,
int a4,
int a5,
int a6,
int a7,
int a8,
int a9,
int a10,
int a11,
char a12)
{
_DWORD *v13; // ebx
int i; // edi
int v15; // ecx
int v16; // edi
char v17; // al
char v18; // al
char v19; // al
char *result; // eax
dword_66D840 = a11;
sub_50C7B0(110291 * a9 + 167801 * a10 + 81569);
*(_DWORD *)(this + 81904) = a2;
*(_DWORD *)(this + 21436) = sub_412B30(a2);
*(_BYTE *)(this + 81967) = 1;
v13 = (_DWORD *)(this + 21672);
if ( a3 )
*v13 = *(char *)(a3 + 34);
else
*v13 = -1;
*(_DWORD *)(this + 21452) = a3;
*(_DWORD *)(this + 21676) = a5;
*(_DWORD *)(this + 21700) = a4;
*(_DWORD *)(this + 21456) = a7;
*(_DWORD *)(this + 21704) = a8;
for ( i = 0; i < 2; ++i )
{
if ( (int)*v13 < 0 )
{
*(_BYTE *)(i + this + 21668) = 0;
*(_BYTE *)(i + this + 21670) = 0;
*(_BYTE *)(i + this + 21682) = 0;
}
else
{
*(_BYTE *)(i + this + 21668) = sub_4CE600(*v13);
*(_BYTE *)(i + this + 21670) = sub_4CE630(*v13);
*(_BYTE *)(i + this + 21682) = sub_4BA970(129);
}
*(_BYTE *)(this + i + 21680) = 1;
v13[3] = 0;
v13[14206] = 30000;
++v13;
}
if ( !a6 )
{
*(_DWORD *)(this + 78580) = 0;
*(_BYTE *)(this + 21417) = 0;
*(_BYTE *)(this + 21416) = 0;
*(_DWORD *)(this + 21448) = 0;
goto LABEL_28;
}
v15 = *(_DWORD *)(a6 + 336);
v16 = *(_DWORD *)(a6 + 340);
if ( (qword_66CDD0 & *(_QWORD *)(a6 + 336)) != 0 )
{
*(_DWORD *)(this + 78580) = 1;
LABEL_25:
*(_BYTE *)(this + 21417) = 0;
*(_BYTE *)(this + 21416) = 0;
goto LABEL_26;
}
if ( !(dword_66CDDC & v16 | dword_66CDD8 & v15) )
{
if ( !(dword_66CDE4 & v16 | dword_66CDE0 & v15) )
{
*(_DWORD *)(this + 78580) = 0;
goto LABEL_25;
}
*(_DWORD *)(this + 78580) = 3;
v19 = *(_BYTE *)(a6 + 4);
if ( v19 != 2 && (v19 != 6 || *(int *)(dword_699538 + 128664) >= 2) )
{
v18 = 1;
goto LABEL_18;
}
goto LABEL_17;
}
*(_DWORD *)(this + 78580) = 2;
v17 = *(_BYTE *)(a6 + 4);
if ( v17 == 2 || v17 == 6 && *(int *)(dword_699538 + 128664) < 2 )
{
LABEL_17:
v18 = 0;
goto LABEL_18;
}
v18 = 1;
LABEL_18:
*(_BYTE *)(this + 21416) = v18;
*(_BYTE *)(this + 21417) = *(_BYTE *)(a6 + 4) == 7;
LABEL_26:
*(_DWORD *)(this + 21412) = 3;
*(_DWORD *)(this + 21448) = a6;
LABEL_28:
sub_463F90(this);
*(_BYTE *)(this + 21445) = a12;
result = sub_4642B0(this);
*(_DWORD *)(this + 78948) = result;
return result;
}