I have this small subroutine (from Hopper, but IDA is similar):             sub_stringbegin:000127b8         push       {r11, lr}                                          000127bc         add        r11, sp, #0x4000127c0         sub        sp, sp, #0x8000127c4         str        r0, [r11, #-0x8]000127c8         ldr        r0, [r11, #-0x8]000127cc         bl         _ZNSs5beginEv@PLT                                   000127d0         mov        r3, r0000127d4         mov        r0, r3000127d8         sub        sp, r11, #0x4000127dc         pop        {r11, pc}                        ; endpThe parameter is passed to this in r0.Why is this stored into the stack frame then immediately read out? It seems wasteful.I understand that r0-r3 aren't preserved in the ARM calling convention, but in that instance it would be sufficient to either just store it in the stack frame or pop it onto the stack.Similarly, moving r0 into r3 and back again seems wasteful after the branch.This is a ELF executable from a Busybox system. 
Why does this ARM subroutine put a parameter into the stack frame and take it straight back out?
disassembly;arm
This is most likely just non-optimized code. When optimization is disabled, the compiler may do the silliest things.I hear that many old-time embedded engineers do not enable optimizations in principle because they got burned by optimization bugs in old compilers.