se casser la tête

Verb

 * 1)  to cudgel one's brain, to puzzle over something; to go to a lot of trouble over something