The atomic bombings of Hiroshima and Nagasaki were likely done more out of desire to influence the Soviets than the Japanese. Japan was already preparing to surrender to the USSR and this was known to many in the US intelligence community and the Truman Administration. It was obvious to all involved that the USA and UK would not remain allied with the USSR long after the defeat of the Axis Powers and much like the creation of NATO and the UN, the use of the atomic bomb may have been an action chosen out of a strategy to avoid a “Third World War” between the USA and USSR. Secretary of Defense Henry Stimson was the one who convinced Truman to use the atomic bomb on Japan so the strategy behind it would have likely been his. Stimson was later vocal in promoting the idea that would later be called “Mutually Assured Destruction”.
In the end we can look back and see that regardless of why the A-bombs were used, the results were that Japan surrendered to the USA not the USSR and thus became a capitalist democracy allied with “The West” and the Soviets obtained the necessary scientific knowledge to build their own nuclear arsenal which led to nearly 4 1/2 decades of the USA and USSR fighting each other indirectly through Third World proxies that in many cases originally had nothing to do with the Cold War. The Atomic bomb prevented the USA and USSR from fighting each other directly but led both sides to fund dictators, terrorists, revolutionaries, counter-revolutionaries and such all around the world from China to Korea to Vietnam to The Congo to Chile to Nicaragua to El Salvador, et cetera.