No photo attached. If the chain slipped and didn't chain-saw your foot off, you're ahead of the game. Almost every other part is easily replaceable (the center case halves are not easily replaceable). Did the chain "slip" off the sprockets, or did it snap...or did the counter-shaft sprocket back-off from the main shaft?
I have better pictures, site just says it's too bigOK, a few things here.
The item circled and labeled as "1" is a problem. It appears to be a hole in the main case. As Ohendo points out, it's the chain guard....but the guard is part of the case. You "may" be able to fill this with epoxy putty, but that depends on what the item under that cover is...I would need better photos. It's not looking good.
Item #2 is the route cause of the problem; your counter-shaft sprocket looks like a big washer. It is well beyond its service life and it should have been replaced thousands of miles ago.
Item #3 is the easy fix - it's the shift linkage. I say easy, but there is a strong possibility that the shaft is now bent and wont engage the properly.
View attachment 73908