Answer:
Simile
Explanation:
The speaker thoughts, (inanimate) is floating up like moths (animate) among branches of perfect trees all night long.
The speaker is deep in thoughts so much they suddenly developed wings and started floating as a kite would or in this case a moth among branches. These branches are also hindrances because it could get stuck in them, and because it got stuck, he had to do the thinking all night.
So far, there was no breakthrough in his thoughts.
Envision someone lying awake in bed all night and staring at the ceiling in the dark, left alone with troubled or pleasant thoughts.