/* search-provider.c generated by valac 0.34.4, the Vala compiler
 * generated from search-provider.vala, do not modify */

/* -*- Mode: vala; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * Copyright (C) 2014 Michael Catanzaro
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
 * license.
 */

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <langinfo.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <locale.h>


#define TYPE_SEARCH_PROVIDER (search_provider_get_type ())
#define SEARCH_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SEARCH_PROVIDER, SearchProvider))
#define SEARCH_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SEARCH_PROVIDER, SearchProviderClass))
#define IS_SEARCH_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SEARCH_PROVIDER))
#define IS_SEARCH_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SEARCH_PROVIDER))
#define SEARCH_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SEARCH_PROVIDER, SearchProviderClass))

typedef struct _SearchProvider SearchProvider;
typedef struct _SearchProviderClass SearchProviderClass;
typedef struct _SearchProviderPrivate SearchProviderPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

#define TYPE_SEARCH_PROVIDER_APP (search_provider_app_get_type ())
#define SEARCH_PROVIDER_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SEARCH_PROVIDER_APP, SearchProviderApp))
#define SEARCH_PROVIDER_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SEARCH_PROVIDER_APP, SearchProviderAppClass))
#define IS_SEARCH_PROVIDER_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SEARCH_PROVIDER_APP))
#define IS_SEARCH_PROVIDER_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SEARCH_PROVIDER_APP))
#define SEARCH_PROVIDER_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SEARCH_PROVIDER_APP, SearchProviderAppClass))

typedef struct _SearchProviderApp SearchProviderApp;
typedef struct _SearchProviderAppClass SearchProviderAppClass;
typedef struct _SearchProviderAppPrivate SearchProviderAppPrivate;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _SearchProvider {
	GObject parent_instance;
	SearchProviderPrivate * priv;
};

struct _SearchProviderClass {
	GObjectClass parent_class;
};

struct _SearchProviderApp {
	GApplication parent_instance;
	SearchProviderAppPrivate * priv;
};

struct _SearchProviderAppClass {
	GApplicationClass parent_class;
};


static gpointer search_provider_parent_class = NULL;
static gpointer search_provider_app_parent_class = NULL;

GType search_provider_get_type (void) G_GNUC_CONST;
guint search_provider_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
enum  {
	SEARCH_PROVIDER_DUMMY_PROPERTY
};
static gchar* search_provider_terms_to_equation (gchar** terms, int terms_length1);
static gboolean search_provider_can_parse (gchar** terms, int terms_length1);
static gchar** search_provider_get_result_identifier (gchar** terms, int terms_length1, int* result_length1);
gchar** search_provider_get_initial_result_set (SearchProvider* self, gchar** terms, int terms_length1, int* result_length1);
gchar** search_provider_get_subsearch_result_set (SearchProvider* self, gchar** previous_results, int previous_results_length1, gchar** terms, int terms_length1, int* result_length1);
GHashTable** search_provider_get_result_metas (SearchProvider* self, gchar** results, int results_length1, int* result_length1);
static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add2 (gchar*** array, int* length, int* size, gchar* value);
static void _g_free0_ (gpointer var);
static void _g_variant_unref0_ (gpointer var);
static GVariant* _variant_new1 (const gchar* value);
static GVariant* _variant_new2 (gchar* value);
static void search_provider_spawn_and_display_equation (gchar** terms, int terms_length1);
void search_provider_activate_result (SearchProvider* self, const gchar* _result_, gchar** terms, int terms_length1, guint32 timestamp);
void search_provider_launch_search (SearchProvider* self, gchar** terms, int terms_length1, guint32 timestamp);
SearchProvider* search_provider_new (void);
SearchProvider* search_provider_construct (GType object_type);
static void _dbus_search_provider_get_initial_result_set (SearchProvider* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_search_provider_get_subsearch_result_set (SearchProvider* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_search_provider_get_result_metas (SearchProvider* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_search_provider_activate_result (SearchProvider* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void _dbus_search_provider_launch_search (SearchProvider* self, GVariant* _parameters_, GDBusMethodInvocation* invocation);
static void search_provider_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data);
static GVariant* search_provider_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data);
static gboolean search_provider_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
static void _search_provider_unregister_object (gpointer user_data);
GType search_provider_app_get_type (void) G_GNUC_CONST;
enum  {
	SEARCH_PROVIDER_APP_DUMMY_PROPERTY
};
SearchProviderApp* search_provider_app_new (void);
SearchProviderApp* search_provider_app_construct (GType object_type);
static gboolean search_provider_app_real_dbus_register (GApplication* base, GDBusConnection* connection, const gchar* object_path, GError** error);
gint _vala_main (void);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);

static const GDBusArgInfo _search_provider_dbus_arg_info_get_initial_result_set_terms = {-1, "terms", "as"};
static const GDBusArgInfo _search_provider_dbus_arg_info_get_initial_result_set_result = {-1, "result", "as"};
static const GDBusArgInfo * const _search_provider_dbus_arg_info_get_initial_result_set_in[] = {&_search_provider_dbus_arg_info_get_initial_result_set_terms, NULL};
static const GDBusArgInfo * const _search_provider_dbus_arg_info_get_initial_result_set_out[] = {&_search_provider_dbus_arg_info_get_initial_result_set_result, NULL};
static const GDBusMethodInfo _search_provider_dbus_method_info_get_initial_result_set = {-1, "GetInitialResultSet", (GDBusArgInfo **) (&_search_provider_dbus_arg_info_get_initial_result_set_in), (GDBusArgInfo **) (&_search_provider_dbus_arg_info_get_initial_result_set_out)};
static const GDBusArgInfo _search_provider_dbus_arg_info_get_subsearch_result_set_previous_results = {-1, "previous_results", "as"};
static const GDBusArgInfo _search_provider_dbus_arg_info_get_subsearch_result_set_terms = {-1, "terms", "as"};
static const GDBusArgInfo _search_provider_dbus_arg_info_get_subsearch_result_set_result = {-1, "result", "as"};
static const GDBusArgInfo * const _search_provider_dbus_arg_info_get_subsearch_result_set_in[] = {&_search_provider_dbus_arg_info_get_subsearch_result_set_previous_results, &_search_provider_dbus_arg_info_get_subsearch_result_set_terms, NULL};
static const GDBusArgInfo * const _search_provider_dbus_arg_info_get_subsearch_result_set_out[] = {&_search_provider_dbus_arg_info_get_subsearch_result_set_result, NULL};
static const GDBusMethodInfo _search_provider_dbus_method_info_get_subsearch_result_set = {-1, "GetSubsearchResultSet", (GDBusArgInfo **) (&_search_provider_dbus_arg_info_get_subsearch_result_set_in), (GDBusArgInfo **) (&_search_provider_dbus_arg_info_get_subsearch_result_set_out)};
static const GDBusArgInfo _search_provider_dbus_arg_info_get_result_metas_results = {-1, "results", "as"};
static const GDBusArgInfo _search_provider_dbus_arg_info_get_result_metas_result = {-1, "result", "aa{sv}"};
static const GDBusArgInfo * const _search_provider_dbus_arg_info_get_result_metas_in[] = {&_search_provider_dbus_arg_info_get_result_metas_results, NULL};
static const GDBusArgInfo * const _search_provider_dbus_arg_info_get_result_metas_out[] = {&_search_provider_dbus_arg_info_get_result_metas_result, NULL};
static const GDBusMethodInfo _search_provider_dbus_method_info_get_result_metas = {-1, "GetResultMetas", (GDBusArgInfo **) (&_search_provider_dbus_arg_info_get_result_metas_in), (GDBusArgInfo **) (&_search_provider_dbus_arg_info_get_result_metas_out)};
static const GDBusArgInfo _search_provider_dbus_arg_info_activate_result_result = {-1, "result", "s"};
static const GDBusArgInfo _search_provider_dbus_arg_info_activate_result_terms = {-1, "terms", "as"};
static const GDBusArgInfo _search_provider_dbus_arg_info_activate_result_timestamp = {-1, "timestamp", "u"};
static const GDBusArgInfo * const _search_provider_dbus_arg_info_activate_result_in[] = {&_search_provider_dbus_arg_info_activate_result_result, &_search_provider_dbus_arg_info_activate_result_terms, &_search_provider_dbus_arg_info_activate_result_timestamp, NULL};
static const GDBusArgInfo * const _search_provider_dbus_arg_info_activate_result_out[] = {NULL};
static const GDBusMethodInfo _search_provider_dbus_method_info_activate_result = {-1, "ActivateResult", (GDBusArgInfo **) (&_search_provider_dbus_arg_info_activate_result_in), (GDBusArgInfo **) (&_search_provider_dbus_arg_info_activate_result_out)};
static const GDBusArgInfo _search_provider_dbus_arg_info_launch_search_terms = {-1, "terms", "as"};
static const GDBusArgInfo _search_provider_dbus_arg_info_launch_search_timestamp = {-1, "timestamp", "u"};
static const GDBusArgInfo * const _search_provider_dbus_arg_info_launch_search_in[] = {&_search_provider_dbus_arg_info_launch_search_terms, &_search_provider_dbus_arg_info_launch_search_timestamp, NULL};
static const GDBusArgInfo * const _search_provider_dbus_arg_info_launch_search_out[] = {NULL};
static const GDBusMethodInfo _search_provider_dbus_method_info_launch_search = {-1, "LaunchSearch", (GDBusArgInfo **) (&_search_provider_dbus_arg_info_launch_search_in), (GDBusArgInfo **) (&_search_provider_dbus_arg_info_launch_search_out)};
static const GDBusMethodInfo * const _search_provider_dbus_method_info[] = {&_search_provider_dbus_method_info_get_initial_result_set, &_search_provider_dbus_method_info_get_subsearch_result_set, &_search_provider_dbus_method_info_get_result_metas, &_search_provider_dbus_method_info_activate_result, &_search_provider_dbus_method_info_launch_search, NULL};
static const GDBusSignalInfo * const _search_provider_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _search_provider_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _search_provider_dbus_interface_info = {-1, "org.gnome.Shell.SearchProvider2", (GDBusMethodInfo **) (&_search_provider_dbus_method_info), (GDBusSignalInfo **) (&_search_provider_dbus_signal_info), (GDBusPropertyInfo **) (&_search_provider_dbus_property_info)};
static const GDBusInterfaceVTable _search_provider_dbus_interface_vtable = {search_provider_dbus_interface_method_call, search_provider_dbus_interface_get_property, search_provider_dbus_interface_set_property};

static gchar* _vala_g_strjoinv (const gchar* separator, gchar** str_array, int str_array_length1) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	_tmp0_ = separator;
	if (_tmp0_ == NULL) {
		separator = "";
	}
	_tmp3_ = str_array;
	_tmp3__length1 = str_array_length1;
	if (_tmp3_ != NULL) {
		_tmp2_ = TRUE;
	} else {
		gchar** _tmp4_ = NULL;
		gint _tmp4__length1 = 0;
		_tmp4_ = str_array;
		_tmp4__length1 = str_array_length1;
		_tmp2_ = _tmp4__length1 > 0;
	}
	if (_tmp2_) {
		_tmp1_ = TRUE;
	} else {
		gboolean _tmp5_ = FALSE;
		gchar** _tmp6_ = NULL;
		gint _tmp6__length1 = 0;
		_tmp6_ = str_array;
		_tmp6__length1 = str_array_length1;
		if (_tmp6__length1 == -1) {
			gchar** _tmp7_ = NULL;
			gint _tmp7__length1 = 0;
			const gchar* _tmp8_ = NULL;
			_tmp7_ = str_array;
			_tmp7__length1 = str_array_length1;
			_tmp8_ = _tmp7_[0];
			_tmp5_ = _tmp8_ != NULL;
		} else {
			_tmp5_ = FALSE;
		}
		_tmp1_ = _tmp5_;
	}
	if (_tmp1_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp31_ = 0;
		gint _tmp33_ = 0;
		gint _tmp34_ = 0;
		gsize _tmp35_ = 0UL;
		const gchar* _tmp36_ = NULL;
		gint _tmp37_ = 0;
		gint _tmp38_ = 0;
		gint _tmp39_ = 0;
		const gchar* res = NULL;
		gsize _tmp40_ = 0UL;
		void* _tmp41_ = NULL;
		void* ptr = NULL;
		const gchar* _tmp42_ = NULL;
		gchar** _tmp43_ = NULL;
		gint _tmp43__length1 = 0;
		const gchar* _tmp44_ = NULL;
		void* _tmp45_ = NULL;
		const gchar* _tmp62_ = NULL;
		len = (gsize) 1;
		{
			gboolean _tmp9_ = FALSE;
			i = 0;
			_tmp9_ = TRUE;
			while (TRUE) {
				gboolean _tmp11_ = FALSE;
				gboolean _tmp12_ = FALSE;
				gchar** _tmp13_ = NULL;
				gint _tmp13__length1 = 0;
				gint _tmp21_ = 0;
				gchar** _tmp22_ = NULL;
				gint _tmp22__length1 = 0;
				gint _tmp23_ = 0;
				const gchar* _tmp24_ = NULL;
				gsize _tmp30_ = 0UL;
				if (!_tmp9_) {
					gint _tmp10_ = 0;
					_tmp10_ = i;
					i = _tmp10_ + 1;
				}
				_tmp9_ = FALSE;
				_tmp13_ = str_array;
				_tmp13__length1 = str_array_length1;
				if (_tmp13__length1 != -1) {
					gint _tmp14_ = 0;
					gchar** _tmp15_ = NULL;
					gint _tmp15__length1 = 0;
					_tmp14_ = i;
					_tmp15_ = str_array;
					_tmp15__length1 = str_array_length1;
					_tmp12_ = _tmp14_ < _tmp15__length1;
				} else {
					_tmp12_ = FALSE;
				}
				if (_tmp12_) {
					_tmp11_ = TRUE;
				} else {
					gboolean _tmp16_ = FALSE;
					gchar** _tmp17_ = NULL;
					gint _tmp17__length1 = 0;
					_tmp17_ = str_array;
					_tmp17__length1 = str_array_length1;
					if (_tmp17__length1 == -1) {
						gchar** _tmp18_ = NULL;
						gint _tmp18__length1 = 0;
						gint _tmp19_ = 0;
						const gchar* _tmp20_ = NULL;
						_tmp18_ = str_array;
						_tmp18__length1 = str_array_length1;
						_tmp19_ = i;
						_tmp20_ = _tmp18_[_tmp19_];
						_tmp16_ = _tmp20_ != NULL;
					} else {
						_tmp16_ = FALSE;
					}
					_tmp11_ = _tmp16_;
				}
				if (!_tmp11_) {
					break;
				}
				_tmp22_ = str_array;
				_tmp22__length1 = str_array_length1;
				_tmp23_ = i;
				_tmp24_ = _tmp22_[_tmp23_];
				if (_tmp24_ != NULL) {
					gchar** _tmp25_ = NULL;
					gint _tmp25__length1 = 0;
					gint _tmp26_ = 0;
					const gchar* _tmp27_ = NULL;
					gint _tmp28_ = 0;
					gint _tmp29_ = 0;
					_tmp25_ = str_array;
					_tmp25__length1 = str_array_length1;
					_tmp26_ = i;
					_tmp27_ = _tmp25_[_tmp26_];
					_tmp28_ = strlen ((const gchar*) _tmp27_);
					_tmp29_ = _tmp28_;
					_tmp21_ = _tmp29_;
				} else {
					_tmp21_ = 0;
				}
				_tmp30_ = len;
				len = _tmp30_ + _tmp21_;
			}
		}
		_tmp31_ = i;
		if (_tmp31_ == 0) {
			gchar* _tmp32_ = NULL;
			_tmp32_ = g_strdup ("");
			result = _tmp32_;
			return result;
		}
		_tmp33_ = i;
		str_array_length1 = _tmp33_;
		_tmp34_ = str_array_length1;
		_tmp35_ = len;
		_tmp36_ = separator;
		_tmp37_ = strlen ((const gchar*) _tmp36_);
		_tmp38_ = _tmp37_;
		_tmp39_ = i;
		len = _tmp35_ + (_tmp38_ * (_tmp39_ - 1));
		_tmp40_ = len;
		_tmp41_ = g_malloc (_tmp40_);
		res = _tmp41_;
		_tmp42_ = res;
		_tmp43_ = str_array;
		_tmp43__length1 = str_array_length1;
		_tmp44_ = _tmp43_[0];
		_tmp45_ = g_stpcpy ((void*) _tmp42_, (const gchar*) _tmp44_);
		ptr = _tmp45_;
		{
			gboolean _tmp46_ = FALSE;
			i = 1;
			_tmp46_ = TRUE;
			while (TRUE) {
				gint _tmp48_ = 0;
				gchar** _tmp49_ = NULL;
				gint _tmp49__length1 = 0;
				void* _tmp50_ = NULL;
				const gchar* _tmp51_ = NULL;
				void* _tmp52_ = NULL;
				const gchar* _tmp53_ = NULL;
				gchar** _tmp54_ = NULL;
				gint _tmp54__length1 = 0;
				gint _tmp55_ = 0;
				const gchar* _tmp56_ = NULL;
				void* _tmp60_ = NULL;
				void* _tmp61_ = NULL;
				if (!_tmp46_) {
					gint _tmp47_ = 0;
					_tmp47_ = i;
					i = _tmp47_ + 1;
				}
				_tmp46_ = FALSE;
				_tmp48_ = i;
				_tmp49_ = str_array;
				_tmp49__length1 = str_array_length1;
				if (!(_tmp48_ < _tmp49__length1)) {
					break;
				}
				_tmp50_ = ptr;
				_tmp51_ = separator;
				_tmp52_ = g_stpcpy (_tmp50_, (const gchar*) _tmp51_);
				ptr = _tmp52_;
				_tmp54_ = str_array;
				_tmp54__length1 = str_array_length1;
				_tmp55_ = i;
				_tmp56_ = _tmp54_[_tmp55_];
				if (_tmp56_ != NULL) {
					gchar** _tmp57_ = NULL;
					gint _tmp57__length1 = 0;
					gint _tmp58_ = 0;
					const gchar* _tmp59_ = NULL;
					_tmp57_ = str_array;
					_tmp57__length1 = str_array_length1;
					_tmp58_ = i;
					_tmp59_ = _tmp57_[_tmp58_];
					_tmp53_ = (const gchar*) _tmp59_;
				} else {
					_tmp53_ = "";
				}
				_tmp60_ = ptr;
				_tmp61_ = g_stpcpy (_tmp60_, _tmp53_);
				ptr = _tmp61_;
			}
		}
		_tmp62_ = res;
		res = NULL;
		result = (gchar*) _tmp62_;
		return result;
	} else {
		gchar* _tmp63_ = NULL;
		_tmp63_ = g_strdup ("");
		result = _tmp63_;
		return result;
	}
}


static gchar* search_provider_terms_to_equation (gchar** terms, int terms_length1) {
	gchar* result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar* _tmp1_ = NULL;
	_tmp0_ = terms;
	_tmp0__length1 = terms_length1;
	_tmp1_ = _vala_g_strjoinv (" ", _tmp0_, _tmp0__length1);
	result = _tmp1_;
	return result;
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	{
		GRegex* regex = NULL;
		const gchar* _tmp0_ = NULL;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		GRegex* _tmp3_ = NULL;
		GRegex* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		GRegex* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		_tmp0_ = old;
		_tmp1_ = g_regex_escape_string (_tmp0_, -1);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		regex = _tmp4_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch1_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_tmp6_ = regex;
		_tmp7_ = replacement;
		_tmp8_ = g_regex_replace_literal (_tmp6_, self, (gssize) -1, 0, _tmp7_, 0, &_inner_error_);
		_tmp5_ = _tmp8_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch1_g_regex_error;
			}
			_g_regex_unref0 (regex);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_tmp9_ = _tmp5_;
		_tmp5_ = NULL;
		result = _tmp9_;
		_g_free0 (_tmp5_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally1;
	__catch1_g_regex_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally1:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
}


static gboolean double_try_parse (const gchar* str, gdouble* _result_) {
	gdouble _vala_result = 0.0;
	gboolean result = FALSE;
	gchar* endptr = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gdouble _tmp2_ = 0.0;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	g_return_val_if_fail (str != NULL, FALSE);
	_tmp0_ = str;
	_tmp2_ = g_ascii_strtod (_tmp0_, &_tmp1_);
	endptr = _tmp1_;
	_vala_result = _tmp2_;
	_tmp3_ = endptr;
	_tmp4_ = str;
	_tmp5_ = str;
	_tmp6_ = strlen (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp3_ == (((gchar*) _tmp4_) + _tmp7_)) {
		result = TRUE;
		if (_result_) {
			*_result_ = _vala_result;
		}
		return result;
	} else {
		result = FALSE;
		if (_result_) {
			*_result_ = _vala_result;
		}
		return result;
	}
	if (_result_) {
		*_result_ = _vala_result;
	}
}


static gboolean search_provider_can_parse (gchar** terms, int terms_length1) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
	{
		gint exit_status = 0;
		gchar* tsep_string = NULL;
		const gchar* _tmp0_ = NULL;
		gchar* _tmp1_ = NULL;
		gboolean _tmp2_ = FALSE;
		const gchar* _tmp3_ = NULL;
		gchar* decimal = NULL;
		const gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
		const gchar* _tmp8_ = NULL;
		gchar* equation = NULL;
		gchar** _tmp10_ = NULL;
		gint _tmp10__length1 = 0;
		gchar* _tmp11_ = NULL;
		gchar* _tmp12_ = NULL;
		const gchar* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
		gchar* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		gchar* _tmp17_ = NULL;
		gchar* _tmp18_ = NULL;
		const gchar* _tmp19_ = NULL;
		gboolean _tmp20_ = FALSE;
		gchar* stdout_buf = NULL;
		gchar* stderr_buf = NULL;
		const gchar* _tmp21_ = NULL;
		gchar* _tmp22_ = NULL;
		gchar* _tmp23_ = NULL;
		gchar* _tmp24_ = NULL;
		gchar* _tmp25_ = NULL;
		gchar* _tmp26_ = NULL;
		gchar* _tmp27_ = NULL;
		gint _tmp28_ = 0;
		gint _tmp29_ = 0;
		_tmp0_ = nl_langinfo (THOUSEP);
		_tmp1_ = g_strdup (_tmp0_);
		tsep_string = _tmp1_;
		_tmp3_ = tsep_string;
		if (_tmp3_ == NULL) {
			_tmp2_ = TRUE;
		} else {
			const gchar* _tmp4_ = NULL;
			_tmp4_ = tsep_string;
			_tmp2_ = g_strcmp0 (_tmp4_, "") == 0;
		}
		if (_tmp2_) {
			gchar* _tmp5_ = NULL;
			_tmp5_ = g_strdup (" ");
			_g_free0 (tsep_string);
			tsep_string = _tmp5_;
		}
		_tmp6_ = nl_langinfo (RADIXCHAR);
		_tmp7_ = g_strdup (_tmp6_);
		decimal = _tmp7_;
		_tmp8_ = decimal;
		if (_tmp8_ == NULL) {
			gchar* _tmp9_ = NULL;
			_tmp9_ = g_strdup ("");
			_g_free0 (decimal);
			decimal = _tmp9_;
		}
		_tmp10_ = terms;
		_tmp10__length1 = terms_length1;
		_tmp11_ = search_provider_terms_to_equation (_tmp10_, _tmp10__length1);
		_tmp12_ = _tmp11_;
		_tmp13_ = tsep_string;
		_tmp14_ = string_replace (_tmp12_, _tmp13_, "");
		_tmp15_ = _tmp14_;
		_tmp16_ = decimal;
		_tmp17_ = string_replace (_tmp15_, _tmp16_, ".");
		_tmp18_ = _tmp17_;
		_g_free0 (_tmp15_);
		_g_free0 (_tmp12_);
		equation = _tmp18_;
		_tmp19_ = equation;
		_tmp20_ = double_try_parse (_tmp19_, NULL);
		if (_tmp20_) {
			result = FALSE;
			_g_free0 (equation);
			_g_free0 (decimal);
			_g_free0 (tsep_string);
			return result;
		}
		_tmp21_ = equation;
		_tmp22_ = g_shell_quote (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = g_strconcat ("gnome-calculator --solve ", _tmp23_, NULL);
		_tmp25_ = _tmp24_;
		g_spawn_command_line_sync (_tmp25_, &_tmp26_, &_tmp27_, &_tmp28_, &_inner_error_);
		_g_free0 (stdout_buf);
		stdout_buf = _tmp26_;
		_g_free0 (stderr_buf);
		stderr_buf = _tmp27_;
		exit_status = _tmp28_;
		_g_free0 (_tmp25_);
		_g_free0 (_tmp23_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_free0 (stderr_buf);
			_g_free0 (stdout_buf);
			_g_free0 (equation);
			_g_free0 (decimal);
			_g_free0 (tsep_string);
			if (_inner_error_->domain == G_SPAWN_ERROR) {
				goto __catch0_g_spawn_error;
			}
			goto __catch0_g_error;
		}
		_tmp29_ = exit_status;
		g_spawn_check_exit_status (_tmp29_, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_free0 (stderr_buf);
			_g_free0 (stdout_buf);
			_g_free0 (equation);
			_g_free0 (decimal);
			_g_free0 (tsep_string);
			if (_inner_error_->domain == G_SPAWN_ERROR) {
				goto __catch0_g_spawn_error;
			}
			goto __catch0_g_error;
		}
		_g_free0 (stderr_buf);
		_g_free0 (stdout_buf);
		_g_free0 (equation);
		_g_free0 (decimal);
		_g_free0 (tsep_string);
	}
	goto __finally0;
	__catch0_g_spawn_error:
	{
		GError* e = NULL;
		const gchar* _tmp30_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp30_ = e->message;
		g_error ("search-provider.vala:53: Failed to spawn Calculator: %s", _tmp30_);
		_g_error_free0 (e);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		result = FALSE;
		_g_error_free0 (e);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return FALSE;
	}
	result = TRUE;
	return result;
}


static gchar** search_provider_get_result_identifier (gchar** terms, int terms_length1, int* result_length1) {
	gchar** result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gboolean _tmp1_ = FALSE;
	gchar** _tmp12_ = NULL;
	gint _tmp12__length1 = 0;
	gchar** _tmp13_ = NULL;
	gint _tmp13__length1 = 0;
	_tmp0_ = terms;
	_tmp0__length1 = terms_length1;
	_tmp1_ = search_provider_can_parse (_tmp0_, _tmp0__length1);
	if (_tmp1_) {
		gchar** _tmp2_ = NULL;
		gint _tmp2__length1 = 0;
		gchar* _tmp3_ = NULL;
		gchar** _tmp4_ = NULL;
		gchar** _tmp5_ = NULL;
		gint _tmp5__length1 = 0;
		gchar** _tmp6_ = NULL;
		gint _tmp6__length1 = 0;
		gchar** _tmp7_ = NULL;
		gint _tmp7__length1 = 0;
		_tmp2_ = terms;
		_tmp2__length1 = terms_length1;
		_tmp3_ = search_provider_terms_to_equation (_tmp2_, _tmp2__length1);
		_tmp4_ = g_new0 (gchar*, 1 + 1);
		_tmp4_[0] = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp5__length1 = 1;
		if (result_length1) {
			*result_length1 = _tmp5__length1;
		}
		result = _tmp5_;
		_tmp6_ = result;
		_tmp6__length1 = *result_length1;
		_tmp7_ = result;
		_tmp7__length1 = *result_length1;
		_vala_warn_if_fail ((_tmp6__length1 == 0) || (_tmp7__length1 == 1), "result.length == 0 || result.length == 1");
		return result;
	} else {
		gchar** _tmp8_ = NULL;
		gchar** _tmp9_ = NULL;
		gint _tmp9__length1 = 0;
		gchar** _tmp10_ = NULL;
		gint _tmp10__length1 = 0;
		gchar** _tmp11_ = NULL;
		gint _tmp11__length1 = 0;
		_tmp8_ = g_new0 (gchar*, 0 + 1);
		_tmp9_ = _tmp8_;
		_tmp9__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp9__length1;
		}
		result = _tmp9_;
		_tmp10_ = result;
		_tmp10__length1 = *result_length1;
		_tmp11_ = result;
		_tmp11__length1 = *result_length1;
		_vala_warn_if_fail ((_tmp10__length1 == 0) || (_tmp11__length1 == 1), "result.length == 0 || result.length == 1");
		return result;
	}
	_tmp12_ = result;
	_tmp12__length1 = *result_length1;
	_tmp13_ = result;
	_tmp13__length1 = *result_length1;
	_vala_warn_if_fail ((_tmp12__length1 == 0) || (_tmp13__length1 == 1), "result.length == 0 || result.length == 1");
}


gchar** search_provider_get_initial_result_set (SearchProvider* self, gchar** terms, int terms_length1, int* result_length1) {
	gchar** result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gint _tmp1_ = 0;
	gchar** _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = terms;
	_tmp0__length1 = terms_length1;
	_tmp2_ = search_provider_get_result_identifier (_tmp0_, _tmp0__length1, &_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	if (result_length1) {
		*result_length1 = _tmp3__length1;
	}
	result = _tmp3_;
	return result;
}


gchar** search_provider_get_subsearch_result_set (SearchProvider* self, gchar** previous_results, int previous_results_length1, gchar** terms, int terms_length1, int* result_length1) {
	gchar** result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gint _tmp1_ = 0;
	gchar** _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = terms;
	_tmp0__length1 = terms_length1;
	_tmp2_ = search_provider_get_result_identifier (_tmp0_, _tmp0__length1, &_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	if (result_length1) {
		*result_length1 = _tmp3__length1;
	}
	result = _tmp3_;
	return result;
}


static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static void _vala_array_add2 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static void _g_free0_ (gpointer var) {
	var = (g_free (var), NULL);
}


static void _g_variant_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
}


static GVariant* _variant_new1 (const gchar* value) {
	return g_variant_ref_sink (g_variant_new_string (value));
}


static GVariant* _variant_new2 (gchar* value) {
	return g_variant_ref_sink (g_variant_new_string (value));
}


GHashTable** search_provider_get_result_metas (SearchProvider* self, gchar** results, int results_length1, int* result_length1) {
	GHashTable** result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	GSubprocess* subprocess = NULL;
	gchar* stdout_buf = NULL;
	gchar* stderr_buf = NULL;
	gchar** argv = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	gint argv_length1 = 0;
	gint _argv_size_ = 0;
	gchar** _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	gchar** _tmp5_ = NULL;
	gint _tmp5__length1 = 0;
	const gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar** _tmp8_ = NULL;
	gint _tmp8__length1 = 0;
	GHashTable** metadata = NULL;
	GHashTable** _tmp17_ = NULL;
	gint metadata_length1 = 0;
	gint _metadata_size_ = 0;
	GHashFunc _tmp18_ = NULL;
	GEqualFunc _tmp19_ = NULL;
	GHashTable* _tmp20_ = NULL;
	GHashTable* _tmp21_ = NULL;
	GHashTable* _tmp22_ = NULL;
	gchar* _tmp23_ = NULL;
	gchar** _tmp24_ = NULL;
	gint _tmp24__length1 = 0;
	const gchar* _tmp25_ = NULL;
	GVariant* _tmp26_ = NULL;
	GHashTable* _tmp27_ = NULL;
	gchar* _tmp28_ = NULL;
	gchar** _tmp29_ = NULL;
	gint _tmp29__length1 = 0;
	const gchar* _tmp30_ = NULL;
	gchar* _tmp31_ = NULL;
	gchar* _tmp32_ = NULL;
	gchar* _tmp33_ = NULL;
	gchar* _tmp34_ = NULL;
	GVariant* _tmp35_ = NULL;
	GHashTable** _tmp36_ = NULL;
	gint _tmp36__length1 = 0;
	GHashTable** _tmp37_ = NULL;
	gint _tmp37__length1 = 0;
	GHashTable** _tmp38_ = NULL;
	gint _tmp38__length1 = 0;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = results;
	_tmp0__length1 = results_length1;
	_vala_return_val_if_fail (_tmp0__length1 == 1, "results.length == 1", NULL);
	_tmp1_ = g_strdup ("gnome-calculator");
	_tmp2_ = g_strdup ("--solve");
	_tmp3_ = g_new0 (gchar*, 2 + 1);
	_tmp3_[0] = _tmp1_;
	_tmp3_[1] = _tmp2_;
	argv = _tmp3_;
	argv_length1 = 2;
	_argv_size_ = argv_length1;
	_tmp4_ = argv;
	_tmp4__length1 = argv_length1;
	_tmp5_ = results;
	_tmp5__length1 = results_length1;
	_tmp6_ = _tmp5_[0];
	_tmp7_ = g_strdup (_tmp6_);
	_vala_array_add1 (&argv, &argv_length1, &_argv_size_, _tmp7_);
	_tmp8_ = argv;
	_tmp8__length1 = argv_length1;
	_vala_array_add2 (&argv, &argv_length1, &_argv_size_, NULL);
	{
		GSubprocess* _tmp9_ = NULL;
		gchar** _tmp10_ = NULL;
		gint _tmp10__length1 = 0;
		GSubprocess* _tmp11_ = NULL;
		GSubprocess* _tmp12_ = NULL;
		_tmp10_ = argv;
		_tmp10__length1 = argv_length1;
		_tmp11_ = g_subprocess_newv (_tmp10_, G_SUBPROCESS_FLAGS_STDOUT_PIPE | G_SUBPROCESS_FLAGS_STDERR_PIPE, &_inner_error_);
		_tmp9_ = _tmp11_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch2_g_error;
		}
		_tmp12_ = _tmp9_;
		_tmp9_ = NULL;
		_g_object_unref0 (subprocess);
		subprocess = _tmp12_;
		_g_object_unref0 (_tmp9_);
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp13_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp13_ = e->message;
		g_error ("search-provider.vala:101: Failed to spawn Calculator: %s", _tmp13_);
		_g_error_free0 (e);
	}
	__finally2:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (stderr_buf);
		_g_free0 (stdout_buf);
		_g_object_unref0 (subprocess);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	{
		gchar* _tmp14_ = NULL;
		gchar* _tmp15_ = NULL;
		g_subprocess_communicate_utf8 (subprocess, NULL, NULL, &_tmp14_, &_tmp15_, &_inner_error_);
		_g_free0 (stdout_buf);
		stdout_buf = _tmp14_;
		_g_free0 (stderr_buf);
		stderr_buf = _tmp15_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch3_g_error;
		}
	}
	goto __finally3;
	__catch3_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp16_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp16_ = e->message;
		g_error ("search-provider.vala:110: Failed reading result: %s", _tmp16_);
		_g_error_free0 (e);
	}
	__finally3:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (stderr_buf);
		_g_free0 (stdout_buf);
		_g_object_unref0 (subprocess);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp17_ = g_new0 (GHashTable*, 1 + 1);
	metadata = _tmp17_;
	metadata_length1 = 1;
	_metadata_size_ = metadata_length1;
	_tmp18_ = g_str_hash;
	_tmp19_ = g_str_equal;
	_tmp20_ = g_hash_table_new_full (_tmp18_, _tmp19_, _g_free0_, _g_variant_unref0_);
	_g_hash_table_unref0 (metadata[0]);
	metadata[0] = _tmp20_;
	_tmp21_ = metadata[0];
	_tmp22_ = metadata[0];
	_tmp23_ = g_strdup ("id");
	_tmp24_ = results;
	_tmp24__length1 = results_length1;
	_tmp25_ = _tmp24_[0];
	_tmp26_ = _variant_new1 (_tmp25_);
	g_hash_table_insert (_tmp22_, _tmp23_, _tmp26_);
	_tmp27_ = metadata[0];
	_tmp28_ = g_strdup ("name");
	_tmp29_ = results;
	_tmp29__length1 = results_length1;
	_tmp30_ = _tmp29_[0];
	_tmp31_ = g_strconcat (_tmp30_, " = ", NULL);
	_tmp32_ = _tmp31_;
	_tmp33_ = g_strconcat (_tmp32_, stdout_buf, NULL);
	_tmp34_ = _tmp33_;
	_tmp35_ = _variant_new2 (_tmp34_);
	g_hash_table_insert (_tmp27_, _tmp28_, _tmp35_);
	_g_free0 (_tmp34_);
	_g_free0 (_tmp32_);
	_tmp36_ = metadata;
	_tmp36__length1 = metadata_length1;
	if (result_length1) {
		*result_length1 = _tmp36__length1;
	}
	result = _tmp36_;
	argv = (_vala_array_free (argv, argv_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (stderr_buf);
	_g_free0 (stdout_buf);
	_g_object_unref0 (subprocess);
	_tmp37_ = result;
	_tmp37__length1 = *result_length1;
	_vala_warn_if_fail (_tmp37__length1 == 1, "result.length == 1");
	return result;
}


static void search_provider_spawn_and_display_equation (gchar** terms, int terms_length1) {
	GError * _inner_error_ = NULL;
	{
		gchar** _tmp0_ = NULL;
		gint _tmp0__length1 = 0;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		_tmp0_ = terms;
		_tmp0__length1 = terms_length1;
		_tmp1_ = search_provider_terms_to_equation (_tmp0_, _tmp0__length1);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_shell_quote (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_strconcat ("gnome-calculator --equation ", _tmp4_, NULL);
		_tmp6_ = _tmp5_;
		g_spawn_command_line_async (_tmp6_, &_inner_error_);
		_g_free0 (_tmp6_);
		_g_free0 (_tmp4_);
		_g_free0 (_tmp2_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			if (_inner_error_->domain == G_SPAWN_ERROR) {
				goto __catch4_g_spawn_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	goto __finally4;
	__catch4_g_spawn_error:
	{
		GError* e = NULL;
		const gchar* _tmp7_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp7_ = e->message;
		g_error ("search-provider.vala:130: Failed to spawn Calculator: %s", _tmp7_);
		_g_error_free0 (e);
	}
	__finally4:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


void search_provider_activate_result (SearchProvider* self, const gchar* _result_, gchar** terms, int terms_length1, guint32 timestamp) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (_result_ != NULL);
	_tmp0_ = terms;
	_tmp0__length1 = terms_length1;
	search_provider_spawn_and_display_equation (_tmp0_, _tmp0__length1);
}


void search_provider_launch_search (SearchProvider* self, gchar** terms, int terms_length1, guint32 timestamp) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = terms;
	_tmp0__length1 = terms_length1;
	search_provider_spawn_and_display_equation (_tmp0_, _tmp0__length1);
}


SearchProvider* search_provider_construct (GType object_type) {
	SearchProvider * self = NULL;
	self = (SearchProvider*) g_object_new (object_type, NULL);
	return self;
}


SearchProvider* search_provider_new (void) {
	return search_provider_construct (TYPE_SEARCH_PROVIDER);
}


static void search_provider_class_init (SearchProviderClass * klass) {
	search_provider_parent_class = g_type_class_peek_parent (klass);
}


static void search_provider_instance_init (SearchProvider * self) {
}


GType search_provider_get_type (void) {
	static volatile gsize search_provider_type_id__volatile = 0;
	if (g_once_init_enter (&search_provider_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (SearchProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) search_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SearchProvider), 0, (GInstanceInitFunc) search_provider_instance_init, NULL };
		GType search_provider_type_id;
		search_provider_type_id = g_type_register_static (G_TYPE_OBJECT, "SearchProvider", &g_define_type_info, 0);
		g_type_set_qdata (search_provider_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) search_provider_register_object);
		g_once_init_leave (&search_provider_type_id__volatile, search_provider_type_id);
	}
	return search_provider_type_id__volatile;
}


static void _dbus_search_provider_get_initial_result_set (SearchProvider* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar** terms = NULL;
	int terms_length1 = 0;
	GVariant* _tmp0_;
	gchar** _tmp1_;
	int _tmp1__length;
	int _tmp1__size;
	int _tmp1__length1;
	GVariantIter _tmp2_;
	GVariant* _tmp3_;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar** result;
	int result_length1 = 0;
	gchar** _tmp4_;
	GVariantBuilder _tmp5_;
	int _tmp6_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp0_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp1_ = g_new (gchar*, 5);
	_tmp1__length = 0;
	_tmp1__size = 4;
	_tmp1__length1 = 0;
	g_variant_iter_init (&_tmp2_, _tmp0_);
	for (; (_tmp3_ = g_variant_iter_next_value (&_tmp2_)) != NULL; _tmp1__length1++) {
		if (_tmp1__size == _tmp1__length) {
			_tmp1__size = 2 * _tmp1__size;
			_tmp1_ = g_renew (gchar*, _tmp1_, _tmp1__size + 1);
		}
		_tmp1_[_tmp1__length++] = g_variant_dup_string (_tmp3_, NULL);
		g_variant_unref (_tmp3_);
	}
	terms_length1 = _tmp1__length1;
	_tmp1_[_tmp1__length] = NULL;
	terms = _tmp1_;
	g_variant_unref (_tmp0_);
	result = search_provider_get_initial_result_set (self, terms, terms_length1, &result_length1);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_tmp4_ = result;
	g_variant_builder_init (&_tmp5_, G_VARIANT_TYPE ("as"));
	for (_tmp6_ = 0; _tmp6_ < result_length1; _tmp6_++) {
		g_variant_builder_add_value (&_tmp5_, g_variant_new_string (*_tmp4_));
		_tmp4_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp5_));
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	terms = (_vala_array_free (terms, terms_length1, (GDestroyNotify) g_free), NULL);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_search_provider_get_subsearch_result_set (SearchProvider* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar** previous_results = NULL;
	int previous_results_length1 = 0;
	GVariant* _tmp7_;
	gchar** _tmp8_;
	int _tmp8__length;
	int _tmp8__size;
	int _tmp8__length1;
	GVariantIter _tmp9_;
	GVariant* _tmp10_;
	gchar** terms = NULL;
	int terms_length1 = 0;
	GVariant* _tmp11_;
	gchar** _tmp12_;
	int _tmp12__length;
	int _tmp12__size;
	int _tmp12__length1;
	GVariantIter _tmp13_;
	GVariant* _tmp14_;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar** result;
	int result_length1 = 0;
	gchar** _tmp15_;
	GVariantBuilder _tmp16_;
	int _tmp17_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp7_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp8_ = g_new (gchar*, 5);
	_tmp8__length = 0;
	_tmp8__size = 4;
	_tmp8__length1 = 0;
	g_variant_iter_init (&_tmp9_, _tmp7_);
	for (; (_tmp10_ = g_variant_iter_next_value (&_tmp9_)) != NULL; _tmp8__length1++) {
		if (_tmp8__size == _tmp8__length) {
			_tmp8__size = 2 * _tmp8__size;
			_tmp8_ = g_renew (gchar*, _tmp8_, _tmp8__size + 1);
		}
		_tmp8_[_tmp8__length++] = g_variant_dup_string (_tmp10_, NULL);
		g_variant_unref (_tmp10_);
	}
	previous_results_length1 = _tmp8__length1;
	_tmp8_[_tmp8__length] = NULL;
	previous_results = _tmp8_;
	g_variant_unref (_tmp7_);
	_tmp11_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp12_ = g_new (gchar*, 5);
	_tmp12__length = 0;
	_tmp12__size = 4;
	_tmp12__length1 = 0;
	g_variant_iter_init (&_tmp13_, _tmp11_);
	for (; (_tmp14_ = g_variant_iter_next_value (&_tmp13_)) != NULL; _tmp12__length1++) {
		if (_tmp12__size == _tmp12__length) {
			_tmp12__size = 2 * _tmp12__size;
			_tmp12_ = g_renew (gchar*, _tmp12_, _tmp12__size + 1);
		}
		_tmp12_[_tmp12__length++] = g_variant_dup_string (_tmp14_, NULL);
		g_variant_unref (_tmp14_);
	}
	terms_length1 = _tmp12__length1;
	_tmp12_[_tmp12__length] = NULL;
	terms = _tmp12_;
	g_variant_unref (_tmp11_);
	result = search_provider_get_subsearch_result_set (self, previous_results, previous_results_length1, terms, terms_length1, &result_length1);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_tmp15_ = result;
	g_variant_builder_init (&_tmp16_, G_VARIANT_TYPE ("as"));
	for (_tmp17_ = 0; _tmp17_ < result_length1; _tmp17_++) {
		g_variant_builder_add_value (&_tmp16_, g_variant_new_string (*_tmp15_));
		_tmp15_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp16_));
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	previous_results = (_vala_array_free (previous_results, previous_results_length1, (GDestroyNotify) g_free), NULL);
	terms = (_vala_array_free (terms, terms_length1, (GDestroyNotify) g_free), NULL);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_search_provider_get_result_metas (SearchProvider* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar** results = NULL;
	int results_length1 = 0;
	GVariant* _tmp18_;
	gchar** _tmp19_;
	int _tmp19__length;
	int _tmp19__size;
	int _tmp19__length1;
	GVariantIter _tmp20_;
	GVariant* _tmp21_;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GHashTable** result;
	int result_length1 = 0;
	GHashTable** _tmp22_;
	GVariantBuilder _tmp23_;
	int _tmp24_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp18_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp19_ = g_new (gchar*, 5);
	_tmp19__length = 0;
	_tmp19__size = 4;
	_tmp19__length1 = 0;
	g_variant_iter_init (&_tmp20_, _tmp18_);
	for (; (_tmp21_ = g_variant_iter_next_value (&_tmp20_)) != NULL; _tmp19__length1++) {
		if (_tmp19__size == _tmp19__length) {
			_tmp19__size = 2 * _tmp19__size;
			_tmp19_ = g_renew (gchar*, _tmp19_, _tmp19__size + 1);
		}
		_tmp19_[_tmp19__length++] = g_variant_dup_string (_tmp21_, NULL);
		g_variant_unref (_tmp21_);
	}
	results_length1 = _tmp19__length1;
	_tmp19_[_tmp19__length] = NULL;
	results = _tmp19_;
	g_variant_unref (_tmp18_);
	result = search_provider_get_result_metas (self, results, results_length1, &result_length1);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_tmp22_ = result;
	g_variant_builder_init (&_tmp23_, G_VARIANT_TYPE ("aa{sv}"));
	for (_tmp24_ = 0; _tmp24_ < result_length1; _tmp24_++) {
		GVariantBuilder _tmp25_;
		GHashTableIter _tmp26_;
		gpointer _tmp27_;
		gpointer _tmp28_;
		g_hash_table_iter_init (&_tmp26_, *_tmp22_);
		g_variant_builder_init (&_tmp25_, G_VARIANT_TYPE ("a{sv}"));
		while (g_hash_table_iter_next (&_tmp26_, &_tmp27_, &_tmp28_)) {
			gchar* _key;
			GVariant* _value;
			_key = (gchar*) _tmp27_;
			_value = (GVariant*) _tmp28_;
			g_variant_builder_add (&_tmp25_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
		}
		g_variant_builder_add_value (&_tmp23_, g_variant_builder_end (&_tmp25_));
		_tmp22_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp23_));
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_hash_table_unref), NULL);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	results = (_vala_array_free (results, results_length1, (GDestroyNotify) g_free), NULL);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_search_provider_activate_result (SearchProvider* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* _result_ = NULL;
	GVariant* _tmp29_;
	gchar** terms = NULL;
	int terms_length1 = 0;
	GVariant* _tmp30_;
	gchar** _tmp31_;
	int _tmp31__length;
	int _tmp31__size;
	int _tmp31__length1;
	GVariantIter _tmp32_;
	GVariant* _tmp33_;
	guint32 timestamp = 0U;
	GVariant* _tmp34_;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp29_ = g_variant_iter_next_value (&_arguments_iter);
	_result_ = g_variant_dup_string (_tmp29_, NULL);
	g_variant_unref (_tmp29_);
	_tmp30_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp31_ = g_new (gchar*, 5);
	_tmp31__length = 0;
	_tmp31__size = 4;
	_tmp31__length1 = 0;
	g_variant_iter_init (&_tmp32_, _tmp30_);
	for (; (_tmp33_ = g_variant_iter_next_value (&_tmp32_)) != NULL; _tmp31__length1++) {
		if (_tmp31__size == _tmp31__length) {
			_tmp31__size = 2 * _tmp31__size;
			_tmp31_ = g_renew (gchar*, _tmp31_, _tmp31__size + 1);
		}
		_tmp31_[_tmp31__length++] = g_variant_dup_string (_tmp33_, NULL);
		g_variant_unref (_tmp33_);
	}
	terms_length1 = _tmp31__length1;
	_tmp31_[_tmp31__length] = NULL;
	terms = _tmp31_;
	g_variant_unref (_tmp30_);
	_tmp34_ = g_variant_iter_next_value (&_arguments_iter);
	timestamp = g_variant_get_uint32 (_tmp34_);
	g_variant_unref (_tmp34_);
	search_provider_activate_result (self, _result_, terms, terms_length1, timestamp);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	_g_free0 (_result_);
	terms = (_vala_array_free (terms, terms_length1, (GDestroyNotify) g_free), NULL);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_search_provider_launch_search (SearchProvider* self, GVariant* _parameters_, GDBusMethodInvocation* invocation) {
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar** terms = NULL;
	int terms_length1 = 0;
	GVariant* _tmp35_;
	gchar** _tmp36_;
	int _tmp36__length;
	int _tmp36__size;
	int _tmp36__length1;
	GVariantIter _tmp37_;
	GVariant* _tmp38_;
	guint32 timestamp = 0U;
	GVariant* _tmp39_;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp35_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp36_ = g_new (gchar*, 5);
	_tmp36__length = 0;
	_tmp36__size = 4;
	_tmp36__length1 = 0;
	g_variant_iter_init (&_tmp37_, _tmp35_);
	for (; (_tmp38_ = g_variant_iter_next_value (&_tmp37_)) != NULL; _tmp36__length1++) {
		if (_tmp36__size == _tmp36__length) {
			_tmp36__size = 2 * _tmp36__size;
			_tmp36_ = g_renew (gchar*, _tmp36_, _tmp36__size + 1);
		}
		_tmp36_[_tmp36__length++] = g_variant_dup_string (_tmp38_, NULL);
		g_variant_unref (_tmp38_);
	}
	terms_length1 = _tmp36__length1;
	_tmp36_[_tmp36__length] = NULL;
	terms = _tmp36_;
	g_variant_unref (_tmp35_);
	_tmp39_ = g_variant_iter_next_value (&_arguments_iter);
	timestamp = g_variant_get_uint32 (_tmp39_);
	g_variant_unref (_tmp39_);
	search_provider_launch_search (self, terms, terms_length1, timestamp);
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	terms = (_vala_array_free (terms, terms_length1, (GDestroyNotify) g_free), NULL);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void search_provider_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "GetInitialResultSet") == 0) {
		_dbus_search_provider_get_initial_result_set (object, parameters, invocation);
	} else if (strcmp (method_name, "GetSubsearchResultSet") == 0) {
		_dbus_search_provider_get_subsearch_result_set (object, parameters, invocation);
	} else if (strcmp (method_name, "GetResultMetas") == 0) {
		_dbus_search_provider_get_result_metas (object, parameters, invocation);
	} else if (strcmp (method_name, "ActivateResult") == 0) {
		_dbus_search_provider_activate_result (object, parameters, invocation);
	} else if (strcmp (method_name, "LaunchSearch") == 0) {
		_dbus_search_provider_launch_search (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}


static GVariant* search_provider_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}


static gboolean search_provider_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}


guint search_provider_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_search_provider_dbus_interface_info), &_search_provider_dbus_interface_vtable, data, _search_provider_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}


static void _search_provider_unregister_object (gpointer user_data) {
	gpointer* data;
	data = user_data;
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}


SearchProviderApp* search_provider_app_construct (GType object_type) {
	SearchProviderApp * self = NULL;
	self = (SearchProviderApp*) g_object_new (object_type, "application-id", "org.gnome.Calculator.SearchProvider", "flags", G_APPLICATION_IS_SERVICE, "inactivity-timeout", 60000, NULL);
	return self;
}


SearchProviderApp* search_provider_app_new (void) {
	return search_provider_app_construct (TYPE_SEARCH_PROVIDER_APP);
}


static gboolean search_provider_app_real_dbus_register (GApplication* base, GDBusConnection* connection, const gchar* object_path, GError** error) {
	SearchProviderApp * self;
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
	self = (SearchProviderApp*) base;
	g_return_val_if_fail (connection != NULL, FALSE);
	g_return_val_if_fail (object_path != NULL, FALSE);
	{
		GDBusConnection* _tmp0_ = NULL;
		const gchar* _tmp1_ = NULL;
		SearchProvider* _tmp2_ = NULL;
		SearchProvider* _tmp3_ = NULL;
		_tmp0_ = connection;
		_tmp1_ = object_path;
		_tmp2_ = search_provider_new ();
		_tmp3_ = _tmp2_;
		search_provider_register_object (_tmp3_, _tmp0_, _tmp1_, &_inner_error_);
		_g_object_unref0 (_tmp3_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			if (_inner_error_->domain == G_IO_ERROR) {
				goto __catch5_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return FALSE;
		}
	}
	goto __finally5;
	__catch5_g_io_error:
	{
		GError* _error_ = NULL;
		FILE* _tmp4_ = NULL;
		GError* _tmp5_ = NULL;
		const gchar* _tmp6_ = NULL;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = stderr;
		_tmp5_ = _error_;
		_tmp6_ = _tmp5_->message;
		fprintf (_tmp4_, "Could not register service: %s\n", _tmp6_);
		g_application_quit ((GApplication*) self);
		_g_error_free0 (_error_);
	}
	__finally5:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return FALSE;
	}
	result = TRUE;
	return result;
}


static void search_provider_app_class_init (SearchProviderAppClass * klass) {
	search_provider_app_parent_class = g_type_class_peek_parent (klass);
	((GApplicationClass *) klass)->dbus_register = search_provider_app_real_dbus_register;
}


static void search_provider_app_instance_init (SearchProviderApp * self) {
}


GType search_provider_app_get_type (void) {
	static volatile gsize search_provider_app_type_id__volatile = 0;
	if (g_once_init_enter (&search_provider_app_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (SearchProviderAppClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) search_provider_app_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SearchProviderApp), 0, (GInstanceInitFunc) search_provider_app_instance_init, NULL };
		GType search_provider_app_type_id;
		search_provider_app_type_id = g_type_register_static (g_application_get_type (), "SearchProviderApp", &g_define_type_info, 0);
		g_once_init_leave (&search_provider_app_type_id__volatile, search_provider_app_type_id);
	}
	return search_provider_app_type_id__volatile;
}


gint _vala_main (void) {
	gint result = 0;
	SearchProviderApp* _tmp0_ = NULL;
	SearchProviderApp* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	setlocale (LC_ALL, "");
	_tmp0_ = search_provider_app_new ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_application_run ((GApplication*) _tmp1_, 0, NULL);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	result = _tmp3_;
	return result;
}


int main (int argc, char ** argv) {
#if !GLIB_CHECK_VERSION (2,35,0)
	g_type_init ();
#endif
	return _vala_main ();
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



