How to understand initialization and stack checking of ARM assembly language
The custom on this website is to ask one question per eh, question, but I'll try to asnwer them all.


  
  why do we call the first six instructions the initialisation and stack checking?
  


Because that is what they do. These instructions are insterted by the compiler, they are not caused by the C-level statement(s) in the main() that the user wrote.


  
  what does ip rfp fp sl mean?
  


Looks look aliases (alternate names) for registers that have a specific purpose.


  
  why does it sub 4? 
  


To make room on the stack for something that it is not using. Looks like a missed opportunity for the optimizer :(


  
  what is bllt? I just find bl in reference manual
  


lt is a condition: on these ARM chips ANY instruction can be conditional. In this case it is branch-and-link-iff-less-than.


  
  where does 'x$stack_overflow' come from?
  


It is supplied by the runtime library, and called when the stack is (about to be) exceeded.


  
  why does it use ldmdb?
  


that is the load-multiple-registers-from-a-full-descending-stack instruction. in other words: pop.

PS: for the bare-metal microcontroller softeware I mostly write the requirement that main() must return an int is a royal PITA. There is no OS or script or whatever to return to, so who cares what main() returns? main() should be an infinite loop, but the compiler insists on a return 0; after it. And then it complains about an unreachable statement :(