1. Branchless counter
    Trade off between branch-compare and logical AND instruction, commonly used in embedded systems for accessing arrays by index.
    Downfall is, that array size must be power of 2, so bit mask is valid and counter/index roll back correctly.

    const unsigned int COUNTER_MAX = 0x100;
    unsigned int counter = 0;
    
    void func(void)
    {
    	counter++;
    	
    	if (counter >= COUNTER_MAX) // count from 0 to 0xFF
    	{
    		counter = 0;
    	}
    }
    const unsigned int COUNTER_MAX = 0x100;
    unsigned int counter = 0;
    
    void func(void)
    {
    	counter++;
    	counter &= (COUNTER_MAX - 1); // set to 0 if > 0xFF, ie. 0x100
    }
    #define ARRAY_SIZE = 0x100;
    int array[ARRAY_SIZE];
     
    void func(void)
    {
    	static int index = 0;
    	
    	printf("%d\n", array[index])
    	index ++;
    	index &= (ARRAY_SIZE - 1);
    }

    If used in synchronously executed code (loop, state machine) branch miss-prediction delay can be reduced.