def right_rotate<N>(u32 x) -> u32 {
    return (x >> N) | (x << (32 - N));
}

// input constraining costs 6 * 33 = 198 constraints, the rest 200
def main(u32 e, u32 f, u32 g, u32 h, u32 k, u32 w) -> u32 {
    // ch := (e and f) xor ((not e) and g)
    u32 ch = (e & f) ^ ((!e) & g); // should be 100 constraints

    // S1 := (e rightrotate 6) xor (e rightrotate 11) xor (e rightrotate 25)
    u32 S1 = right_rotate::<6>(e) ^ right_rotate::<11>(e) ^ right_rotate::<25>(e); // should be 66 constraints
    
    // temp1 := h + S1 + ch + k + w
    return h + S1 + ch + k + w; // should be 35 constraints
}