Skip to content

Instantly share code, notes, and snippets.

@profi200
Created November 7, 2019 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save profi200/a0a0ad997df26351865a33090b8dbeea to your computer and use it in GitHub Desktop.
Save profi200/a0a0ad997df26351865a33090b8dbeea to your computer and use it in GitHub Desktop.
unsigned int __fastcall gpioMaskToIrqId(char *irqId, signed int gpioMask)
{
int v2; // r3
int v3; // r1
int v4; // r4
char v6; // r1
v2 = gpioMask - 0x400;
if ( gpioMask == 0x400 )
{
v6 = 0x6C;
goto LABEL_26;
}
if ( gpioMask > 0x400 )
{
v4 = gpioMask - 0x4000;
if ( v2 == 0x3C00 )
{
v6 = 0x70;
goto LABEL_26;
}
if ( v2 > 0x3C00 )
{
if ( v4 == 0x4000 )
{
v6 = 0x71;
goto LABEL_26;
}
if ( v4 == 0xC000 )
{
v6 = 0x72;
goto LABEL_26;
}
if ( gpioMask == 0x20000 )
{
v6 = 0x73;
goto LABEL_26;
}
}
else
{
if ( v2 == 0x400 )
{
v6 = 0x6D;
goto LABEL_26;
}
if ( v2 == 0xC00 )
{
v6 = 0x6E;
goto LABEL_26;
}
if ( gpioMask == 0x2000 )
{
v6 = 0x6F;
goto LABEL_26;
}
}
return makeResult(7, 12, 1018);
}
if ( gpioMask == 0x40 )
{
v6 = 0x68;
goto LABEL_26;
}
if ( gpioMask > 0x40 )
{
if ( gpioMask == 0x80 )
{
v6 = 0x69;
goto LABEL_26;
}
v3 = gpioMask - 0x100;
if ( !v3 )
{
v6 = 0x6A;
goto LABEL_26;
}
if ( v3 == 0x100 )
{
v6 = 0x6B;
goto LABEL_26;
}
return makeResult(7, 12, 1018);
}
switch ( gpioMask )
{
case 2:
v6 = 0x63;
goto LABEL_26;
case 4:
v6 = 0x60;
goto LABEL_26;
case 8:
v6 = 0x64;
goto LABEL_26;
}
if ( gpioMask != 0x10 )
return makeResult(7, 12, 1018);
v6 = 0x66;
LABEL_26:
*irqId = v6;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment