/* DxeIplInstallPpi @ 0xffc1643f size=0xaf */
int __fastcall DxeIplInstallPpi(_DWORD *a1, int (*sub_FFC16E63)(), int (*sub_FFC16EE0)())
{
int result; // eax
_DWORD *this_1; // esi
unsigned int n0x10_1; // edi
unsigned int n0x10; // ebx
_DWORD *v7; // ecx
_DWORD *v8; // edx
int v9; // ecx
_DWORD *this; // [esp+14h] [ebp-4h] BYREF
result = DxeIplFvOpenDevice(&this); /*0xffc16457*/
if ( result >= 0 ) /*0xffc1645e*/
{
this_1 = this; /*0xffc16464*/
n0x10_1 = 0; /*0xffc16468*/
n0x10 = this[1]; /*0xffc1646a*/
if ( n0x10 ) /*0xffc1646f*/
{
v7 = (_DWORD *)this[2]; /*0xffc16471*/
v8 = a1; /*0xffc16474*/
while ( !DxeIplFvIsAddrValid(v7, v8) ) /*0xffc1647f*/
{
++n0x10_1; /*0xffc16481*/
v7 = (_DWORD *)(v9 + 16); /*0xffc16482*/
if ( n0x10_1 >= n0x10 ) /*0xffc16487*/
goto LABEL_6; /*0xffc16487*/
}
*(_DWORD *)(this_1[3] + 4 * n0x10_1) = sub_FFC16EE0; /*0xffc1649f*/
*(_DWORD *)(this_1[4] + 4 * n0x10_1) = sub_FFC16E63; /*0xffc164a5*/
}
else
{
LABEL_6:
if ( n0x10 >= 0x10 ) /*0xffc1648c*/
return -2147483639; /*0xffc16493*/
DxeIplFvSetError((_DWORD *)(this_1[2] + 16 * n0x10), a1); /*0xffc164b8*/
*(_DWORD *)(this_1[3] + 4 * this_1[1]) = sub_FFC16EE0; /*0xffc164c8*/
*(_DWORD *)(this_1[4] + 4 * this_1[1]++) = sub_FFC16E63; /*0xffc164d5*/
DxeIplAllocPagesBelow4G(16); /*0xffc164df*/
}
return 0; /*0xffc164e5*/
}
return result; /*0xffc164e7*/
}