factor out stack alignment into #with_aligned_stack