/* benchmarksorts.c generated by valac 0.24.0.111-cb21a, the Vala compiler
 * generated from benchmarksorts.vala, do not modify */

/* benchmarksorts.vala
 *
 * Copyright (C) 2008  Jürg Billeter
 * Copyright (C) 2009  Didier Villevalois
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Didier 'Ptitjes Villevalois <ptitjes@free.fr>
 * 	Will <tcosprojects@gmail.com>
 */

#include <glib.h>
#include <glib-object.h>
#include <gee-internals.h>
#include <stdlib.h>
#include <string.h>
#include <gobject/gvaluecollector.h>


#define GEE_BENCHMARK_TYPE_ALGORITHM (gee_benchmark_algorithm_get_type ())
#define GEE_BENCHMARK_ALGORITHM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_ALGORITHM, GeeBenchmarkAlgorithm))
#define GEE_BENCHMARK_IS_ALGORITHM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_ALGORITHM))
#define GEE_BENCHMARK_ALGORITHM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_BENCHMARK_TYPE_ALGORITHM, GeeBenchmarkAlgorithmIface))

typedef struct _GeeBenchmarkAlgorithm GeeBenchmarkAlgorithm;
typedef struct _GeeBenchmarkAlgorithmIface GeeBenchmarkAlgorithmIface;

#define GEE_BENCHMARK_TYPE_TIM_SORT (gee_benchmark_tim_sort_get_type ())
#define GEE_BENCHMARK_TIM_SORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_TIM_SORT, GeeBenchmarkTimSort))
#define GEE_BENCHMARK_TIM_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_TIM_SORT, GeeBenchmarkTimSortClass))
#define GEE_BENCHMARK_IS_TIM_SORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_TIM_SORT))
#define GEE_BENCHMARK_IS_TIM_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_TIM_SORT))
#define GEE_BENCHMARK_TIM_SORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_TIM_SORT, GeeBenchmarkTimSortClass))

typedef struct _GeeBenchmarkTimSort GeeBenchmarkTimSort;
typedef struct _GeeBenchmarkTimSortClass GeeBenchmarkTimSortClass;
typedef struct _GeeBenchmarkTimSortPrivate GeeBenchmarkTimSortPrivate;

#define GEE_BENCHMARK_TYPE_MERGE_SORT (gee_benchmark_merge_sort_get_type ())
#define GEE_BENCHMARK_MERGE_SORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_MERGE_SORT, GeeBenchmarkMergeSort))
#define GEE_BENCHMARK_MERGE_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_MERGE_SORT, GeeBenchmarkMergeSortClass))
#define GEE_BENCHMARK_IS_MERGE_SORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_MERGE_SORT))
#define GEE_BENCHMARK_IS_MERGE_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_MERGE_SORT))
#define GEE_BENCHMARK_MERGE_SORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_MERGE_SORT, GeeBenchmarkMergeSortClass))

typedef struct _GeeBenchmarkMergeSort GeeBenchmarkMergeSort;
typedef struct _GeeBenchmarkMergeSortClass GeeBenchmarkMergeSortClass;
typedef struct _GeeBenchmarkMergeSortPrivate GeeBenchmarkMergeSortPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GEE_BENCHMARK_TYPE_GENERATOR (gee_benchmark_generator_get_type ())
#define GEE_BENCHMARK_GENERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_GENERATOR, GeeBenchmarkGenerator))
#define GEE_BENCHMARK_IS_GENERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_GENERATOR))
#define GEE_BENCHMARK_GENERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_BENCHMARK_TYPE_GENERATOR, GeeBenchmarkGeneratorIface))

typedef struct _GeeBenchmarkGenerator GeeBenchmarkGenerator;
typedef struct _GeeBenchmarkGeneratorIface GeeBenchmarkGeneratorIface;

#define GEE_BENCHMARK_TYPE_RANDOM_INT32 (gee_benchmark_random_int32_get_type ())
#define GEE_BENCHMARK_RANDOM_INT32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_RANDOM_INT32, GeeBenchmarkRandomInt32))
#define GEE_BENCHMARK_RANDOM_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_RANDOM_INT32, GeeBenchmarkRandomInt32Class))
#define GEE_BENCHMARK_IS_RANDOM_INT32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_RANDOM_INT32))
#define GEE_BENCHMARK_IS_RANDOM_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_RANDOM_INT32))
#define GEE_BENCHMARK_RANDOM_INT32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_RANDOM_INT32, GeeBenchmarkRandomInt32Class))

typedef struct _GeeBenchmarkRandomInt32 GeeBenchmarkRandomInt32;
typedef struct _GeeBenchmarkRandomInt32Class GeeBenchmarkRandomInt32Class;

#define GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32 (gee_benchmark_fixed_variance_int32_get_type ())
#define GEE_BENCHMARK_FIXED_VARIANCE_INT32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32, GeeBenchmarkFixedVarianceInt32))
#define GEE_BENCHMARK_FIXED_VARIANCE_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32, GeeBenchmarkFixedVarianceInt32Class))
#define GEE_BENCHMARK_IS_FIXED_VARIANCE_INT32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32))
#define GEE_BENCHMARK_IS_FIXED_VARIANCE_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32))
#define GEE_BENCHMARK_FIXED_VARIANCE_INT32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32, GeeBenchmarkFixedVarianceInt32Class))

typedef struct _GeeBenchmarkFixedVarianceInt32 GeeBenchmarkFixedVarianceInt32;
typedef struct _GeeBenchmarkFixedVarianceInt32Class GeeBenchmarkFixedVarianceInt32Class;

#define GEE_BENCHMARK_TYPE_MOUNTS_INT32 (gee_benchmark_mounts_int32_get_type ())
#define GEE_BENCHMARK_MOUNTS_INT32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_MOUNTS_INT32, GeeBenchmarkMountsInt32))
#define GEE_BENCHMARK_MOUNTS_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_MOUNTS_INT32, GeeBenchmarkMountsInt32Class))
#define GEE_BENCHMARK_IS_MOUNTS_INT32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_MOUNTS_INT32))
#define GEE_BENCHMARK_IS_MOUNTS_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_MOUNTS_INT32))
#define GEE_BENCHMARK_MOUNTS_INT32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_MOUNTS_INT32, GeeBenchmarkMountsInt32Class))

typedef struct _GeeBenchmarkMountsInt32 GeeBenchmarkMountsInt32;
typedef struct _GeeBenchmarkMountsInt32Class GeeBenchmarkMountsInt32Class;

#define GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32 (gee_benchmark_reverse_sorted_int32_get_type ())
#define GEE_BENCHMARK_REVERSE_SORTED_INT32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32, GeeBenchmarkReverseSortedInt32))
#define GEE_BENCHMARK_REVERSE_SORTED_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32, GeeBenchmarkReverseSortedInt32Class))
#define GEE_BENCHMARK_IS_REVERSE_SORTED_INT32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32))
#define GEE_BENCHMARK_IS_REVERSE_SORTED_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32))
#define GEE_BENCHMARK_REVERSE_SORTED_INT32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32, GeeBenchmarkReverseSortedInt32Class))

typedef struct _GeeBenchmarkReverseSortedInt32 GeeBenchmarkReverseSortedInt32;
typedef struct _GeeBenchmarkReverseSortedInt32Class GeeBenchmarkReverseSortedInt32Class;

#define GEE_BENCHMARK_TYPE_SORTED_INT32 (gee_benchmark_sorted_int32_get_type ())
#define GEE_BENCHMARK_SORTED_INT32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_SORTED_INT32, GeeBenchmarkSortedInt32))
#define GEE_BENCHMARK_SORTED_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_SORTED_INT32, GeeBenchmarkSortedInt32Class))
#define GEE_BENCHMARK_IS_SORTED_INT32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_SORTED_INT32))
#define GEE_BENCHMARK_IS_SORTED_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_SORTED_INT32))
#define GEE_BENCHMARK_SORTED_INT32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_SORTED_INT32, GeeBenchmarkSortedInt32Class))

typedef struct _GeeBenchmarkSortedInt32 GeeBenchmarkSortedInt32;
typedef struct _GeeBenchmarkSortedInt32Class GeeBenchmarkSortedInt32Class;

#define GEE_BENCHMARK_TYPE_BENCHMARK (gee_benchmark_benchmark_get_type ())
#define GEE_BENCHMARK_BENCHMARK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_BENCHMARK, GeeBenchmarkBenchmark))
#define GEE_BENCHMARK_BENCHMARK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_BENCHMARK, GeeBenchmarkBenchmarkClass))
#define GEE_BENCHMARK_IS_BENCHMARK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_BENCHMARK))
#define GEE_BENCHMARK_IS_BENCHMARK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_BENCHMARK))
#define GEE_BENCHMARK_BENCHMARK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_BENCHMARK, GeeBenchmarkBenchmarkClass))

typedef struct _GeeBenchmarkBenchmark GeeBenchmarkBenchmark;
typedef struct _GeeBenchmarkBenchmarkClass GeeBenchmarkBenchmarkClass;

#define GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY (gee_benchmark_array_list_factory_get_type ())
#define GEE_BENCHMARK_ARRAY_LIST_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY, GeeBenchmarkArrayListFactory))
#define GEE_BENCHMARK_ARRAY_LIST_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY, GeeBenchmarkArrayListFactoryClass))
#define GEE_BENCHMARK_IS_ARRAY_LIST_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY))
#define GEE_BENCHMARK_IS_ARRAY_LIST_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY))
#define GEE_BENCHMARK_ARRAY_LIST_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY, GeeBenchmarkArrayListFactoryClass))

typedef struct _GeeBenchmarkArrayListFactory GeeBenchmarkArrayListFactory;
typedef struct _GeeBenchmarkArrayListFactoryClass GeeBenchmarkArrayListFactoryClass;

#define GEE_BENCHMARK_TYPE_FACTORY (gee_benchmark_factory_get_type ())
#define GEE_BENCHMARK_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_FACTORY, GeeBenchmarkFactory))
#define GEE_BENCHMARK_IS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_FACTORY))
#define GEE_BENCHMARK_FACTORY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_BENCHMARK_TYPE_FACTORY, GeeBenchmarkFactoryIface))

typedef struct _GeeBenchmarkFactory GeeBenchmarkFactory;
typedef struct _GeeBenchmarkFactoryIface GeeBenchmarkFactoryIface;

#define GEE_TYPE_MERGE_SORT (gee_merge_sort_get_type ())
#define GEE_MERGE_SORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MERGE_SORT, GeeMergeSort))
#define GEE_MERGE_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_MERGE_SORT, GeeMergeSortClass))
#define GEE_IS_MERGE_SORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MERGE_SORT))
#define GEE_IS_MERGE_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_MERGE_SORT))
#define GEE_MERGE_SORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_MERGE_SORT, GeeMergeSortClass))

typedef struct _GeeMergeSort GeeMergeSort;
typedef struct _GeeMergeSortClass GeeMergeSortClass;
typedef struct _GeeMergeSortPrivate GeeMergeSortPrivate;
#define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL)))
#define _gee_merge_sort_unref0(var) ((var == NULL) ? NULL : (var = (gee_merge_sort_unref (var), NULL)))
typedef struct _GeeParamSpecMergeSort GeeParamSpecMergeSort;

struct _GeeBenchmarkAlgorithmIface {
	GTypeInterface parent_iface;
	void (*process_collection) (GeeBenchmarkAlgorithm* self, GeeCollection* collection);
	const gchar* (*get_name) (GeeBenchmarkAlgorithm* self);
};

struct _GeeBenchmarkTimSort {
	GObject parent_instance;
	GeeBenchmarkTimSortPrivate * priv;
};

struct _GeeBenchmarkTimSortClass {
	GObjectClass parent_class;
};

struct _GeeBenchmarkTimSortPrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
};

struct _GeeBenchmarkMergeSort {
	GObject parent_instance;
	GeeBenchmarkMergeSortPrivate * priv;
};

struct _GeeBenchmarkMergeSortClass {
	GObjectClass parent_class;
};

struct _GeeBenchmarkMergeSortPrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
};

struct _GeeBenchmarkGeneratorIface {
	GTypeInterface parent_iface;
	void (*generate_collection) (GeeBenchmarkGenerator* self, gint size, GeeCollection* collection);
	const gchar* (*get_name) (GeeBenchmarkGenerator* self);
};

struct _GeeBenchmarkFactoryIface {
	GTypeInterface parent_iface;
	GeeCollection* (*create) (GeeBenchmarkFactory* self);
	GeeCollection* (*copy) (GeeBenchmarkFactory* self, GeeCollection* collection);
};

struct _GeeMergeSort {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GeeMergeSortPrivate * priv;
};

struct _GeeMergeSortClass {
	GTypeClass parent_class;
	void (*finalize) (GeeMergeSort *self);
};

struct _GeeMergeSortPrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
	GeeList* list_collection;
	gpointer* array;
	gint array_length1;
	gint _array_size_;
	gpointer* list;
	gint list_length1;
	gint _list_size_;
	gint index;
	gint size;
	GCompareDataFunc compare;
	gpointer compare_target;
	GDestroyNotify compare_target_destroy_notify;
};

struct _GeeParamSpecMergeSort {
	GParamSpec parent_instance;
};


static gpointer gee_benchmark_tim_sort_parent_class = NULL;
static GeeBenchmarkAlgorithmIface* gee_benchmark_tim_sort_gee_benchmark_algorithm_parent_iface = NULL;
static gpointer gee_benchmark_merge_sort_parent_class = NULL;
static GeeBenchmarkAlgorithmIface* gee_benchmark_merge_sort_gee_benchmark_algorithm_parent_iface = NULL;
static gpointer gee_merge_sort_parent_class = NULL;

GType gee_benchmark_algorithm_get_type (void) G_GNUC_CONST;
GType gee_benchmark_tim_sort_get_type (void) G_GNUC_CONST;
#define GEE_BENCHMARK_TIM_SORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_BENCHMARK_TYPE_TIM_SORT, GeeBenchmarkTimSortPrivate))
enum  {
	GEE_BENCHMARK_TIM_SORT_DUMMY_PROPERTY,
	GEE_BENCHMARK_TIM_SORT_G_TYPE,
	GEE_BENCHMARK_TIM_SORT_G_DUP_FUNC,
	GEE_BENCHMARK_TIM_SORT_G_DESTROY_FUNC,
	GEE_BENCHMARK_TIM_SORT_NAME
};
static void gee_benchmark_tim_sort_real_process_collection (GeeBenchmarkAlgorithm* base, GeeCollection* collection);
GeeBenchmarkTimSort* gee_benchmark_tim_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
GeeBenchmarkTimSort* gee_benchmark_tim_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
const gchar* gee_benchmark_algorithm_get_name (GeeBenchmarkAlgorithm* self);
static void _vala_gee_benchmark_tim_sort_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gee_benchmark_tim_sort_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType gee_benchmark_merge_sort_get_type (void) G_GNUC_CONST;
#define GEE_BENCHMARK_MERGE_SORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_BENCHMARK_TYPE_MERGE_SORT, GeeBenchmarkMergeSortPrivate))
enum  {
	GEE_BENCHMARK_MERGE_SORT_DUMMY_PROPERTY,
	GEE_BENCHMARK_MERGE_SORT_G_TYPE,
	GEE_BENCHMARK_MERGE_SORT_G_DUP_FUNC,
	GEE_BENCHMARK_MERGE_SORT_G_DESTROY_FUNC,
	GEE_BENCHMARK_MERGE_SORT_NAME
};
static void gee_benchmark_merge_sort_real_process_collection (GeeBenchmarkAlgorithm* base, GeeCollection* collection);
G_GNUC_INTERNAL void gee_merge_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target);
GeeBenchmarkMergeSort* gee_benchmark_merge_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
GeeBenchmarkMergeSort* gee_benchmark_merge_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
static void _vala_gee_benchmark_merge_sort_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gee_benchmark_merge_sort_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
void gee_benchmark_benchmark_sorts (void);
GType gee_benchmark_generator_get_type (void) G_GNUC_CONST;
GeeBenchmarkRandomInt32* gee_benchmark_random_int32_new (void);
GeeBenchmarkRandomInt32* gee_benchmark_random_int32_construct (GType object_type);
GType gee_benchmark_random_int32_get_type (void) G_GNUC_CONST;
GeeBenchmarkFixedVarianceInt32* gee_benchmark_fixed_variance_int32_new (void);
GeeBenchmarkFixedVarianceInt32* gee_benchmark_fixed_variance_int32_construct (GType object_type);
GType gee_benchmark_fixed_variance_int32_get_type (void) G_GNUC_CONST;
GeeBenchmarkMountsInt32* gee_benchmark_mounts_int32_new (void);
GeeBenchmarkMountsInt32* gee_benchmark_mounts_int32_construct (GType object_type);
GType gee_benchmark_mounts_int32_get_type (void) G_GNUC_CONST;
GeeBenchmarkReverseSortedInt32* gee_benchmark_reverse_sorted_int32_new (void);
GeeBenchmarkReverseSortedInt32* gee_benchmark_reverse_sorted_int32_construct (GType object_type);
GType gee_benchmark_reverse_sorted_int32_get_type (void) G_GNUC_CONST;
GeeBenchmarkSortedInt32* gee_benchmark_sorted_int32_new (void);
GeeBenchmarkSortedInt32* gee_benchmark_sorted_int32_construct (GType object_type);
GType gee_benchmark_sorted_int32_get_type (void) G_GNUC_CONST;
GType gee_benchmark_benchmark_get_type (void) G_GNUC_CONST;
GeeBenchmarkArrayListFactory* gee_benchmark_array_list_factory_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
GeeBenchmarkArrayListFactory* gee_benchmark_array_list_factory_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
GType gee_benchmark_array_list_factory_get_type (void) G_GNUC_CONST;
GType gee_benchmark_factory_get_type (void) G_GNUC_CONST;
GeeBenchmarkBenchmark* gee_benchmark_benchmark_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBenchmarkFactory* factory, GeeList* algorithms, GeeList* generators, gint* sizes, int sizes_length1, gint iteration_count);
GeeBenchmarkBenchmark* gee_benchmark_benchmark_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeBenchmarkFactory* factory, GeeList* algorithms, GeeList* generators, gint* sizes, int sizes_length1, gint iteration_count);
void gee_benchmark_benchmark_run (GeeBenchmarkBenchmark* self);
G_GNUC_INTERNAL gpointer gee_merge_sort_ref (gpointer instance);
G_GNUC_INTERNAL void gee_merge_sort_unref (gpointer instance);
G_GNUC_INTERNAL GParamSpec* gee_param_spec_merge_sort (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
G_GNUC_INTERNAL void gee_value_set_merge_sort (GValue* value, gpointer v_object) G_GNUC_UNUSED;
G_GNUC_INTERNAL void gee_value_take_merge_sort (GValue* value, gpointer v_object);
G_GNUC_INTERNAL gpointer gee_value_get_merge_sort (const GValue* value) G_GNUC_UNUSED;
G_GNUC_INTERNAL GType gee_merge_sort_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define GEE_MERGE_SORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_MERGE_SORT, GeeMergeSortPrivate))
enum  {
	GEE_MERGE_SORT_DUMMY_PROPERTY
};
G_GNUC_INTERNAL void gee_merge_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareDataFunc compare, void* compare_target);
G_GNUC_INTERNAL void gee_merge_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target);
G_GNUC_INTERNAL GeeMergeSort* gee_merge_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
G_GNUC_INTERNAL GeeMergeSort* gee_merge_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
static void gee_merge_sort_do_sort (GeeMergeSort* self);
static void gee_merge_sort_merge_sort_aux (GeeMergeSort* self, gint left, gint right, gpointer* work_area, int work_area_length1);
static void gee_merge_sort_finalize (GeeMergeSort* obj);
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 void gee_benchmark_tim_sort_real_process_collection (GeeBenchmarkAlgorithm* base, GeeCollection* collection) {
	GeeBenchmarkTimSort * self;
	GeeCollection* _tmp0_ = NULL;
	self = (GeeBenchmarkTimSort*) base;
	g_return_if_fail (collection != NULL);
	_tmp0_ = collection;
	gee_list_sort (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_LIST, GeeList), NULL, NULL, NULL);
}


GeeBenchmarkTimSort* gee_benchmark_tim_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) {
	GeeBenchmarkTimSort * self = NULL;
	self = (GeeBenchmarkTimSort*) g_object_new (object_type, NULL);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	return self;
}


GeeBenchmarkTimSort* gee_benchmark_tim_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) {
	return gee_benchmark_tim_sort_construct (GEE_BENCHMARK_TYPE_TIM_SORT, g_type, g_dup_func, g_destroy_func);
}


static const gchar* gee_benchmark_tim_sort_real_get_name (GeeBenchmarkAlgorithm* base) {
	const gchar* result;
	GeeBenchmarkTimSort* self;
	self = (GeeBenchmarkTimSort*) base;
	result = "TimSort";
	return result;
}


static void gee_benchmark_tim_sort_class_init (GeeBenchmarkTimSortClass * klass) {
	gee_benchmark_tim_sort_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeeBenchmarkTimSortPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_gee_benchmark_tim_sort_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gee_benchmark_tim_sort_set_property;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_TIM_SORT_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_TIM_SORT_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_TIM_SORT_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_TIM_SORT_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void gee_benchmark_tim_sort_gee_benchmark_algorithm_interface_init (GeeBenchmarkAlgorithmIface * iface) {
	gee_benchmark_tim_sort_gee_benchmark_algorithm_parent_iface = g_type_interface_peek_parent (iface);
	iface->process_collection = (void (*)(GeeBenchmarkAlgorithm*, GeeCollection*)) gee_benchmark_tim_sort_real_process_collection;
	iface->get_name = gee_benchmark_tim_sort_real_get_name;
}


static void gee_benchmark_tim_sort_instance_init (GeeBenchmarkTimSort * self) {
	self->priv = GEE_BENCHMARK_TIM_SORT_GET_PRIVATE (self);
}


GType gee_benchmark_tim_sort_get_type (void) {
	static volatile gsize gee_benchmark_tim_sort_type_id__volatile = 0;
	if (g_once_init_enter (&gee_benchmark_tim_sort_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeeBenchmarkTimSortClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_benchmark_tim_sort_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeBenchmarkTimSort), 0, (GInstanceInitFunc) gee_benchmark_tim_sort_instance_init, NULL };
		static const GInterfaceInfo gee_benchmark_algorithm_info = { (GInterfaceInitFunc) gee_benchmark_tim_sort_gee_benchmark_algorithm_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gee_benchmark_tim_sort_type_id;
		gee_benchmark_tim_sort_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeBenchmarkTimSort", &g_define_type_info, 0);
		g_type_add_interface_static (gee_benchmark_tim_sort_type_id, GEE_BENCHMARK_TYPE_ALGORITHM, &gee_benchmark_algorithm_info);
		g_once_init_leave (&gee_benchmark_tim_sort_type_id__volatile, gee_benchmark_tim_sort_type_id);
	}
	return gee_benchmark_tim_sort_type_id__volatile;
}


static void _vala_gee_benchmark_tim_sort_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GeeBenchmarkTimSort * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_TIM_SORT, GeeBenchmarkTimSort);
	switch (property_id) {
		case GEE_BENCHMARK_TIM_SORT_NAME:
		g_value_set_string (value, gee_benchmark_algorithm_get_name ((GeeBenchmarkAlgorithm*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gee_benchmark_tim_sort_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GeeBenchmarkTimSort * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_TIM_SORT, GeeBenchmarkTimSort);
	switch (property_id) {
		case GEE_BENCHMARK_TIM_SORT_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEE_BENCHMARK_TIM_SORT_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEE_BENCHMARK_TIM_SORT_G_DESTROY_FUNC:
		self->priv->g_destroy_func = g_value_get_pointer (value);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void gee_benchmark_merge_sort_real_process_collection (GeeBenchmarkAlgorithm* base, GeeCollection* collection) {
	GeeBenchmarkMergeSort * self;
	GCompareDataFunc compare = NULL;
	void* _tmp0_ = NULL;
	GDestroyNotify _tmp1_ = NULL;
	GCompareDataFunc _tmp2_ = NULL;
	void* compare_target = NULL;
	GDestroyNotify compare_target_destroy_notify = NULL;
	GeeCollection* _tmp3_ = NULL;
	self = (GeeBenchmarkMergeSort*) base;
	g_return_if_fail (collection != NULL);
	_tmp2_ = gee_functions_get_compare_func_for (self->priv->g_type, &_tmp0_, &_tmp1_);
	compare = _tmp2_;
	compare_target = _tmp0_;
	compare_target_destroy_notify = _tmp1_;
	_tmp3_ = collection;
	gee_merge_sort_sort (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_LIST, GeeList), compare, compare_target);
	(compare_target_destroy_notify == NULL) ? NULL : (compare_target_destroy_notify (compare_target), NULL);
	compare = NULL;
	compare_target = NULL;
	compare_target_destroy_notify = NULL;
}


GeeBenchmarkMergeSort* gee_benchmark_merge_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) {
	GeeBenchmarkMergeSort * self = NULL;
	self = (GeeBenchmarkMergeSort*) g_object_new (object_type, NULL);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	return self;
}


GeeBenchmarkMergeSort* gee_benchmark_merge_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) {
	return gee_benchmark_merge_sort_construct (GEE_BENCHMARK_TYPE_MERGE_SORT, g_type, g_dup_func, g_destroy_func);
}


static const gchar* gee_benchmark_merge_sort_real_get_name (GeeBenchmarkAlgorithm* base) {
	const gchar* result;
	GeeBenchmarkMergeSort* self;
	self = (GeeBenchmarkMergeSort*) base;
	result = "MergeSort";
	return result;
}


static void gee_benchmark_merge_sort_class_init (GeeBenchmarkMergeSortClass * klass) {
	gee_benchmark_merge_sort_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeeBenchmarkMergeSortPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_gee_benchmark_merge_sort_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gee_benchmark_merge_sort_set_property;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_MERGE_SORT_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_MERGE_SORT_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_MERGE_SORT_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_MERGE_SORT_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void gee_benchmark_merge_sort_gee_benchmark_algorithm_interface_init (GeeBenchmarkAlgorithmIface * iface) {
	gee_benchmark_merge_sort_gee_benchmark_algorithm_parent_iface = g_type_interface_peek_parent (iface);
	iface->process_collection = (void (*)(GeeBenchmarkAlgorithm*, GeeCollection*)) gee_benchmark_merge_sort_real_process_collection;
	iface->get_name = gee_benchmark_merge_sort_real_get_name;
}


static void gee_benchmark_merge_sort_instance_init (GeeBenchmarkMergeSort * self) {
	self->priv = GEE_BENCHMARK_MERGE_SORT_GET_PRIVATE (self);
}


GType gee_benchmark_merge_sort_get_type (void) {
	static volatile gsize gee_benchmark_merge_sort_type_id__volatile = 0;
	if (g_once_init_enter (&gee_benchmark_merge_sort_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeeBenchmarkMergeSortClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_benchmark_merge_sort_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeBenchmarkMergeSort), 0, (GInstanceInitFunc) gee_benchmark_merge_sort_instance_init, NULL };
		static const GInterfaceInfo gee_benchmark_algorithm_info = { (GInterfaceInitFunc) gee_benchmark_merge_sort_gee_benchmark_algorithm_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gee_benchmark_merge_sort_type_id;
		gee_benchmark_merge_sort_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeBenchmarkMergeSort", &g_define_type_info, 0);
		g_type_add_interface_static (gee_benchmark_merge_sort_type_id, GEE_BENCHMARK_TYPE_ALGORITHM, &gee_benchmark_algorithm_info);
		g_once_init_leave (&gee_benchmark_merge_sort_type_id__volatile, gee_benchmark_merge_sort_type_id);
	}
	return gee_benchmark_merge_sort_type_id__volatile;
}


static void _vala_gee_benchmark_merge_sort_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GeeBenchmarkMergeSort * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_MERGE_SORT, GeeBenchmarkMergeSort);
	switch (property_id) {
		case GEE_BENCHMARK_MERGE_SORT_NAME:
		g_value_set_string (value, gee_benchmark_algorithm_get_name ((GeeBenchmarkAlgorithm*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gee_benchmark_merge_sort_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GeeBenchmarkMergeSort * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_MERGE_SORT, GeeBenchmarkMergeSort);
	switch (property_id) {
		case GEE_BENCHMARK_MERGE_SORT_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEE_BENCHMARK_MERGE_SORT_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEE_BENCHMARK_MERGE_SORT_G_DESTROY_FUNC:
		self->priv->g_destroy_func = g_value_get_pointer (value);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


void gee_benchmark_benchmark_sorts (void) {
	GeeArrayList* algorithms = NULL;
	GeeArrayList* _tmp0_ = NULL;
	GeeBenchmarkTimSort* _tmp1_ = NULL;
	GeeBenchmarkTimSort* _tmp2_ = NULL;
	GeeBenchmarkMergeSort* _tmp3_ = NULL;
	GeeBenchmarkMergeSort* _tmp4_ = NULL;
	GeeArrayList* generators = NULL;
	GeeArrayList* _tmp5_ = NULL;
	GeeBenchmarkRandomInt32* _tmp6_ = NULL;
	GeeBenchmarkRandomInt32* _tmp7_ = NULL;
	GeeBenchmarkFixedVarianceInt32* _tmp8_ = NULL;
	GeeBenchmarkFixedVarianceInt32* _tmp9_ = NULL;
	GeeBenchmarkMountsInt32* _tmp10_ = NULL;
	GeeBenchmarkMountsInt32* _tmp11_ = NULL;
	GeeBenchmarkReverseSortedInt32* _tmp12_ = NULL;
	GeeBenchmarkReverseSortedInt32* _tmp13_ = NULL;
	GeeBenchmarkSortedInt32* _tmp14_ = NULL;
	GeeBenchmarkSortedInt32* _tmp15_ = NULL;
	GeeBenchmarkBenchmark* benchmark = NULL;
	GeeBenchmarkArrayListFactory* _tmp16_ = NULL;
	GeeBenchmarkArrayListFactory* _tmp17_ = NULL;
	gint* _tmp18_ = NULL;
	gint* _tmp19_ = NULL;
	gint _tmp19__length1 = 0;
	GeeBenchmarkBenchmark* _tmp20_ = NULL;
	GeeBenchmarkBenchmark* _tmp21_ = NULL;
	_tmp0_ = gee_array_list_new (GEE_BENCHMARK_TYPE_ALGORITHM, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
	algorithms = _tmp0_;
	_tmp1_ = gee_benchmark_tim_sort_new (G_TYPE_INT, NULL, NULL);
	_tmp2_ = _tmp1_;
	gee_abstract_collection_add ((GeeAbstractCollection*) algorithms, (GeeBenchmarkAlgorithm*) _tmp2_);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = gee_benchmark_merge_sort_new (G_TYPE_INT, NULL, NULL);
	_tmp4_ = _tmp3_;
	gee_abstract_collection_add ((GeeAbstractCollection*) algorithms, (GeeBenchmarkAlgorithm*) _tmp4_);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = gee_array_list_new (GEE_BENCHMARK_TYPE_GENERATOR, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
	generators = _tmp5_;
	_tmp6_ = gee_benchmark_random_int32_new ();
	_tmp7_ = _tmp6_;
	gee_abstract_collection_add ((GeeAbstractCollection*) generators, (GeeBenchmarkGenerator*) _tmp7_);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = gee_benchmark_fixed_variance_int32_new ();
	_tmp9_ = _tmp8_;
	gee_abstract_collection_add ((GeeAbstractCollection*) generators, (GeeBenchmarkGenerator*) _tmp9_);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = gee_benchmark_mounts_int32_new ();
	_tmp11_ = _tmp10_;
	gee_abstract_collection_add ((GeeAbstractCollection*) generators, (GeeBenchmarkGenerator*) _tmp11_);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = gee_benchmark_reverse_sorted_int32_new ();
	_tmp13_ = _tmp12_;
	gee_abstract_collection_add ((GeeAbstractCollection*) generators, (GeeBenchmarkGenerator*) _tmp13_);
	_g_object_unref0 (_tmp13_);
	_tmp14_ = gee_benchmark_sorted_int32_new ();
	_tmp15_ = _tmp14_;
	gee_abstract_collection_add ((GeeAbstractCollection*) generators, (GeeBenchmarkGenerator*) _tmp15_);
	_g_object_unref0 (_tmp15_);
	_tmp16_ = gee_benchmark_array_list_factory_new (G_TYPE_INT, NULL, NULL);
	_tmp17_ = _tmp16_;
	_tmp18_ = g_new0 (gint, 6);
	_tmp18_[0] = 10;
	_tmp18_[1] = 100;
	_tmp18_[2] = 1000;
	_tmp18_[3] = 10000;
	_tmp18_[4] = 100000;
	_tmp18_[5] = 1000000;
	_tmp19_ = _tmp18_;
	_tmp19__length1 = 6;
	_tmp20_ = gee_benchmark_benchmark_new (G_TYPE_INT, NULL, NULL, (GeeBenchmarkFactory*) _tmp17_, (GeeList*) algorithms, (GeeList*) generators, _tmp19_, 6, 1000);
	_tmp21_ = _tmp20_;
	_tmp19_ = (g_free (_tmp19_), NULL);
	_g_object_unref0 (_tmp17_);
	benchmark = _tmp21_;
	gee_benchmark_benchmark_run (benchmark);
	_g_object_unref0 (benchmark);
	_g_object_unref0 (generators);
	_g_object_unref0 (algorithms);
}


G_GNUC_INTERNAL void gee_merge_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target) {
	GeeList* _tmp0_ = NULL;
	g_return_if_fail (list != NULL);
	_tmp0_ = list;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_ARRAY_LIST)) {
		GeeList* _tmp1_ = NULL;
		GCompareDataFunc _tmp2_ = NULL;
		void* _tmp2__target = NULL;
		_tmp1_ = list;
		_tmp2_ = compare;
		_tmp2__target = compare_target;
		gee_merge_sort_sort_arraylist (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ARRAY_LIST, GeeArrayList), _tmp2_, _tmp2__target);
	} else {
		GeeList* _tmp3_ = NULL;
		GCompareDataFunc _tmp4_ = NULL;
		void* _tmp4__target = NULL;
		_tmp3_ = list;
		_tmp4_ = compare;
		_tmp4__target = compare_target;
		gee_merge_sort_sort_list (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp3_, _tmp4_, _tmp4__target);
	}
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


G_GNUC_INTERNAL void gee_merge_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target) {
	GeeMergeSort* helper = NULL;
	GeeMergeSort* _tmp0_ = NULL;
	GeeMergeSort* _tmp1_ = NULL;
	GeeList* _tmp2_ = NULL;
	GeeList* _tmp3_ = NULL;
	GeeMergeSort* _tmp4_ = NULL;
	GeeList* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	gpointer* _tmp7_ = NULL;
	GeeMergeSort* _tmp8_ = NULL;
	GeeMergeSort* _tmp9_ = NULL;
	gpointer* _tmp10_ = NULL;
	gint _tmp10__length1 = 0;
	GeeMergeSort* _tmp11_ = NULL;
	GeeMergeSort* _tmp12_ = NULL;
	GeeList* _tmp13_ = NULL;
	gint _tmp14_ = 0;
	gint _tmp15_ = 0;
	GeeMergeSort* _tmp16_ = NULL;
	GCompareDataFunc _tmp17_ = NULL;
	void* _tmp17__target = NULL;
	GeeMergeSort* _tmp18_ = NULL;
	GeeList* _tmp19_ = NULL;
	GeeMergeSort* _tmp20_ = NULL;
	gpointer* _tmp21_ = NULL;
	gint _tmp21__length1 = 0;
	g_return_if_fail (list != NULL);
	_tmp0_ = gee_merge_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func);
	helper = _tmp0_;
	_tmp1_ = helper;
	_tmp2_ = list;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (_tmp1_->priv->list_collection);
	_tmp1_->priv->list_collection = _tmp3_;
	_tmp4_ = helper;
	_tmp5_ = list;
	_tmp7_ = gee_collection_to_array ((GeeCollection*) _tmp5_, &_tmp6_);
	_tmp4_->priv->array = (_vala_array_free (_tmp4_->priv->array, _tmp4_->priv->array_length1, (GDestroyNotify) g_destroy_func), NULL);
	_tmp4_->priv->array = _tmp7_;
	_tmp4_->priv->array_length1 = _tmp6_;
	_tmp4_->priv->_array_size_ = _tmp4_->priv->array_length1;
	_tmp8_ = helper;
	_tmp9_ = helper;
	_tmp10_ = _tmp9_->priv->array;
	_tmp10__length1 = _tmp9_->priv->array_length1;
	_tmp8_->priv->list = _tmp10_;
	_tmp8_->priv->list_length1 = _tmp10__length1;
	_tmp8_->priv->_list_size_ = _tmp8_->priv->list_length1;
	_tmp11_ = helper;
	_tmp11_->priv->index = 0;
	_tmp12_ = helper;
	_tmp13_ = list;
	_tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_);
	_tmp15_ = _tmp14_;
	_tmp12_->priv->size = _tmp15_;
	_tmp16_ = helper;
	_tmp17_ = compare;
	_tmp17__target = compare_target;
	(_tmp16_->priv->compare_target_destroy_notify == NULL) ? NULL : (_tmp16_->priv->compare_target_destroy_notify (_tmp16_->priv->compare_target), NULL);
	_tmp16_->priv->compare = NULL;
	_tmp16_->priv->compare_target = NULL;
	_tmp16_->priv->compare_target_destroy_notify = NULL;
	_tmp16_->priv->compare = _tmp17_;
	_tmp16_->priv->compare_target = _tmp17__target;
	_tmp16_->priv->compare_target_destroy_notify = NULL;
	_tmp18_ = helper;
	gee_merge_sort_do_sort (_tmp18_);
	_tmp19_ = list;
	gee_collection_clear ((GeeCollection*) _tmp19_);
	_tmp20_ = helper;
	_tmp21_ = _tmp20_->priv->array;
	_tmp21__length1 = _tmp20_->priv->array_length1;
	{
		gpointer* item_collection = NULL;
		gint item_collection_length1 = 0;
		gint _item_collection_size_ = 0;
		gint item_it = 0;
		item_collection = _tmp21_;
		item_collection_length1 = _tmp21__length1;
		for (item_it = 0; item_it < _tmp21__length1; item_it = item_it + 1) {
			gpointer _tmp22_ = NULL;
			gpointer item = NULL;
			_tmp22_ = ((item_collection[item_it] != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) item_collection[item_it]) : ((gpointer) item_collection[item_it]);
			item = _tmp22_;
			{
				GeeList* _tmp23_ = NULL;
				gconstpointer _tmp24_ = NULL;
				_tmp23_ = list;
				_tmp24_ = item;
				gee_collection_add ((GeeCollection*) _tmp23_, _tmp24_);
				_g_destroy_func0 (item);
			}
		}
	}
	_gee_merge_sort_unref0 (helper);
}


G_GNUC_INTERNAL void gee_merge_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareDataFunc compare, void* compare_target) {
	GeeMergeSort* helper = NULL;
	GeeMergeSort* _tmp0_ = NULL;
	GeeArrayList* _tmp1_ = NULL;
	GeeList* _tmp2_ = NULL;
	GeeArrayList* _tmp3_ = NULL;
	gpointer* _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	GeeArrayList* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	GCompareDataFunc _tmp7_ = NULL;
	void* _tmp7__target = NULL;
	g_return_if_fail (list != NULL);
	_tmp0_ = gee_merge_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func);
	helper = _tmp0_;
	_tmp1_ = list;
	_tmp2_ = _g_object_ref0 ((GeeList*) _tmp1_);
	_g_object_unref0 (helper->priv->list_collection);
	helper->priv->list_collection = _tmp2_;
	_tmp3_ = list;
	_tmp4_ = _tmp3_->_items;
	_tmp4__length1 = _tmp3_->_items_length1;
	helper->priv->list = _tmp4_;
	helper->priv->list_length1 = _tmp4__length1;
	helper->priv->_list_size_ = helper->priv->list_length1;
	helper->priv->index = 0;
	_tmp5_ = list;
	_tmp6_ = _tmp5_->_size;
	helper->priv->size = _tmp6_;
	_tmp7_ = compare;
	_tmp7__target = compare_target;
	(helper->priv->compare_target_destroy_notify == NULL) ? NULL : (helper->priv->compare_target_destroy_notify (helper->priv->compare_target), NULL);
	helper->priv->compare = NULL;
	helper->priv->compare_target = NULL;
	helper->priv->compare_target_destroy_notify = NULL;
	helper->priv->compare = _tmp7_;
	helper->priv->compare_target = _tmp7__target;
	helper->priv->compare_target_destroy_notify = NULL;
	gee_merge_sort_do_sort (helper);
	_gee_merge_sort_unref0 (helper);
}


static void gee_merge_sort_do_sort (GeeMergeSort* self) {
	gint _tmp0_ = 0;
	gpointer* work_area = NULL;
	gint _tmp1_ = 0;
	gpointer* _tmp2_ = NULL;
	gint work_area_length1 = 0;
	gint _work_area_size_ = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	gpointer* _tmp5_ = NULL;
	gint _tmp5__length1 = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->size;
	if (_tmp0_ <= 1) {
		return;
	}
	_tmp1_ = self->priv->size;
	_tmp2_ = g_new0 (gpointer, _tmp1_);
	work_area = _tmp2_;
	work_area_length1 = _tmp1_;
	_work_area_size_ = work_area_length1;
	_tmp3_ = self->priv->index;
	_tmp4_ = self->priv->size;
	_tmp5_ = work_area;
	_tmp5__length1 = work_area_length1;
	gee_merge_sort_merge_sort_aux (self, _tmp3_, _tmp4_, _tmp5_, _tmp5__length1);
	work_area = (_vala_array_free (work_area, work_area_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL);
}


static void gee_merge_sort_merge_sort_aux (GeeMergeSort* self, gint left, gint right, gpointer* work_area, int work_area_length1) {
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = right;
	_tmp1_ = left;
	if (_tmp0_ == (_tmp1_ + 1)) {
		return;
	} else {
		gint size = 0;
		gint _tmp2_ = 0;
		gint _tmp3_ = 0;
		gint middle = 0;
		gint _tmp4_ = 0;
		gint lbegin = 0;
		gint _tmp5_ = 0;
		gint rbegin = 0;
		gint _tmp6_ = 0;
		gint _tmp7_ = 0;
		gint _tmp8_ = 0;
		gint _tmp9_ = 0;
		gint _tmp10_ = 0;
		gpointer* _tmp11_ = NULL;
		gint _tmp11__length1 = 0;
		gint _tmp12_ = 0;
		gint _tmp13_ = 0;
		gint _tmp14_ = 0;
		gpointer* _tmp15_ = NULL;
		gint _tmp15__length1 = 0;
		_tmp2_ = right;
		_tmp3_ = left;
		size = _tmp2_ - _tmp3_;
		_tmp4_ = size;
		middle = _tmp4_ / 2;
		_tmp5_ = left;
		lbegin = _tmp5_;
		_tmp6_ = left;
		_tmp7_ = middle;
		rbegin = _tmp6_ + _tmp7_;
		_tmp8_ = left;
		_tmp9_ = left;
		_tmp10_ = middle;
		_tmp11_ = work_area;
		_tmp11__length1 = work_area_length1;
		gee_merge_sort_merge_sort_aux (self, _tmp8_, _tmp9_ + _tmp10_, _tmp11_, _tmp11__length1);
		_tmp12_ = left;
		_tmp13_ = middle;
		_tmp14_ = right;
		_tmp15_ = work_area;
		_tmp15__length1 = work_area_length1;
		gee_merge_sort_merge_sort_aux (self, _tmp12_ + _tmp13_, _tmp14_, _tmp15_, _tmp15__length1);
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp16_ = FALSE;
				_tmp16_ = TRUE;
				while (TRUE) {
					gint _tmp18_ = 0;
					gint _tmp19_ = 0;
					gboolean _tmp20_ = FALSE;
					gint _tmp21_ = 0;
					gint _tmp22_ = 0;
					gint _tmp23_ = 0;
					if (!_tmp16_) {
						gint _tmp17_ = 0;
						_tmp17_ = i;
						i = _tmp17_ + 1;
					}
					_tmp16_ = FALSE;
					_tmp18_ = i;
					_tmp19_ = size;
					if (!(_tmp18_ < _tmp19_)) {
						break;
					}
					_tmp21_ = lbegin;
					_tmp22_ = left;
					_tmp23_ = middle;
					if (_tmp21_ < (_tmp22_ + _tmp23_)) {
						gboolean _tmp24_ = FALSE;
						gint _tmp25_ = 0;
						gint _tmp26_ = 0;
						_tmp25_ = rbegin;
						_tmp26_ = right;
						if (_tmp25_ == _tmp26_) {
							_tmp24_ = TRUE;
						} else {
							GCompareDataFunc _tmp27_ = NULL;
							void* _tmp27__target = NULL;
							gpointer* _tmp28_ = NULL;
							gint _tmp28__length1 = 0;
							gint _tmp29_ = 0;
							gconstpointer _tmp30_ = NULL;
							gpointer* _tmp31_ = NULL;
							gint _tmp31__length1 = 0;
							gint _tmp32_ = 0;
							gconstpointer _tmp33_ = NULL;
							gint _tmp34_ = 0;
							_tmp27_ = self->priv->compare;
							_tmp27__target = self->priv->compare_target;
							_tmp28_ = self->priv->list;
							_tmp28__length1 = self->priv->list_length1;
							_tmp29_ = lbegin;
							_tmp30_ = _tmp28_[_tmp29_];
							_tmp31_ = self->priv->list;
							_tmp31__length1 = self->priv->list_length1;
							_tmp32_ = rbegin;
							_tmp33_ = _tmp31_[_tmp32_];
							_tmp34_ = _tmp27_ (_tmp30_, _tmp33_, _tmp27__target);
							_tmp24_ = _tmp34_ <= 0;
						}
						_tmp20_ = _tmp24_;
					} else {
						_tmp20_ = FALSE;
					}
					if (_tmp20_) {
						gpointer* _tmp35_ = NULL;
						gint _tmp35__length1 = 0;
						gint _tmp36_ = 0;
						gpointer* _tmp37_ = NULL;
						gint _tmp37__length1 = 0;
						gint _tmp38_ = 0;
						gconstpointer _tmp39_ = NULL;
						gpointer _tmp40_ = NULL;
						gpointer _tmp41_ = NULL;
						gint _tmp42_ = 0;
						_tmp35_ = work_area;
						_tmp35__length1 = work_area_length1;
						_tmp36_ = i;
						_tmp37_ = self->priv->list;
						_tmp37__length1 = self->priv->list_length1;
						_tmp38_ = lbegin;
						_tmp39_ = _tmp37_[_tmp38_];
						_tmp40_ = ((_tmp39_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp39_) : ((gpointer) _tmp39_);
						((_tmp35_[_tmp36_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp35_[_tmp36_] = (self->priv->g_destroy_func (_tmp35_[_tmp36_]), NULL));
						_tmp35_[_tmp36_] = _tmp40_;
						_tmp41_ = _tmp35_[_tmp36_];
						_tmp42_ = lbegin;
						lbegin = _tmp42_ + 1;
					} else {
						gpointer* _tmp43_ = NULL;
						gint _tmp43__length1 = 0;
						gint _tmp44_ = 0;
						gpointer* _tmp45_ = NULL;
						gint _tmp45__length1 = 0;
						gint _tmp46_ = 0;
						gconstpointer _tmp47_ = NULL;
						gpointer _tmp48_ = NULL;
						gpointer _tmp49_ = NULL;
						gint _tmp50_ = 0;
						_tmp43_ = work_area;
						_tmp43__length1 = work_area_length1;
						_tmp44_ = i;
						_tmp45_ = self->priv->list;
						_tmp45__length1 = self->priv->list_length1;
						_tmp46_ = rbegin;
						_tmp47_ = _tmp45_[_tmp46_];
						_tmp48_ = ((_tmp47_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp47_) : ((gpointer) _tmp47_);
						((_tmp43_[_tmp44_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp43_[_tmp44_] = (self->priv->g_destroy_func (_tmp43_[_tmp44_]), NULL));
						_tmp43_[_tmp44_] = _tmp48_;
						_tmp49_ = _tmp43_[_tmp44_];
						_tmp50_ = rbegin;
						rbegin = _tmp50_ + 1;
					}
				}
			}
		}
		{
			gint i = 0;
			gint _tmp51_ = 0;
			_tmp51_ = left;
			i = _tmp51_;
			{
				gboolean _tmp52_ = FALSE;
				_tmp52_ = TRUE;
				while (TRUE) {
					gint _tmp54_ = 0;
					gint _tmp55_ = 0;
					gpointer* _tmp56_ = NULL;
					gint _tmp56__length1 = 0;
					gint _tmp57_ = 0;
					gpointer* _tmp58_ = NULL;
					gint _tmp58__length1 = 0;
					gint _tmp59_ = 0;
					gint _tmp60_ = 0;
					gconstpointer _tmp61_ = NULL;
					gpointer _tmp62_ = NULL;
					gpointer _tmp63_ = NULL;
					if (!_tmp52_) {
						gint _tmp53_ = 0;
						_tmp53_ = i;
						i = _tmp53_ + 1;
					}
					_tmp52_ = FALSE;
					_tmp54_ = i;
					_tmp55_ = right;
					if (!(_tmp54_ < _tmp55_)) {
						break;
					}
					_tmp56_ = self->priv->list;
					_tmp56__length1 = self->priv->list_length1;
					_tmp57_ = i;
					_tmp58_ = work_area;
					_tmp58__length1 = work_area_length1;
					_tmp59_ = i;
					_tmp60_ = left;
					_tmp61_ = _tmp58_[_tmp59_ - _tmp60_];
					_tmp62_ = ((_tmp61_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp61_) : ((gpointer) _tmp61_);
					((_tmp56_[_tmp57_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp56_[_tmp57_] = (self->priv->g_destroy_func (_tmp56_[_tmp57_]), NULL));
					_tmp56_[_tmp57_] = _tmp62_;
					_tmp63_ = _tmp56_[_tmp57_];
				}
			}
		}
	}
}


G_GNUC_INTERNAL GeeMergeSort* gee_merge_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) {
	GeeMergeSort* self = NULL;
	self = (GeeMergeSort*) g_type_create_instance (object_type);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	return self;
}


G_GNUC_INTERNAL GeeMergeSort* gee_merge_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) {
	return gee_merge_sort_construct (GEE_TYPE_MERGE_SORT, g_type, g_dup_func, g_destroy_func);
}


static void gee_value_merge_sort_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void gee_value_merge_sort_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		gee_merge_sort_unref (value->data[0].v_pointer);
	}
}


static void gee_value_merge_sort_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = gee_merge_sort_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer gee_value_merge_sort_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* gee_value_merge_sort_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		GeeMergeSort* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = gee_merge_sort_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* gee_value_merge_sort_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	GeeMergeSort** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = gee_merge_sort_ref (value->data[0].v_pointer);
	}
	return NULL;
}


G_GNUC_INTERNAL GParamSpec* gee_param_spec_merge_sort (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	GeeParamSpecMergeSort* spec;
	g_return_val_if_fail (g_type_is_a (object_type, GEE_TYPE_MERGE_SORT), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


G_GNUC_INTERNAL gpointer gee_value_get_merge_sort (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TYPE_MERGE_SORT), NULL);
	return value->data[0].v_pointer;
}


G_GNUC_INTERNAL void gee_value_set_merge_sort (GValue* value, gpointer v_object) {
	GeeMergeSort* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TYPE_MERGE_SORT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TYPE_MERGE_SORT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		gee_merge_sort_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gee_merge_sort_unref (old);
	}
}


G_GNUC_INTERNAL void gee_value_take_merge_sort (GValue* value, gpointer v_object) {
	GeeMergeSort* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TYPE_MERGE_SORT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TYPE_MERGE_SORT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gee_merge_sort_unref (old);
	}
}


static void gee_merge_sort_class_init (GeeMergeSortClass * klass) {
	gee_merge_sort_parent_class = g_type_class_peek_parent (klass);
	GEE_MERGE_SORT_CLASS (klass)->finalize = gee_merge_sort_finalize;
	g_type_class_add_private (klass, sizeof (GeeMergeSortPrivate));
}


static void gee_merge_sort_instance_init (GeeMergeSort * self) {
	self->priv = GEE_MERGE_SORT_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void gee_merge_sort_finalize (GeeMergeSort* obj) {
	GeeMergeSort * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_MERGE_SORT, GeeMergeSort);
	_g_object_unref0 (self->priv->list_collection);
	self->priv->array = (_vala_array_free (self->priv->array, self->priv->array_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL);
	(self->priv->compare_target_destroy_notify == NULL) ? NULL : (self->priv->compare_target_destroy_notify (self->priv->compare_target), NULL);
	self->priv->compare = NULL;
	self->priv->compare_target = NULL;
	self->priv->compare_target_destroy_notify = NULL;
}


G_GNUC_INTERNAL GType gee_merge_sort_get_type (void) {
	static volatile gsize gee_merge_sort_type_id__volatile = 0;
	if (g_once_init_enter (&gee_merge_sort_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { gee_value_merge_sort_init, gee_value_merge_sort_free_value, gee_value_merge_sort_copy_value, gee_value_merge_sort_peek_pointer, "p", gee_value_merge_sort_collect_value, "p", gee_value_merge_sort_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (GeeMergeSortClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_merge_sort_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeMergeSort), 0, (GInstanceInitFunc) gee_merge_sort_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType gee_merge_sort_type_id;
		gee_merge_sort_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeeMergeSort", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&gee_merge_sort_type_id__volatile, gee_merge_sort_type_id);
	}
	return gee_merge_sort_type_id__volatile;
}


G_GNUC_INTERNAL gpointer gee_merge_sort_ref (gpointer instance) {
	GeeMergeSort* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


G_GNUC_INTERNAL void gee_merge_sort_unref (gpointer instance) {
	GeeMergeSort* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GEE_MERGE_SORT_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


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);
}



