int __thiscall VgaExtendedModeSetup(int this)
{
int v2; // edi
int v3; // ecx
int v4; // ecx
int v5; // ecx
int v6; // ecx
int v7; // ecx
int v8; // ecx
int v9; // ecx
int v10; // ecx
int v11; // ecx
int v12; // ecx
int v13; // ecx
int v14; // ecx
int v15; // ecx
int v16; // ecx
int v17; // ecx
int v18; // ecx
int v19; // ecx
int v20; // ecx
int v21; // ecx
int v22; // ecx
int v23; // ecx
int v24; // ecx
int v25; // ecx
int v26; // ecx
int v27; // ecx
int v28; // ecx
int v29; // eax
int v30; // edx
int v31; // ecx
int v32; // ecx
int v33; // ecx
unsigned int v34; // esi
int v35; // ecx
int v36; // ecx
int v37; // ecx
unsigned __int16 v38; // ax
int v39; // ecx
int v40; // ecx
int v41; // ecx
int v42; // ecx
int v43; // ecx
int v44; // ecx
int v45; // ecx
int v46; // ecx
int v47; // ecx
int v48; // ecx
int v49; // ecx
int v50; // ecx
int v51; // ecx
int v52; // ecx
int v53; // ecx
int v54; // ecx
int v55; // ecx
unsigned int v56; // esi
int v57; // edx
int v58; // ecx
int v59; // ecx
int v60; // ecx
int v61; // ecx
int v62; // ecx
int v63; // eax
int v64; // edx
int v65; // ecx
int v66; // esi
int v67; // ecx
int v68; // ecx
int v69; // ecx
int v70; // ecx
int v71; // ecx
int v72; // ecx
int v73; // ecx
int v74; // ecx
int v75; // edx
int v76; // ecx
unsigned int v78; // [esp-4h] [ebp-18h]
v2 = *(_DWORD *)this;
PciRegWrite(*(_DWORD *)this, 510525440, -60816631);
PciRegWrite(v3, 510525540, 0);
PciRegWrite(v4, 510525492, 0);
PciRegWrite(v5, 510525464, 256);
PciRegWrite(v6, 510525476, 0);
PciRegWrite(v7, 510525540, *(_DWORD *)(this + 40));
PciRegWrite(v8, 510525544, *(_DWORD *)(this + 44));
MicroSecondDelay(10);
PciRegWrite(v2, 510525540, *(_DWORD *)(this + 40) | 0xC0000);
MicroSecondDelay(10);
PciRegWrite(v2, 510525444, 272);
PciRegWrite(v9, 510525448, 9438223);
PciRegWrite(v10, 510525444, 1296);
PciRegWrite(v11, 510525456, *(_DWORD *)(this + 56));
PciRegWrite(v12, 510525460, *(_DWORD *)(this + 60));
PciRegWrite(v13, 510525472, *(_DWORD *)(this + 68));
PciRegWrite(v14, 510525568, 0);
PciRegWrite(v15, 510525572, 0xFFFFFF);
PciRegWrite(v16, 510525576, *(_DWORD *)(this + 80));
PciRegWrite(v17, 510525464, 1073783088);
PciRegWrite(v18, 510525464, 304);
PciRegWrite(v19, 510525496, 0);
PciRegWrite(v20, 510525504, -8355840);
PciRegWrite(v21, 510525508, -2004581274);
PciRegWrite(v22, 510525512, 1145307144);
PciRegWrite(v23, 510525516, 0);
PciRegWrite(v24, 510525520, 0x80000000);
PciRegWrite(v25, 510525520, 0);
PciRegWrite(v26, 510525524, 0);
PciRegWrite(v27, 510525536, *(_DWORD *)(this + 72));
v29 = PciRegRead(v28, 510525444);
PciRegWrite(v31, v30, v29 | 0x400);
v34 = (unsigned int)PciRegRead(v32, 510525444) >> 10;
if ( v34 )
PciRegWrite(v2, 510525548, (*(_DWORD *)(this + 76) << 8) | (*(_DWORD *)(this + 76) - 17));
else
PciRegWrite(v33, 510525548, *(_DWORD *)(this + 76));
PciRegWrite(v2, 510525552, 0);
PciRegWrite(v35, 510525556, 0);
PciRegWrite(v36, 510525560, 0);
PciRegWrite(v37, 510525564, 0);
if ( v34 )
VgaModeSetSync((int *)this);
else
VgaModeConfigPll((int *)this, 0);
v38 = PciRegRead(v2, 510525544);
PciRegWrite(v39, 510525728, v38);
PciRegWrite(v40, 510525492, 1);
PciRegWrite(v41, 510525452, 0);
MicroSecondDelay(50);
PciRegWrite(v2, 510525484, *(_DWORD *)(this + 48) | 0x100);
PciRegWrite(v42, 510525488, *(_DWORD *)(this + 52));
PciRegWrite(v43, 510525480, 5);
PciRegWrite(v44, 510525480, 7);
PciRegWrite(v45, 510525480, 3);
PciRegWrite(v46, 510525480, 1);
PciRegWrite(v47, 510525452, 23560);
PciRegWrite(v48, 510525484, *(_DWORD *)(this + 48));
PciRegWrite(v49, 510525480, 1);
PciRegWrite(v50, 510525488, *(_DWORD *)(this + 52) | 0x380);
PciRegWrite(v51, 510525480, 3);
PciRegWrite(v52, 510525488, *(_DWORD *)(this + 52));
PciRegWrite(v53, 510525480, 3);
PciRegWrite(v54, 510525452, 8193);
v55 = *(_DWORD *)(this + 24) != 0 ? 0x500 : 0;
if ( *(_DWORD *)(this + 28) )
v55 |= (*(_DWORD *)(this + 60) >> 3) & 0xC000;
PciRegWrite(v2, 510525492, v55 | 3);
VgaModeInit((int *)this);
v56 = PciRegRead(v2, 510525444) & 0xFFFFFFDC;
PciRegWrite(v2, v57, v56 | 0x23);
PciRegWrite(v58, 0x40000000, 404166938);
PciRegWrite(v59, 1073750016, 1935762738);
if ( PciRegRead(v60, 0x40000000) == 404166938 )
{
v66 = v56 | 0x20;
PciRegWrite(v61, 1343225856, 1094861636);
PciRegWrite(v67, 1209008128, 623257384);
PciRegWrite(v68, 1074790400, 421141276);
if ( PciRegRead(v69, 1343225856) == 1094861636 )
{
PciRegWrite(v70, 510525444, v66 | 3);
v63 = PciRegRead(v71, 510525460);
v65 = *(unsigned __int8 *)(this + 67);
}
else
{
if ( PciRegRead(v70, 1209008128) != 623257384 )
{
PciRegWrite(v72, 510525444, v66 | 1);
v78 = PciRegRead(v74, 510525460) & 0xFFFFFF00 | *(unsigned __int8 *)(this + 65);
PciRegWrite(v76, v75, v78);
return PciRegWrite(v2, 510525728, *(_DWORD *)(this + 84));
}
PciRegWrite(v72, 510525444, v66 | 2);
v63 = PciRegRead(v73, 510525460);
v65 = *(unsigned __int8 *)(this + 66);
}
}
else
{
PciRegWrite(v61, 510525444, v56);
v63 = PciRegRead(v62, 510525460);
v65 = *(unsigned __int8 *)(this + 64);
}
PciRegWrite(v2, v64, v63 & 0xFFFFFF00 | v65);
return PciRegWrite(v2, 510525728, *(_DWORD *)(this + 84));
}