function genIfConditions (
  conditions,
  state,
  altGen,
  altEmpty