rebase -i: rewrite init_basic_state() in C