Two black wires into same terminal on light switch
A and B are already connected.  The switch in the photo provides both backstab and screw connections which are internally connected within the switch. The builder prefers backstab connections (because they're faster; their poor reliability isn't his problem), and when he needed a second connection he used the screw also.  

It looks like A is a pigtail from the wirenut to the switch.  I imagine that before, it was a jumper to the other switch, but then, you added that smart switch, which necessitated a pigtail.  Given the presence of the pigtail, sending B to the switch is stupid.  B should immediately be pried out of the switch and added to wirenut C. 

From there, if you are replacing that switch with another smart switch, I imagine A will be replaced by the smart switch's pigtail.  

To help you lose your mind less in that box, look at the wire that attaches to the left smart switch's red wire; I would tag that with red tape.  The right wire on the right switch, I would tag that with blue tape. They are both switched-hots going to a light or fan.  

Remember you must never, ever put a dimmer on a fan or receptacle! Check all your receptacles and make sure they are not switched by any of these switches (this is a common "feature" in newer homes). If you really, really want to do that, there are a couple of technical solutions.