int random01() {
return ({
int x;
asm volatile(
"1: call random;" // Call the `random` function
"cmp $5, %%eax;" // Compare the result with 5
"je 1b;" // If equal, jump back to label 1
"mov %%eax, %0;" // Store the result in x
: "=r"(x) // Output operand (x)
: // No input operands
: "eax" // Clobbered registers
);
(x % 2) << 1 >> 1; // Obfuscate with pointless shifts
});
}