Six hours of solid and quality programming in a day is pretty decent. But if you're then producing sub-par work in the afternoon, some of your next day will be wasted fixing it.
Losing energy at 3 or 4 is also pretty common. One factor is lunch - try not to eat anything too big or heavy for lunch, as your body will divert energy into digestion. Also, try and get out in the fresh air for a bit in the middle of the day to recharge. A 15-20 minute break in the day is the bare minimum - you should try and get away from the computer for up to an hour (and try to avoid surfing or socialising on the phone, too - but it's okay to have a real conversation with someone).
If you still have trouble concentrating on coding, do other things:
- Documentation - I know you said there isn't much, but why not get started? Document what you just code in the day, or even document other parts of the codebase (great way to learn how others are doing things);
- Planning - think about what you need to do next, without actually writing code. Or scaffold out some tests ready for tomorrow;
- Learning - spend some time reading articles and tutorials adjacent to your current and future work. Experiment in a fresh project separate from the one you're working on.
Burnout and management expectations
I just read your new comment:
I've been praised for being a high performer and received nothing but excellent reviews but my manager has noticed I tend to not get much done around those hours and wants me to do more. I'm also burned out slightly lately because I was working almost 12-14 hour days + weekends for the past month to get a project done.
Yeah, as you're learning: working 12-14 hours a day for 6-7 days a week is simply unsustainable.
Really, even trying to push through your afternoon slump like your manager is trying is a recipe for burnout in the long run.
Coupled with the lack of current documentation, these are a handful of red flags to me.
One thing to say about that: not everywhere is like this.