RZ_API RzList *rz_analysis_function_get_var_fields(RzAnalysisFunction *fcn, int kind) {
	if (!fcn) {
		return NULL;
	}
	RzList *list = rz_list_newf((RzListFree)var_field_free);
	if (kind < 1) {
		kind = RZ_ANALYSIS_VAR_KIND_BPV; // by default show vars
	}
	void **it;
	rz_pvector_foreach (&fcn->vars, it) {
		RzAnalysisVar *var = *it;
		if (var->kind != kind) {
			continue;
		}
		if (var_add_structure_fields_to_list(fcn->analysis, var, list)) {
			// this var is a struct and var_add_structure_fields_to_list added all the fields
			continue;
		}
		RzAnalysisVarField *field = RZ_NEW0(RzAnalysisVarField);
		if (!field) {
			break;
		}
		field->name = strdup(var->name);
		if (!field->name) {
			var_field_free(field);
			break;
		}
		field->delta = var->delta;
		rz_list_push(list, field);
	}
	return list;
}
RZ_API RzList *rz_analysis_function_get_var_fields(RzAnalysisFunction *fcn, int kind) {
	if (!fcn) {
		return NULL;
	}
	RzList *list = rz_list_newf((RzListFree)var_field_free);
	if (kind < 1) {
		kind = RZ_ANALYSIS_VAR_KIND_BPV;  
	}
	void **it;
	rz_pvector_foreach (&fcn->vars, it) {
		RzAnalysisVar *var = *it;
		if (var->kind != kind) {
			continue;
		}
		if (var_add_structure_fields_to_list(fcn->analysis, var, list)) {
			 
			continue;
		}
		RzAnalysisVarField *field = RZ_NEW0(RzAnalysisVarField);
		if (!field) {
			break;
		}
		field->name = strdup(var->name);
		if (!field->name) {
			var_field_free(field);
			break;
		}
		field->delta = var->delta;
		rz_list_push(list, field);
	}
	return list;
}