Psychosocial functioning in the balance between autism and psychosis: evidence from three populations