brains out, bang (one's)

try very hard to understand or think out something difficult; tire (oneself) out by thinking.