INT64 __stdcall HalpInterruptInitializeController(PVOID BugCheckParameter3, DOUBLE a2){
int v3;
NTSTATUS v4;
int v5;
unsigned int v6;
int v8;
int v9;
if( (*((_DWORD *)BugCheckParameter3 + 56) & 1) != 0 )
return 0i64;
v3 = *((_DWORD *)BugCheckParameter3 + 55);
if( (v3 & 1) == 0 )
goto LABEL_3;
if( !HalpInterruptMaxClusterSize || (unsigned int)HalpInterruptMaxClusterSize > *((_DWORD *)BugCheckParameter3 + 70) )
HalpInterruptMaxClusterSize = *((_DWORD *)BugCheckParameter3 + 70);
if( !(_DWORD)HalpInterruptMaxCluster || (unsigned int)HalpInterruptMaxCluster > *((_DWORD *)BugCheckParameter3 + 71) )
LODWORD(HalpInterruptMaxCluster) = *((_DWORD *)BugCheckParameter3 + 71);
v8 = v3 & 0x400;
if( HalpInterruptDirectedEoiModeDetermined )
{
if( !v8 )
{
if( !HalpInterruptDirectedEoiModeEnabled )
goto LABEL_14;
LABEL_20:
v4 = -1073741811;
*((_DWORD *)BugCheckParameter3 + 78) = 472;
v9 = 25;
LABEL_22:
HalpInterruptLastProblem = v9;
*((_DWORD *)BugCheckParameter3 + 73) = v9;
*((_QWORD *)BugCheckParameter3 + 38) = "minkernel\\hals\\lib\\interrupts\\common\\intsup.c";
*((_DWORD *)BugCheckParameter3 + 74) = v4;
goto LABEL_4;
}
if( !HalpInterruptDirectedEoiModeEnabled )
goto LABEL_20;
}
LABEL_14:
v4 = HalpInterruptInitializeLocalUnit(BugCheckParameter3, a2);
if( v4 < 0 )
goto LABEL_4;
LABEL_3:
v4 = (*((__int64(__fastcall **)(_QWORD))BugCheckParameter3 + 5))(*((_QWORD *)BugCheckParameter3 + 2));
if( v4 < 0 )
{
v9 = 5;
*((_DWORD *)BugCheckParameter3 + 78) = 497;
goto LABEL_22;
}
LABEL_4:
v5 = *((_DWORD *)BugCheckParameter3 + 56);
if( v4 < 0 )
v6 = v5 & 0xFFFFFFFC | 2;
else
v6 = v5 & 0xFFFFFFFC | 1;
*((_DWORD *)BugCheckParameter3 + 56) = v6;
return(unsigned int)v4;
}