abc/src/bool/lucky/luckyFast16.c
// It considers all swap and flip possibilities of iVar and iVar+1 and switches InOut to a minimal of them 
It considers all swap and flip possibilities of iVar and iVar+1 and switches InOut to a minimal of them
It considers all swap and flip possibilities of iVar and iVar + 1 and switches InOut to a minimal of them
void minimalSwapAndFlipIVar_superFast_iVar5(unsigned* pInOut, int nWords, char * pCanonPerm, unsigned* pCanonPhase)
{
    int min1, min2, DifStart0, DifStart1, DifStartMin;
    int M[2];
    unsigned temp[2048];
    M[0] = minTemp0_fast_iVar5(pInOut, nWords, &DifStart0); 
    M[1] = minTemp1_fast_iVar5(pInOut, nWords, &DifStart1); 
    min1 = minTemp2_fast_iVar5(pInOut, M[0], M[1], nWords, &DifStartMin);
    if(DifStart0 != DifStart1)
    {   
        if( DifStartMin>=DifStart1 && DifStartMin>=DifStart0 )
            arrangeQuoters_superFast_iVar5(pInOut, temp, DifStartMin, M[min1], M[(min1+1)&1], 3 - M[(min1+1)&1], 3 - M[min1], pCanonPerm, pCanonPhase);
        else if( DifStart0 > DifStart1)
            arrangeQuoters_superFast_iVar5(pInOut, temp, luckyMax(DifStartMin,DifStart0), M[0], M[1], 3 - M[1], 3 - M[0], pCanonPerm, pCanonPhase);
        else
            arrangeQuoters_superFast_iVar5(pInOut, temp, luckyMax(DifStartMin,DifStart1), M[1], M[0], 3 - M[0], 3 - M[1], pCanonPerm, pCanonPhase);
    }
    else
    {
        if(DifStartMin>=DifStart0)
            arrangeQuoters_superFast_iVar5(pInOut, temp, DifStartMin, M[min1], M[(min1+1)&1], 3 - M[(min1+1)&1], 3 - M[min1], pCanonPerm, pCanonPhase);
        else
        {
            min2 = minTemp3_fast_iVar5(pInOut, DifStart0, DifStartMin, 3-M[0], 3-M[1], &DifStart1);  
            if(DifStart1>DifStartMin)
                arrangeQuoters_superFast_iVar5(pInOut, temp, DifStart0, M[(min2+1)&1], M[min2], 3 - M[min2], 3 - M[(min2+1)&1], pCanonPerm, pCanonPhase);
            else
                arrangeQuoters_superFast_iVar5(pInOut, temp, DifStart0, M[min1], M[(min1+1)&1], 3 - M[(min1+1)&1], 3 - M[min1], pCanonPerm, pCanonPhase);
        }
    }
}
void minimalSwapAndFlipIVar_superFast_iVar5 ( unsigned * pInOut , int nWords , char * pCanonPerm , unsigned * pCanonPhase ) { int min1 , min2 , DifStart0 , DifStart1 , DifStartMin ; int M [ 2 ] ; unsigned temp [ 2048 ] ; M [ 0 ] = minTemp0_fast_iVar5 ( pInOut , nWords , & DifStart0 ) ; M [ 1 ] = minTemp1_fast_iVar5 ( pInOut , nWords , & DifStart1 ) ; min1 = minTemp2_fast_iVar5 ( pInOut , M [ 0 ] , M [ 1 ] , nWords , & DifStartMin ) ; if ( DifStart0 != DifStart1 ) { if ( DifStartMin >= DifStart1 && DifStartMin >= DifStart0 ) arrangeQuoters_superFast_iVar5 ( pInOut , temp , DifStartMin , M [ min1 ] , M [ ( min1 + 1 ) & 1 ] , 3 - M [ ( min1 + 1 ) & 1 ] , 3 - M [ min1 ] , pCanonPerm , pCanonPhase ) ; else if ( DifStart0 > DifStart1 ) arrangeQuoters_superFast_iVar5 ( pInOut , temp , luckyMax ( DifStartMin , DifStart0 ) , M [ 0 ] , M [ 1 ] , 3 - M [ 1 ] , 3 - M [ 0 ] , pCanonPerm , pCanonPhase ) ; else arrangeQuoters_superFast_iVar5 ( pInOut , temp , luckyMax ( DifStartMin , DifStart1 ) , M [ 1 ] , M [ 0 ] , 3 - M [ 0 ] , 3 - M [ 1 ] , pCanonPerm , pCanonPhase ) ; } else { if ( DifStartMin >= DifStart0 ) arrangeQuoters_superFast_iVar5 ( pInOut , temp , DifStartMin , M [ min1 ] , M [ ( min1 + 1 ) & 1 ] , 3 - M [ ( min1 + 1 ) & 1 ] , 3 - M [ min1 ] , pCanonPerm , pCanonPhase ) ; else { min2 = minTemp3_fast_iVar5 ( pInOut , DifStart0 , DifStartMin , 3 - M [ 0 ] , 3 - M [ 1 ] , & DifStart1 ) ; if ( DifStart1 > DifStartMin ) arrangeQuoters_superFast_iVar5 ( pInOut , temp , DifStart0 , M [ ( min2 + 1 ) & 1 ] , M [ min2 ] , 3 - M [ min2 ] , 3 - M [ ( min2 + 1 ) & 1 ] , pCanonPerm , pCanonPhase ) ; else arrangeQuoters_superFast_iVar5 ( pInOut , temp , DifStart0 , M [ min1 ] , M [ ( min1 + 1 ) & 1 ] , 3 - M [ ( min1 + 1 ) & 1 ] , 3 - M [ min1 ] , pCanonPerm , pCanonPhase ) ; } } }
It considers all swap and flip possibilities of iVar and iVar+1 and switches InOut to a minimal of them
It considers all swap and flip possibilities of iVar and iVar + 1 and switches InOut to a minimal of them
//     printf("in minimalSwapAndFlipIVar_superFast_iVar5\n"); // 0, 3 // 1, 2 // reuse DifStart1 because DifStart1 = DifStart1=0