Simplification steps: Scope/type/declaration related: * simplify_name_structunionenum: All structs/unions/enums get names. * simplify_split_structunion_decl: A declaration using type specifier defining a struct/union might be converted into one typedef declaration of the struct/union and a declaration using the newly defined struct/union. Works only if struct/union has a name. * simplify_split_vardecl_init: "auto" and "register" declarations using an initializer might be splitted into a declaration without an initializer and a new statement assigning the initial value to the variable. Works only in functions and blocks within functions and only if variable is not declared "const". * simplify_split_vardecl_list: Declarations containing two or more declarators might be splitted into separate declarations with only one declarator each. Works only if type specifier is simple type, user type or struct/union without declarations. * simplify_remove_empty_declarations: Declarations containing no declarators might be deleted. Works only if type specifier is simple type or user type. * simplify_enum_expr: Add initializers to all enumerators not having one. * Enum definitions might be converted into constant definitions and int variables. * simplify_merge_declarations_of_blocks: Register and auto variable definitions in sub-scopes of functions might be moved to function scope. Same with type definitions. Rename variable/type in old scope and its sub-scopes. Works only if variables has no initializers and type is visible in outer scope, too. * Static variables from functions and blocks within functions might be moved to top scope if initializer is known constant. Rename variables in old scope and its sub-scopes. * Type definitions from functions and blocks within functions might be moved to top scope. Rename type in old scope and its sub-scopes. * A declaration using a complex declarator might be changed into a typedef declaration defining the type and a variable declaration using the newly defined type. The type specifier must be a simple one. * Register and auto variable definitions with initializers in functions and its sub-scopes might be splitted into variable definitions without initializers and statements containing assignment of initializer to variable. * Type definitions using a simple type specifier and a simple declarator might be removed. Change places where the declared type is used to use the simple type specifier directly. Function related: * For loops might be translated into goto and if-goto statements. Change continue and break statements accordingly using goto statements. * While loops might be translated into goto and if-goto statements. Change continue and break statements accordingly using goto statements. * Do-while loops might be translated into goto and if-goto statements. Change continue and break statements accordingly using goto statements. * Switch statements might be translated into simple switch statements containing only a list of case-goto and default-goto statements. Change break statements accordingly using goto statements. * If-else statements might be translated into goto and if-goto statements. * simplify_rename_labels: Rename user-named labels by labels with unique name. * simplify_remove_labels: Remove labels with no corresponding goto. If consecutive labels exist redirect all gotos to first label to go to second label and remove first label. * simplify_goto: Goto statements with goto-statement as target might be replace by goto statement to second target. Goto or if-then-goto statements with the next statement as target might be removed or converted into null statements. (Keep epression of if-then-goto statements!) An if-goto statement jumping over a following goto statement might be replaced by a single if-goto statement with a negated condition. * simplify_remove_unreachable_stmts: Unreachable code might be removed. * simplify_returns: Return statements not at the end of a function might be replaced by variable assignment and a goto statement to end of function. * simplify_rename_labels: An user-defined label might be replaced by a temporary one to omit "redefined" errors. Change corresponding goto statements accordingly. * simplify_split_exprs: Expressions containing sub-expressions might be translated into several statements with expressions using temporary variables. Comma separated expressions might be translated into several statements containing one expression each. Expressions related: * simplify_constant_folding: sizeof expressions might be replaced by a constant. Operations only using constants as operands might be replaced by only one constant. * simplify_split_exprs: Replace complex expressions by expressions only using one operator. Use temporary variables. Replace pre-dec/inc operator expressions by first decrementing/incrementing the variable before using it in an expression. Replace post-dec/inc operator expressions by first assigning the current value to a temporary variable and then decrementing/incrementing the original variable. Use the temporary variable in the expression instead of the original one. Move up commas in expressions. * Expressions with implicit type conversion should be replaced by expressions using explicit type conversions.