/* benchmarksorts.c generated by valac 0.21.2.4-6740f, 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);
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);
gpointer gee_merge_sort_ref (gpointer instance);
void gee_merge_sort_unref (gpointer instance);
GParamSpec* gee_param_spec_merge_sort (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void gee_value_set_merge_sort (GValue* value, gpointer v_object);
void gee_value_take_merge_sort (GValue* value, gpointer v_object);
gpointer gee_value_get_merge_sort (const GValue* value);
GType gee_merge_sort_get_type (void) G_GNUC_CONST;
#define GEE_MERGE_SORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_MERGE_SORT, GeeMergeSortPrivate))
enum  {
	GEE_MERGE_SORT_DUMMY_PROPERTY
};
void gee_merge_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareDataFunc compare, void* compare_target);
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* gee_merge_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
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);
}


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


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


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) {
					gboolean _tmp17_ = FALSE;
					gint _tmp19_ = 0;
					gint _tmp20_ = 0;
					gboolean _tmp21_ = FALSE;
					gint _tmp22_ = 0;
					gint _tmp23_ = 0;
					gint _tmp24_ = 0;
					gboolean _tmp37_ = FALSE;
					_tmp17_ = _tmp16_;
					if (!_tmp17_) {
						gint _tmp18_ = 0;
						_tmp18_ = i;
						i = _tmp18_ + 1;
					}
					_tmp16_ = FALSE;
					_tmp19_ = i;
					_tmp20_ = size;
					if (!(_tmp19_ < _tmp20_)) {
						break;
					}
					_tmp22_ = lbegin;
					_tmp23_ = left;
					_tmp24_ = middle;
					if (_tmp22_ < (_tmp23_ + _tmp24_)) {
						gboolean _tmp25_ = FALSE;
						gint _tmp26_ = 0;
						gint _tmp27_ = 0;
						gboolean _tmp36_ = FALSE;
						_tmp26_ = rbegin;
						_tmp27_ = right;
						if (_tmp26_ == _tmp27_) {
							_tmp25_ = TRUE;
						} else {
							GCompareDataFunc _tmp28_ = NULL;
							void* _tmp28__target = NULL;
							gpointer* _tmp29_ = NULL;
							gint _tmp29__length1 = 0;
							gint _tmp30_ = 0;
							gconstpointer _tmp31_ = NULL;
							gpointer* _tmp32_ = NULL;
							gint _tmp32__length1 = 0;
							gint _tmp33_ = 0;
							gconstpointer _tmp34_ = NULL;
							gint _tmp35_ = 0;
							_tmp28_ = self->priv->compare;
							_tmp28__target = self->priv->compare_target;
							_tmp29_ = self->priv->list;
							_tmp29__length1 = self->priv->list_length1;
							_tmp30_ = lbegin;
							_tmp31_ = _tmp29_[_tmp30_];
							_tmp32_ = self->priv->list;
							_tmp32__length1 = self->priv->list_length1;
							_tmp33_ = rbegin;
							_tmp34_ = _tmp32_[_tmp33_];
							_tmp35_ = _tmp28_ (_tmp31_, _tmp34_, _tmp28__target);
							_tmp25_ = _tmp35_ <= 0;
						}
						_tmp36_ = _tmp25_;
						_tmp21_ = _tmp36_;
					} else {
						_tmp21_ = FALSE;
					}
					_tmp37_ = _tmp21_;
					if (_tmp37_) {
						gpointer* _tmp38_ = NULL;
						gint _tmp38__length1 = 0;
						gint _tmp39_ = 0;
						gpointer* _tmp40_ = NULL;
						gint _tmp40__length1 = 0;
						gint _tmp41_ = 0;
						gconstpointer _tmp42_ = NULL;
						gpointer _tmp43_ = NULL;
						gpointer _tmp44_ = NULL;
						gint _tmp45_ = 0;
						_tmp38_ = work_area;
						_tmp38__length1 = work_area_length1;
						_tmp39_ = i;
						_tmp40_ = self->priv->list;
						_tmp40__length1 = self->priv->list_length1;
						_tmp41_ = lbegin;
						_tmp42_ = _tmp40_[_tmp41_];
						_tmp43_ = ((_tmp42_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp42_) : ((gpointer) _tmp42_);
						((_tmp38_[_tmp39_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp38_[_tmp39_] = (self->priv->g_destroy_func (_tmp38_[_tmp39_]), NULL));
						_tmp38_[_tmp39_] = _tmp43_;
						_tmp44_ = _tmp38_[_tmp39_];
						_tmp45_ = lbegin;
						lbegin = _tmp45_ + 1;
					} else {
						gpointer* _tmp46_ = NULL;
						gint _tmp46__length1 = 0;
						gint _tmp47_ = 0;
						gpointer* _tmp48_ = NULL;
						gint _tmp48__length1 = 0;
						gint _tmp49_ = 0;
						gconstpointer _tmp50_ = NULL;
						gpointer _tmp51_ = NULL;
						gpointer _tmp52_ = NULL;
						gint _tmp53_ = 0;
						_tmp46_ = work_area;
						_tmp46__length1 = work_area_length1;
						_tmp47_ = i;
						_tmp48_ = self->priv->list;
						_tmp48__length1 = self->priv->list_length1;
						_tmp49_ = rbegin;
						_tmp50_ = _tmp48_[_tmp49_];
						_tmp51_ = ((_tmp50_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp50_) : ((gpointer) _tmp50_);
						((_tmp46_[_tmp47_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp46_[_tmp47_] = (self->priv->g_destroy_func (_tmp46_[_tmp47_]), NULL));
						_tmp46_[_tmp47_] = _tmp51_;
						_tmp52_ = _tmp46_[_tmp47_];
						_tmp53_ = rbegin;
						rbegin = _tmp53_ + 1;
					}
				}
			}
		}
		{
			gint i = 0;
			gint _tmp54_ = 0;
			_tmp54_ = left;
			i = _tmp54_;
			{
				gboolean _tmp55_ = FALSE;
				_tmp55_ = TRUE;
				while (TRUE) {
					gboolean _tmp56_ = FALSE;
					gint _tmp58_ = 0;
					gint _tmp59_ = 0;
					gpointer* _tmp60_ = NULL;
					gint _tmp60__length1 = 0;
					gint _tmp61_ = 0;
					gpointer* _tmp62_ = NULL;
					gint _tmp62__length1 = 0;
					gint _tmp63_ = 0;
					gint _tmp64_ = 0;
					gconstpointer _tmp65_ = NULL;
					gpointer _tmp66_ = NULL;
					gpointer _tmp67_ = NULL;
					_tmp56_ = _tmp55_;
					if (!_tmp56_) {
						gint _tmp57_ = 0;
						_tmp57_ = i;
						i = _tmp57_ + 1;
					}
					_tmp55_ = FALSE;
					_tmp58_ = i;
					_tmp59_ = right;
					if (!(_tmp58_ < _tmp59_)) {
						break;
					}
					_tmp60_ = self->priv->list;
					_tmp60__length1 = self->priv->list_length1;
					_tmp61_ = i;
					_tmp62_ = work_area;
					_tmp62__length1 = work_area_length1;
					_tmp63_ = i;
					_tmp64_ = left;
					_tmp65_ = _tmp62_[_tmp63_ - _tmp64_];
					_tmp66_ = ((_tmp65_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp65_) : ((gpointer) _tmp65_);
					((_tmp60_[_tmp61_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp60_[_tmp61_] = (self->priv->g_destroy_func (_tmp60_[_tmp61_]), NULL));
					_tmp60_[_tmp61_] = _tmp66_;
					_tmp67_ = _tmp60_[_tmp61_];
				}
			}
		}
	}
}


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


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


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


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


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


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


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


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


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



