When I decompile using IDA PRO I get code which could look like both of these
Understanding the __PAIR__
macro.
Macro itself.
// The following definition is not quite correct because it always returns
// uint64. The above C++ functions are good, though.
#define __PAIR__(high, low) (((unsigned long)(high)<<sizeof(high)*8) | low)
if ( (__PAIR__(a4, a3) & 0x8000000000000000ui64) == 0i64 ) {
//condition code.
}
I also have code that looks like this
if ( (__PAIR__(v17, v12) & 0x8000000000000000ui64) != 0i64 ) {
//condition code.
}
I actually found some guy who helped me repair this bad looking code and as far I could tell by the pattern they could simply be replaced like so.
if( (__PAIR__(a4, a3) & 0x8000000000000000ui64) == 0i64 )
becomes
if(a4 >= 0 && a3 >= 0)
Now I found a very similar pattern that looks like above but instead of == 0i64
it has != 0i64
So I figured if my pattern is correct then the following code below
if ( (__PAIR__(v17, v12) & 0x8000000000000000ui64) != 0i64 ) {
should look like this
if( v17 < 0 || v12 < 0 ) {
Then again that's just a guess I wonder if that's correct.
I can't post the assembly for the != 0i64
example as I couldn't find it the assembly code is very big.. but the one with == 0i64
looks like this
.text:004049F0 mov edx, [esp+a3]
.text:004049F4 test edx, edx
.text:004049F6 jl short locret_404A3E
.text:004049F8 mov eax, [esp+a4]
.text:004049FC test eax, eax
.text:004049FE jl short locret_404A3E