shader a_vconditional_b_vconditional (output vector cout = 0, output vector mcout = 0) {
    int a = (P[0] < 0.5);
    int b = (P[1] > 0.75);
    
    int c = a|b;
    
    cout = vector(tan(u), tan(P[0]/c), v*u);
    vector mcout_ = cout;
    
    if(int(P[0]*32)%2)
    {
        a = (u > 0.25);
        b = (v < 0.5);
        c = a|b;
        cout = vector(tan(u/c), tan(v/c), P[2]);
    }
    
    mcout = mcout_;
}
