Assuming the Phils win over the Braves today, I think this is how it works.
If Giants and Braves win tomorrow, Reds play Philly. Braves would be wild card.
If Giants win tomorrow and Braves lose, then the Giants win the West. The wildcard then would be the winner of a playoff between the Padres and Braves in Atl. If Braves win that game, Reds play Philly. If Pads win that game, Reds play Giants.
If Pads win tomorrow and Braves lose, then the Giants and Pads make the playoffs and the Braves are out. The Pads would win the NL West due to tiebraker with Giants. Reds would then play the Padres in the playoffs. Phils would play the wildcard Giants.
If Pads and Braves both win tomorrow, then it is a three-way tie. The Pads and Giants would playoff Monday for the NL West title. The loser would play in Atlanta Tuesday for the wildcard. If the Braves win the wildcard, Reds play Philly. If the Pads win the wildcard Reds play Giants. If the Giants win the wildcard, Reds play Padres.