+ assert(declaration->type->type == TYPE_FUNCTION);
+ const function_type_t* const func_type = (const function_type_t*)declaration->type;
+ ir_node *ret;
+ if (func_type->result_type == type_void) {
+ ret = new_Return(get_store(), 0, NULL);
+ } else {
+ ir_mode *const mode = get_ir_mode(func_type->result_type);
+ ir_node * in[1];
+ // ยง5.1.2.2.3 main implicitly returns 0
+ if (strcmp(declaration->symbol->string, "main") == 0) {
+ in[0] = new_Const(mode, get_mode_null(mode));
+ } else {
+ in[0] = new_Unknown(mode);
+ }
+ ret = new_Return(get_store(), 1, in);
+ }