気が狂う (ki ga kuruu: to go crazy) spirit + to go crazy
気が狂いそうだ。
Ki ga kuruisō da.
I’m about to lose my mind.あの犯罪を犯した男は、気が狂っている。
Ano hanzai o okashita otoko wa, ki ga kurutte iru.
That man who committed that crime is crazy.犯罪 (hanzai: crime) crime + crime
犯す (okasu: to commit (e.g., crime))
男 (otoko: man)彼は妻を失って気が狂った。
Kare wa tsuma o ushinatte ki ga kurutta.
Losing his wife drove him crazy.彼 (kare: he)
妻 (tsuma: one’s own wife)
失 (ushina(u): to lose)トムは気が狂ったように働いた。
Tomu wa ki ga kurutta yō ni hataraita.
Tom worked like a madman.働 (hatara(ku): to work)
ハムレットはまるで気が狂ったかのように振る舞う。
Hamuretto wa maru de ki ga kurutta ka no yō ni furumau.
Hamlet acts as if he were insane.まるで (maru de: entirely)
か (ka: indicates uncertainty)振る舞う (furumau: to conduct oneself) to shake + to dance
My first assumption about the odd breakdown was that this must be ateji, but that doesn’t seem to be the case. Perhaps shaking and dancing have come to be seen as a way of conducting oneself.