Heat some of the olive oil and a knob of butter, add 3 of the cloves of garlic (chopped) and some of the thyme, add the leeks and coat in the oil, add the white wine and cook out the alcohol. Add salt and pepper to taste. Cover the leeks with the ham and cook for 30 minutes.
Blitz the mushrooms and the bread to form breadcrumbs.
In a frying pan heat some olive oil, the last of the garlic (unpeeled and crushed) and the rosemary, add the breadcrumbs and cook until golden and crisp.
Cook the pasta in salted water for about 2 minutes.
When the leeks are done remove the ham and slice thinly and add back to the leeks, add the butter and the pasta with a bit of the pasta water, mix and serve immediately. Top with the pan rattata.