int_proxy currently uses floating-point operations, which cause MSVC to pull in _ftol3.obj and other CRT dependencies when building with /NODEFAULTLIB.
We should replace the floating-point math with integer-based logic to remove the CRT requirement while keeping the same control-flow macros and structure intact.
volatile static INLINE int int_proxy(long long val) {
INDIRECT_BRANCH;
volatile long long a = val * (_7 - (_3 * 2));
BLOCK_TRUE(
BLOCK_FALSE(
return _RND;
)
)
BLOCK_TRUE(
loc_end:
if (_RND)
return (int)((a ^ _TRUE) & 0x7FFFFFFF);
loc_fake:
return _RND;
)
}
int_proxy currently uses floating-point operations, which cause MSVC to pull in _ftol3.obj and other CRT dependencies when building with /NODEFAULTLIB.
We should replace the floating-point math with integer-based logic to remove the CRT requirement while keeping the same control-flow macros and structure intact.