Preheat the oven to 180 degrees. Wash the pumpkin and cut in half. Scrape out the core with a spoon. Peel and slice the garlic, strip the rosemary needles from the branches. Mix both with the olive oil and brush the pumpkin halves with it. Salt and pepper. Place in the oven with the cut surfaces facing up and cook for approx. 45 minutes. The cooking time depends on the size of the pumpkin. When the pulp is soft, remove the garlic and rosemary with a spoon. Scrape out the pulp, it will crumble into spaghetti. Serve with the garlic and rosemary as a topping.