Legal cannabis to generate $40bn, 400,000 jobs: study