WS2812 LED bit code problem

I was doing it as a project to create a library but then I stumbled across this problem, maybe I should just use an existing library, but I wanted to see if anyone has suggestions.

I know my code may seem primitive compared to assembly code but I was just creating a starting point to base the idea on