Consider a thin layer at a height h and thickness dh. Let p and dp+p be the pressure on the two sides of the layer. The mass of the layer is Sdhp. Equating vertical downward force to the force acting on the layer.
That means, temperature of air drops by 34°C at a height of 1 km above bottom.