It looks something like a bubble sort perhaps a custom one. Fairly horrible code that is seriously lacking comments and may well have been written by someone trying to be clever. That happens enough.
Two things to note:
fu2
is recursive, i.e. it's a function that calls itself.
The tertiary operator ? works like this.
x ? y : z;
means
if( x )
{
y;
}
else
{
z;
}
so fu2 can be rewritten as
int fu2(int *a, int b)
{
int c=*a;
if( b > 1 )
{
c = fu2( a + 1, b - 1 );
}
if( *a < 0 )
{
if( *a > c )
{
return *a;
}
else
{
if( c < 0 )
{
return c;
}
else
{
return a;
}
}
}
else
{
if( c < 0 ? )
{
return c;
}
else
{
return 0;
}
}
}
Now you can follow what it's doing, plug in the numbers and step through it in the dugger to see what happens. Keep a watch on the contents of the array but having done the expansion it doesn't look like it gets alterred so this is some sort of search possibly for the smallest negative number.
Let us know when you've cracked it.