There is no single easy answer. The best way is to let us help you with the details by showing us the actual code in need of porting.
If you look over the many threads on this forum, you'll see lots of examples where this worked out pretty well. But the details matter. Sometimes the changes are simple, like minor differences with I/O ports. Sometimes it's more complex stuff like the hardware timers, but often people in the Arduino world just use the timers for periodic interrupt which is easy to port using IntervalTimer. Sometimes the "porting" is stuff like needing to add delays for multiplexed signals, where AVR is so slow that the ~500 ns time for a pullup resistor doesn't matter, but a fast 32 bit chip running the same code reads the signal too early while the voltage is still changing. Details matter, and the best way to talk about details is with the actual code and any necessary info like the hardware it uses.