/* benchmarksorts.c generated by valac 0.56.3, 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-object.h>
#include <gee-internals.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gobject/gvaluecollector.h>

#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#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;
enum  {
	GEE_BENCHMARK_TIM_SORT_0_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_PROPERTY,
	GEE_BENCHMARK_TIM_SORT_NUM_PROPERTIES
};
static GParamSpec* gee_benchmark_tim_sort_properties[GEE_BENCHMARK_TIM_SORT_NUM_PROPERTIES];

#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;
enum  {
	GEE_BENCHMARK_MERGE_SORT_0_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_PROPERTY,
	GEE_BENCHMARK_MERGE_SORT_NUM_PROPERTIES
};
static GParamSpec* gee_benchmark_merge_sort_properties[GEE_BENCHMARK_MERGE_SORT_NUM_PROPERTIES];
#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 _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 gint GeeBenchmarkTimSort_private_offset;
static gpointer gee_benchmark_tim_sort_parent_class = NULL;
static GeeBenchmarkAlgorithmIface * gee_benchmark_tim_sort_gee_benchmark_algorithm_parent_iface = NULL;
static gint GeeBenchmarkMergeSort_private_offset;
static gpointer gee_benchmark_merge_sort_parent_class = NULL;
static GeeBenchmarkAlgorithmIface * gee_benchmark_merge_sort_gee_benchmark_algorithm_parent_iface = NULL;
static gint GeeMergeSort_private_offset;
static gpointer gee_merge_sort_parent_class = NULL;

VALA_EXTERN GType gee_benchmark_algorithm_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkAlgorithm, g_object_unref)
VALA_EXTERN GType gee_benchmark_tim_sort_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkTimSort, g_object_unref)
static void gee_benchmark_tim_sort_real_process_collection (GeeBenchmarkAlgorithm* base,
                                                     GeeCollection* collection);
VALA_EXTERN GeeBenchmarkTimSort* gee_benchmark_tim_sort_new (GType g_type,
                                                 GBoxedCopyFunc g_dup_func,
                                                 GDestroyNotify g_destroy_func);
VALA_EXTERN GeeBenchmarkTimSort* gee_benchmark_tim_sort_construct (GType object_type,
                                                       GType g_type,
                                                       GBoxedCopyFunc g_dup_func,
                                                       GDestroyNotify g_destroy_func);
VALA_EXTERN void gee_benchmark_algorithm_process_collection (GeeBenchmarkAlgorithm* self,
                                                 GeeCollection* collection);
VALA_EXTERN const gchar* gee_benchmark_algorithm_get_name (GeeBenchmarkAlgorithm* self);
static GType gee_benchmark_tim_sort_get_type_once (void);
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);
VALA_EXTERN GType gee_benchmark_merge_sort_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkMergeSort, g_object_unref)
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,
                          gpointer compare_target);
VALA_EXTERN GeeBenchmarkMergeSort* gee_benchmark_merge_sort_new (GType g_type,
                                                     GBoxedCopyFunc g_dup_func,
                                                     GDestroyNotify g_destroy_func);
VALA_EXTERN GeeBenchmarkMergeSort* gee_benchmark_merge_sort_construct (GType object_type,
                                                           GType g_type,
                                                           GBoxedCopyFunc g_dup_func,
                                                           GDestroyNotify g_destroy_func);
static GType gee_benchmark_merge_sort_get_type_once (void);
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);
VALA_EXTERN void gee_benchmark_benchmark_sorts (void);
VALA_EXTERN GType gee_benchmark_generator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkGenerator, g_object_unref)
VALA_EXTERN GeeBenchmarkRandomInt32* gee_benchmark_random_int32_new (void);
VALA_EXTERN GeeBenchmarkRandomInt32* gee_benchmark_random_int32_construct (GType object_type);
VALA_EXTERN GType gee_benchmark_random_int32_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkRandomInt32, g_object_unref)
VALA_EXTERN GeeBenchmarkFixedVarianceInt32* gee_benchmark_fixed_variance_int32_new (void);
VALA_EXTERN GeeBenchmarkFixedVarianceInt32* gee_benchmark_fixed_variance_int32_construct (GType object_type);
VALA_EXTERN GType gee_benchmark_fixed_variance_int32_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkFixedVarianceInt32, g_object_unref)
VALA_EXTERN GeeBenchmarkMountsInt32* gee_benchmark_mounts_int32_new (void);
VALA_EXTERN GeeBenchmarkMountsInt32* gee_benchmark_mounts_int32_construct (GType object_type);
VALA_EXTERN GType gee_benchmark_mounts_int32_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkMountsInt32, g_object_unref)
VALA_EXTERN GeeBenchmarkReverseSortedInt32* gee_benchmark_reverse_sorted_int32_new (void);
VALA_EXTERN GeeBenchmarkReverseSortedInt32* gee_benchmark_reverse_sorted_int32_construct (GType object_type);
VALA_EXTERN GType gee_benchmark_reverse_sorted_int32_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkReverseSortedInt32, g_object_unref)
VALA_EXTERN GeeBenchmarkSortedInt32* gee_benchmark_sorted_int32_new (void);
VALA_EXTERN GeeBenchmarkSortedInt32* gee_benchmark_sorted_int32_construct (GType object_type);
VALA_EXTERN GType gee_benchmark_sorted_int32_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkSortedInt32, g_object_unref)
VALA_EXTERN GType gee_benchmark_benchmark_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkBenchmark, g_object_unref)
VALA_EXTERN GeeBenchmarkArrayListFactory* gee_benchmark_array_list_factory_new (GType g_type,
                                                                    GBoxedCopyFunc g_dup_func,
                                                                    GDestroyNotify g_destroy_func);
VALA_EXTERN GeeBenchmarkArrayListFactory* gee_benchmark_array_list_factory_construct (GType object_type,
                                                                          GType g_type,
                                                                          GBoxedCopyFunc g_dup_func,
                                                                          GDestroyNotify g_destroy_func);
VALA_EXTERN GType gee_benchmark_array_list_factory_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkArrayListFactory, g_object_unref)
VALA_EXTERN GType gee_benchmark_factory_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkFactory, g_object_unref)
VALA_EXTERN GeeBenchmarkBenchmark* gee_benchmark_benchmark_new (GType g_type,
                                                    GBoxedCopyFunc g_dup_func,
                                                    GDestroyNotify g_destroy_func,
                                                    GeeBenchmarkFactory* factory,
                                                    GeeList* algorithms,
                                                    GeeList* generators,
                                                    gint* sizes,
                                                    gint sizes_length1,
                                                    gint iteration_count);
VALA_EXTERN 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,
                                                          gint sizes_length1,
                                                          gint iteration_count);
VALA_EXTERN 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 ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeMergeSort, gee_merge_sort_unref)
 G_GNUC_INTERNAL void gee_merge_sort_sort_arraylist (GType g_type,
                                    GBoxedCopyFunc g_dup_func,
                                    GDestroyNotify g_destroy_func,
                                    GeeArrayList* list,
                                    GCompareDataFunc compare,
                                    gpointer 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,
                               gpointer 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,
                                    gint work_area_length1);
static void gee_merge_sort_finalize (GeeMergeSort * obj);
static GType gee_merge_sort_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
gee_benchmark_tim_sort_get_instance_private (GeeBenchmarkTimSort* self)
{
	return G_STRUCT_MEMBER_P (self, GeeBenchmarkTimSort_private_offset);
}

static void
gee_benchmark_tim_sort_real_process_collection (GeeBenchmarkAlgorithm* base,
                                                GeeCollection* collection)
{
	GeeBenchmarkTimSort * self;
	self = (GeeBenchmarkTimSort*) base;
	g_return_if_fail (collection != NULL);
	gee_list_sort (G_TYPE_CHECK_INSTANCE_CAST (collection, 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, "g-type", g_type, "g-dup-func", g_dup_func, "g-destroy-func", g_destroy_func, 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,
                                   gpointer klass_data)
{
	gee_benchmark_tim_sort_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GeeBenchmarkTimSort_private_offset);
	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_STRINGS | G_PARAM_READWRITE | 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_STRINGS | G_PARAM_READWRITE | 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_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_TIM_SORT_NAME_PROPERTY, gee_benchmark_tim_sort_properties[GEE_BENCHMARK_TIM_SORT_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gee_benchmark_tim_sort_gee_benchmark_algorithm_interface_init (GeeBenchmarkAlgorithmIface * iface,
                                                               gpointer iface_data)
{
	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,
                                      gpointer klass)
{
	self->priv = gee_benchmark_tim_sort_get_instance_private (self);
}

static GType
gee_benchmark_tim_sort_get_type_once (void)
{
	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);
	GeeBenchmarkTimSort_private_offset = g_type_add_instance_private (gee_benchmark_tim_sort_type_id, sizeof (GeeBenchmarkTimSortPrivate));
	return gee_benchmark_tim_sort_type_id;
}

GType
gee_benchmark_tim_sort_get_type (void)
{
	static volatile gsize gee_benchmark_tim_sort_type_id__once = 0;
	if (g_once_init_enter (&gee_benchmark_tim_sort_type_id__once)) {
		GType gee_benchmark_tim_sort_type_id;
		gee_benchmark_tim_sort_type_id = gee_benchmark_tim_sort_get_type_once ();
		g_once_init_leave (&gee_benchmark_tim_sort_type_id__once, gee_benchmark_tim_sort_type_id);
	}
	return gee_benchmark_tim_sort_type_id__once;
}

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_PROPERTY:
		g_value_set_string (value, gee_benchmark_algorithm_get_name ((GeeBenchmarkAlgorithm*) self));
		break;
		case GEE_BENCHMARK_TIM_SORT_G_TYPE:
		g_value_set_gtype (value, self->priv->g_type);
		break;
		case GEE_BENCHMARK_TIM_SORT_G_DUP_FUNC:
		g_value_set_pointer (value, self->priv->g_dup_func);
		break;
		case GEE_BENCHMARK_TIM_SORT_G_DESTROY_FUNC:
		g_value_set_pointer (value, self->priv->g_destroy_func);
		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 inline gpointer
gee_benchmark_merge_sort_get_instance_private (GeeBenchmarkMergeSort* self)
{
	return G_STRUCT_MEMBER_P (self, GeeBenchmarkMergeSort_private_offset);
}

static void
gee_benchmark_merge_sort_real_process_collection (GeeBenchmarkAlgorithm* base,
                                                  GeeCollection* collection)
{
	GeeBenchmarkMergeSort * self;
	GCompareDataFunc compare = NULL;
	gpointer _tmp0_ = NULL;
	GDestroyNotify _tmp1_ = NULL;
	GCompareDataFunc _tmp2_;
	gpointer compare_target;
	GDestroyNotify compare_target_destroy_notify;
	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_;
	gee_merge_sort_sort (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, G_TYPE_CHECK_INSTANCE_CAST (collection, 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, "g-type", g_type, "g-dup-func", g_dup_func, "g-destroy-func", g_destroy_func, 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,
                                     gpointer klass_data)
{
	gee_benchmark_merge_sort_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GeeBenchmarkMergeSort_private_offset);
	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_STRINGS | G_PARAM_READWRITE | 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_STRINGS | G_PARAM_READWRITE | 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_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_MERGE_SORT_NAME_PROPERTY, gee_benchmark_merge_sort_properties[GEE_BENCHMARK_MERGE_SORT_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gee_benchmark_merge_sort_gee_benchmark_algorithm_interface_init (GeeBenchmarkAlgorithmIface * iface,
                                                                 gpointer iface_data)
{
	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,
                                        gpointer klass)
{
	self->priv = gee_benchmark_merge_sort_get_instance_private (self);
}

static GType
gee_benchmark_merge_sort_get_type_once (void)
{
	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);
	GeeBenchmarkMergeSort_private_offset = g_type_add_instance_private (gee_benchmark_merge_sort_type_id, sizeof (GeeBenchmarkMergeSortPrivate));
	return gee_benchmark_merge_sort_type_id;
}

GType
gee_benchmark_merge_sort_get_type (void)
{
	static volatile gsize gee_benchmark_merge_sort_type_id__once = 0;
	if (g_once_init_enter (&gee_benchmark_merge_sort_type_id__once)) {
		GType gee_benchmark_merge_sort_type_id;
		gee_benchmark_merge_sort_type_id = gee_benchmark_merge_sort_get_type_once ();
		g_once_init_leave (&gee_benchmark_merge_sort_type_id__once, gee_benchmark_merge_sort_type_id);
	}
	return gee_benchmark_merge_sort_type_id__once;
}

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_PROPERTY:
		g_value_set_string (value, gee_benchmark_algorithm_get_name ((GeeBenchmarkAlgorithm*) self));
		break;
		case GEE_BENCHMARK_MERGE_SORT_G_TYPE:
		g_value_set_gtype (value, self->priv->g_type);
		break;
		case GEE_BENCHMARK_MERGE_SORT_G_DUP_FUNC:
		g_value_set_pointer (value, self->priv->g_dup_func);
		break;
		case GEE_BENCHMARK_MERGE_SORT_G_DESTROY_FUNC:
		g_value_set_pointer (value, self->priv->g_destroy_func);
		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_;
	GeeBenchmarkTimSort* _tmp1_;
	GeeBenchmarkTimSort* _tmp2_;
	GeeBenchmarkMergeSort* _tmp3_;
	GeeBenchmarkMergeSort* _tmp4_;
	GeeArrayList* generators = NULL;
	GeeArrayList* _tmp5_;
	GeeBenchmarkRandomInt32* _tmp6_;
	GeeBenchmarkRandomInt32* _tmp7_;
	GeeBenchmarkFixedVarianceInt32* _tmp8_;
	GeeBenchmarkFixedVarianceInt32* _tmp9_;
	GeeBenchmarkMountsInt32* _tmp10_;
	GeeBenchmarkMountsInt32* _tmp11_;
	GeeBenchmarkReverseSortedInt32* _tmp12_;
	GeeBenchmarkReverseSortedInt32* _tmp13_;
	GeeBenchmarkSortedInt32* _tmp14_;
	GeeBenchmarkSortedInt32* _tmp15_;
	GeeBenchmarkBenchmark* benchmark = NULL;
	GeeBenchmarkArrayListFactory* _tmp16_;
	GeeBenchmarkArrayListFactory* _tmp17_;
	gint* _tmp18_;
	gint* _tmp19_;
	gint _tmp19__length1;
	GeeBenchmarkBenchmark* _tmp20_;
	GeeBenchmarkBenchmark* _tmp21_;
	_tmp0_ = gee_array_list_new (GEE_BENCHMARK_TYPE_ALGORITHM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) 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, (GDestroyNotify) 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);
}

static inline gpointer
gee_merge_sort_get_instance_private (GeeMergeSort* self)
{
	return G_STRUCT_MEMBER_P (self, GeeMergeSort_private_offset);
}

 G_GNUC_INTERNAL void
gee_merge_sort_sort (GType g_type,
                     GBoxedCopyFunc g_dup_func,
                     GDestroyNotify g_destroy_func,
                     GeeList* list,
                     GCompareDataFunc compare,
                     gpointer compare_target)
{
	g_return_if_fail (list != NULL);
	if (G_TYPE_CHECK_INSTANCE_TYPE (list, GEE_TYPE_ARRAY_LIST)) {
		gee_merge_sort_sort_arraylist (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_ARRAY_LIST, GeeArrayList), compare, compare_target);
	} else {
		gee_merge_sort_sort_list (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, list, compare, compare_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,
                          gpointer compare_target)
{
	GeeMergeSort* helper = NULL;
	GeeMergeSort* _tmp0_;
	GeeMergeSort* _tmp1_;
	GeeList* _tmp2_;
	GeeMergeSort* _tmp3_;
	gint _tmp4_ = 0;
	gpointer* _tmp5_;
	GeeMergeSort* _tmp6_;
	GeeMergeSort* _tmp7_;
	gpointer* _tmp8_;
	gint _tmp8__length1;
	GeeMergeSort* _tmp9_;
	GeeMergeSort* _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	GeeMergeSort* _tmp13_;
	GeeMergeSort* _tmp14_;
	GeeMergeSort* _tmp15_;
	gpointer* _tmp16_;
	gint _tmp16__length1;
	g_return_if_fail (list != NULL);
	_tmp0_ = gee_merge_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func);
	helper = _tmp0_;
	_tmp1_ = helper;
	_tmp2_ = _g_object_ref0 (list);
	_g_object_unref0 (_tmp1_->priv->list_collection);
	_tmp1_->priv->list_collection = _tmp2_;
	_tmp3_ = helper;
	_tmp5_ = gee_collection_to_array ((GeeCollection*) list, &_tmp4_);
	_tmp3_->priv->array = (_vala_array_free (_tmp3_->priv->array, _tmp3_->priv->array_length1, (GDestroyNotify) g_destroy_func), NULL);
	_tmp3_->priv->array = _tmp5_;
	_tmp3_->priv->array_length1 = _tmp4_;
	_tmp3_->priv->_array_size_ = _tmp3_->priv->array_length1;
	_tmp6_ = helper;
	_tmp7_ = helper;
	_tmp8_ = _tmp7_->priv->array;
	_tmp8__length1 = _tmp7_->priv->array_length1;
	_tmp6_->priv->list = _tmp8_;
	_tmp6_->priv->list_length1 = _tmp8__length1;
	_tmp6_->priv->_list_size_ = _tmp6_->priv->list_length1;
	_tmp9_ = helper;
	_tmp9_->priv->index = 0;
	_tmp10_ = helper;
	_tmp11_ = gee_collection_get_size ((GeeCollection*) list);
	_tmp12_ = _tmp11_;
	_tmp10_->priv->size = _tmp12_;
	_tmp13_ = helper;
	(_tmp13_->priv->compare_target_destroy_notify == NULL) ? NULL : (_tmp13_->priv->compare_target_destroy_notify (_tmp13_->priv->compare_target), NULL);
	_tmp13_->priv->compare = NULL;
	_tmp13_->priv->compare_target = NULL;
	_tmp13_->priv->compare_target_destroy_notify = NULL;
	_tmp13_->priv->compare = compare;
	_tmp13_->priv->compare_target = compare_target;
	_tmp13_->priv->compare_target_destroy_notify = NULL;
	_tmp14_ = helper;
	gee_merge_sort_do_sort (_tmp14_);
	gee_collection_clear ((GeeCollection*) list);
	_tmp15_ = helper;
	_tmp16_ = _tmp15_->priv->array;
	_tmp16__length1 = _tmp15_->priv->array_length1;
	{
		gpointer* item_collection = NULL;
		gint item_collection_length1 = 0;
		gint _item_collection_size_ = 0;
		gint item_it = 0;
		item_collection = _tmp16_;
		item_collection_length1 = _tmp16__length1;
		for (item_it = 0; item_it < item_collection_length1; item_it = item_it + 1) {
			gpointer _tmp17_;
			gpointer item = NULL;
			_tmp17_ = ((item_collection[item_it] != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) item_collection[item_it]) : ((gpointer) item_collection[item_it]);
			item = _tmp17_;
			{
				gconstpointer _tmp18_;
				_tmp18_ = item;
				gee_collection_add ((GeeCollection*) list, _tmp18_);
				((item == NULL) || (g_destroy_func == NULL)) ? NULL : (item = (g_destroy_func (item), NULL));
			}
		}
	}
	_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,
                               gpointer compare_target)
{
	GeeMergeSort* helper = NULL;
	GeeMergeSort* _tmp0_;
	GeeList* _tmp1_;
	gpointer* _tmp2_;
	gint _tmp2__length1;
	g_return_if_fail (list != NULL);
	_tmp0_ = gee_merge_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func);
	helper = _tmp0_;
	_tmp1_ = _g_object_ref0 ((GeeList*) list);
	_g_object_unref0 (helper->priv->list_collection);
	helper->priv->list_collection = _tmp1_;
	_tmp2_ = list->_items;
	_tmp2__length1 = list->_items_length1;
	helper->priv->list = _tmp2_;
	helper->priv->list_length1 = _tmp2__length1;
	helper->priv->_list_size_ = helper->priv->list_length1;
	helper->priv->index = 0;
	helper->priv->size = list->_size;
	(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 = compare;
	helper->priv->compare_target = compare_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)
{
	gpointer* work_area = NULL;
	gpointer* _tmp0_;
	gint work_area_length1;
	gint _work_area_size_;
	gpointer* _tmp1_;
	gint _tmp1__length1;
	g_return_if_fail (self != NULL);
	if (self->priv->size <= 1) {
		return;
	}
	_tmp0_ = g_new0 (gpointer, self->priv->size);
	work_area = _tmp0_;
	work_area_length1 = self->priv->size;
	_work_area_size_ = work_area_length1;
	_tmp1_ = work_area;
	_tmp1__length1 = work_area_length1;
	gee_merge_sort_merge_sort_aux (self, self->priv->index, self->priv->size, _tmp1_, (gint) _tmp1__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,
                               gint work_area_length1)
{
	g_return_if_fail (self != NULL);
	if (right == (left + 1)) {
		return;
	} else {
		gint size = 0;
		gint middle = 0;
		gint lbegin = 0;
		gint rbegin = 0;
		size = right - left;
		middle = size / 2;
		lbegin = left;
		rbegin = left + middle;
		gee_merge_sort_merge_sort_aux (self, left, left + middle, work_area, (gint) work_area_length1);
		gee_merge_sort_merge_sort_aux (self, left + middle, right, work_area, (gint) work_area_length1);
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp0_ = FALSE;
				_tmp0_ = TRUE;
				while (TRUE) {
					gboolean _tmp2_ = FALSE;
					if (!_tmp0_) {
						gint _tmp1_;
						_tmp1_ = i;
						i = _tmp1_ + 1;
					}
					_tmp0_ = FALSE;
					if (!(i < size)) {
						break;
					}
					if (lbegin < (left + middle)) {
						gboolean _tmp3_ = FALSE;
						if (rbegin == right) {
							_tmp3_ = TRUE;
						} else {
							GCompareDataFunc _tmp4_;
							gpointer _tmp4__target;
							gpointer* _tmp5_;
							gint _tmp5__length1;
							gconstpointer _tmp6_;
							gpointer* _tmp7_;
							gint _tmp7__length1;
							gconstpointer _tmp8_;
							_tmp4_ = self->priv->compare;
							_tmp4__target = self->priv->compare_target;
							_tmp5_ = self->priv->list;
							_tmp5__length1 = self->priv->list_length1;
							_tmp6_ = _tmp5_[lbegin];
							_tmp7_ = self->priv->list;
							_tmp7__length1 = self->priv->list_length1;
							_tmp8_ = _tmp7_[rbegin];
							_tmp3_ = _tmp4_ (_tmp6_, _tmp8_, _tmp4__target) <= 0;
						}
						_tmp2_ = _tmp3_;
					} else {
						_tmp2_ = FALSE;
					}
					if (_tmp2_) {
						gpointer* _tmp9_;
						gint _tmp9__length1;
						gconstpointer _tmp10_;
						gpointer _tmp11_;
						gint _tmp12_;
						_tmp9_ = self->priv->list;
						_tmp9__length1 = self->priv->list_length1;
						_tmp10_ = _tmp9_[lbegin];
						_tmp11_ = ((_tmp10_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp10_) : ((gpointer) _tmp10_);
						((work_area[i] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (work_area[i] = (self->priv->g_destroy_func (work_area[i]), NULL));
						work_area[i] = _tmp11_;
						_tmp12_ = lbegin;
						lbegin = _tmp12_ + 1;
					} else {
						gpointer* _tmp13_;
						gint _tmp13__length1;
						gconstpointer _tmp14_;
						gpointer _tmp15_;
						gint _tmp16_;
						_tmp13_ = self->priv->list;
						_tmp13__length1 = self->priv->list_length1;
						_tmp14_ = _tmp13_[rbegin];
						_tmp15_ = ((_tmp14_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp14_) : ((gpointer) _tmp14_);
						((work_area[i] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (work_area[i] = (self->priv->g_destroy_func (work_area[i]), NULL));
						work_area[i] = _tmp15_;
						_tmp16_ = rbegin;
						rbegin = _tmp16_ + 1;
					}
				}
			}
		}
		{
			gint i = 0;
			i = left;
			{
				gboolean _tmp17_ = FALSE;
				_tmp17_ = TRUE;
				while (TRUE) {
					gpointer* _tmp19_;
					gint _tmp19__length1;
					gconstpointer _tmp20_;
					gpointer _tmp21_;
					if (!_tmp17_) {
						gint _tmp18_;
						_tmp18_ = i;
						i = _tmp18_ + 1;
					}
					_tmp17_ = FALSE;
					if (!(i < right)) {
						break;
					}
					_tmp19_ = self->priv->list;
					_tmp19__length1 = self->priv->list_length1;
					_tmp20_ = work_area[i - left];
					_tmp21_ = ((_tmp20_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp20_) : ((gpointer) _tmp20_);
					((_tmp19_[i] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp19_[i] = (self->priv->g_destroy_func (_tmp19_[i]), NULL));
					_tmp19_[i] = _tmp21_;
				}
			}
		}
	}
}

 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,
                           gpointer klass_data)
{
	gee_merge_sort_parent_class = g_type_class_peek_parent (klass);
	((GeeMergeSortClass *) klass)->finalize = gee_merge_sort_finalize;
	g_type_class_adjust_private_offset (klass, &GeeMergeSort_private_offset);
}

static void
gee_merge_sort_instance_init (GeeMergeSort * self,
                              gpointer klass)
{
	self->priv = gee_merge_sort_get_instance_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_signal_handlers_destroy (self);
	_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;
}

static GType
gee_merge_sort_get_type_once (void)
{
	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);
	GeeMergeSort_private_offset = g_type_add_instance_private (gee_merge_sort_type_id, sizeof (GeeMergeSortPrivate));
	return gee_merge_sort_type_id;
}

 G_GNUC_INTERNAL GType
gee_merge_sort_get_type (void)
{
	static volatile gsize gee_merge_sort_type_id__once = 0;
	if (g_once_init_enter (&gee_merge_sort_type_id__once)) {
		GType gee_merge_sort_type_id;
		gee_merge_sort_type_id = gee_merge_sort_get_type_once ();
		g_once_init_leave (&gee_merge_sort_type_id__once, gee_merge_sort_type_id);
	}
	return gee_merge_sort_type_id__once;
}

 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,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize 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,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

