/* DxeIplFvOpenDevice @ 0xffc163a4 size=0x9b */
int __thiscall DxeIplFvOpenDevice(_DWORD **p_this)
{
_WORD *i_1; // eax
_WORD *i; // eax
_DWORD *v4; // ecx
_WORD *i_2; // esi
int v6; // eax
int v8; // eax
int v9; // eax
i_1 = (_WORD *)DxeIplGetPeiServices(); /*0xffc163b0*/
for ( i = DxeIplLocatePpi(4, i_1); ; i = DxeIplLocatePpi(4, (_WORD *)((char *)i_2 + (unsigned __int16)i_2[1])) ) /*0xffc163ba*/
{
i_2 = i; /*0xffc163ee*/
if ( !i ) /*0xffc163f2*/
{
v6 = DxeIplAllocPages((int)dword_FFC18DB8, 404); /*0xffc163fb*/
v4 = (_DWORD *)v6; /*0xffc16400*/
if ( !v6 ) /*0xffc16404*/
{
*p_this = 0; /*0xffc16406*/
return -2147483639; /*0xffc1640d*/
}
*(_DWORD *)(v6 + 4) = 0; /*0xffc16419*/
v8 = v6 + 20; /*0xffc1641d*/
*v4 = 1229473104; /*0xffc16420*/
goto LABEL_11; /*0xffc16420*/
}
if ( DxeIplFvIsAddrValid((_DWORD *)i + 2, dword_FFC18DB8) ) /*0xffc163d0*/
{
v4 = i_2 + 12; /*0xffc163d9*/
if ( *((_DWORD *)i_2 + 6) == 1229473104 ) /*0xffc163de*/
break; /*0xffc163de*/
}
}
v8 = (int)(i_2 + 22); /*0xffc1640f*/
if ( *((_WORD **)i_2 + 8) == i_2 + 22 ) /*0xffc16415*/
goto LABEL_12; /*0xffc16415*/
LABEL_11:
v4[2] = v8; /*0xffc16422*/
v9 = v8 + 256; /*0xffc16425*/
v4[3] = v9; /*0xffc1642a*/
v4[4] = v9 + 64; /*0xffc16430*/
LABEL_12:
*p_this = v4; /*0xffc16433*/
return 0; /*0xffc16437*/
}