[ar] Create doit() function
[ar] Create doit() function

Main() began to have too much code, and moving all the actions to a doit()
function makes easier to read the code.

k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/scc