When your rotate your camera up on end into portrait orientation (vertical), the pop up flash makes the shadow on the side of your subject (like your #2 and #3). Your D7100 has 24 megapixels, which is more than plenty of pixels to waste. So, by keeping the camera horizontal, and then cropping it vertically later, the flash is directly over the lens, which it will generally hide the shadow directly behind the subject, instead of being so prominent at the side of the subject (but you do have to do the cropping step then). Most pictures are helped by cropping anyway.
Or, if using an external hot shot flash, you can simply use bounce flash, and achieve much better lighting, less direct glare, and any shadow is diffused and below the subject. Much more pleasing, extremely worthwhile to learn.
As to manual settings, you set some aperture, and the automatic TTL flash reacts to that aperture (and ISO) by automatically setting flash power level to whatever it needs to be (if it has enough power to do it). TTL is automatic flash, even in camera Manual mode. Normally we give consideration to select the aperture to be appropriate for the available flash power. Maybe f/8 for direct flash, maybe f/4 for bounce (but it depends on the distance). The little popup flash is low powered, not always a lot of choice.
The flash could not care less about the shutter speed. Any shutter speed is the same to the flash. Because, the flash is faster than than the shutter speed. The shutter simply has to be open when the flash fires. The room ambient is continuous light however (slower than slow, no motion stopping ability at all), so the background ambient is affected by shutter speed, in the normal way. Indoors, we can often just ignore the weak ambient, because we are using flash.
You would normally use low ISO however. Auto ISO with flash in dim ambient will always use very high ISO (with most current camera models). High ISO helps the little flash, but it is high ISO. You can just turn Auto ISO off with flash, and set ISO to some reasonable low value you desire to use. With high ISO, the ambient is the main light and the flash is weak fill (and ISO is about maximum, as evidenced by the weak side shadows in #2 and #3). With low ISO, the ambient is ignored and the flash is the main light (and the side shadow will be much darker, needing attention). This is speaking of flash indoors. Outside, the sun will determine ISO.
If we use camera A mode, we set the aperture manually (as above, for flash power) and indoors in A mode, the camera normally will set 1/60 second shutter (which the default Minimum Shutter Speed With Flash). Not because 1/60 has any special meaning, but just because we are using flash, and do not need it to be slower. Indoors in auto modes, it likely always is 1/60 second. Outdoors, the sun and ISO will set shutter speed.
If we use camera M mode, we still set the Same aperture whatever we want to use), and so as far as the flash is concerned, there is zero difference in A and M mode. We set the same aperture either way. But in camera M mode, we can also set the shutter speed. The flash does not care at all about shutter speed, but we can set a speed for the ambient.... either fairly fast to keep out the ambient (is often orange under incandescent lights), or slower to allow some of the ambient into the picture. It is our choice in camera M mode.
I refer you my signature link for more, specifically Part 4 there "Flashes Are Double Exposures".