int __thiscall PciRegClearBit(int this)
{
int v2; // ecx
_DWORD *v3; // edi
int n15; // ebx
int v5; // ecx
char n3; // al
int n3465; // ebx
char v8; // al
unsigned __int16 n4; // ax
int n510533696; // edx
int v11; // eax
int v12; // edx
int result; // eax
int v14; // [esp+4h] [ebp-4h] BYREF
if ( (VgaCrtcRegAnd(0xD0u, 0xFFu) & 0x80u) == 0 )
{
v2 = *(_DWORD *)(this + 60);
if ( *(_BYTE *)(this + 28) < 0x20u )
{
v3 = &unk_FFE7776C;
PciRegWrite(v2, 510525696, 168);
while ( PciRegRead(*(_DWORD *)(this + 60), 510525696) != 168 )
;
}
else
{
v3 = &unk_FFE7758C;
PciRegWrite(v2, 510533632, 378054824);
while ( PciRegRead(*(_DWORD *)(this + 60), 510533632) != 1 )
;
PciRegWrite(*(_DWORD *)(this + 60), 510525440, -60816631);
while ( PciRegRead(*(_DWORD *)(this + 60), 510525440) != 1 )
;
}
while ( 1 )
{
n4 = *(_WORD *)v3;
if ( *(_WORD *)v3 == 0xFFFF )
break;
if ( n4 == 0xFF00 )
{
n15 = 15;
do
{
v5 = v3[1];
if ( v5 )
MicroSecondDelay(v5);
--n15;
}
while ( n15 );
}
else if ( n4 == 4 && *(_BYTE *)(this + 28) >= 0x20u )
{
n3 = *(_BYTE *)(this + 29);
n3465 = v3[1];
if ( n3 == 1 )
{
n3465 = 3465;
}
else if ( n3 == 3 )
{
n3465 = 3213;
}
v8 = PciRegRead(*(_DWORD *)(this + 60), 510533744);
PciRegWrite(*(_DWORD *)(this + 60), 510525444, (4 * (v8 & 0xC)) | n3465);
}
else
{
PciRegWrite(*(_DWORD *)(this + 60), n4 + 510525440, v3[1]);
}
v3 += 2;
}
if ( PciRegRead(*(_DWORD *)(this + 60), 510525728) == 20577 )
{
v14 = *(_DWORD *)(this + 60);
PciRegRead(v14, 510525444);
PciRegSetBit(&v14);
}
n510533696 = 510533696;
if ( *(_BYTE *)(this + 28) < 0x10u )
n510533696 = 510525760;
v11 = PciRegRead(*(_DWORD *)(this + 60), n510533696);
PciRegWrite(*(_DWORD *)(this + 60), v12, v11 | 0xC0);
}
do
result = VgaCrtcRegAnd(0xD0u, 0xFFu);
while ( (result & 0x40) == 0 );
return result;
}