Update Changelog
[profile/ivi/libgee.git] / gee / timsort.c
1 /* timsort.c generated by valac 0.18.0, the Vala compiler
2  * generated from timsort.vala, do not modify */
3
4 /* timsort.vala
5  *
6  * Copyright (C) 2009  Didier Villevalois
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
21  *
22  * Author:
23  *      Didier 'Ptitjes Villevalois <ptitjes@free.fr>
24  */
25
26 #include <glib.h>
27 #include <glib-object.h>
28 #include <string.h>
29
30
31 #define GEE_TYPE_TIM_SORT (gee_tim_sort_get_type ())
32 #define GEE_TIM_SORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TIM_SORT, GeeTimSort))
33 #define GEE_TIM_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TIM_SORT, GeeTimSortClass))
34 #define GEE_IS_TIM_SORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TIM_SORT))
35 #define GEE_IS_TIM_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TIM_SORT))
36 #define GEE_TIM_SORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TIM_SORT, GeeTimSortClass))
37
38 typedef struct _GeeTimSort GeeTimSort;
39 typedef struct _GeeTimSortClass GeeTimSortClass;
40 typedef struct _GeeTimSortPrivate GeeTimSortPrivate;
41
42 #define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
43 #define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
44 #define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
45 #define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))
46
47 typedef struct _GeeTraversable GeeTraversable;
48 typedef struct _GeeTraversableIface GeeTraversableIface;
49
50 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
51
52 #define GEE_TYPE_LAZY (gee_lazy_get_type ())
53 #define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
54 #define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
55 #define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
56 #define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
57 #define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))
58
59 typedef struct _GeeLazy GeeLazy;
60 typedef struct _GeeLazyClass GeeLazyClass;
61
62 #define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
63 #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
64 #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
65 #define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))
66
67 typedef struct _GeeIterator GeeIterator;
68 typedef struct _GeeIteratorIface GeeIteratorIface;
69
70 #define GEE_TYPE_ITERABLE (gee_iterable_get_type ())
71 #define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable))
72 #define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE))
73 #define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface))
74
75 typedef struct _GeeIterable GeeIterable;
76 typedef struct _GeeIterableIface GeeIterableIface;
77
78 #define GEE_TYPE_COLLECTION (gee_collection_get_type ())
79 #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection))
80 #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION))
81 #define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface))
82
83 typedef struct _GeeCollection GeeCollection;
84 typedef struct _GeeCollectionIface GeeCollectionIface;
85
86 #define GEE_TYPE_LIST (gee_list_get_type ())
87 #define GEE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST, GeeList))
88 #define GEE_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST))
89 #define GEE_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST, GeeListIface))
90
91 typedef struct _GeeList GeeList;
92 typedef struct _GeeListIface GeeListIface;
93
94 #define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ())
95 #define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator))
96 #define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR))
97 #define GEE_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIteratorIface))
98
99 typedef struct _GeeListIterator GeeListIterator;
100 typedef struct _GeeListIteratorIface GeeListIteratorIface;
101 typedef struct _GeeTimSortSlice GeeTimSortSlice;
102 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
103
104 #define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ())
105 #define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection))
106 #define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass))
107 #define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION))
108 #define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION))
109 #define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass))
110
111 typedef struct _GeeAbstractCollection GeeAbstractCollection;
112 typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass;
113
114 #define GEE_TYPE_ABSTRACT_LIST (gee_abstract_list_get_type ())
115 #define GEE_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractList))
116 #define GEE_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass))
117 #define GEE_IS_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_LIST))
118 #define GEE_IS_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_LIST))
119 #define GEE_ABSTRACT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass))
120
121 typedef struct _GeeAbstractList GeeAbstractList;
122 typedef struct _GeeAbstractListClass GeeAbstractListClass;
123
124 #define GEE_TYPE_ABSTRACT_BIDIR_LIST (gee_abstract_bidir_list_get_type ())
125 #define GEE_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList))
126 #define GEE_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass))
127 #define GEE_IS_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST))
128 #define GEE_IS_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST))
129 #define GEE_ABSTRACT_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass))
130
131 typedef struct _GeeAbstractBidirList GeeAbstractBidirList;
132 typedef struct _GeeAbstractBidirListClass GeeAbstractBidirListClass;
133
134 #define GEE_TYPE_ARRAY_LIST (gee_array_list_get_type ())
135 #define GEE_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayList))
136 #define GEE_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ARRAY_LIST, GeeArrayListClass))
137 #define GEE_IS_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ARRAY_LIST))
138 #define GEE_IS_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ARRAY_LIST))
139 #define GEE_ARRAY_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayListClass))
140
141 typedef struct _GeeArrayList GeeArrayList;
142 typedef struct _GeeArrayListClass GeeArrayListClass;
143 #define _g_destroy_func0(var) (((var == NULL) || (g_destroy_func == NULL)) ? NULL : (var = (g_destroy_func (var), NULL)))
144 typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate;
145 typedef struct _GeeAbstractListPrivate GeeAbstractListPrivate;
146
147 #define GEE_TYPE_BIDIR_LIST (gee_bidir_list_get_type ())
148 #define GEE_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirList))
149 #define GEE_IS_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST))
150 #define GEE_BIDIR_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirListIface))
151
152 typedef struct _GeeBidirList GeeBidirList;
153 typedef struct _GeeBidirListIface GeeBidirListIface;
154
155 #define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ())
156 #define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator))
157 #define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR))
158 #define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface))
159
160 typedef struct _GeeBidirIterator GeeBidirIterator;
161 typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface;
162
163 #define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ())
164 #define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator))
165 #define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR))
166 #define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface))
167
168 typedef struct _GeeBidirListIterator GeeBidirListIterator;
169 typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface;
170 typedef struct _GeeAbstractBidirListPrivate GeeAbstractBidirListPrivate;
171 typedef struct _GeeArrayListPrivate GeeArrayListPrivate;
172 #define _gee_tim_sort_slice_free0(var) ((var == NULL) ? NULL : (var = (gee_tim_sort_slice_free (var), NULL)))
173 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
174
175 struct _GeeTimSort {
176         GObject parent_instance;
177         GeeTimSortPrivate * priv;
178 };
179
180 struct _GeeTimSortClass {
181         GObjectClass parent_class;
182 };
183
184 typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
185 typedef enum  {
186         GEE_TRAVERSABLE_STREAM_YIELD,
187         GEE_TRAVERSABLE_STREAM_CONTINUE,
188         GEE_TRAVERSABLE_STREAM_END
189 } GeeTraversableStream;
190
191 typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data);
192 struct _GeeIteratorIface {
193         GTypeInterface parent_iface;
194         gboolean (*next) (GeeIterator* self);
195         gboolean (*has_next) (GeeIterator* self);
196         gpointer (*get) (GeeIterator* self);
197         void (*remove) (GeeIterator* self);
198         gboolean (*get_valid) (GeeIterator* self);
199         gboolean (*get_read_only) (GeeIterator* self);
200 };
201
202 typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
203 typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
204 typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data);
205 struct _GeeTraversableIface {
206         GTypeInterface parent_iface;
207         GType (*get_g_type) (GeeTraversable* self);
208         GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
209         GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
210         gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
211         GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify);
212         gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
213         GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
214         GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
215         GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
216         GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
217         GType (*get_element_type) (GeeTraversable* self);
218 };
219
220 struct _GeeIterableIface {
221         GTypeInterface parent_iface;
222         GType (*get_g_type) (GeeIterable* self);
223         GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self);
224         GDestroyNotify (*get_g_destroy_func) (GeeIterable* self);
225         GeeIterator* (*iterator) (GeeIterable* self);
226 };
227
228 struct _GeeCollectionIface {
229         GTypeInterface parent_iface;
230         GType (*get_g_type) (GeeCollection* self);
231         GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self);
232         GDestroyNotify (*get_g_destroy_func) (GeeCollection* self);
233         gboolean (*contains) (GeeCollection* self, gconstpointer item);
234         gboolean (*add) (GeeCollection* self, gconstpointer item);
235         gboolean (*remove) (GeeCollection* self, gconstpointer item);
236         void (*clear) (GeeCollection* self);
237         gboolean (*add_all) (GeeCollection* self, GeeCollection* collection);
238         gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection);
239         gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection);
240         gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection);
241         gpointer* (*to_array) (GeeCollection* self, int* result_length1);
242         gint (*get_size) (GeeCollection* self);
243         gboolean (*get_is_empty) (GeeCollection* self);
244         gboolean (*get_read_only) (GeeCollection* self);
245         GeeCollection* (*get_read_only_view) (GeeCollection* self);
246 };
247
248 struct _GeeListIteratorIface {
249         GTypeInterface parent_iface;
250         void (*set) (GeeListIterator* self, gconstpointer item);
251         void (*add) (GeeListIterator* self, gconstpointer item);
252         gint (*index) (GeeListIterator* self);
253 };
254
255 struct _GeeListIface {
256         GTypeInterface parent_iface;
257         GType (*get_g_type) (GeeList* self);
258         GBoxedCopyFunc (*get_g_dup_func) (GeeList* self);
259         GDestroyNotify (*get_g_destroy_func) (GeeList* self);
260         GeeListIterator* (*list_iterator) (GeeList* self);
261         gpointer (*get) (GeeList* self, gint index);
262         void (*set) (GeeList* self, gint index, gconstpointer item);
263         gint (*index_of) (GeeList* self, gconstpointer item);
264         void (*insert) (GeeList* self, gint index, gconstpointer item);
265         gpointer (*remove_at) (GeeList* self, gint index);
266         GeeList* (*slice) (GeeList* self, gint start, gint stop);
267         gpointer (*first) (GeeList* self);
268         gpointer (*last) (GeeList* self);
269         void (*insert_all) (GeeList* self, gint index, GeeCollection* collection);
270         void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify);
271         GeeList* (*get_read_only_view) (GeeList* self);
272 };
273
274 struct _GeeTimSortPrivate {
275         GType g_type;
276         GBoxedCopyFunc g_dup_func;
277         GDestroyNotify g_destroy_func;
278         GeeList* list_collection;
279         gpointer* array;
280         gint array_length1;
281         gint _array_size_;
282         void** list;
283         gint index;
284         gint size;
285         GeeTimSortSlice** pending;
286         gint pending_length1;
287         gint _pending_size_;
288         gint minimum_gallop;
289         GCompareDataFunc compare;
290         gpointer compare_target;
291         GDestroyNotify compare_target_destroy_notify;
292 };
293
294 struct _GeeAbstractCollection {
295         GObject parent_instance;
296         GeeAbstractCollectionPrivate * priv;
297 };
298
299 struct _GeeAbstractCollectionClass {
300         GObjectClass parent_class;
301         gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item);
302         gboolean (*add) (GeeAbstractCollection* self, gconstpointer item);
303         gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item);
304         void (*clear) (GeeAbstractCollection* self);
305         GeeIterator* (*iterator) (GeeAbstractCollection* self);
306         gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target);
307         void (*reserved0) (GeeAbstractCollection* self);
308         void (*reserved1) (GeeAbstractCollection* self);
309         void (*reserved2) (GeeAbstractCollection* self);
310         void (*reserved3) (GeeAbstractCollection* self);
311         void (*reserved4) (GeeAbstractCollection* self);
312         void (*reserved5) (GeeAbstractCollection* self);
313         void (*reserved6) (GeeAbstractCollection* self);
314         void (*reserved7) (GeeAbstractCollection* self);
315         void (*reserved8) (GeeAbstractCollection* self);
316         void (*reserved9) (GeeAbstractCollection* self);
317         gint (*get_size) (GeeAbstractCollection* self);
318         gboolean (*get_read_only) (GeeAbstractCollection* self);
319         GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self);
320 };
321
322 struct _GeeAbstractList {
323         GeeAbstractCollection parent_instance;
324         GeeAbstractListPrivate * priv;
325 };
326
327 struct _GeeAbstractListClass {
328         GeeAbstractCollectionClass parent_class;
329         GeeListIterator* (*list_iterator) (GeeAbstractList* self);
330         gpointer (*get) (GeeAbstractList* self, gint index);
331         void (*set) (GeeAbstractList* self, gint index, gconstpointer item);
332         gint (*index_of) (GeeAbstractList* self, gconstpointer item);
333         void (*insert) (GeeAbstractList* self, gint index, gconstpointer item);
334         gpointer (*remove_at) (GeeAbstractList* self, gint index);
335         GeeList* (*slice) (GeeAbstractList* self, gint start, gint stop);
336         void (*reserved0) (GeeAbstractList* self);
337         void (*reserved1) (GeeAbstractList* self);
338         void (*reserved2) (GeeAbstractList* self);
339         void (*reserved3) (GeeAbstractList* self);
340         void (*reserved4) (GeeAbstractList* self);
341         void (*reserved5) (GeeAbstractList* self);
342         void (*reserved6) (GeeAbstractList* self);
343         void (*reserved7) (GeeAbstractList* self);
344         void (*reserved8) (GeeAbstractList* self);
345         void (*reserved9) (GeeAbstractList* self);
346         GeeList* (*get_read_only_view) (GeeAbstractList* self);
347 };
348
349 struct _GeeBidirIteratorIface {
350         GTypeInterface parent_iface;
351         GType (*get_g_type) (GeeBidirIterator* self);
352         GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self);
353         GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self);
354         gboolean (*previous) (GeeBidirIterator* self);
355         gboolean (*has_previous) (GeeBidirIterator* self);
356         gboolean (*first) (GeeBidirIterator* self);
357         gboolean (*last) (GeeBidirIterator* self);
358 };
359
360 struct _GeeBidirListIteratorIface {
361         GTypeInterface parent_iface;
362         GType (*get_g_type) (GeeBidirListIterator* self);
363         GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self);
364         GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self);
365         void (*insert) (GeeBidirListIterator* self, gconstpointer item);
366 };
367
368 struct _GeeBidirListIface {
369         GTypeInterface parent_iface;
370         GType (*get_g_type) (GeeBidirList* self);
371         GBoxedCopyFunc (*get_g_dup_func) (GeeBidirList* self);
372         GDestroyNotify (*get_g_destroy_func) (GeeBidirList* self);
373         GeeBidirListIterator* (*bidir_list_iterator) (GeeBidirList* self);
374         GeeBidirList* (*get_read_only_view) (GeeBidirList* self);
375 };
376
377 struct _GeeAbstractBidirList {
378         GeeAbstractList parent_instance;
379         GeeAbstractBidirListPrivate * priv;
380 };
381
382 struct _GeeAbstractBidirListClass {
383         GeeAbstractListClass parent_class;
384         GeeBidirListIterator* (*bidir_list_iterator) (GeeAbstractBidirList* self);
385         void (*reserved0) (GeeAbstractBidirList* self);
386         void (*reserved1) (GeeAbstractBidirList* self);
387         void (*reserved2) (GeeAbstractBidirList* self);
388         void (*reserved3) (GeeAbstractBidirList* self);
389         void (*reserved4) (GeeAbstractBidirList* self);
390         void (*reserved5) (GeeAbstractBidirList* self);
391         void (*reserved6) (GeeAbstractBidirList* self);
392         void (*reserved7) (GeeAbstractBidirList* self);
393         void (*reserved8) (GeeAbstractBidirList* self);
394         void (*reserved9) (GeeAbstractBidirList* self);
395         GeeBidirList* (*get_read_only_view) (GeeAbstractBidirList* self);
396 };
397
398 struct _GeeArrayList {
399         GeeAbstractBidirList parent_instance;
400         GeeArrayListPrivate * priv;
401         gpointer* _items;
402         gint _items_length1;
403         gint __items_size_;
404         gint _size;
405 };
406
407 struct _GeeArrayListClass {
408         GeeAbstractBidirListClass parent_class;
409 };
410
411 struct _GeeTimSortSlice {
412         void** list;
413         void** new_list;
414         gint index;
415         gint length;
416 };
417
418 typedef gboolean (*GeeTimSortLowerFunc) (gconstpointer left, gconstpointer right, void* user_data);
419
420 static gpointer gee_tim_sort_parent_class = NULL;
421
422 GType gee_tim_sort_get_type (void) G_GNUC_CONST;
423 GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
424 gpointer gee_lazy_ref (gpointer instance);
425 void gee_lazy_unref (gpointer instance);
426 GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
427 void gee_value_set_lazy (GValue* value, gpointer v_object);
428 void gee_value_take_lazy (GValue* value, gpointer v_object);
429 gpointer gee_value_get_lazy (const GValue* value);
430 GType gee_lazy_get_type (void) G_GNUC_CONST;
431 GType gee_iterator_get_type (void) G_GNUC_CONST;
432 GType gee_traversable_get_type (void) G_GNUC_CONST;
433 GType gee_iterable_get_type (void) G_GNUC_CONST;
434 GType gee_collection_get_type (void) G_GNUC_CONST;
435 GType gee_list_iterator_get_type (void) G_GNUC_CONST;
436 GType gee_list_get_type (void) G_GNUC_CONST;
437 static void gee_tim_sort_slice_free (GeeTimSortSlice* self);
438 #define GEE_TIM_SORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_TIM_SORT, GeeTimSortPrivate))
439 enum  {
440         GEE_TIM_SORT_DUMMY_PROPERTY,
441         GEE_TIM_SORT_G_TYPE,
442         GEE_TIM_SORT_G_DUP_FUNC,
443         GEE_TIM_SORT_G_DESTROY_FUNC
444 };
445 #define GEE_TIM_SORT_MINIMUM_GALLOP 7
446 void gee_tim_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target);
447 GType gee_abstract_collection_get_type (void) G_GNUC_CONST;
448 GType gee_abstract_list_get_type (void) G_GNUC_CONST;
449 GType gee_abstract_bidir_list_get_type (void) G_GNUC_CONST;
450 GType gee_array_list_get_type (void) G_GNUC_CONST;
451 static void gee_tim_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareDataFunc compare, void* compare_target);
452 static void gee_tim_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target);
453 GeeTimSort* gee_tim_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
454 GeeTimSort* gee_tim_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
455 gpointer* gee_collection_to_array (GeeCollection* self, int* result_length1);
456 gint gee_collection_get_size (GeeCollection* self);
457 static void gee_tim_sort_do_sort (GeeTimSort* self);
458 void gee_collection_clear (GeeCollection* self);
459 gboolean gee_collection_add (GeeCollection* self, gconstpointer item);
460 GType gee_bidir_iterator_get_type (void) G_GNUC_CONST;
461 GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST;
462 GType gee_bidir_list_get_type (void) G_GNUC_CONST;
463 static GeeTimSortSlice* gee_tim_sort_slice_new (void** list, gint index, gint length);
464 static GeeTimSortSlice* gee_tim_sort_slice_new (void** list, gint index, gint length);
465 static gint gee_tim_sort_compute_minimum_run_length (GeeTimSort* self, gint length);
466 static GeeTimSortSlice* gee_tim_sort_compute_longest_run (GeeTimSort* self, GeeTimSortSlice* a, gboolean* descending);
467 static void gee_tim_sort_slice_reverse (GeeTimSortSlice* self);
468 static void gee_tim_sort_insertion_sort (GeeTimSort* self, GeeTimSortSlice* a, gint offset);
469 static inline void gee_tim_sort_slice_shorten_start (GeeTimSortSlice* self, gint n);
470 static void _vala_array_add1 (GeeTimSortSlice*** array, int* length, int* size, GeeTimSortSlice* value);
471 static void gee_tim_sort_merge_collapse (GeeTimSort* self);
472 static void gee_tim_sort_merge_force_collapse (GeeTimSort* self);
473 static inline gboolean gee_tim_sort_lower_than (GeeTimSort* self, gconstpointer left, gconstpointer right);
474 static inline gboolean gee_tim_sort_lower_than_or_equal_to (GeeTimSort* self, gconstpointer left, gconstpointer right);
475 static void gee_tim_sort_merge_at (GeeTimSort* self, gint index);
476 static gint gee_tim_sort_gallop_rightmost (GeeTimSort* self, gconstpointer key, GeeTimSortSlice* a, gint hint);
477 static inline void* gee_tim_sort_slice_peek_first (GeeTimSortSlice* self);
478 static gint gee_tim_sort_gallop_leftmost (GeeTimSort* self, gconstpointer key, GeeTimSortSlice* a, gint hint);
479 static inline void* gee_tim_sort_slice_peek_last (GeeTimSortSlice* self);
480 static void gee_tim_sort_merge_low (GeeTimSort* self, GeeTimSortSlice* a, GeeTimSortSlice* b);
481 static void gee_tim_sort_merge_high (GeeTimSort* self, GeeTimSortSlice* a, GeeTimSortSlice* b);
482 static void gee_tim_sort_slice_copy (GeeTimSortSlice* self);
483 static inline void* gee_tim_sort_slice_pop_first (GeeTimSortSlice* self);
484 static inline void gee_tim_sort_slice_merge_in (GeeTimSortSlice* self, void** dest_array, gint index, gint dest_index, gint count);
485 static inline void* gee_tim_sort_slice_pop_last (GeeTimSortSlice* self);
486 static inline void gee_tim_sort_slice_merge_in_reversed (GeeTimSortSlice* self, void** dest_array, gint index, gint dest_index, gint count);
487 static inline void gee_tim_sort_slice_shorten_end (GeeTimSortSlice* self, gint n);
488 static void gee_tim_sort_slice_instance_init (GeeTimSortSlice * self);
489 static inline void gee_tim_sort_slice_swap (GeeTimSortSlice* self, gint i, gint j);
490 static void gee_tim_sort_finalize (GObject* obj);
491 static void _vala_gee_tim_sort_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
492 static void _vala_gee_tim_sort_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
493 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
494 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
495 static void _vala_array_move (gpointer array, gsize element_size, gint src, gint dest, gint length);
496
497
498 void gee_tim_sort_sort (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target) {
499         GeeList* _tmp0_;
500         g_return_if_fail (list != NULL);
501         _tmp0_ = list;
502         if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_ARRAY_LIST)) {
503                 GeeList* _tmp1_;
504                 GCompareDataFunc _tmp2_;
505                 void* _tmp2__target;
506                 _tmp1_ = list;
507                 _tmp2_ = compare;
508                 _tmp2__target = compare_target;
509                 gee_tim_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);
510         } else {
511                 GeeList* _tmp3_;
512                 GCompareDataFunc _tmp4_;
513                 void* _tmp4__target;
514                 _tmp3_ = list;
515                 _tmp4_ = compare;
516                 _tmp4__target = compare_target;
517                 gee_tim_sort_sort_list (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp3_, _tmp4_, _tmp4__target);
518         }
519 }
520
521
522 static gpointer _g_object_ref0 (gpointer self) {
523         return self ? g_object_ref (self) : NULL;
524 }
525
526
527 static void gee_tim_sort_sort_list (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeList* list, GCompareDataFunc compare, void* compare_target) {
528         GeeTimSort* _tmp0_;
529         GeeTimSort* helper;
530         GeeTimSort* _tmp1_;
531         GeeList* _tmp2_;
532         GeeList* _tmp3_;
533         GeeTimSort* _tmp4_;
534         GeeList* _tmp5_;
535         gint _tmp6_ = 0;
536         gpointer* _tmp7_ = NULL;
537         GeeTimSort* _tmp8_;
538         GeeTimSort* _tmp9_;
539         gpointer* _tmp10_;
540         gint _tmp10__length1;
541         GeeTimSort* _tmp11_;
542         GeeTimSort* _tmp12_;
543         GeeList* _tmp13_;
544         gint _tmp14_;
545         gint _tmp15_;
546         GeeTimSort* _tmp16_;
547         GCompareDataFunc _tmp17_;
548         void* _tmp17__target;
549         GeeTimSort* _tmp18_;
550         GeeList* _tmp19_;
551         GeeTimSort* _tmp20_;
552         gpointer* _tmp21_;
553         gint _tmp21__length1;
554         g_return_if_fail (list != NULL);
555         _tmp0_ = gee_tim_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func);
556         helper = _tmp0_;
557         _tmp1_ = helper;
558         _tmp2_ = list;
559         _tmp3_ = _g_object_ref0 (_tmp2_);
560         _g_object_unref0 (_tmp1_->priv->list_collection);
561         _tmp1_->priv->list_collection = _tmp3_;
562         _tmp4_ = helper;
563         _tmp5_ = list;
564         _tmp7_ = gee_collection_to_array ((GeeCollection*) _tmp5_, &_tmp6_);
565         _tmp4_->priv->array = (_vala_array_free (_tmp4_->priv->array, _tmp4_->priv->array_length1, (GDestroyNotify) g_destroy_func), NULL);
566         _tmp4_->priv->array = _tmp7_;
567         _tmp4_->priv->array_length1 = _tmp6_;
568         _tmp4_->priv->_array_size_ = _tmp4_->priv->array_length1;
569         _tmp8_ = helper;
570         _tmp9_ = helper;
571         _tmp10_ = _tmp9_->priv->array;
572         _tmp10__length1 = _tmp9_->priv->array_length1;
573         _tmp8_->priv->list = _tmp10_;
574         _tmp11_ = helper;
575         _tmp11_->priv->index = 0;
576         _tmp12_ = helper;
577         _tmp13_ = list;
578         _tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_);
579         _tmp15_ = _tmp14_;
580         _tmp12_->priv->size = _tmp15_;
581         _tmp16_ = helper;
582         _tmp17_ = compare;
583         _tmp17__target = compare_target;
584         (_tmp16_->priv->compare_target_destroy_notify == NULL) ? NULL : (_tmp16_->priv->compare_target_destroy_notify (_tmp16_->priv->compare_target), NULL);
585         _tmp16_->priv->compare = NULL;
586         _tmp16_->priv->compare_target = NULL;
587         _tmp16_->priv->compare_target_destroy_notify = NULL;
588         _tmp16_->priv->compare = _tmp17_;
589         _tmp16_->priv->compare_target = _tmp17__target;
590         _tmp16_->priv->compare_target_destroy_notify = NULL;
591         _tmp18_ = helper;
592         gee_tim_sort_do_sort (_tmp18_);
593         _tmp19_ = list;
594         gee_collection_clear ((GeeCollection*) _tmp19_);
595         _tmp20_ = helper;
596         _tmp21_ = _tmp20_->priv->array;
597         _tmp21__length1 = _tmp20_->priv->array_length1;
598         {
599                 gpointer* item_collection = NULL;
600                 gint item_collection_length1 = 0;
601                 gint _item_collection_size_ = 0;
602                 gint item_it = 0;
603                 item_collection = _tmp21_;
604                 item_collection_length1 = _tmp21__length1;
605                 for (item_it = 0; item_it < _tmp21__length1; item_it = item_it + 1) {
606                         gpointer _tmp22_;
607                         gpointer item = NULL;
608                         _tmp22_ = ((item_collection[item_it] != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) item_collection[item_it]) : ((gpointer) item_collection[item_it]);
609                         item = _tmp22_;
610                         {
611                                 GeeList* _tmp23_;
612                                 gconstpointer _tmp24_;
613                                 _tmp23_ = list;
614                                 _tmp24_ = item;
615                                 gee_collection_add ((GeeCollection*) _tmp23_, _tmp24_);
616                                 _g_destroy_func0 (item);
617                         }
618                 }
619         }
620         _g_object_unref0 (helper);
621 }
622
623
624 static void gee_tim_sort_sort_arraylist (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list, GCompareDataFunc compare, void* compare_target) {
625         GeeTimSort* _tmp0_;
626         GeeTimSort* helper;
627         GeeArrayList* _tmp1_;
628         GeeList* _tmp2_;
629         GeeArrayList* _tmp3_;
630         gpointer* _tmp4_;
631         gint _tmp4__length1;
632         GeeArrayList* _tmp5_;
633         gint _tmp6_;
634         GCompareDataFunc _tmp7_;
635         void* _tmp7__target;
636         g_return_if_fail (list != NULL);
637         _tmp0_ = gee_tim_sort_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func);
638         helper = _tmp0_;
639         _tmp1_ = list;
640         _tmp2_ = _g_object_ref0 ((GeeList*) _tmp1_);
641         _g_object_unref0 (helper->priv->list_collection);
642         helper->priv->list_collection = _tmp2_;
643         _tmp3_ = list;
644         _tmp4_ = _tmp3_->_items;
645         _tmp4__length1 = _tmp3_->_items_length1;
646         helper->priv->list = _tmp4_;
647         helper->priv->index = 0;
648         _tmp5_ = list;
649         _tmp6_ = _tmp5_->_size;
650         helper->priv->size = _tmp6_;
651         _tmp7_ = compare;
652         _tmp7__target = compare_target;
653         (helper->priv->compare_target_destroy_notify == NULL) ? NULL : (helper->priv->compare_target_destroy_notify (helper->priv->compare_target), NULL);
654         helper->priv->compare = NULL;
655         helper->priv->compare_target = NULL;
656         helper->priv->compare_target_destroy_notify = NULL;
657         helper->priv->compare = _tmp7_;
658         helper->priv->compare_target = _tmp7__target;
659         helper->priv->compare_target_destroy_notify = NULL;
660         gee_tim_sort_do_sort (helper);
661         _g_object_unref0 (helper);
662 }
663
664
665 static void _vala_array_add1 (GeeTimSortSlice*** array, int* length, int* size, GeeTimSortSlice* value) {
666         if ((*length) == (*size)) {
667                 *size = (*size) ? (2 * (*size)) : 4;
668                 *array = g_renew (GeeTimSortSlice*, *array, (*size) + 1);
669         }
670         (*array)[(*length)++] = value;
671         (*array)[*length] = NULL;
672 }
673
674
675 static void gee_tim_sort_do_sort (GeeTimSort* self) {
676         gint _tmp0_;
677         GeeTimSortSlice** _tmp1_ = NULL;
678         void** _tmp2_;
679         gint _tmp3_;
680         gint _tmp4_;
681         GeeTimSortSlice* _tmp5_;
682         GeeTimSortSlice* remaining;
683         GeeTimSortSlice* _tmp6_;
684         gint _tmp7_;
685         gint _tmp8_ = 0;
686         gint minimum_length;
687         GeeTimSortSlice* _tmp33_;
688         gint _tmp34_;
689         gint _tmp35_;
690         GeeTimSortSlice** _tmp36_;
691         gint _tmp36__length1;
692         GeeTimSortSlice** _tmp37_;
693         gint _tmp37__length1;
694         GeeTimSortSlice* _tmp38_;
695         gint _tmp39_;
696         GeeTimSortSlice** _tmp40_;
697         gint _tmp40__length1;
698         GeeTimSortSlice* _tmp41_;
699         gint _tmp42_;
700         gint _tmp43_;
701         g_return_if_fail (self != NULL);
702         _tmp0_ = self->priv->size;
703         if (_tmp0_ < 2) {
704                 return;
705         }
706         _tmp1_ = g_new0 (GeeTimSortSlice*, 0 + 1);
707         self->priv->pending = (_vala_array_free (self->priv->pending, self->priv->pending_length1, (GDestroyNotify) gee_tim_sort_slice_free), NULL);
708         self->priv->pending = _tmp1_;
709         self->priv->pending_length1 = 0;
710         self->priv->_pending_size_ = self->priv->pending_length1;
711         self->priv->minimum_gallop = GEE_TIM_SORT_MINIMUM_GALLOP;
712         _tmp2_ = self->priv->list;
713         _tmp3_ = self->priv->index;
714         _tmp4_ = self->priv->size;
715         _tmp5_ = gee_tim_sort_slice_new (_tmp2_, _tmp3_, _tmp4_);
716         remaining = _tmp5_;
717         _tmp6_ = remaining;
718         _tmp7_ = _tmp6_->length;
719         _tmp8_ = gee_tim_sort_compute_minimum_run_length (self, _tmp7_);
720         minimum_length = _tmp8_;
721         while (TRUE) {
722                 GeeTimSortSlice* _tmp9_;
723                 gint _tmp10_;
724                 gboolean descending = FALSE;
725                 GeeTimSortSlice* _tmp11_;
726                 gboolean _tmp12_ = FALSE;
727                 GeeTimSortSlice* _tmp13_ = NULL;
728                 GeeTimSortSlice* run;
729                 gboolean _tmp14_;
730                 GeeTimSortSlice* _tmp16_;
731                 gint _tmp17_;
732                 gint _tmp18_;
733                 GeeTimSortSlice* _tmp28_;
734                 GeeTimSortSlice* _tmp29_;
735                 gint _tmp30_;
736                 GeeTimSortSlice** _tmp31_;
737                 gint _tmp31__length1;
738                 GeeTimSortSlice* _tmp32_;
739                 _tmp9_ = remaining;
740                 _tmp10_ = _tmp9_->length;
741                 if (!(_tmp10_ > 0)) {
742                         break;
743                 }
744                 _tmp11_ = remaining;
745                 _tmp13_ = gee_tim_sort_compute_longest_run (self, _tmp11_, &_tmp12_);
746                 descending = _tmp12_;
747                 run = _tmp13_;
748                 _tmp14_ = descending;
749                 if (_tmp14_) {
750                         GeeTimSortSlice* _tmp15_;
751                         _tmp15_ = run;
752                         gee_tim_sort_slice_reverse (_tmp15_);
753                 }
754                 _tmp16_ = run;
755                 _tmp17_ = _tmp16_->length;
756                 _tmp18_ = minimum_length;
757                 if (_tmp17_ < _tmp18_) {
758                         GeeTimSortSlice* _tmp19_;
759                         gint _tmp20_;
760                         gint sorted_count;
761                         GeeTimSortSlice* _tmp21_;
762                         gint _tmp22_;
763                         GeeTimSortSlice* _tmp23_;
764                         gint _tmp24_;
765                         gint _tmp25_ = 0;
766                         GeeTimSortSlice* _tmp26_;
767                         gint _tmp27_;
768                         _tmp19_ = run;
769                         _tmp20_ = _tmp19_->length;
770                         sorted_count = _tmp20_;
771                         _tmp21_ = run;
772                         _tmp22_ = minimum_length;
773                         _tmp23_ = remaining;
774                         _tmp24_ = _tmp23_->length;
775                         _tmp25_ = MIN (_tmp22_, _tmp24_);
776                         _tmp21_->length = _tmp25_;
777                         _tmp26_ = run;
778                         _tmp27_ = sorted_count;
779                         gee_tim_sort_insertion_sort (self, _tmp26_, _tmp27_);
780                 }
781                 _tmp28_ = remaining;
782                 _tmp29_ = run;
783                 _tmp30_ = _tmp29_->length;
784                 gee_tim_sort_slice_shorten_start (_tmp28_, _tmp30_);
785                 _tmp31_ = self->priv->pending;
786                 _tmp31__length1 = self->priv->pending_length1;
787                 _tmp32_ = run;
788                 run = NULL;
789                 _vala_array_add1 (&self->priv->pending, &self->priv->pending_length1, &self->priv->_pending_size_, _tmp32_);
790                 gee_tim_sort_merge_collapse (self);
791                 _gee_tim_sort_slice_free0 (run);
792         }
793         _tmp33_ = remaining;
794         _tmp34_ = _tmp33_->index;
795         _tmp35_ = self->priv->size;
796         _vala_assert (_tmp34_ == _tmp35_, "remaining.index == size");
797         gee_tim_sort_merge_force_collapse (self);
798         _tmp36_ = self->priv->pending;
799         _tmp36__length1 = self->priv->pending_length1;
800         _vala_assert (_tmp36__length1 == 1, "pending.length == 1");
801         _tmp37_ = self->priv->pending;
802         _tmp37__length1 = self->priv->pending_length1;
803         _tmp38_ = _tmp37_[0];
804         _tmp39_ = _tmp38_->index;
805         _vala_assert (_tmp39_ == 0, "pending[0].index == 0");
806         _tmp40_ = self->priv->pending;
807         _tmp40__length1 = self->priv->pending_length1;
808         _tmp41_ = _tmp40_[0];
809         _tmp42_ = _tmp41_->length;
810         _tmp43_ = self->priv->size;
811         _vala_assert (_tmp42_ == _tmp43_, "pending[0].length == size");
812         _gee_tim_sort_slice_free0 (remaining);
813 }
814
815
816 static inline gboolean gee_tim_sort_lower_than (GeeTimSort* self, gconstpointer left, gconstpointer right) {
817         gboolean result = FALSE;
818         GCompareDataFunc _tmp0_;
819         void* _tmp0__target;
820         gconstpointer _tmp1_;
821         gconstpointer _tmp2_;
822         gint _tmp3_ = 0;
823         g_return_val_if_fail (self != NULL, FALSE);
824         _tmp0_ = self->priv->compare;
825         _tmp0__target = self->priv->compare_target;
826         _tmp1_ = left;
827         _tmp2_ = right;
828         _tmp3_ = _tmp0_ (_tmp1_, _tmp2_, _tmp0__target);
829         result = _tmp3_ < 0;
830         return result;
831 }
832
833
834 static inline gboolean gee_tim_sort_lower_than_or_equal_to (GeeTimSort* self, gconstpointer left, gconstpointer right) {
835         gboolean result = FALSE;
836         GCompareDataFunc _tmp0_;
837         void* _tmp0__target;
838         gconstpointer _tmp1_;
839         gconstpointer _tmp2_;
840         gint _tmp3_ = 0;
841         g_return_val_if_fail (self != NULL, FALSE);
842         _tmp0_ = self->priv->compare;
843         _tmp0__target = self->priv->compare_target;
844         _tmp1_ = left;
845         _tmp2_ = right;
846         _tmp3_ = _tmp0_ (_tmp1_, _tmp2_, _tmp0__target);
847         result = _tmp3_ <= 0;
848         return result;
849 }
850
851
852 static gint gee_tim_sort_compute_minimum_run_length (GeeTimSort* self, gint length) {
853         gint result = 0;
854         gint run_length;
855         gint _tmp4_;
856         gint _tmp5_;
857         g_return_val_if_fail (self != NULL, 0);
858         run_length = 0;
859         while (TRUE) {
860                 gint _tmp0_;
861                 gint _tmp1_;
862                 gint _tmp2_;
863                 gint _tmp3_;
864                 _tmp0_ = length;
865                 if (!(_tmp0_ >= 64)) {
866                         break;
867                 }
868                 _tmp1_ = run_length;
869                 _tmp2_ = length;
870                 run_length = _tmp1_ | (_tmp2_ & 1);
871                 _tmp3_ = length;
872                 length = _tmp3_ >> 1;
873         }
874         _tmp4_ = length;
875         _tmp5_ = run_length;
876         result = _tmp4_ + _tmp5_;
877         return result;
878 }
879
880
881 static GeeTimSortSlice* gee_tim_sort_compute_longest_run (GeeTimSort* self, GeeTimSortSlice* a, gboolean* descending) {
882         gboolean _vala_descending = FALSE;
883         GeeTimSortSlice* result = NULL;
884         gint run_length = 0;
885         GeeTimSortSlice* _tmp0_;
886         gint _tmp1_;
887         GeeTimSortSlice* _tmp55_;
888         void** _tmp56_;
889         GeeTimSortSlice* _tmp57_;
890         gint _tmp58_;
891         gint _tmp59_;
892         GeeTimSortSlice* _tmp60_;
893         g_return_val_if_fail (self != NULL, NULL);
894         g_return_val_if_fail (a != NULL, NULL);
895         _tmp0_ = a;
896         _tmp1_ = _tmp0_->length;
897         if (_tmp1_ <= 1) {
898                 GeeTimSortSlice* _tmp2_;
899                 gint _tmp3_;
900                 _tmp2_ = a;
901                 _tmp3_ = _tmp2_->length;
902                 run_length = _tmp3_;
903                 _vala_descending = FALSE;
904         } else {
905                 GeeTimSortSlice* _tmp4_;
906                 void** _tmp5_;
907                 GeeTimSortSlice* _tmp6_;
908                 gint _tmp7_;
909                 void* _tmp8_;
910                 GeeTimSortSlice* _tmp9_;
911                 void** _tmp10_;
912                 GeeTimSortSlice* _tmp11_;
913                 gint _tmp12_;
914                 void* _tmp13_;
915                 gboolean _tmp14_ = FALSE;
916                 run_length = 2;
917                 _tmp4_ = a;
918                 _tmp5_ = _tmp4_->list;
919                 _tmp6_ = a;
920                 _tmp7_ = _tmp6_->index;
921                 _tmp8_ = _tmp5_[_tmp7_ + 1];
922                 _tmp9_ = a;
923                 _tmp10_ = _tmp9_->list;
924                 _tmp11_ = a;
925                 _tmp12_ = _tmp11_->index;
926                 _tmp13_ = _tmp10_[_tmp12_];
927                 _tmp14_ = gee_tim_sort_lower_than (self, _tmp8_, _tmp13_);
928                 if (_tmp14_) {
929                         _vala_descending = TRUE;
930                         {
931                                 GeeTimSortSlice* _tmp15_;
932                                 gint _tmp16_;
933                                 gint i;
934                                 _tmp15_ = a;
935                                 _tmp16_ = _tmp15_->index;
936                                 i = _tmp16_ + 2;
937                                 {
938                                         gboolean _tmp17_;
939                                         _tmp17_ = TRUE;
940                                         while (TRUE) {
941                                                 gboolean _tmp18_;
942                                                 gint _tmp20_;
943                                                 GeeTimSortSlice* _tmp21_;
944                                                 gint _tmp22_;
945                                                 GeeTimSortSlice* _tmp23_;
946                                                 gint _tmp24_;
947                                                 GeeTimSortSlice* _tmp25_;
948                                                 void** _tmp26_;
949                                                 gint _tmp27_;
950                                                 void* _tmp28_;
951                                                 GeeTimSortSlice* _tmp29_;
952                                                 void** _tmp30_;
953                                                 gint _tmp31_;
954                                                 void* _tmp32_;
955                                                 gboolean _tmp33_ = FALSE;
956                                                 _tmp18_ = _tmp17_;
957                                                 if (!_tmp18_) {
958                                                         gint _tmp19_;
959                                                         _tmp19_ = i;
960                                                         i = _tmp19_ + 1;
961                                                 }
962                                                 _tmp17_ = FALSE;
963                                                 _tmp20_ = i;
964                                                 _tmp21_ = a;
965                                                 _tmp22_ = _tmp21_->index;
966                                                 _tmp23_ = a;
967                                                 _tmp24_ = _tmp23_->length;
968                                                 if (!(_tmp20_ < (_tmp22_ + _tmp24_))) {
969                                                         break;
970                                                 }
971                                                 _tmp25_ = a;
972                                                 _tmp26_ = _tmp25_->list;
973                                                 _tmp27_ = i;
974                                                 _tmp28_ = _tmp26_[_tmp27_];
975                                                 _tmp29_ = a;
976                                                 _tmp30_ = _tmp29_->list;
977                                                 _tmp31_ = i;
978                                                 _tmp32_ = _tmp30_[_tmp31_ - 1];
979                                                 _tmp33_ = gee_tim_sort_lower_than (self, _tmp28_, _tmp32_);
980                                                 if (_tmp33_) {
981                                                         gint _tmp34_;
982                                                         _tmp34_ = run_length;
983                                                         run_length = _tmp34_ + 1;
984                                                 } else {
985                                                         break;
986                                                 }
987                                         }
988                                 }
989                         }
990                 } else {
991                         _vala_descending = FALSE;
992                         {
993                                 GeeTimSortSlice* _tmp35_;
994                                 gint _tmp36_;
995                                 gint i;
996                                 _tmp35_ = a;
997                                 _tmp36_ = _tmp35_->index;
998                                 i = _tmp36_ + 2;
999                                 {
1000                                         gboolean _tmp37_;
1001                                         _tmp37_ = TRUE;
1002                                         while (TRUE) {
1003                                                 gboolean _tmp38_;
1004                                                 gint _tmp40_;
1005                                                 GeeTimSortSlice* _tmp41_;
1006                                                 gint _tmp42_;
1007                                                 GeeTimSortSlice* _tmp43_;
1008                                                 gint _tmp44_;
1009                                                 GeeTimSortSlice* _tmp45_;
1010                                                 void** _tmp46_;
1011                                                 gint _tmp47_;
1012                                                 void* _tmp48_;
1013                                                 GeeTimSortSlice* _tmp49_;
1014                                                 void** _tmp50_;
1015                                                 gint _tmp51_;
1016                                                 void* _tmp52_;
1017                                                 gboolean _tmp53_ = FALSE;
1018                                                 _tmp38_ = _tmp37_;
1019                                                 if (!_tmp38_) {
1020                                                         gint _tmp39_;
1021                                                         _tmp39_ = i;
1022                                                         i = _tmp39_ + 1;
1023                                                 }
1024                                                 _tmp37_ = FALSE;
1025                                                 _tmp40_ = i;
1026                                                 _tmp41_ = a;
1027                                                 _tmp42_ = _tmp41_->index;
1028                                                 _tmp43_ = a;
1029                                                 _tmp44_ = _tmp43_->length;
1030                                                 if (!(_tmp40_ < (_tmp42_ + _tmp44_))) {
1031                                                         break;
1032                                                 }
1033                                                 _tmp45_ = a;
1034                                                 _tmp46_ = _tmp45_->list;
1035                                                 _tmp47_ = i;
1036                                                 _tmp48_ = _tmp46_[_tmp47_];
1037                                                 _tmp49_ = a;
1038                                                 _tmp50_ = _tmp49_->list;
1039                                                 _tmp51_ = i;
1040                                                 _tmp52_ = _tmp50_[_tmp51_ - 1];
1041                                                 _tmp53_ = gee_tim_sort_lower_than (self, _tmp48_, _tmp52_);
1042                                                 if (_tmp53_) {
1043                                                         break;
1044                                                 } else {
1045                                                         gint _tmp54_;
1046                                                         _tmp54_ = run_length;
1047                                                         run_length = _tmp54_ + 1;
1048                                                 }
1049                                         }
1050                                 }
1051                         }
1052                 }
1053         }
1054         _tmp55_ = a;
1055         _tmp56_ = _tmp55_->list;
1056         _tmp57_ = a;
1057         _tmp58_ = _tmp57_->index;
1058         _tmp59_ = run_length;
1059         _tmp60_ = gee_tim_sort_slice_new (_tmp56_, _tmp58_, _tmp59_);
1060         result = _tmp60_;
1061         if (descending) {
1062                 *descending = _vala_descending;
1063         }
1064         return result;
1065 }
1066
1067
1068 static void gee_tim_sort_insertion_sort (GeeTimSort* self, GeeTimSortSlice* a, gint offset) {
1069         g_return_if_fail (self != NULL);
1070         g_return_if_fail (a != NULL);
1071         {
1072                 GeeTimSortSlice* _tmp0_;
1073                 gint _tmp1_;
1074                 gint _tmp2_;
1075                 gint start;
1076                 _tmp0_ = a;
1077                 _tmp1_ = _tmp0_->index;
1078                 _tmp2_ = offset;
1079                 start = _tmp1_ + _tmp2_;
1080                 {
1081                         gboolean _tmp3_;
1082                         _tmp3_ = TRUE;
1083                         while (TRUE) {
1084                                 gboolean _tmp4_;
1085                                 gint _tmp6_;
1086                                 GeeTimSortSlice* _tmp7_;
1087                                 gint _tmp8_;
1088                                 GeeTimSortSlice* _tmp9_;
1089                                 gint _tmp10_;
1090                                 GeeTimSortSlice* _tmp11_;
1091                                 gint _tmp12_;
1092                                 gint left;
1093                                 gint _tmp13_;
1094                                 gint right;
1095                                 GeeTimSortSlice* _tmp14_;
1096                                 void** _tmp15_;
1097                                 gint _tmp16_;
1098                                 void* _tmp17_;
1099                                 void* pivot;
1100                                 gint _tmp31_;
1101                                 gint _tmp32_;
1102                                 GeeTimSortSlice* _tmp33_;
1103                                 void** _tmp34_;
1104                                 gint _tmp35_;
1105                                 GeeTimSortSlice* _tmp36_;
1106                                 void** _tmp37_;
1107                                 gint _tmp38_;
1108                                 gint _tmp39_;
1109                                 gint _tmp40_;
1110                                 GeeTimSortSlice* _tmp41_;
1111                                 void** _tmp42_;
1112                                 gint _tmp43_;
1113                                 void* _tmp44_;
1114                                 void* _tmp45_;
1115                                 _tmp4_ = _tmp3_;
1116                                 if (!_tmp4_) {
1117                                         gint _tmp5_;
1118                                         _tmp5_ = start;
1119                                         start = _tmp5_ + 1;
1120                                 }
1121                                 _tmp3_ = FALSE;
1122                                 _tmp6_ = start;
1123                                 _tmp7_ = a;
1124                                 _tmp8_ = _tmp7_->index;
1125                                 _tmp9_ = a;
1126                                 _tmp10_ = _tmp9_->length;
1127                                 if (!(_tmp6_ < (_tmp8_ + _tmp10_))) {
1128                                         break;
1129                                 }
1130                                 _tmp11_ = a;
1131                                 _tmp12_ = _tmp11_->index;
1132                                 left = _tmp12_;
1133                                 _tmp13_ = start;
1134                                 right = _tmp13_;
1135                                 _tmp14_ = a;
1136                                 _tmp15_ = _tmp14_->list;
1137                                 _tmp16_ = right;
1138                                 _tmp17_ = _tmp15_[_tmp16_];
1139                                 pivot = _tmp17_;
1140                                 while (TRUE) {
1141                                         gint _tmp18_;
1142                                         gint _tmp19_;
1143                                         gint _tmp20_;
1144                                         gint _tmp21_;
1145                                         gint _tmp22_;
1146                                         gint p;
1147                                         void* _tmp23_;
1148                                         GeeTimSortSlice* _tmp24_;
1149                                         void** _tmp25_;
1150                                         gint _tmp26_;
1151                                         void* _tmp27_;
1152                                         gboolean _tmp28_ = FALSE;
1153                                         _tmp18_ = left;
1154                                         _tmp19_ = right;
1155                                         if (!(_tmp18_ < _tmp19_)) {
1156                                                 break;
1157                                         }
1158                                         _tmp20_ = left;
1159                                         _tmp21_ = right;
1160                                         _tmp22_ = left;
1161                                         p = _tmp20_ + ((_tmp21_ - _tmp22_) >> 1);
1162                                         _tmp23_ = pivot;
1163                                         _tmp24_ = a;
1164                                         _tmp25_ = _tmp24_->list;
1165                                         _tmp26_ = p;
1166                                         _tmp27_ = _tmp25_[_tmp26_];
1167                                         _tmp28_ = gee_tim_sort_lower_than (self, _tmp23_, _tmp27_);
1168                                         if (_tmp28_) {
1169                                                 gint _tmp29_;
1170                                                 _tmp29_ = p;
1171                                                 right = _tmp29_;
1172                                         } else {
1173                                                 gint _tmp30_;
1174                                                 _tmp30_ = p;
1175                                                 left = _tmp30_ + 1;
1176                                         }
1177                                 }
1178                                 _tmp31_ = left;
1179                                 _tmp32_ = right;
1180                                 _vala_assert (_tmp31_ == _tmp32_, "left == right");
1181                                 _tmp33_ = a;
1182                                 _tmp34_ = _tmp33_->list;
1183                                 _tmp35_ = left;
1184                                 _tmp36_ = a;
1185                                 _tmp37_ = _tmp36_->list;
1186                                 _tmp38_ = left;
1187                                 _tmp39_ = start;
1188                                 _tmp40_ = left;
1189                                 g_memmove (&_tmp34_[_tmp35_ + 1], &_tmp37_[_tmp38_], (gsize) (sizeof (gpointer) * (_tmp39_ - _tmp40_)));
1190                                 _tmp41_ = a;
1191                                 _tmp42_ = _tmp41_->list;
1192                                 _tmp43_ = left;
1193                                 _tmp44_ = pivot;
1194                                 _tmp42_[_tmp43_] = _tmp44_;
1195                                 _tmp45_ = _tmp42_[_tmp43_];
1196                         }
1197                 }
1198         }
1199 }
1200
1201
1202 static void gee_tim_sort_merge_collapse (GeeTimSort* self) {
1203         GeeTimSortSlice** _tmp0_;
1204         gint _tmp0__length1;
1205         gint count;
1206         g_return_if_fail (self != NULL);
1207         _tmp0_ = self->priv->pending;
1208         _tmp0__length1 = self->priv->pending_length1;
1209         count = _tmp0__length1;
1210         while (TRUE) {
1211                 gint _tmp1_;
1212                 gboolean _tmp2_ = FALSE;
1213                 gint _tmp3_;
1214                 gboolean _tmp16_;
1215                 GeeTimSortSlice** _tmp36_;
1216                 gint _tmp36__length1;
1217                 _tmp1_ = count;
1218                 if (!(_tmp1_ > 1)) {
1219                         break;
1220                 }
1221                 _tmp3_ = count;
1222                 if (_tmp3_ >= 3) {
1223                         GeeTimSortSlice** _tmp4_;
1224                         gint _tmp4__length1;
1225                         gint _tmp5_;
1226                         GeeTimSortSlice* _tmp6_;
1227                         gint _tmp7_;
1228                         GeeTimSortSlice** _tmp8_;
1229                         gint _tmp8__length1;
1230                         gint _tmp9_;
1231                         GeeTimSortSlice* _tmp10_;
1232                         gint _tmp11_;
1233                         GeeTimSortSlice** _tmp12_;
1234                         gint _tmp12__length1;
1235                         gint _tmp13_;
1236                         GeeTimSortSlice* _tmp14_;
1237                         gint _tmp15_;
1238                         _tmp4_ = self->priv->pending;
1239                         _tmp4__length1 = self->priv->pending_length1;
1240                         _tmp5_ = count;
1241                         _tmp6_ = _tmp4_[_tmp5_ - 3];
1242                         _tmp7_ = _tmp6_->length;
1243                         _tmp8_ = self->priv->pending;
1244                         _tmp8__length1 = self->priv->pending_length1;
1245                         _tmp9_ = count;
1246                         _tmp10_ = _tmp8_[_tmp9_ - 2];
1247                         _tmp11_ = _tmp10_->length;
1248                         _tmp12_ = self->priv->pending;
1249                         _tmp12__length1 = self->priv->pending_length1;
1250                         _tmp13_ = count;
1251                         _tmp14_ = _tmp12_[_tmp13_ - 1];
1252                         _tmp15_ = _tmp14_->length;
1253                         _tmp2_ = _tmp7_ <= (_tmp11_ + _tmp15_);
1254                 } else {
1255                         _tmp2_ = FALSE;
1256                 }
1257                 _tmp16_ = _tmp2_;
1258                 if (_tmp16_) {
1259                         GeeTimSortSlice** _tmp17_;
1260                         gint _tmp17__length1;
1261                         gint _tmp18_;
1262                         GeeTimSortSlice* _tmp19_;
1263                         gint _tmp20_;
1264                         GeeTimSortSlice** _tmp21_;
1265                         gint _tmp21__length1;
1266                         gint _tmp22_;
1267                         GeeTimSortSlice* _tmp23_;
1268                         gint _tmp24_;
1269                         _tmp17_ = self->priv->pending;
1270                         _tmp17__length1 = self->priv->pending_length1;
1271                         _tmp18_ = count;
1272                         _tmp19_ = _tmp17_[_tmp18_ - 3];
1273                         _tmp20_ = _tmp19_->length;
1274                         _tmp21_ = self->priv->pending;
1275                         _tmp21__length1 = self->priv->pending_length1;
1276                         _tmp22_ = count;
1277                         _tmp23_ = _tmp21_[_tmp22_ - 1];
1278                         _tmp24_ = _tmp23_->length;
1279                         if (_tmp20_ < _tmp24_) {
1280                                 gint _tmp25_;
1281                                 _tmp25_ = count;
1282                                 gee_tim_sort_merge_at (self, _tmp25_ - 3);
1283                         } else {
1284                                 gint _tmp26_;
1285                                 _tmp26_ = count;
1286                                 gee_tim_sort_merge_at (self, _tmp26_ - 2);
1287                         }
1288                 } else {
1289                         GeeTimSortSlice** _tmp27_;
1290                         gint _tmp27__length1;
1291                         gint _tmp28_;
1292                         GeeTimSortSlice* _tmp29_;
1293                         gint _tmp30_;
1294                         GeeTimSortSlice** _tmp31_;
1295                         gint _tmp31__length1;
1296                         gint _tmp32_;
1297                         GeeTimSortSlice* _tmp33_;
1298                         gint _tmp34_;
1299                         _tmp27_ = self->priv->pending;
1300                         _tmp27__length1 = self->priv->pending_length1;
1301                         _tmp28_ = count;
1302                         _tmp29_ = _tmp27_[_tmp28_ - 2];
1303                         _tmp30_ = _tmp29_->length;
1304                         _tmp31_ = self->priv->pending;
1305                         _tmp31__length1 = self->priv->pending_length1;
1306                         _tmp32_ = count;
1307                         _tmp33_ = _tmp31_[_tmp32_ - 1];
1308                         _tmp34_ = _tmp33_->length;
1309                         if (_tmp30_ <= _tmp34_) {
1310                                 gint _tmp35_;
1311                                 _tmp35_ = count;
1312                                 gee_tim_sort_merge_at (self, _tmp35_ - 2);
1313                         } else {
1314                                 break;
1315                         }
1316                 }
1317                 _tmp36_ = self->priv->pending;
1318                 _tmp36__length1 = self->priv->pending_length1;
1319                 count = _tmp36__length1;
1320         }
1321 }
1322
1323
1324 static void gee_tim_sort_merge_force_collapse (GeeTimSort* self) {
1325         GeeTimSortSlice** _tmp0_;
1326         gint _tmp0__length1;
1327         gint count;
1328         g_return_if_fail (self != NULL);
1329         _tmp0_ = self->priv->pending;
1330         _tmp0__length1 = self->priv->pending_length1;
1331         count = _tmp0__length1;
1332         while (TRUE) {
1333                 gint _tmp1_;
1334                 gboolean _tmp2_ = FALSE;
1335                 gint _tmp3_;
1336                 gboolean _tmp12_;
1337                 GeeTimSortSlice** _tmp15_;
1338                 gint _tmp15__length1;
1339                 _tmp1_ = count;
1340                 if (!(_tmp1_ > 1)) {
1341                         break;
1342                 }
1343                 _tmp3_ = count;
1344                 if (_tmp3_ >= 3) {
1345                         GeeTimSortSlice** _tmp4_;
1346                         gint _tmp4__length1;
1347                         gint _tmp5_;
1348                         GeeTimSortSlice* _tmp6_;
1349                         gint _tmp7_;
1350                         GeeTimSortSlice** _tmp8_;
1351                         gint _tmp8__length1;
1352                         gint _tmp9_;
1353                         GeeTimSortSlice* _tmp10_;
1354                         gint _tmp11_;
1355                         _tmp4_ = self->priv->pending;
1356                         _tmp4__length1 = self->priv->pending_length1;
1357                         _tmp5_ = count;
1358                         _tmp6_ = _tmp4_[_tmp5_ - 3];
1359                         _tmp7_ = _tmp6_->length;
1360                         _tmp8_ = self->priv->pending;
1361                         _tmp8__length1 = self->priv->pending_length1;
1362                         _tmp9_ = count;
1363                         _tmp10_ = _tmp8_[_tmp9_ - 1];
1364                         _tmp11_ = _tmp10_->length;
1365                         _tmp2_ = _tmp7_ < _tmp11_;
1366                 } else {
1367                         _tmp2_ = FALSE;
1368                 }
1369                 _tmp12_ = _tmp2_;
1370                 if (_tmp12_) {
1371                         gint _tmp13_;
1372                         _tmp13_ = count;
1373                         gee_tim_sort_merge_at (self, _tmp13_ - 3);
1374                 } else {
1375                         gint _tmp14_;
1376                         _tmp14_ = count;
1377                         gee_tim_sort_merge_at (self, _tmp14_ - 2);
1378                 }
1379                 _tmp15_ = self->priv->pending;
1380                 _tmp15__length1 = self->priv->pending_length1;
1381                 count = _tmp15__length1;
1382         }
1383 }
1384
1385
1386 static void gee_tim_sort_merge_at (GeeTimSort* self, gint index) {
1387         GeeTimSortSlice** _tmp0_;
1388         gint _tmp0__length1;
1389         gint _tmp1_;
1390         GeeTimSortSlice* _tmp2_;
1391         GeeTimSortSlice* a;
1392         GeeTimSortSlice** _tmp3_;
1393         gint _tmp3__length1;
1394         gint _tmp4_;
1395         GeeTimSortSlice* _tmp5_;
1396         GeeTimSortSlice* b;
1397         GeeTimSortSlice* _tmp6_;
1398         gint _tmp7_;
1399         GeeTimSortSlice* _tmp8_;
1400         gint _tmp9_;
1401         GeeTimSortSlice* _tmp10_;
1402         gint _tmp11_;
1403         GeeTimSortSlice* _tmp12_;
1404         gint _tmp13_;
1405         GeeTimSortSlice* _tmp14_;
1406         gint _tmp15_;
1407         GeeTimSortSlice** _tmp16_;
1408         gint _tmp16__length1;
1409         gint _tmp17_;
1410         void** _tmp18_;
1411         GeeTimSortSlice* _tmp19_;
1412         gint _tmp20_;
1413         GeeTimSortSlice* _tmp21_;
1414         gint _tmp22_;
1415         GeeTimSortSlice* _tmp23_;
1416         gint _tmp24_;
1417         GeeTimSortSlice* _tmp25_;
1418         GeeTimSortSlice* _tmp26_;
1419         gint _tmp27_;
1420         gint _tmp28_;
1421         GeeTimSortSlice** _tmp29_;
1422         gint _tmp29__length1;
1423         gint _tmp30_;
1424         gint _tmp31_;
1425         GeeTimSortSlice* _tmp32_;
1426         void* _tmp33_ = NULL;
1427         GeeTimSortSlice* _tmp34_;
1428         gint _tmp35_ = 0;
1429         gint sorted_count;
1430         GeeTimSortSlice* _tmp36_;
1431         gint _tmp37_;
1432         GeeTimSortSlice* _tmp38_;
1433         gint _tmp39_;
1434         GeeTimSortSlice* _tmp40_;
1435         GeeTimSortSlice* _tmp41_;
1436         void* _tmp42_ = NULL;
1437         GeeTimSortSlice* _tmp43_;
1438         GeeTimSortSlice* _tmp44_;
1439         gint _tmp45_;
1440         gint _tmp46_ = 0;
1441         GeeTimSortSlice* _tmp47_;
1442         gint _tmp48_;
1443         GeeTimSortSlice* _tmp49_;
1444         gint _tmp50_;
1445         GeeTimSortSlice* _tmp51_;
1446         gint _tmp52_;
1447         g_return_if_fail (self != NULL);
1448         _tmp0_ = self->priv->pending;
1449         _tmp0__length1 = self->priv->pending_length1;
1450         _tmp1_ = index;
1451         _tmp2_ = _tmp0_[_tmp1_];
1452         _tmp0_[_tmp1_] = NULL;
1453         a = _tmp2_;
1454         _tmp3_ = self->priv->pending;
1455         _tmp3__length1 = self->priv->pending_length1;
1456         _tmp4_ = index;
1457         _tmp5_ = _tmp3_[_tmp4_ + 1];
1458         _tmp3_[_tmp4_ + 1] = NULL;
1459         b = _tmp5_;
1460         _tmp6_ = a;
1461         _tmp7_ = _tmp6_->length;
1462         _vala_assert (_tmp7_ > 0, "a.length > 0");
1463         _tmp8_ = b;
1464         _tmp9_ = _tmp8_->length;
1465         _vala_assert (_tmp9_ > 0, "b.length > 0");
1466         _tmp10_ = a;
1467         _tmp11_ = _tmp10_->index;
1468         _tmp12_ = a;
1469         _tmp13_ = _tmp12_->length;
1470         _tmp14_ = b;
1471         _tmp15_ = _tmp14_->index;
1472         _vala_assert ((_tmp11_ + _tmp13_) == _tmp15_, "a.index + a.length == b.index");
1473         _tmp16_ = self->priv->pending;
1474         _tmp16__length1 = self->priv->pending_length1;
1475         _tmp17_ = index;
1476         _tmp18_ = self->priv->list;
1477         _tmp19_ = a;
1478         _tmp20_ = _tmp19_->index;
1479         _tmp21_ = a;
1480         _tmp22_ = _tmp21_->length;
1481         _tmp23_ = b;
1482         _tmp24_ = _tmp23_->length;
1483         _tmp25_ = gee_tim_sort_slice_new (_tmp18_, _tmp20_, _tmp22_ + _tmp24_);
1484         _gee_tim_sort_slice_free0 (_tmp16_[_tmp17_]);
1485         _tmp16_[_tmp17_] = _tmp25_;
1486         _tmp26_ = _tmp16_[_tmp17_];
1487         _tmp27_ = index;
1488         _tmp28_ = index;
1489         _tmp29_ = self->priv->pending;
1490         _tmp29__length1 = self->priv->pending_length1;
1491         _tmp30_ = index;
1492         _vala_array_move (self->priv->pending, sizeof (GeeTimSortSlice*), _tmp27_ + 2, _tmp28_ + 1, (_tmp29__length1 - _tmp30_) - 2);
1493         self->priv->pending_length1 = self->priv->pending_length1 - 1;
1494         _tmp31_ = self->priv->pending_length1;
1495         _tmp32_ = b;
1496         _tmp33_ = gee_tim_sort_slice_peek_first (_tmp32_);
1497         _tmp34_ = a;
1498         _tmp35_ = gee_tim_sort_gallop_rightmost (self, _tmp33_, _tmp34_, 0);
1499         sorted_count = _tmp35_;
1500         _tmp36_ = a;
1501         _tmp37_ = sorted_count;
1502         gee_tim_sort_slice_shorten_start (_tmp36_, _tmp37_);
1503         _tmp38_ = a;
1504         _tmp39_ = _tmp38_->length;
1505         if (_tmp39_ == 0) {
1506                 _gee_tim_sort_slice_free0 (b);
1507                 _gee_tim_sort_slice_free0 (a);
1508                 return;
1509         }
1510         _tmp40_ = b;
1511         _tmp41_ = a;
1512         _tmp42_ = gee_tim_sort_slice_peek_last (_tmp41_);
1513         _tmp43_ = b;
1514         _tmp44_ = b;
1515         _tmp45_ = _tmp44_->length;
1516         _tmp46_ = gee_tim_sort_gallop_leftmost (self, _tmp42_, _tmp43_, _tmp45_ - 1);
1517         _tmp40_->length = _tmp46_;
1518         _tmp47_ = b;
1519         _tmp48_ = _tmp47_->length;
1520         if (_tmp48_ == 0) {
1521                 _gee_tim_sort_slice_free0 (b);
1522                 _gee_tim_sort_slice_free0 (a);
1523                 return;
1524         }
1525         _tmp49_ = a;
1526         _tmp50_ = _tmp49_->length;
1527         _tmp51_ = b;
1528         _tmp52_ = _tmp51_->length;
1529         if (_tmp50_ <= _tmp52_) {
1530                 GeeTimSortSlice* _tmp53_;
1531                 GeeTimSortSlice* _tmp54_;
1532                 _tmp53_ = a;
1533                 a = NULL;
1534                 _tmp54_ = b;
1535                 b = NULL;
1536                 gee_tim_sort_merge_low (self, _tmp53_, _tmp54_);
1537         } else {
1538                 GeeTimSortSlice* _tmp55_;
1539                 GeeTimSortSlice* _tmp56_;
1540                 _tmp55_ = a;
1541                 a = NULL;
1542                 _tmp56_ = b;
1543                 b = NULL;
1544                 gee_tim_sort_merge_high (self, _tmp55_, _tmp56_);
1545         }
1546         _gee_tim_sort_slice_free0 (b);
1547         _gee_tim_sort_slice_free0 (a);
1548 }
1549
1550
1551 static gint gee_tim_sort_gallop_leftmost (GeeTimSort* self, gconstpointer key, GeeTimSortSlice* a, gint hint) {
1552         gint result = 0;
1553         gint _tmp0_;
1554         gint _tmp1_;
1555         GeeTimSortSlice* _tmp2_;
1556         gint _tmp3_;
1557         GeeTimSortSlice* _tmp4_;
1558         gint _tmp5_;
1559         gint _tmp6_;
1560         gint p;
1561         gint last_offset;
1562         gint offset;
1563         GeeTimSortSlice* _tmp7_;
1564         void** _tmp8_;
1565         gint _tmp9_;
1566         void* _tmp10_;
1567         gconstpointer _tmp11_;
1568         gboolean _tmp12_ = FALSE;
1569         gint _tmp57_;
1570         gint _tmp58_;
1571         gint _tmp59_;
1572         gint _tmp60_;
1573         GeeTimSortSlice* _tmp61_;
1574         gint _tmp62_;
1575         gint _tmp63_;
1576         gint _tmp79_;
1577         gint _tmp80_;
1578         g_return_val_if_fail (self != NULL, 0);
1579         g_return_val_if_fail (a != NULL, 0);
1580         _tmp0_ = hint;
1581         _vala_assert (0 <= _tmp0_, "0 <= hint");
1582         _tmp1_ = hint;
1583         _tmp2_ = a;
1584         _tmp3_ = _tmp2_->length;
1585         _vala_assert (_tmp1_ < _tmp3_, "hint < a.length");
1586         _tmp4_ = a;
1587         _tmp5_ = _tmp4_->index;
1588         _tmp6_ = hint;
1589         p = _tmp5_ + _tmp6_;
1590         last_offset = 0;
1591         offset = 1;
1592         _tmp7_ = a;
1593         _tmp8_ = _tmp7_->list;
1594         _tmp9_ = p;
1595         _tmp10_ = _tmp8_[_tmp9_];
1596         _tmp11_ = key;
1597         _tmp12_ = gee_tim_sort_lower_than (self, _tmp10_, _tmp11_);
1598         if (_tmp12_) {
1599                 GeeTimSortSlice* _tmp13_;
1600                 gint _tmp14_;
1601                 gint _tmp15_;
1602                 gint max_offset;
1603                 gint _tmp28_;
1604                 gint _tmp29_;
1605                 gint _tmp31_;
1606                 gint _tmp32_;
1607                 gint _tmp33_;
1608                 gint _tmp34_;
1609                 _tmp13_ = a;
1610                 _tmp14_ = _tmp13_->length;
1611                 _tmp15_ = hint;
1612                 max_offset = _tmp14_ - _tmp15_;
1613                 while (TRUE) {
1614                         gint _tmp16_;
1615                         gint _tmp17_;
1616                         GeeTimSortSlice* _tmp18_;
1617                         void** _tmp19_;
1618                         gint _tmp20_;
1619                         gint _tmp21_;
1620                         void* _tmp22_;
1621                         gconstpointer _tmp23_;
1622                         gboolean _tmp24_ = FALSE;
1623                         _tmp16_ = offset;
1624                         _tmp17_ = max_offset;
1625                         if (!(_tmp16_ < _tmp17_)) {
1626                                 break;
1627                         }
1628                         _tmp18_ = a;
1629                         _tmp19_ = _tmp18_->list;
1630                         _tmp20_ = p;
1631                         _tmp21_ = offset;
1632                         _tmp22_ = _tmp19_[_tmp20_ + _tmp21_];
1633                         _tmp23_ = key;
1634                         _tmp24_ = gee_tim_sort_lower_than (self, _tmp22_, _tmp23_);
1635                         if (_tmp24_) {
1636                                 gint _tmp25_;
1637                                 gint _tmp26_;
1638                                 gint _tmp27_;
1639                                 _tmp25_ = offset;
1640                                 last_offset = _tmp25_;
1641                                 _tmp26_ = offset;
1642                                 offset = _tmp26_ << 1;
1643                                 _tmp27_ = offset;
1644                                 offset = _tmp27_ + 1;
1645                         } else {
1646                                 break;
1647                         }
1648                 }
1649                 _tmp28_ = offset;
1650                 _tmp29_ = max_offset;
1651                 if (_tmp28_ > _tmp29_) {
1652                         gint _tmp30_;
1653                         _tmp30_ = max_offset;
1654                         offset = _tmp30_;
1655                 }
1656                 _tmp31_ = hint;
1657                 _tmp32_ = last_offset;
1658                 last_offset = _tmp31_ + _tmp32_;
1659                 _tmp33_ = hint;
1660                 _tmp34_ = offset;
1661                 offset = _tmp33_ + _tmp34_;
1662         } else {
1663                 gint _tmp35_;
1664                 gint max_offset;
1665                 gint _tmp48_;
1666                 gint _tmp49_;
1667                 gint _tmp51_;
1668                 gint temp_last_offset;
1669                 gint _tmp52_;
1670                 gint temp_offset;
1671                 gint _tmp53_;
1672                 gint _tmp54_;
1673                 gint _tmp55_;
1674                 gint _tmp56_;
1675                 _tmp35_ = hint;
1676                 max_offset = _tmp35_ + 1;
1677                 while (TRUE) {
1678                         gint _tmp36_;
1679                         gint _tmp37_;
1680                         GeeTimSortSlice* _tmp38_;
1681                         void** _tmp39_;
1682                         gint _tmp40_;
1683                         gint _tmp41_;
1684                         void* _tmp42_;
1685                         gconstpointer _tmp43_;
1686                         gboolean _tmp44_ = FALSE;
1687                         _tmp36_ = offset;
1688                         _tmp37_ = max_offset;
1689                         if (!(_tmp36_ < _tmp37_)) {
1690                                 break;
1691                         }
1692                         _tmp38_ = a;
1693                         _tmp39_ = _tmp38_->list;
1694                         _tmp40_ = p;
1695                         _tmp41_ = offset;
1696                         _tmp42_ = _tmp39_[_tmp40_ - _tmp41_];
1697                         _tmp43_ = key;
1698                         _tmp44_ = gee_tim_sort_lower_than (self, _tmp42_, _tmp43_);
1699                         if (_tmp44_) {
1700                                 break;
1701                         } else {
1702                                 gint _tmp45_;
1703                                 gint _tmp46_;
1704                                 gint _tmp47_;
1705                                 _tmp45_ = offset;
1706                                 last_offset = _tmp45_;
1707                                 _tmp46_ = offset;
1708                                 offset = _tmp46_ << 1;
1709                                 _tmp47_ = offset;
1710                                 offset = _tmp47_ + 1;
1711                         }
1712                 }
1713                 _tmp48_ = offset;
1714                 _tmp49_ = max_offset;
1715                 if (_tmp48_ > _tmp49_) {
1716                         gint _tmp50_;
1717                         _tmp50_ = max_offset;
1718                         offset = _tmp50_;
1719                 }
1720                 _tmp51_ = last_offset;
1721                 temp_last_offset = _tmp51_;
1722                 _tmp52_ = offset;
1723                 temp_offset = _tmp52_;
1724                 _tmp53_ = hint;
1725                 _tmp54_ = temp_offset;
1726                 last_offset = _tmp53_ - _tmp54_;
1727                 _tmp55_ = hint;
1728                 _tmp56_ = temp_last_offset;
1729                 offset = _tmp55_ - _tmp56_;
1730         }
1731         _tmp57_ = last_offset;
1732         _vala_assert ((-1) <= _tmp57_, "-1 <= last_offset");
1733         _tmp58_ = last_offset;
1734         _tmp59_ = offset;
1735         _vala_assert (_tmp58_ < _tmp59_, "last_offset < offset");
1736         _tmp60_ = offset;
1737         _tmp61_ = a;
1738         _tmp62_ = _tmp61_->length;
1739         _vala_assert (_tmp60_ <= _tmp62_, "offset <= a.length");
1740         _tmp63_ = last_offset;
1741         last_offset = _tmp63_ + 1;
1742         while (TRUE) {
1743                 gint _tmp64_;
1744                 gint _tmp65_;
1745                 gint _tmp66_;
1746                 gint _tmp67_;
1747                 gint _tmp68_;
1748                 gint m;
1749                 GeeTimSortSlice* _tmp69_;
1750                 void** _tmp70_;
1751                 GeeTimSortSlice* _tmp71_;
1752                 gint _tmp72_;
1753                 gint _tmp73_;
1754                 void* _tmp74_;
1755                 gconstpointer _tmp75_;
1756                 gboolean _tmp76_ = FALSE;
1757                 _tmp64_ = last_offset;
1758                 _tmp65_ = offset;
1759                 if (!(_tmp64_ < _tmp65_)) {
1760                         break;
1761                 }
1762                 _tmp66_ = last_offset;
1763                 _tmp67_ = offset;
1764                 _tmp68_ = last_offset;
1765                 m = _tmp66_ + ((_tmp67_ - _tmp68_) >> 1);
1766                 _tmp69_ = a;
1767                 _tmp70_ = _tmp69_->list;
1768                 _tmp71_ = a;
1769                 _tmp72_ = _tmp71_->index;
1770                 _tmp73_ = m;
1771                 _tmp74_ = _tmp70_[_tmp72_ + _tmp73_];
1772                 _tmp75_ = key;
1773                 _tmp76_ = gee_tim_sort_lower_than (self, _tmp74_, _tmp75_);
1774                 if (_tmp76_) {
1775                         gint _tmp77_;
1776                         _tmp77_ = m;
1777                         last_offset = _tmp77_ + 1;
1778                 } else {
1779                         gint _tmp78_;
1780                         _tmp78_ = m;
1781                         offset = _tmp78_;
1782                 }
1783         }
1784         _tmp79_ = last_offset;
1785         _tmp80_ = offset;
1786         _vala_assert (_tmp79_ == _tmp80_, "last_offset == offset");
1787         result = offset;
1788         return result;
1789 }
1790
1791
1792 static gint gee_tim_sort_gallop_rightmost (GeeTimSort* self, gconstpointer key, GeeTimSortSlice* a, gint hint) {
1793         gint result = 0;
1794         gint _tmp0_;
1795         gint _tmp1_;
1796         GeeTimSortSlice* _tmp2_;
1797         gint _tmp3_;
1798         GeeTimSortSlice* _tmp4_;
1799         gint _tmp5_;
1800         gint _tmp6_;
1801         gint p;
1802         gint last_offset;
1803         gint offset;
1804         GeeTimSortSlice* _tmp7_;
1805         void** _tmp8_;
1806         gint _tmp9_;
1807         void* _tmp10_;
1808         gconstpointer _tmp11_;
1809         gboolean _tmp12_ = FALSE;
1810         gint _tmp57_;
1811         gint _tmp58_;
1812         gint _tmp59_;
1813         gint _tmp60_;
1814         GeeTimSortSlice* _tmp61_;
1815         gint _tmp62_;
1816         gint _tmp63_;
1817         gint _tmp79_;
1818         gint _tmp80_;
1819         g_return_val_if_fail (self != NULL, 0);
1820         g_return_val_if_fail (a != NULL, 0);
1821         _tmp0_ = hint;
1822         _vala_assert (0 <= _tmp0_, "0 <= hint");
1823         _tmp1_ = hint;
1824         _tmp2_ = a;
1825         _tmp3_ = _tmp2_->length;
1826         _vala_assert (_tmp1_ < _tmp3_, "hint < a.length");
1827         _tmp4_ = a;
1828         _tmp5_ = _tmp4_->index;
1829         _tmp6_ = hint;
1830         p = _tmp5_ + _tmp6_;
1831         last_offset = 0;
1832         offset = 1;
1833         _tmp7_ = a;
1834         _tmp8_ = _tmp7_->list;
1835         _tmp9_ = p;
1836         _tmp10_ = _tmp8_[_tmp9_];
1837         _tmp11_ = key;
1838         _tmp12_ = gee_tim_sort_lower_than_or_equal_to (self, _tmp10_, _tmp11_);
1839         if (_tmp12_) {
1840                 GeeTimSortSlice* _tmp13_;
1841                 gint _tmp14_;
1842                 gint _tmp15_;
1843                 gint max_offset;
1844                 gint _tmp28_;
1845                 gint _tmp29_;
1846                 gint _tmp31_;
1847                 gint _tmp32_;
1848                 gint _tmp33_;
1849                 gint _tmp34_;
1850                 _tmp13_ = a;
1851                 _tmp14_ = _tmp13_->length;
1852                 _tmp15_ = hint;
1853                 max_offset = _tmp14_ - _tmp15_;
1854                 while (TRUE) {
1855                         gint _tmp16_;
1856                         gint _tmp17_;
1857                         GeeTimSortSlice* _tmp18_;
1858                         void** _tmp19_;
1859                         gint _tmp20_;
1860                         gint _tmp21_;
1861                         void* _tmp22_;
1862                         gconstpointer _tmp23_;
1863                         gboolean _tmp24_ = FALSE;
1864                         _tmp16_ = offset;
1865                         _tmp17_ = max_offset;
1866                         if (!(_tmp16_ < _tmp17_)) {
1867                                 break;
1868                         }
1869                         _tmp18_ = a;
1870                         _tmp19_ = _tmp18_->list;
1871                         _tmp20_ = p;
1872                         _tmp21_ = offset;
1873                         _tmp22_ = _tmp19_[_tmp20_ + _tmp21_];
1874                         _tmp23_ = key;
1875                         _tmp24_ = gee_tim_sort_lower_than_or_equal_to (self, _tmp22_, _tmp23_);
1876                         if (_tmp24_) {
1877                                 gint _tmp25_;
1878                                 gint _tmp26_;
1879                                 gint _tmp27_;
1880                                 _tmp25_ = offset;
1881                                 last_offset = _tmp25_;
1882                                 _tmp26_ = offset;
1883                                 offset = _tmp26_ << 1;
1884                                 _tmp27_ = offset;
1885                                 offset = _tmp27_ + 1;
1886                         } else {
1887                                 break;
1888                         }
1889                 }
1890                 _tmp28_ = offset;
1891                 _tmp29_ = max_offset;
1892                 if (_tmp28_ > _tmp29_) {
1893                         gint _tmp30_;
1894                         _tmp30_ = max_offset;
1895                         offset = _tmp30_;
1896                 }
1897                 _tmp31_ = hint;
1898                 _tmp32_ = last_offset;
1899                 last_offset = _tmp31_ + _tmp32_;
1900                 _tmp33_ = hint;
1901                 _tmp34_ = offset;
1902                 offset = _tmp33_ + _tmp34_;
1903         } else {
1904                 gint _tmp35_;
1905                 gint max_offset;
1906                 gint _tmp48_;
1907                 gint _tmp49_;
1908                 gint _tmp51_;
1909                 gint temp_last_offset;
1910                 gint _tmp52_;
1911                 gint temp_offset;
1912                 gint _tmp53_;
1913                 gint _tmp54_;
1914                 gint _tmp55_;
1915                 gint _tmp56_;
1916                 _tmp35_ = hint;
1917                 max_offset = _tmp35_ + 1;
1918                 while (TRUE) {
1919                         gint _tmp36_;
1920                         gint _tmp37_;
1921                         GeeTimSortSlice* _tmp38_;
1922                         void** _tmp39_;
1923                         gint _tmp40_;
1924                         gint _tmp41_;
1925                         void* _tmp42_;
1926                         gconstpointer _tmp43_;
1927                         gboolean _tmp44_ = FALSE;
1928                         _tmp36_ = offset;
1929                         _tmp37_ = max_offset;
1930                         if (!(_tmp36_ < _tmp37_)) {
1931                                 break;
1932                         }
1933                         _tmp38_ = a;
1934                         _tmp39_ = _tmp38_->list;
1935                         _tmp40_ = p;
1936                         _tmp41_ = offset;
1937                         _tmp42_ = _tmp39_[_tmp40_ - _tmp41_];
1938                         _tmp43_ = key;
1939                         _tmp44_ = gee_tim_sort_lower_than_or_equal_to (self, _tmp42_, _tmp43_);
1940                         if (_tmp44_) {
1941                                 break;
1942                         } else {
1943                                 gint _tmp45_;
1944                                 gint _tmp46_;
1945                                 gint _tmp47_;
1946                                 _tmp45_ = offset;
1947                                 last_offset = _tmp45_;
1948                                 _tmp46_ = offset;
1949                                 offset = _tmp46_ << 1;
1950                                 _tmp47_ = offset;
1951                                 offset = _tmp47_ + 1;
1952                         }
1953                 }
1954                 _tmp48_ = offset;
1955                 _tmp49_ = max_offset;
1956                 if (_tmp48_ > _tmp49_) {
1957                         gint _tmp50_;
1958                         _tmp50_ = max_offset;
1959                         offset = _tmp50_;
1960                 }
1961                 _tmp51_ = last_offset;
1962                 temp_last_offset = _tmp51_;
1963                 _tmp52_ = offset;
1964                 temp_offset = _tmp52_;
1965                 _tmp53_ = hint;
1966                 _tmp54_ = temp_offset;
1967                 last_offset = _tmp53_ - _tmp54_;
1968                 _tmp55_ = hint;
1969                 _tmp56_ = temp_last_offset;
1970                 offset = _tmp55_ - _tmp56_;
1971         }
1972         _tmp57_ = last_offset;
1973         _vala_assert ((-1) <= _tmp57_, "-1 <= last_offset");
1974         _tmp58_ = last_offset;
1975         _tmp59_ = offset;
1976         _vala_assert (_tmp58_ < _tmp59_, "last_offset < offset");
1977         _tmp60_ = offset;
1978         _tmp61_ = a;
1979         _tmp62_ = _tmp61_->length;
1980         _vala_assert (_tmp60_ <= _tmp62_, "offset <= a.length");
1981         _tmp63_ = last_offset;
1982         last_offset = _tmp63_ + 1;
1983         while (TRUE) {
1984                 gint _tmp64_;
1985                 gint _tmp65_;
1986                 gint _tmp66_;
1987                 gint _tmp67_;
1988                 gint _tmp68_;
1989                 gint m;
1990                 GeeTimSortSlice* _tmp69_;
1991                 void** _tmp70_;
1992                 GeeTimSortSlice* _tmp71_;
1993                 gint _tmp72_;
1994                 gint _tmp73_;
1995                 void* _tmp74_;
1996                 gconstpointer _tmp75_;
1997                 gboolean _tmp76_ = FALSE;
1998                 _tmp64_ = last_offset;
1999                 _tmp65_ = offset;
2000                 if (!(_tmp64_ < _tmp65_)) {
2001                         break;
2002                 }
2003                 _tmp66_ = last_offset;
2004                 _tmp67_ = offset;
2005                 _tmp68_ = last_offset;
2006                 m = _tmp66_ + ((_tmp67_ - _tmp68_) >> 1);
2007                 _tmp69_ = a;
2008                 _tmp70_ = _tmp69_->list;
2009                 _tmp71_ = a;
2010                 _tmp72_ = _tmp71_->index;
2011                 _tmp73_ = m;
2012                 _tmp74_ = _tmp70_[_tmp72_ + _tmp73_];
2013                 _tmp75_ = key;
2014                 _tmp76_ = gee_tim_sort_lower_than_or_equal_to (self, _tmp74_, _tmp75_);
2015                 if (_tmp76_) {
2016                         gint _tmp77_;
2017                         _tmp77_ = m;
2018                         last_offset = _tmp77_ + 1;
2019                 } else {
2020                         gint _tmp78_;
2021                         _tmp78_ = m;
2022                         offset = _tmp78_;
2023                 }
2024         }
2025         _tmp79_ = last_offset;
2026         _tmp80_ = offset;
2027         _vala_assert (_tmp79_ == _tmp80_, "last_offset == offset");
2028         result = offset;
2029         return result;
2030 }
2031
2032
2033 static void gee_tim_sort_merge_low (GeeTimSort* self, GeeTimSortSlice* a, GeeTimSortSlice* b) {
2034         GeeTimSortSlice* _tmp0_;
2035         gint _tmp1_;
2036         GeeTimSortSlice* _tmp2_;
2037         gint _tmp3_;
2038         GeeTimSortSlice* _tmp4_;
2039         gint _tmp5_;
2040         GeeTimSortSlice* _tmp6_;
2041         gint _tmp7_;
2042         GeeTimSortSlice* _tmp8_;
2043         gint _tmp9_;
2044         gint _tmp10_;
2045         gint minimum_gallop;
2046         GeeTimSortSlice* _tmp11_;
2047         gint _tmp12_;
2048         gint dest;
2049         GeeTimSortSlice* _tmp13_;
2050         GError * _inner_error_ = NULL;
2051         g_return_if_fail (self != NULL);
2052         g_return_if_fail (a != NULL);
2053         g_return_if_fail (b != NULL);
2054         _tmp0_ = a;
2055         _tmp1_ = _tmp0_->length;
2056         _vala_assert (_tmp1_ > 0, "a.length > 0");
2057         _tmp2_ = b;
2058         _tmp3_ = _tmp2_->length;
2059         _vala_assert (_tmp3_ > 0, "b.length > 0");
2060         _tmp4_ = a;
2061         _tmp5_ = _tmp4_->index;
2062         _tmp6_ = a;
2063         _tmp7_ = _tmp6_->length;
2064         _tmp8_ = b;
2065         _tmp9_ = _tmp8_->index;
2066         _vala_assert ((_tmp5_ + _tmp7_) == _tmp9_, "a.index + a.length == b.index");
2067         _tmp10_ = self->priv->minimum_gallop;
2068         minimum_gallop = _tmp10_;
2069         _tmp11_ = a;
2070         _tmp12_ = _tmp11_->index;
2071         dest = _tmp12_;
2072         _tmp13_ = a;
2073         gee_tim_sort_slice_copy (_tmp13_);
2074         {
2075                 void** _tmp14_;
2076                 gint _tmp15_;
2077                 GeeTimSortSlice* _tmp16_;
2078                 void* _tmp17_ = NULL;
2079                 void* _tmp18_;
2080                 gboolean _tmp19_ = FALSE;
2081                 GeeTimSortSlice* _tmp20_;
2082                 gint _tmp21_;
2083                 gboolean _tmp24_;
2084                 _tmp14_ = self->priv->list;
2085                 _tmp15_ = dest;
2086                 dest = _tmp15_ + 1;
2087                 _tmp16_ = b;
2088                 _tmp17_ = gee_tim_sort_slice_pop_first (_tmp16_);
2089                 _tmp14_[_tmp15_] = _tmp17_;
2090                 _tmp18_ = _tmp14_[_tmp15_];
2091                 _tmp20_ = a;
2092                 _tmp21_ = _tmp20_->length;
2093                 if (_tmp21_ == 1) {
2094                         _tmp19_ = TRUE;
2095                 } else {
2096                         GeeTimSortSlice* _tmp22_;
2097                         gint _tmp23_;
2098                         _tmp22_ = b;
2099                         _tmp23_ = _tmp22_->length;
2100                         _tmp19_ = _tmp23_ == 0;
2101                 }
2102                 _tmp24_ = _tmp19_;
2103                 if (_tmp24_) {
2104                         {
2105                                 GeeTimSortSlice* _tmp25_;
2106                                 gint _tmp26_;
2107                                 GeeTimSortSlice* _tmp27_;
2108                                 gint _tmp28_;
2109                                 GeeTimSortSlice* _tmp29_;
2110                                 void** _tmp30_;
2111                                 GeeTimSortSlice* _tmp31_;
2112                                 gint _tmp32_;
2113                                 gint _tmp33_;
2114                                 GeeTimSortSlice* _tmp34_;
2115                                 gint _tmp35_;
2116                                 GeeTimSortSlice* _tmp36_;
2117                                 void** _tmp37_;
2118                                 GeeTimSortSlice* _tmp38_;
2119                                 gint _tmp39_;
2120                                 gint _tmp40_;
2121                                 GeeTimSortSlice* _tmp41_;
2122                                 gint _tmp42_;
2123                                 GeeTimSortSlice* _tmp43_;
2124                                 gint _tmp44_;
2125                                 _tmp25_ = a;
2126                                 _tmp26_ = _tmp25_->length;
2127                                 _vala_assert (_tmp26_ >= 0, "a.length >= 0");
2128                                 _tmp27_ = b;
2129                                 _tmp28_ = _tmp27_->length;
2130                                 _vala_assert (_tmp28_ >= 0, "b.length >= 0");
2131                                 _tmp29_ = b;
2132                                 _tmp30_ = self->priv->list;
2133                                 _tmp31_ = b;
2134                                 _tmp32_ = _tmp31_->index;
2135                                 _tmp33_ = dest;
2136                                 _tmp34_ = b;
2137                                 _tmp35_ = _tmp34_->length;
2138                                 gee_tim_sort_slice_merge_in (_tmp29_, _tmp30_, _tmp32_, _tmp33_, _tmp35_);
2139                                 _tmp36_ = a;
2140                                 _tmp37_ = self->priv->list;
2141                                 _tmp38_ = a;
2142                                 _tmp39_ = _tmp38_->index;
2143                                 _tmp40_ = dest;
2144                                 _tmp41_ = b;
2145                                 _tmp42_ = _tmp41_->length;
2146                                 _tmp43_ = a;
2147                                 _tmp44_ = _tmp43_->length;
2148                                 gee_tim_sort_slice_merge_in (_tmp36_, _tmp37_, _tmp39_, _tmp40_ + _tmp42_, _tmp44_);
2149                         }
2150                         _gee_tim_sort_slice_free0 (a);
2151                         _gee_tim_sort_slice_free0 (b);
2152                         return;
2153                 }
2154                 while (TRUE) {
2155                         gint a_count;
2156                         gint b_count;
2157                         gint _tmp110_;
2158                         gint _tmp246_;
2159                         gint _tmp247_;
2160                         a_count = 0;
2161                         b_count = 0;
2162                         while (TRUE) {
2163                                 GeeTimSortSlice* _tmp45_;
2164                                 void* _tmp46_ = NULL;
2165                                 GeeTimSortSlice* _tmp47_;
2166                                 void* _tmp48_ = NULL;
2167                                 gboolean _tmp49_ = FALSE;
2168                                 _tmp45_ = b;
2169                                 _tmp46_ = gee_tim_sort_slice_peek_first (_tmp45_);
2170                                 _tmp47_ = a;
2171                                 _tmp48_ = gee_tim_sort_slice_peek_first (_tmp47_);
2172                                 _tmp49_ = gee_tim_sort_lower_than (self, _tmp46_, _tmp48_);
2173                                 if (_tmp49_) {
2174                                         void** _tmp50_;
2175                                         gint _tmp51_;
2176                                         GeeTimSortSlice* _tmp52_;
2177                                         void* _tmp53_ = NULL;
2178                                         void* _tmp54_;
2179                                         GeeTimSortSlice* _tmp55_;
2180                                         gint _tmp56_;
2181                                         gint _tmp77_;
2182                                         gint _tmp78_;
2183                                         gint _tmp79_;
2184                                         _tmp50_ = self->priv->list;
2185                                         _tmp51_ = dest;
2186                                         dest = _tmp51_ + 1;
2187                                         _tmp52_ = b;
2188                                         _tmp53_ = gee_tim_sort_slice_pop_first (_tmp52_);
2189                                         _tmp50_[_tmp51_] = _tmp53_;
2190                                         _tmp54_ = _tmp50_[_tmp51_];
2191                                         _tmp55_ = b;
2192                                         _tmp56_ = _tmp55_->length;
2193                                         if (_tmp56_ == 0) {
2194                                                 {
2195                                                         GeeTimSortSlice* _tmp57_;
2196                                                         gint _tmp58_;
2197                                                         GeeTimSortSlice* _tmp59_;
2198                                                         gint _tmp60_;
2199                                                         GeeTimSortSlice* _tmp61_;
2200                                                         void** _tmp62_;
2201                                                         GeeTimSortSlice* _tmp63_;
2202                                                         gint _tmp64_;
2203                                                         gint _tmp65_;
2204                                                         GeeTimSortSlice* _tmp66_;
2205                                                         gint _tmp67_;
2206                                                         GeeTimSortSlice* _tmp68_;
2207                                                         void** _tmp69_;
2208                                                         GeeTimSortSlice* _tmp70_;
2209                                                         gint _tmp71_;
2210                                                         gint _tmp72_;
2211                                                         GeeTimSortSlice* _tmp73_;
2212                                                         gint _tmp74_;
2213                                                         GeeTimSortSlice* _tmp75_;
2214                                                         gint _tmp76_;
2215                                                         _tmp57_ = a;
2216                                                         _tmp58_ = _tmp57_->length;
2217                                                         _vala_assert (_tmp58_ >= 0, "a.length >= 0");
2218                                                         _tmp59_ = b;
2219                                                         _tmp60_ = _tmp59_->length;
2220                                                         _vala_assert (_tmp60_ >= 0, "b.length >= 0");
2221                                                         _tmp61_ = b;
2222                                                         _tmp62_ = self->priv->list;
2223                                                         _tmp63_ = b;
2224                                                         _tmp64_ = _tmp63_->index;
2225                                                         _tmp65_ = dest;
2226                                                         _tmp66_ = b;
2227                                                         _tmp67_ = _tmp66_->length;
2228                                                         gee_tim_sort_slice_merge_in (_tmp61_, _tmp62_, _tmp64_, _tmp65_, _tmp67_);
2229                                                         _tmp68_ = a;
2230                                                         _tmp69_ = self->priv->list;
2231                                                         _tmp70_ = a;
2232                                                         _tmp71_ = _tmp70_->index;
2233                                                         _tmp72_ = dest;
2234                                                         _tmp73_ = b;
2235                                                         _tmp74_ = _tmp73_->length;
2236                                                         _tmp75_ = a;
2237                                                         _tmp76_ = _tmp75_->length;
2238                                                         gee_tim_sort_slice_merge_in (_tmp68_, _tmp69_, _tmp71_, _tmp72_ + _tmp74_, _tmp76_);
2239                                                 }
2240                                                 _gee_tim_sort_slice_free0 (a);
2241                                                 _gee_tim_sort_slice_free0 (b);
2242                                                 return;
2243                                         }
2244                                         _tmp77_ = b_count;
2245                                         b_count = _tmp77_ + 1;
2246                                         a_count = 0;
2247                                         _tmp78_ = b_count;
2248                                         _tmp79_ = minimum_gallop;
2249                                         if (_tmp78_ >= _tmp79_) {
2250                                                 break;
2251                                         }
2252                                 } else {
2253                                         void** _tmp80_;
2254                                         gint _tmp81_;
2255                                         GeeTimSortSlice* _tmp82_;
2256                                         void* _tmp83_ = NULL;
2257                                         void* _tmp84_;
2258                                         GeeTimSortSlice* _tmp85_;
2259                                         gint _tmp86_;
2260                                         gint _tmp107_;
2261                                         gint _tmp108_;
2262                                         gint _tmp109_;
2263                                         _tmp80_ = self->priv->list;
2264                                         _tmp81_ = dest;
2265                                         dest = _tmp81_ + 1;
2266                                         _tmp82_ = a;
2267                                         _tmp83_ = gee_tim_sort_slice_pop_first (_tmp82_);
2268                                         _tmp80_[_tmp81_] = _tmp83_;
2269                                         _tmp84_ = _tmp80_[_tmp81_];
2270                                         _tmp85_ = a;
2271                                         _tmp86_ = _tmp85_->length;
2272                                         if (_tmp86_ == 1) {
2273                                                 {
2274                                                         GeeTimSortSlice* _tmp87_;
2275                                                         gint _tmp88_;
2276                                                         GeeTimSortSlice* _tmp89_;
2277                                                         gint _tmp90_;
2278                                                         GeeTimSortSlice* _tmp91_;
2279                                                         void** _tmp92_;
2280                                                         GeeTimSortSlice* _tmp93_;
2281                                                         gint _tmp94_;
2282                                                         gint _tmp95_;
2283                                                         GeeTimSortSlice* _tmp96_;
2284                                                         gint _tmp97_;
2285                                                         GeeTimSortSlice* _tmp98_;
2286                                                         void** _tmp99_;
2287                                                         GeeTimSortSlice* _tmp100_;
2288                                                         gint _tmp101_;
2289                                                         gint _tmp102_;
2290                                                         GeeTimSortSlice* _tmp103_;
2291                                                         gint _tmp104_;
2292                                                         GeeTimSortSlice* _tmp105_;
2293                                                         gint _tmp106_;
2294                                                         _tmp87_ = a;
2295                                                         _tmp88_ = _tmp87_->length;
2296                                                         _vala_assert (_tmp88_ >= 0, "a.length >= 0");
2297                                                         _tmp89_ = b;
2298                                                         _tmp90_ = _tmp89_->length;
2299                                                         _vala_assert (_tmp90_ >= 0, "b.length >= 0");
2300                                                         _tmp91_ = b;
2301                                                         _tmp92_ = self->priv->list;
2302                                                         _tmp93_ = b;
2303                                                         _tmp94_ = _tmp93_->index;
2304                                                         _tmp95_ = dest;
2305                                                         _tmp96_ = b;
2306                                                         _tmp97_ = _tmp96_->length;
2307                                                         gee_tim_sort_slice_merge_in (_tmp91_, _tmp92_, _tmp94_, _tmp95_, _tmp97_);
2308                                                         _tmp98_ = a;
2309                                                         _tmp99_ = self->priv->list;
2310                                                         _tmp100_ = a;
2311                                                         _tmp101_ = _tmp100_->index;
2312                                                         _tmp102_ = dest;
2313                                                         _tmp103_ = b;
2314                                                         _tmp104_ = _tmp103_->length;
2315                                                         _tmp105_ = a;
2316                                                         _tmp106_ = _tmp105_->length;
2317                                                         gee_tim_sort_slice_merge_in (_tmp98_, _tmp99_, _tmp101_, _tmp102_ + _tmp104_, _tmp106_);
2318                                                 }
2319                                                 _gee_tim_sort_slice_free0 (a);
2320                                                 _gee_tim_sort_slice_free0 (b);
2321                                                 return;
2322                                         }
2323                                         _tmp107_ = a_count;
2324                                         a_count = _tmp107_ + 1;
2325                                         b_count = 0;
2326                                         _tmp108_ = a_count;
2327                                         _tmp109_ = minimum_gallop;
2328                                         if (_tmp108_ >= _tmp109_) {
2329                                                 break;
2330                                         }
2331                                 }
2332                         }
2333                         _tmp110_ = minimum_gallop;
2334                         minimum_gallop = _tmp110_ + 1;
2335                         while (TRUE) {
2336                                 gint _tmp111_ = 0;
2337                                 gint _tmp112_;
2338                                 gint _tmp113_;
2339                                 gint _tmp114_;
2340                                 gint _tmp115_;
2341                                 GeeTimSortSlice* _tmp116_;
2342                                 void* _tmp117_ = NULL;
2343                                 GeeTimSortSlice* _tmp118_;
2344                                 gint _tmp119_ = 0;
2345                                 GeeTimSortSlice* _tmp120_;
2346                                 void** _tmp121_;
2347                                 GeeTimSortSlice* _tmp122_;
2348                                 gint _tmp123_;
2349                                 gint _tmp124_;
2350                                 gint _tmp125_;
2351                                 gint _tmp126_;
2352                                 gint _tmp127_;
2353                                 GeeTimSortSlice* _tmp128_;
2354                                 gint _tmp129_;
2355                                 GeeTimSortSlice* _tmp130_;
2356                                 gint _tmp131_;
2357                                 void** _tmp152_;
2358                                 gint _tmp153_;
2359                                 GeeTimSortSlice* _tmp154_;
2360                                 void* _tmp155_ = NULL;
2361                                 void* _tmp156_;
2362                                 GeeTimSortSlice* _tmp157_;
2363                                 gint _tmp158_;
2364                                 GeeTimSortSlice* _tmp179_;
2365                                 void* _tmp180_ = NULL;
2366                                 GeeTimSortSlice* _tmp181_;
2367                                 gint _tmp182_ = 0;
2368                                 GeeTimSortSlice* _tmp183_;
2369                                 void** _tmp184_;
2370                                 GeeTimSortSlice* _tmp185_;
2371                                 gint _tmp186_;
2372                                 gint _tmp187_;
2373                                 gint _tmp188_;
2374                                 gint _tmp189_;
2375                                 gint _tmp190_;
2376                                 GeeTimSortSlice* _tmp191_;
2377                                 gint _tmp192_;
2378                                 GeeTimSortSlice* _tmp193_;
2379                                 gint _tmp194_;
2380                                 void** _tmp215_;
2381                                 gint _tmp216_;
2382                                 GeeTimSortSlice* _tmp217_;
2383                                 void* _tmp218_ = NULL;
2384                                 void* _tmp219_;
2385                                 GeeTimSortSlice* _tmp220_;
2386                                 gint _tmp221_;
2387                                 gboolean _tmp242_ = FALSE;
2388                                 gint _tmp243_;
2389                                 gboolean _tmp245_;
2390                                 _tmp112_ = minimum_gallop;
2391                                 if (_tmp112_ > 1) {
2392                                         _tmp111_ = 1;
2393                                 } else {
2394                                         _tmp111_ = 0;
2395                                 }
2396                                 _tmp113_ = minimum_gallop;
2397                                 _tmp114_ = _tmp111_;
2398                                 minimum_gallop = _tmp113_ - _tmp114_;
2399                                 _tmp115_ = minimum_gallop;
2400                                 self->priv->minimum_gallop = _tmp115_;
2401                                 _tmp116_ = b;
2402                                 _tmp117_ = gee_tim_sort_slice_peek_first (_tmp116_);
2403                                 _tmp118_ = a;
2404                                 _tmp119_ = gee_tim_sort_gallop_rightmost (self, _tmp117_, _tmp118_, 0);
2405                                 a_count = _tmp119_;
2406                                 _tmp120_ = a;
2407                                 _tmp121_ = self->priv->list;
2408                                 _tmp122_ = a;
2409                                 _tmp123_ = _tmp122_->index;
2410                                 _tmp124_ = dest;
2411                                 _tmp125_ = a_count;
2412                                 gee_tim_sort_slice_merge_in (_tmp120_, _tmp121_, _tmp123_, _tmp124_, _tmp125_);
2413                                 _tmp126_ = dest;
2414                                 _tmp127_ = a_count;
2415                                 dest = _tmp126_ + _tmp127_;
2416                                 _tmp128_ = a;
2417                                 _tmp129_ = a_count;
2418                                 gee_tim_sort_slice_shorten_start (_tmp128_, _tmp129_);
2419                                 _tmp130_ = a;
2420                                 _tmp131_ = _tmp130_->length;
2421                                 if (_tmp131_ <= 1) {
2422                                         {
2423                                                 GeeTimSortSlice* _tmp132_;
2424                                                 gint _tmp133_;
2425                                                 GeeTimSortSlice* _tmp134_;
2426                                                 gint _tmp135_;
2427                                                 GeeTimSortSlice* _tmp136_;
2428                                                 void** _tmp137_;
2429                                                 GeeTimSortSlice* _tmp138_;
2430                                                 gint _tmp139_;
2431                                                 gint _tmp140_;
2432                                                 GeeTimSortSlice* _tmp141_;
2433                                                 gint _tmp142_;
2434                                                 GeeTimSortSlice* _tmp143_;
2435                                                 void** _tmp144_;
2436                                                 GeeTimSortSlice* _tmp145_;
2437                                                 gint _tmp146_;
2438                                                 gint _tmp147_;
2439                                                 GeeTimSortSlice* _tmp148_;
2440                                                 gint _tmp149_;
2441                                                 GeeTimSortSlice* _tmp150_;
2442                                                 gint _tmp151_;
2443                                                 _tmp132_ = a;
2444                                                 _tmp133_ = _tmp132_->length;
2445                                                 _vala_assert (_tmp133_ >= 0, "a.length >= 0");
2446                                                 _tmp134_ = b;
2447                                                 _tmp135_ = _tmp134_->length;
2448                                                 _vala_assert (_tmp135_ >= 0, "b.length >= 0");
2449                                                 _tmp136_ = b;
2450                                                 _tmp137_ = self->priv->list;
2451                                                 _tmp138_ = b;
2452                                                 _tmp139_ = _tmp138_->index;
2453                                                 _tmp140_ = dest;
2454                                                 _tmp141_ = b;
2455                                                 _tmp142_ = _tmp141_->length;
2456                                                 gee_tim_sort_slice_merge_in (_tmp136_, _tmp137_, _tmp139_, _tmp140_, _tmp142_);
2457                                                 _tmp143_ = a;
2458                                                 _tmp144_ = self->priv->list;
2459                                                 _tmp145_ = a;
2460                                                 _tmp146_ = _tmp145_->index;
2461                                                 _tmp147_ = dest;
2462                                                 _tmp148_ = b;
2463                                                 _tmp149_ = _tmp148_->length;
2464                                                 _tmp150_ = a;
2465                                                 _tmp151_ = _tmp150_->length;
2466                                                 gee_tim_sort_slice_merge_in (_tmp143_, _tmp144_, _tmp146_, _tmp147_ + _tmp149_, _tmp151_);
2467                                         }
2468                                         _gee_tim_sort_slice_free0 (a);
2469                                         _gee_tim_sort_slice_free0 (b);
2470                                         return;
2471                                 }
2472                                 _tmp152_ = self->priv->list;
2473                                 _tmp153_ = dest;
2474                                 dest = _tmp153_ + 1;
2475                                 _tmp154_ = b;
2476                                 _tmp155_ = gee_tim_sort_slice_pop_first (_tmp154_);
2477                                 _tmp152_[_tmp153_] = _tmp155_;
2478                                 _tmp156_ = _tmp152_[_tmp153_];
2479                                 _tmp157_ = b;
2480                                 _tmp158_ = _tmp157_->length;
2481                                 if (_tmp158_ == 0) {
2482                                         {
2483                                                 GeeTimSortSlice* _tmp159_;
2484                                                 gint _tmp160_;
2485                                                 GeeTimSortSlice* _tmp161_;
2486                                                 gint _tmp162_;
2487                                                 GeeTimSortSlice* _tmp163_;
2488                                                 void** _tmp164_;
2489                                                 GeeTimSortSlice* _tmp165_;
2490                                                 gint _tmp166_;
2491                                                 gint _tmp167_;
2492                                                 GeeTimSortSlice* _tmp168_;
2493                                                 gint _tmp169_;
2494                                                 GeeTimSortSlice* _tmp170_;
2495                                                 void** _tmp171_;
2496                                                 GeeTimSortSlice* _tmp172_;
2497                                                 gint _tmp173_;
2498                                                 gint _tmp174_;
2499                                                 GeeTimSortSlice* _tmp175_;
2500                                                 gint _tmp176_;
2501                                                 GeeTimSortSlice* _tmp177_;
2502                                                 gint _tmp178_;
2503                                                 _tmp159_ = a;
2504                                                 _tmp160_ = _tmp159_->length;
2505                                                 _vala_assert (_tmp160_ >= 0, "a.length >= 0");
2506                                                 _tmp161_ = b;
2507                                                 _tmp162_ = _tmp161_->length;
2508                                                 _vala_assert (_tmp162_ >= 0, "b.length >= 0");
2509                                                 _tmp163_ = b;
2510                                                 _tmp164_ = self->priv->list;
2511                                                 _tmp165_ = b;
2512                                                 _tmp166_ = _tmp165_->index;
2513                                                 _tmp167_ = dest;
2514                                                 _tmp168_ = b;
2515                                                 _tmp169_ = _tmp168_->length;
2516                                                 gee_tim_sort_slice_merge_in (_tmp163_, _tmp164_, _tmp166_, _tmp167_, _tmp169_);
2517                                                 _tmp170_ = a;
2518                                                 _tmp171_ = self->priv->list;
2519                                                 _tmp172_ = a;
2520                                                 _tmp173_ = _tmp172_->index;
2521                                                 _tmp174_ = dest;
2522                                                 _tmp175_ = b;
2523                                                 _tmp176_ = _tmp175_->length;
2524                                                 _tmp177_ = a;
2525                                                 _tmp178_ = _tmp177_->length;
2526                                                 gee_tim_sort_slice_merge_in (_tmp170_, _tmp171_, _tmp173_, _tmp174_ + _tmp176_, _tmp178_);
2527                                         }
2528                                         _gee_tim_sort_slice_free0 (a);
2529                                         _gee_tim_sort_slice_free0 (b);
2530                                         return;
2531                                 }
2532                                 _tmp179_ = a;
2533                                 _tmp180_ = gee_tim_sort_slice_peek_first (_tmp179_);
2534                                 _tmp181_ = b;
2535                                 _tmp182_ = gee_tim_sort_gallop_leftmost (self, _tmp180_, _tmp181_, 0);
2536                                 b_count = _tmp182_;
2537                                 _tmp183_ = b;
2538                                 _tmp184_ = self->priv->list;
2539                                 _tmp185_ = b;
2540                                 _tmp186_ = _tmp185_->index;
2541                                 _tmp187_ = dest;
2542                                 _tmp188_ = b_count;
2543                                 gee_tim_sort_slice_merge_in (_tmp183_, _tmp184_, _tmp186_, _tmp187_, _tmp188_);
2544                                 _tmp189_ = dest;
2545                                 _tmp190_ = b_count;
2546                                 dest = _tmp189_ + _tmp190_;
2547                                 _tmp191_ = b;
2548                                 _tmp192_ = b_count;
2549                                 gee_tim_sort_slice_shorten_start (_tmp191_, _tmp192_);
2550                                 _tmp193_ = b;
2551                                 _tmp194_ = _tmp193_->length;
2552                                 if (_tmp194_ == 0) {
2553                                         {
2554                                                 GeeTimSortSlice* _tmp195_;
2555                                                 gint _tmp196_;
2556                                                 GeeTimSortSlice* _tmp197_;
2557                                                 gint _tmp198_;
2558                                                 GeeTimSortSlice* _tmp199_;
2559                                                 void** _tmp200_;
2560                                                 GeeTimSortSlice* _tmp201_;
2561                                                 gint _tmp202_;
2562                                                 gint _tmp203_;
2563                                                 GeeTimSortSlice* _tmp204_;
2564                                                 gint _tmp205_;
2565                                                 GeeTimSortSlice* _tmp206_;
2566                                                 void** _tmp207_;
2567                                                 GeeTimSortSlice* _tmp208_;
2568                                                 gint _tmp209_;
2569                                                 gint _tmp210_;
2570                                                 GeeTimSortSlice* _tmp211_;
2571                                                 gint _tmp212_;
2572                                                 GeeTimSortSlice* _tmp213_;
2573                                                 gint _tmp214_;
2574                                                 _tmp195_ = a;
2575                                                 _tmp196_ = _tmp195_->length;
2576                                                 _vala_assert (_tmp196_ >= 0, "a.length >= 0");
2577                                                 _tmp197_ = b;
2578                                                 _tmp198_ = _tmp197_->length;
2579                                                 _vala_assert (_tmp198_ >= 0, "b.length >= 0");
2580                                                 _tmp199_ = b;
2581                                                 _tmp200_ = self->priv->list;
2582                                                 _tmp201_ = b;
2583                                                 _tmp202_ = _tmp201_->index;
2584                                                 _tmp203_ = dest;
2585                                                 _tmp204_ = b;
2586                                                 _tmp205_ = _tmp204_->length;
2587                                                 gee_tim_sort_slice_merge_in (_tmp199_, _tmp200_, _tmp202_, _tmp203_, _tmp205_);
2588                                                 _tmp206_ = a;
2589                                                 _tmp207_ = self->priv->list;
2590                                                 _tmp208_ = a;
2591                                                 _tmp209_ = _tmp208_->index;
2592                                                 _tmp210_ = dest;
2593                                                 _tmp211_ = b;
2594                                                 _tmp212_ = _tmp211_->length;
2595                                                 _tmp213_ = a;
2596                                                 _tmp214_ = _tmp213_->length;
2597                                                 gee_tim_sort_slice_merge_in (_tmp206_, _tmp207_, _tmp209_, _tmp210_ + _tmp212_, _tmp214_);
2598                                         }
2599                                         _gee_tim_sort_slice_free0 (a);
2600                                         _gee_tim_sort_slice_free0 (b);
2601                                         return;
2602                                 }
2603                                 _tmp215_ = self->priv->list;
2604                                 _tmp216_ = dest;
2605                                 dest = _tmp216_ + 1;
2606                                 _tmp217_ = a;
2607                                 _tmp218_ = gee_tim_sort_slice_pop_first (_tmp217_);
2608                                 _tmp215_[_tmp216_] = _tmp218_;
2609                                 _tmp219_ = _tmp215_[_tmp216_];
2610                                 _tmp220_ = a;
2611                                 _tmp221_ = _tmp220_->length;
2612                                 if (_tmp221_ == 1) {
2613                                         {
2614                                                 GeeTimSortSlice* _tmp222_;
2615                                                 gint _tmp223_;
2616                                                 GeeTimSortSlice* _tmp224_;
2617                                                 gint _tmp225_;
2618                                                 GeeTimSortSlice* _tmp226_;
2619                                                 void** _tmp227_;
2620                                                 GeeTimSortSlice* _tmp228_;
2621                                                 gint _tmp229_;
2622                                                 gint _tmp230_;
2623                                                 GeeTimSortSlice* _tmp231_;
2624                                                 gint _tmp232_;
2625                                                 GeeTimSortSlice* _tmp233_;
2626                                                 void** _tmp234_;
2627                                                 GeeTimSortSlice* _tmp235_;
2628                                                 gint _tmp236_;
2629                                                 gint _tmp237_;
2630                                                 GeeTimSortSlice* _tmp238_;
2631                                                 gint _tmp239_;
2632                                                 GeeTimSortSlice* _tmp240_;
2633                                                 gint _tmp241_;
2634                                                 _tmp222_ = a;
2635                                                 _tmp223_ = _tmp222_->length;
2636                                                 _vala_assert (_tmp223_ >= 0, "a.length >= 0");
2637                                                 _tmp224_ = b;
2638                                                 _tmp225_ = _tmp224_->length;
2639                                                 _vala_assert (_tmp225_ >= 0, "b.length >= 0");
2640                                                 _tmp226_ = b;
2641                                                 _tmp227_ = self->priv->list;
2642                                                 _tmp228_ = b;
2643                                                 _tmp229_ = _tmp228_->index;
2644                                                 _tmp230_ = dest;
2645                                                 _tmp231_ = b;
2646                                                 _tmp232_ = _tmp231_->length;
2647                                                 gee_tim_sort_slice_merge_in (_tmp226_, _tmp227_, _tmp229_, _tmp230_, _tmp232_);
2648                                                 _tmp233_ = a;
2649                                                 _tmp234_ = self->priv->list;
2650                                                 _tmp235_ = a;
2651                                                 _tmp236_ = _tmp235_->index;
2652                                                 _tmp237_ = dest;
2653                                                 _tmp238_ = b;
2654                                                 _tmp239_ = _tmp238_->length;
2655                                                 _tmp240_ = a;
2656                                                 _tmp241_ = _tmp240_->length;
2657                                                 gee_tim_sort_slice_merge_in (_tmp233_, _tmp234_, _tmp236_, _tmp237_ + _tmp239_, _tmp241_);
2658                                         }
2659                                         _gee_tim_sort_slice_free0 (a);
2660                                         _gee_tim_sort_slice_free0 (b);
2661                                         return;
2662                                 }
2663                                 _tmp243_ = a_count;
2664                                 if (_tmp243_ < GEE_TIM_SORT_MINIMUM_GALLOP) {
2665                                         gint _tmp244_;
2666                                         _tmp244_ = b_count;
2667                                         _tmp242_ = _tmp244_ < GEE_TIM_SORT_MINIMUM_GALLOP;
2668                                 } else {
2669                                         _tmp242_ = FALSE;
2670                                 }
2671                                 _tmp245_ = _tmp242_;
2672                                 if (_tmp245_) {
2673                                         break;
2674                                 }
2675                         }
2676                         _tmp246_ = minimum_gallop;
2677                         minimum_gallop = _tmp246_ + 1;
2678                         _tmp247_ = minimum_gallop;
2679                         self->priv->minimum_gallop = _tmp247_;
2680                 }
2681         }
2682         __finally0:
2683         {
2684                 GeeTimSortSlice* _tmp248_;
2685                 gint _tmp249_;
2686                 GeeTimSortSlice* _tmp250_;
2687                 gint _tmp251_;
2688                 GeeTimSortSlice* _tmp252_;
2689                 void** _tmp253_;
2690                 GeeTimSortSlice* _tmp254_;
2691                 gint _tmp255_;
2692                 gint _tmp256_;
2693                 GeeTimSortSlice* _tmp257_;
2694                 gint _tmp258_;
2695                 GeeTimSortSlice* _tmp259_;
2696                 void** _tmp260_;
2697                 GeeTimSortSlice* _tmp261_;
2698                 gint _tmp262_;
2699                 gint _tmp263_;
2700                 GeeTimSortSlice* _tmp264_;
2701                 gint _tmp265_;
2702                 GeeTimSortSlice* _tmp266_;
2703                 gint _tmp267_;
2704                 _tmp248_ = a;
2705                 _tmp249_ = _tmp248_->length;
2706                 _vala_assert (_tmp249_ >= 0, "a.length >= 0");
2707                 _tmp250_ = b;
2708                 _tmp251_ = _tmp250_->length;
2709                 _vala_assert (_tmp251_ >= 0, "b.length >= 0");
2710                 _tmp252_ = b;
2711                 _tmp253_ = self->priv->list;
2712                 _tmp254_ = b;
2713                 _tmp255_ = _tmp254_->index;
2714                 _tmp256_ = dest;
2715                 _tmp257_ = b;
2716                 _tmp258_ = _tmp257_->length;
2717                 gee_tim_sort_slice_merge_in (_tmp252_, _tmp253_, _tmp255_, _tmp256_, _tmp258_);
2718                 _tmp259_ = a;
2719                 _tmp260_ = self->priv->list;
2720                 _tmp261_ = a;
2721                 _tmp262_ = _tmp261_->index;
2722                 _tmp263_ = dest;
2723                 _tmp264_ = b;
2724                 _tmp265_ = _tmp264_->length;
2725                 _tmp266_ = a;
2726                 _tmp267_ = _tmp266_->length;
2727                 gee_tim_sort_slice_merge_in (_tmp259_, _tmp260_, _tmp262_, _tmp263_ + _tmp265_, _tmp267_);
2728         }
2729         _gee_tim_sort_slice_free0 (a);
2730         _gee_tim_sort_slice_free0 (b);
2731         g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
2732         g_clear_error (&_inner_error_);
2733         return;
2734 }
2735
2736
2737 static void gee_tim_sort_merge_high (GeeTimSort* self, GeeTimSortSlice* a, GeeTimSortSlice* b) {
2738         GeeTimSortSlice* _tmp0_;
2739         gint _tmp1_;
2740         GeeTimSortSlice* _tmp2_;
2741         gint _tmp3_;
2742         GeeTimSortSlice* _tmp4_;
2743         gint _tmp5_;
2744         GeeTimSortSlice* _tmp6_;
2745         gint _tmp7_;
2746         GeeTimSortSlice* _tmp8_;
2747         gint _tmp9_;
2748         gint _tmp10_;
2749         gint minimum_gallop;
2750         GeeTimSortSlice* _tmp11_;
2751         gint _tmp12_;
2752         GeeTimSortSlice* _tmp13_;
2753         gint _tmp14_;
2754         gint dest;
2755         GeeTimSortSlice* _tmp15_;
2756         GError * _inner_error_ = NULL;
2757         g_return_if_fail (self != NULL);
2758         g_return_if_fail (a != NULL);
2759         g_return_if_fail (b != NULL);
2760         _tmp0_ = a;
2761         _tmp1_ = _tmp0_->length;
2762         _vala_assert (_tmp1_ > 0, "a.length > 0");
2763         _tmp2_ = b;
2764         _tmp3_ = _tmp2_->length;
2765         _vala_assert (_tmp3_ > 0, "b.length > 0");
2766         _tmp4_ = a;
2767         _tmp5_ = _tmp4_->index;
2768         _tmp6_ = a;
2769         _tmp7_ = _tmp6_->length;
2770         _tmp8_ = b;
2771         _tmp9_ = _tmp8_->index;
2772         _vala_assert ((_tmp5_ + _tmp7_) == _tmp9_, "a.index + a.length == b.index");
2773         _tmp10_ = self->priv->minimum_gallop;
2774         minimum_gallop = _tmp10_;
2775         _tmp11_ = b;
2776         _tmp12_ = _tmp11_->index;
2777         _tmp13_ = b;
2778         _tmp14_ = _tmp13_->length;
2779         dest = _tmp12_ + _tmp14_;
2780         _tmp15_ = b;
2781         gee_tim_sort_slice_copy (_tmp15_);
2782         {
2783                 void** _tmp16_;
2784                 gint _tmp17_;
2785                 gint _tmp18_;
2786                 GeeTimSortSlice* _tmp19_;
2787                 void* _tmp20_ = NULL;
2788                 void* _tmp21_;
2789                 gboolean _tmp22_ = FALSE;
2790                 GeeTimSortSlice* _tmp23_;
2791                 gint _tmp24_;
2792                 gboolean _tmp27_;
2793                 _tmp16_ = self->priv->list;
2794                 _tmp17_ = dest;
2795                 dest = _tmp17_ - 1;
2796                 _tmp18_ = dest;
2797                 _tmp19_ = a;
2798                 _tmp20_ = gee_tim_sort_slice_pop_last (_tmp19_);
2799                 _tmp16_[_tmp18_] = _tmp20_;
2800                 _tmp21_ = _tmp16_[_tmp18_];
2801                 _tmp23_ = a;
2802                 _tmp24_ = _tmp23_->length;
2803                 if (_tmp24_ == 0) {
2804                         _tmp22_ = TRUE;
2805                 } else {
2806                         GeeTimSortSlice* _tmp25_;
2807                         gint _tmp26_;
2808                         _tmp25_ = b;
2809                         _tmp26_ = _tmp25_->length;
2810                         _tmp22_ = _tmp26_ == 1;
2811                 }
2812                 _tmp27_ = _tmp22_;
2813                 if (_tmp27_) {
2814                         {
2815                                 GeeTimSortSlice* _tmp28_;
2816                                 gint _tmp29_;
2817                                 GeeTimSortSlice* _tmp30_;
2818                                 gint _tmp31_;
2819                                 GeeTimSortSlice* _tmp32_;
2820                                 void** _tmp33_;
2821                                 GeeTimSortSlice* _tmp34_;
2822                                 gint _tmp35_;
2823                                 gint _tmp36_;
2824                                 GeeTimSortSlice* _tmp37_;
2825                                 gint _tmp38_;
2826                                 GeeTimSortSlice* _tmp39_;
2827                                 gint _tmp40_;
2828                                 GeeTimSortSlice* _tmp41_;
2829                                 void** _tmp42_;
2830                                 GeeTimSortSlice* _tmp43_;
2831                                 gint _tmp44_;
2832                                 gint _tmp45_;
2833                                 GeeTimSortSlice* _tmp46_;
2834                                 gint _tmp47_;
2835                                 GeeTimSortSlice* _tmp48_;
2836                                 gint _tmp49_;
2837                                 GeeTimSortSlice* _tmp50_;
2838                                 gint _tmp51_;
2839                                 _tmp28_ = a;
2840                                 _tmp29_ = _tmp28_->length;
2841                                 _vala_assert (_tmp29_ >= 0, "a.length >= 0");
2842                                 _tmp30_ = b;
2843                                 _tmp31_ = _tmp30_->length;
2844                                 _vala_assert (_tmp31_ >= 0, "b.length >= 0");
2845                                 _tmp32_ = a;
2846                                 _tmp33_ = self->priv->list;
2847                                 _tmp34_ = a;
2848                                 _tmp35_ = _tmp34_->index;
2849                                 _tmp36_ = dest;
2850                                 _tmp37_ = a;
2851                                 _tmp38_ = _tmp37_->length;
2852                                 _tmp39_ = a;
2853                                 _tmp40_ = _tmp39_->length;
2854                                 gee_tim_sort_slice_merge_in_reversed (_tmp32_, _tmp33_, _tmp35_, _tmp36_ - _tmp38_, _tmp40_);
2855                                 _tmp41_ = b;
2856                                 _tmp42_ = self->priv->list;
2857                                 _tmp43_ = b;
2858                                 _tmp44_ = _tmp43_->index;
2859                                 _tmp45_ = dest;
2860                                 _tmp46_ = a;
2861                                 _tmp47_ = _tmp46_->length;
2862                                 _tmp48_ = b;
2863                                 _tmp49_ = _tmp48_->length;
2864                                 _tmp50_ = b;
2865                                 _tmp51_ = _tmp50_->length;
2866                                 gee_tim_sort_slice_merge_in_reversed (_tmp41_, _tmp42_, _tmp44_, (_tmp45_ - _tmp47_) - _tmp49_, _tmp51_);
2867                         }
2868                         _gee_tim_sort_slice_free0 (a);
2869                         _gee_tim_sort_slice_free0 (b);
2870                         return;
2871                 }
2872                 while (TRUE) {
2873                         gint a_count;
2874                         gint b_count;
2875                         gint _tmp127_;
2876                         gint _tmp295_;
2877                         gint _tmp296_;
2878                         a_count = 0;
2879                         b_count = 0;
2880                         while (TRUE) {
2881                                 GeeTimSortSlice* _tmp52_;
2882                                 void* _tmp53_ = NULL;
2883                                 GeeTimSortSlice* _tmp54_;
2884                                 void* _tmp55_ = NULL;
2885                                 gboolean _tmp56_ = FALSE;
2886                                 _tmp52_ = b;
2887                                 _tmp53_ = gee_tim_sort_slice_peek_last (_tmp52_);
2888                                 _tmp54_ = a;
2889                                 _tmp55_ = gee_tim_sort_slice_peek_last (_tmp54_);
2890                                 _tmp56_ = gee_tim_sort_lower_than (self, _tmp53_, _tmp55_);
2891                                 if (_tmp56_) {
2892                                         void** _tmp57_;
2893                                         gint _tmp58_;
2894                                         gint _tmp59_;
2895                                         GeeTimSortSlice* _tmp60_;
2896                                         void* _tmp61_ = NULL;
2897                                         void* _tmp62_;
2898                                         GeeTimSortSlice* _tmp63_;
2899                                         gint _tmp64_;
2900                                         gint _tmp89_;
2901                                         gint _tmp90_;
2902                                         gint _tmp91_;
2903                                         _tmp57_ = self->priv->list;
2904                                         _tmp58_ = dest;
2905                                         dest = _tmp58_ - 1;
2906                                         _tmp59_ = dest;
2907                                         _tmp60_ = a;
2908                                         _tmp61_ = gee_tim_sort_slice_pop_last (_tmp60_);
2909                                         _tmp57_[_tmp59_] = _tmp61_;
2910                                         _tmp62_ = _tmp57_[_tmp59_];
2911                                         _tmp63_ = a;
2912                                         _tmp64_ = _tmp63_->length;
2913                                         if (_tmp64_ == 0) {
2914                                                 {
2915                                                         GeeTimSortSlice* _tmp65_;
2916                                                         gint _tmp66_;
2917                                                         GeeTimSortSlice* _tmp67_;
2918                                                         gint _tmp68_;
2919                                                         GeeTimSortSlice* _tmp69_;
2920                                                         void** _tmp70_;
2921                                                         GeeTimSortSlice* _tmp71_;
2922                                                         gint _tmp72_;
2923                                                         gint _tmp73_;
2924                                                         GeeTimSortSlice* _tmp74_;
2925                                                         gint _tmp75_;
2926                                                         GeeTimSortSlice* _tmp76_;
2927                                                         gint _tmp77_;
2928                                                         GeeTimSortSlice* _tmp78_;
2929                                                         void** _tmp79_;
2930                                                         GeeTimSortSlice* _tmp80_;
2931                                                         gint _tmp81_;
2932                                                         gint _tmp82_;
2933                                                         GeeTimSortSlice* _tmp83_;
2934                                                         gint _tmp84_;
2935                                                         GeeTimSortSlice* _tmp85_;
2936                                                         gint _tmp86_;
2937                                                         GeeTimSortSlice* _tmp87_;
2938                                                         gint _tmp88_;
2939                                                         _tmp65_ = a;
2940                                                         _tmp66_ = _tmp65_->length;
2941                                                         _vala_assert (_tmp66_ >= 0, "a.length >= 0");
2942                                                         _tmp67_ = b;
2943                                                         _tmp68_ = _tmp67_->length;
2944                                                         _vala_assert (_tmp68_ >= 0, "b.length >= 0");
2945                                                         _tmp69_ = a;
2946                                                         _tmp70_ = self->priv->list;
2947                                                         _tmp71_ = a;
2948                                                         _tmp72_ = _tmp71_->index;
2949                                                         _tmp73_ = dest;
2950                                                         _tmp74_ = a;
2951                                                         _tmp75_ = _tmp74_->length;
2952                                                         _tmp76_ = a;
2953                                                         _tmp77_ = _tmp76_->length;
2954                                                         gee_tim_sort_slice_merge_in_reversed (_tmp69_, _tmp70_, _tmp72_, _tmp73_ - _tmp75_, _tmp77_);
2955                                                         _tmp78_ = b;
2956                                                         _tmp79_ = self->priv->list;
2957                                                         _tmp80_ = b;
2958                                                         _tmp81_ = _tmp80_->index;
2959                                                         _tmp82_ = dest;
2960                                                         _tmp83_ = a;
2961                                                         _tmp84_ = _tmp83_->length;
2962                                                         _tmp85_ = b;
2963                                                         _tmp86_ = _tmp85_->length;
2964                                                         _tmp87_ = b;
2965                                                         _tmp88_ = _tmp87_->length;
2966                                                         gee_tim_sort_slice_merge_in_reversed (_tmp78_, _tmp79_, _tmp81_, (_tmp82_ - _tmp84_) - _tmp86_, _tmp88_);
2967                                                 }
2968                                                 _gee_tim_sort_slice_free0 (a);
2969                                                 _gee_tim_sort_slice_free0 (b);
2970                                                 return;
2971                                         }
2972                                         _tmp89_ = a_count;
2973                                         a_count = _tmp89_ + 1;
2974                                         b_count = 0;
2975                                         _tmp90_ = a_count;
2976                                         _tmp91_ = minimum_gallop;
2977                                         if (_tmp90_ >= _tmp91_) {
2978                                                 break;
2979                                         }
2980                                 } else {
2981                                         void** _tmp92_;
2982                                         gint _tmp93_;
2983                                         gint _tmp94_;
2984                                         GeeTimSortSlice* _tmp95_;
2985                                         void* _tmp96_ = NULL;
2986                                         void* _tmp97_;
2987                                         GeeTimSortSlice* _tmp98_;
2988                                         gint _tmp99_;
2989                                         gint _tmp124_;
2990                                         gint _tmp125_;
2991                                         gint _tmp126_;
2992                                         _tmp92_ = self->priv->list;
2993                                         _tmp93_ = dest;
2994                                         dest = _tmp93_ - 1;
2995                                         _tmp94_ = dest;
2996                                         _tmp95_ = b;
2997                                         _tmp96_ = gee_tim_sort_slice_pop_last (_tmp95_);
2998                                         _tmp92_[_tmp94_] = _tmp96_;
2999                                         _tmp97_ = _tmp92_[_tmp94_];
3000                                         _tmp98_ = b;
3001                                         _tmp99_ = _tmp98_->length;
3002                                         if (_tmp99_ == 1) {
3003                                                 {
3004                                                         GeeTimSortSlice* _tmp100_;
3005                                                         gint _tmp101_;
3006                                                         GeeTimSortSlice* _tmp102_;
3007                                                         gint _tmp103_;
3008                                                         GeeTimSortSlice* _tmp104_;
3009                                                         void** _tmp105_;
3010                                                         GeeTimSortSlice* _tmp106_;
3011                                                         gint _tmp107_;
3012                                                         gint _tmp108_;
3013                                                         GeeTimSortSlice* _tmp109_;
3014                                                         gint _tmp110_;
3015                                                         GeeTimSortSlice* _tmp111_;
3016                                                         gint _tmp112_;
3017                                                         GeeTimSortSlice* _tmp113_;
3018                                                         void** _tmp114_;
3019                                                         GeeTimSortSlice* _tmp115_;
3020                                                         gint _tmp116_;
3021                                                         gint _tmp117_;
3022                                                         GeeTimSortSlice* _tmp118_;
3023                                                         gint _tmp119_;
3024                                                         GeeTimSortSlice* _tmp120_;
3025                                                         gint _tmp121_;
3026                                                         GeeTimSortSlice* _tmp122_;
3027                                                         gint _tmp123_;
3028                                                         _tmp100_ = a;
3029                                                         _tmp101_ = _tmp100_->length;
3030                                                         _vala_assert (_tmp101_ >= 0, "a.length >= 0");
3031                                                         _tmp102_ = b;
3032                                                         _tmp103_ = _tmp102_->length;
3033                                                         _vala_assert (_tmp103_ >= 0, "b.length >= 0");
3034                                                         _tmp104_ = a;
3035                                                         _tmp105_ = self->priv->list;
3036                                                         _tmp106_ = a;
3037                                                         _tmp107_ = _tmp106_->index;
3038                                                         _tmp108_ = dest;
3039                                                         _tmp109_ = a;
3040                                                         _tmp110_ = _tmp109_->length;
3041                                                         _tmp111_ = a;
3042                                                         _tmp112_ = _tmp111_->length;
3043                                                         gee_tim_sort_slice_merge_in_reversed (_tmp104_, _tmp105_, _tmp107_, _tmp108_ - _tmp110_, _tmp112_);
3044                                                         _tmp113_ = b;
3045                                                         _tmp114_ = self->priv->list;
3046                                                         _tmp115_ = b;
3047                                                         _tmp116_ = _tmp115_->index;
3048                                                         _tmp117_ = dest;
3049                                                         _tmp118_ = a;
3050                                                         _tmp119_ = _tmp118_->length;
3051                                                         _tmp120_ = b;
3052                                                         _tmp121_ = _tmp120_->length;
3053                                                         _tmp122_ = b;
3054                                                         _tmp123_ = _tmp122_->length;
3055                                                         gee_tim_sort_slice_merge_in_reversed (_tmp113_, _tmp114_, _tmp116_, (_tmp117_ - _tmp119_) - _tmp121_, _tmp123_);
3056                                                 }
3057                                                 _gee_tim_sort_slice_free0 (a);
3058                                                 _gee_tim_sort_slice_free0 (b);
3059                                                 return;
3060                                         }
3061                                         _tmp124_ = b_count;
3062                                         b_count = _tmp124_ + 1;
3063                                         a_count = 0;
3064                                         _tmp125_ = b_count;
3065                                         _tmp126_ = minimum_gallop;
3066                                         if (_tmp125_ >= _tmp126_) {
3067                                                 break;
3068                                         }
3069                                 }
3070                         }
3071                         _tmp127_ = minimum_gallop;
3072                         minimum_gallop = _tmp127_ + 1;
3073                         while (TRUE) {
3074                                 gint _tmp128_ = 0;
3075                                 gint _tmp129_;
3076                                 gint _tmp130_;
3077                                 gint _tmp131_;
3078                                 gint _tmp132_;
3079                                 GeeTimSortSlice* _tmp133_;
3080                                 void* _tmp134_ = NULL;
3081                                 GeeTimSortSlice* _tmp135_;
3082                                 GeeTimSortSlice* _tmp136_;
3083                                 gint _tmp137_;
3084                                 gint _tmp138_ = 0;
3085                                 gint k;
3086                                 GeeTimSortSlice* _tmp139_;
3087                                 gint _tmp140_;
3088                                 gint _tmp141_;
3089                                 GeeTimSortSlice* _tmp142_;
3090                                 void** _tmp143_;
3091                                 GeeTimSortSlice* _tmp144_;
3092                                 gint _tmp145_;
3093                                 gint _tmp146_;
3094                                 gint _tmp147_;
3095                                 gint _tmp148_;
3096                                 gint _tmp149_;
3097                                 gint _tmp150_;
3098                                 gint _tmp151_;
3099                                 GeeTimSortSlice* _tmp152_;
3100                                 gint _tmp153_;
3101                                 GeeTimSortSlice* _tmp154_;
3102                                 gint _tmp155_;
3103                                 void** _tmp180_;
3104                                 gint _tmp181_;
3105                                 gint _tmp182_;
3106                                 GeeTimSortSlice* _tmp183_;
3107                                 void* _tmp184_ = NULL;
3108                                 void* _tmp185_;
3109                                 GeeTimSortSlice* _tmp186_;
3110                                 gint _tmp187_;
3111                                 GeeTimSortSlice* _tmp212_;
3112                                 void* _tmp213_ = NULL;
3113                                 GeeTimSortSlice* _tmp214_;
3114                                 GeeTimSortSlice* _tmp215_;
3115                                 gint _tmp216_;
3116                                 gint _tmp217_ = 0;
3117                                 GeeTimSortSlice* _tmp218_;
3118                                 gint _tmp219_;
3119                                 gint _tmp220_;
3120                                 GeeTimSortSlice* _tmp221_;
3121                                 void** _tmp222_;
3122                                 GeeTimSortSlice* _tmp223_;
3123                                 gint _tmp224_;
3124                                 gint _tmp225_;
3125                                 gint _tmp226_;
3126                                 gint _tmp227_;
3127                                 gint _tmp228_;
3128                                 gint _tmp229_;
3129                                 gint _tmp230_;
3130                                 GeeTimSortSlice* _tmp231_;
3131                                 gint _tmp232_;
3132                                 GeeTimSortSlice* _tmp233_;
3133                                 gint _tmp234_;
3134                                 void** _tmp259_;
3135                                 gint _tmp260_;
3136                                 gint _tmp261_;
3137                                 GeeTimSortSlice* _tmp262_;
3138                                 void* _tmp263_ = NULL;
3139                                 void* _tmp264_;
3140                                 GeeTimSortSlice* _tmp265_;
3141                                 gint _tmp266_;
3142                                 gboolean _tmp291_ = FALSE;
3143                                 gint _tmp292_;
3144                                 gboolean _tmp294_;
3145                                 _tmp129_ = minimum_gallop;
3146                                 if (_tmp129_ > 1) {
3147                                         _tmp128_ = 1;
3148                                 } else {
3149                                         _tmp128_ = 0;
3150                                 }
3151                                 _tmp130_ = minimum_gallop;
3152                                 _tmp131_ = _tmp128_;
3153                                 minimum_gallop = _tmp130_ - _tmp131_;
3154                                 _tmp132_ = minimum_gallop;
3155                                 self->priv->minimum_gallop = _tmp132_;
3156                                 _tmp133_ = b;
3157                                 _tmp134_ = gee_tim_sort_slice_peek_last (_tmp133_);
3158                                 _tmp135_ = a;
3159                                 _tmp136_ = a;
3160                                 _tmp137_ = _tmp136_->length;
3161                                 _tmp138_ = gee_tim_sort_gallop_rightmost (self, _tmp134_, _tmp135_, _tmp137_ - 1);
3162                                 k = _tmp138_;
3163                                 _tmp139_ = a;
3164                                 _tmp140_ = _tmp139_->length;
3165                                 _tmp141_ = k;
3166                                 a_count = _tmp140_ - _tmp141_;
3167                                 _tmp142_ = a;
3168                                 _tmp143_ = self->priv->list;
3169                                 _tmp144_ = a;
3170                                 _tmp145_ = _tmp144_->index;
3171                                 _tmp146_ = k;
3172                                 _tmp147_ = dest;
3173                                 _tmp148_ = a_count;
3174                                 _tmp149_ = a_count;
3175                                 gee_tim_sort_slice_merge_in_reversed (_tmp142_, _tmp143_, _tmp145_ + _tmp146_, _tmp147_ - _tmp148_, _tmp149_);
3176                                 _tmp150_ = dest;
3177                                 _tmp151_ = a_count;
3178                                 dest = _tmp150_ - _tmp151_;
3179                                 _tmp152_ = a;
3180                                 _tmp153_ = a_count;
3181                                 gee_tim_sort_slice_shorten_end (_tmp152_, _tmp153_);
3182                                 _tmp154_ = a;
3183                                 _tmp155_ = _tmp154_->length;
3184                                 if (_tmp155_ == 0) {
3185                                         {
3186                                                 GeeTimSortSlice* _tmp156_;
3187                                                 gint _tmp157_;
3188                                                 GeeTimSortSlice* _tmp158_;
3189                                                 gint _tmp159_;
3190                                                 GeeTimSortSlice* _tmp160_;
3191                                                 void** _tmp161_;
3192                                                 GeeTimSortSlice* _tmp162_;
3193                                                 gint _tmp163_;
3194                                                 gint _tmp164_;
3195                                                 GeeTimSortSlice* _tmp165_;
3196                                                 gint _tmp166_;
3197                                                 GeeTimSortSlice* _tmp167_;
3198                                                 gint _tmp168_;
3199                                                 GeeTimSortSlice* _tmp169_;
3200                                                 void** _tmp170_;
3201                                                 GeeTimSortSlice* _tmp171_;
3202                                                 gint _tmp172_;
3203                                                 gint _tmp173_;
3204                                                 GeeTimSortSlice* _tmp174_;
3205                                                 gint _tmp175_;
3206                                                 GeeTimSortSlice* _tmp176_;
3207                                                 gint _tmp177_;
3208                                                 GeeTimSortSlice* _tmp178_;
3209                                                 gint _tmp179_;
3210                                                 _tmp156_ = a;
3211                                                 _tmp157_ = _tmp156_->length;
3212                                                 _vala_assert (_tmp157_ >= 0, "a.length >= 0");
3213                                                 _tmp158_ = b;
3214                                                 _tmp159_ = _tmp158_->length;
3215                                                 _vala_assert (_tmp159_ >= 0, "b.length >= 0");
3216                                                 _tmp160_ = a;
3217                                                 _tmp161_ = self->priv->list;
3218                                                 _tmp162_ = a;
3219                                                 _tmp163_ = _tmp162_->index;
3220                                                 _tmp164_ = dest;
3221                                                 _tmp165_ = a;
3222                                                 _tmp166_ = _tmp165_->length;
3223                                                 _tmp167_ = a;
3224                                                 _tmp168_ = _tmp167_->length;
3225                                                 gee_tim_sort_slice_merge_in_reversed (_tmp160_, _tmp161_, _tmp163_, _tmp164_ - _tmp166_, _tmp168_);
3226                                                 _tmp169_ = b;
3227                                                 _tmp170_ = self->priv->list;
3228                                                 _tmp171_ = b;
3229                                                 _tmp172_ = _tmp171_->index;
3230                                                 _tmp173_ = dest;
3231                                                 _tmp174_ = a;
3232                                                 _tmp175_ = _tmp174_->length;
3233                                                 _tmp176_ = b;
3234                                                 _tmp177_ = _tmp176_->length;
3235                                                 _tmp178_ = b;
3236                                                 _tmp179_ = _tmp178_->length;
3237                                                 gee_tim_sort_slice_merge_in_reversed (_tmp169_, _tmp170_, _tmp172_, (_tmp173_ - _tmp175_) - _tmp177_, _tmp179_);
3238                                         }
3239                                         _gee_tim_sort_slice_free0 (a);
3240                                         _gee_tim_sort_slice_free0 (b);
3241                                         return;
3242                                 }
3243                                 _tmp180_ = self->priv->list;
3244                                 _tmp181_ = dest;
3245                                 dest = _tmp181_ - 1;
3246                                 _tmp182_ = dest;
3247                                 _tmp183_ = b;
3248                                 _tmp184_ = gee_tim_sort_slice_pop_last (_tmp183_);
3249                                 _tmp180_[_tmp182_] = _tmp184_;
3250                                 _tmp185_ = _tmp180_[_tmp182_];
3251                                 _tmp186_ = b;
3252                                 _tmp187_ = _tmp186_->length;
3253                                 if (_tmp187_ == 1) {
3254                                         {
3255                                                 GeeTimSortSlice* _tmp188_;
3256                                                 gint _tmp189_;
3257                                                 GeeTimSortSlice* _tmp190_;
3258                                                 gint _tmp191_;
3259                                                 GeeTimSortSlice* _tmp192_;
3260                                                 void** _tmp193_;
3261                                                 GeeTimSortSlice* _tmp194_;
3262                                                 gint _tmp195_;
3263                                                 gint _tmp196_;
3264                                                 GeeTimSortSlice* _tmp197_;
3265                                                 gint _tmp198_;
3266                                                 GeeTimSortSlice* _tmp199_;
3267                                                 gint _tmp200_;
3268                                                 GeeTimSortSlice* _tmp201_;
3269                                                 void** _tmp202_;
3270                                                 GeeTimSortSlice* _tmp203_;
3271                                                 gint _tmp204_;
3272                                                 gint _tmp205_;
3273                                                 GeeTimSortSlice* _tmp206_;
3274                                                 gint _tmp207_;
3275                                                 GeeTimSortSlice* _tmp208_;
3276                                                 gint _tmp209_;
3277                                                 GeeTimSortSlice* _tmp210_;
3278                                                 gint _tmp211_;
3279                                                 _tmp188_ = a;
3280                                                 _tmp189_ = _tmp188_->length;
3281                                                 _vala_assert (_tmp189_ >= 0, "a.length >= 0");
3282                                                 _tmp190_ = b;
3283                                                 _tmp191_ = _tmp190_->length;
3284                                                 _vala_assert (_tmp191_ >= 0, "b.length >= 0");
3285                                                 _tmp192_ = a;
3286                                                 _tmp193_ = self->priv->list;
3287                                                 _tmp194_ = a;
3288                                                 _tmp195_ = _tmp194_->index;
3289                                                 _tmp196_ = dest;
3290                                                 _tmp197_ = a;
3291                                                 _tmp198_ = _tmp197_->length;
3292                                                 _tmp199_ = a;
3293                                                 _tmp200_ = _tmp199_->length;
3294                                                 gee_tim_sort_slice_merge_in_reversed (_tmp192_, _tmp193_, _tmp195_, _tmp196_ - _tmp198_, _tmp200_);
3295                                                 _tmp201_ = b;
3296                                                 _tmp202_ = self->priv->list;
3297                                                 _tmp203_ = b;
3298                                                 _tmp204_ = _tmp203_->index;
3299                                                 _tmp205_ = dest;
3300                                                 _tmp206_ = a;
3301                                                 _tmp207_ = _tmp206_->length;
3302                                                 _tmp208_ = b;
3303                                                 _tmp209_ = _tmp208_->length;
3304                                                 _tmp210_ = b;
3305                                                 _tmp211_ = _tmp210_->length;
3306                                                 gee_tim_sort_slice_merge_in_reversed (_tmp201_, _tmp202_, _tmp204_, (_tmp205_ - _tmp207_) - _tmp209_, _tmp211_);
3307                                         }
3308                                         _gee_tim_sort_slice_free0 (a);
3309                                         _gee_tim_sort_slice_free0 (b);
3310                                         return;
3311                                 }
3312                                 _tmp212_ = a;
3313                                 _tmp213_ = gee_tim_sort_slice_peek_last (_tmp212_);
3314                                 _tmp214_ = b;
3315                                 _tmp215_ = b;
3316                                 _tmp216_ = _tmp215_->length;
3317                                 _tmp217_ = gee_tim_sort_gallop_leftmost (self, _tmp213_, _tmp214_, _tmp216_ - 1);
3318                                 k = _tmp217_;
3319                                 _tmp218_ = b;
3320                                 _tmp219_ = _tmp218_->length;
3321                                 _tmp220_ = k;
3322                                 b_count = _tmp219_ - _tmp220_;
3323                                 _tmp221_ = b;
3324                                 _tmp222_ = self->priv->list;
3325                                 _tmp223_ = b;
3326                                 _tmp224_ = _tmp223_->index;
3327                                 _tmp225_ = k;
3328                                 _tmp226_ = dest;
3329                                 _tmp227_ = b_count;
3330                                 _tmp228_ = b_count;
3331                                 gee_tim_sort_slice_merge_in_reversed (_tmp221_, _tmp222_, _tmp224_ + _tmp225_, _tmp226_ - _tmp227_, _tmp228_);
3332                                 _tmp229_ = dest;
3333                                 _tmp230_ = b_count;
3334                                 dest = _tmp229_ - _tmp230_;
3335                                 _tmp231_ = b;
3336                                 _tmp232_ = b_count;
3337                                 gee_tim_sort_slice_shorten_end (_tmp231_, _tmp232_);
3338                                 _tmp233_ = b;
3339                                 _tmp234_ = _tmp233_->length;
3340                                 if (_tmp234_ <= 1) {
3341                                         {
3342                                                 GeeTimSortSlice* _tmp235_;
3343                                                 gint _tmp236_;
3344                                                 GeeTimSortSlice* _tmp237_;
3345                                                 gint _tmp238_;
3346                                                 GeeTimSortSlice* _tmp239_;
3347                                                 void** _tmp240_;
3348                                                 GeeTimSortSlice* _tmp241_;
3349                                                 gint _tmp242_;
3350                                                 gint _tmp243_;
3351                                                 GeeTimSortSlice* _tmp244_;
3352                                                 gint _tmp245_;
3353                                                 GeeTimSortSlice* _tmp246_;
3354                                                 gint _tmp247_;
3355                                                 GeeTimSortSlice* _tmp248_;
3356                                                 void** _tmp249_;
3357                                                 GeeTimSortSlice* _tmp250_;
3358                                                 gint _tmp251_;
3359                                                 gint _tmp252_;
3360                                                 GeeTimSortSlice* _tmp253_;
3361                                                 gint _tmp254_;
3362                                                 GeeTimSortSlice* _tmp255_;
3363                                                 gint _tmp256_;
3364                                                 GeeTimSortSlice* _tmp257_;
3365                                                 gint _tmp258_;
3366                                                 _tmp235_ = a;
3367                                                 _tmp236_ = _tmp235_->length;
3368                                                 _vala_assert (_tmp236_ >= 0, "a.length >= 0");
3369                                                 _tmp237_ = b;
3370                                                 _tmp238_ = _tmp237_->length;
3371                                                 _vala_assert (_tmp238_ >= 0, "b.length >= 0");
3372                                                 _tmp239_ = a;
3373                                                 _tmp240_ = self->priv->list;
3374                                                 _tmp241_ = a;
3375                                                 _tmp242_ = _tmp241_->index;
3376                                                 _tmp243_ = dest;
3377                                                 _tmp244_ = a;
3378                                                 _tmp245_ = _tmp244_->length;
3379                                                 _tmp246_ = a;
3380                                                 _tmp247_ = _tmp246_->length;
3381                                                 gee_tim_sort_slice_merge_in_reversed (_tmp239_, _tmp240_, _tmp242_, _tmp243_ - _tmp245_, _tmp247_);
3382                                                 _tmp248_ = b;
3383                                                 _tmp249_ = self->priv->list;
3384                                                 _tmp250_ = b;
3385                                                 _tmp251_ = _tmp250_->index;
3386                                                 _tmp252_ = dest;
3387                                                 _tmp253_ = a;
3388                                                 _tmp254_ = _tmp253_->length;
3389                                                 _tmp255_ = b;
3390                                                 _tmp256_ = _tmp255_->length;
3391                                                 _tmp257_ = b;
3392                                                 _tmp258_ = _tmp257_->length;
3393                                                 gee_tim_sort_slice_merge_in_reversed (_tmp248_, _tmp249_, _tmp251_, (_tmp252_ - _tmp254_) - _tmp256_, _tmp258_);
3394                                         }
3395                                         _gee_tim_sort_slice_free0 (a);
3396                                         _gee_tim_sort_slice_free0 (b);
3397                                         return;
3398                                 }
3399                                 _tmp259_ = self->priv->list;
3400                                 _tmp260_ = dest;
3401                                 dest = _tmp260_ - 1;
3402                                 _tmp261_ = dest;
3403                                 _tmp262_ = a;
3404                                 _tmp263_ = gee_tim_sort_slice_pop_last (_tmp262_);
3405                                 _tmp259_[_tmp261_] = _tmp263_;
3406                                 _tmp264_ = _tmp259_[_tmp261_];
3407                                 _tmp265_ = a;
3408                                 _tmp266_ = _tmp265_->length;
3409                                 if (_tmp266_ == 0) {
3410                                         {
3411                                                 GeeTimSortSlice* _tmp267_;
3412                                                 gint _tmp268_;
3413                                                 GeeTimSortSlice* _tmp269_;
3414                                                 gint _tmp270_;
3415                                                 GeeTimSortSlice* _tmp271_;
3416                                                 void** _tmp272_;
3417                                                 GeeTimSortSlice* _tmp273_;
3418                                                 gint _tmp274_;
3419                                                 gint _tmp275_;
3420                                                 GeeTimSortSlice* _tmp276_;
3421                                                 gint _tmp277_;
3422                                                 GeeTimSortSlice* _tmp278_;
3423                                                 gint _tmp279_;
3424                                                 GeeTimSortSlice* _tmp280_;
3425                                                 void** _tmp281_;
3426                                                 GeeTimSortSlice* _tmp282_;
3427                                                 gint _tmp283_;
3428                                                 gint _tmp284_;
3429                                                 GeeTimSortSlice* _tmp285_;
3430                                                 gint _tmp286_;
3431                                                 GeeTimSortSlice* _tmp287_;
3432                                                 gint _tmp288_;
3433                                                 GeeTimSortSlice* _tmp289_;
3434                                                 gint _tmp290_;
3435                                                 _tmp267_ = a;
3436                                                 _tmp268_ = _tmp267_->length;
3437                                                 _vala_assert (_tmp268_ >= 0, "a.length >= 0");
3438                                                 _tmp269_ = b;
3439                                                 _tmp270_ = _tmp269_->length;
3440                                                 _vala_assert (_tmp270_ >= 0, "b.length >= 0");
3441                                                 _tmp271_ = a;
3442                                                 _tmp272_ = self->priv->list;
3443                                                 _tmp273_ = a;
3444                                                 _tmp274_ = _tmp273_->index;
3445                                                 _tmp275_ = dest;
3446                                                 _tmp276_ = a;
3447                                                 _tmp277_ = _tmp276_->length;
3448                                                 _tmp278_ = a;
3449                                                 _tmp279_ = _tmp278_->length;
3450                                                 gee_tim_sort_slice_merge_in_reversed (_tmp271_, _tmp272_, _tmp274_, _tmp275_ - _tmp277_, _tmp279_);
3451                                                 _tmp280_ = b;
3452                                                 _tmp281_ = self->priv->list;
3453                                                 _tmp282_ = b;
3454                                                 _tmp283_ = _tmp282_->index;
3455                                                 _tmp284_ = dest;
3456                                                 _tmp285_ = a;
3457                                                 _tmp286_ = _tmp285_->length;
3458                                                 _tmp287_ = b;
3459                                                 _tmp288_ = _tmp287_->length;
3460                                                 _tmp289_ = b;
3461                                                 _tmp290_ = _tmp289_->length;
3462                                                 gee_tim_sort_slice_merge_in_reversed (_tmp280_, _tmp281_, _tmp283_, (_tmp284_ - _tmp286_) - _tmp288_, _tmp290_);
3463                                         }
3464                                         _gee_tim_sort_slice_free0 (a);
3465                                         _gee_tim_sort_slice_free0 (b);
3466                                         return;
3467                                 }
3468                                 _tmp292_ = a_count;
3469                                 if (_tmp292_ < GEE_TIM_SORT_MINIMUM_GALLOP) {
3470                                         gint _tmp293_;
3471                                         _tmp293_ = b_count;
3472                                         _tmp291_ = _tmp293_ < GEE_TIM_SORT_MINIMUM_GALLOP;
3473                                 } else {
3474                                         _tmp291_ = FALSE;
3475                                 }
3476                                 _tmp294_ = _tmp291_;
3477                                 if (_tmp294_) {
3478                                         break;
3479                                 }
3480                         }
3481                         _tmp295_ = minimum_gallop;
3482                         minimum_gallop = _tmp295_ + 1;
3483                         _tmp296_ = minimum_gallop;
3484                         self->priv->minimum_gallop = _tmp296_;
3485                 }
3486         }
3487         __finally1:
3488         {
3489                 GeeTimSortSlice* _tmp297_;
3490                 gint _tmp298_;
3491                 GeeTimSortSlice* _tmp299_;
3492                 gint _tmp300_;
3493                 GeeTimSortSlice* _tmp301_;
3494                 void** _tmp302_;
3495                 GeeTimSortSlice* _tmp303_;
3496                 gint _tmp304_;
3497                 gint _tmp305_;
3498                 GeeTimSortSlice* _tmp306_;
3499                 gint _tmp307_;
3500                 GeeTimSortSlice* _tmp308_;
3501                 gint _tmp309_;
3502                 GeeTimSortSlice* _tmp310_;
3503                 void** _tmp311_;
3504                 GeeTimSortSlice* _tmp312_;
3505                 gint _tmp313_;
3506                 gint _tmp314_;
3507                 GeeTimSortSlice* _tmp315_;
3508                 gint _tmp316_;
3509                 GeeTimSortSlice* _tmp317_;
3510                 gint _tmp318_;
3511                 GeeTimSortSlice* _tmp319_;
3512                 gint _tmp320_;
3513                 _tmp297_ = a;
3514                 _tmp298_ = _tmp297_->length;
3515                 _vala_assert (_tmp298_ >= 0, "a.length >= 0");
3516                 _tmp299_ = b;
3517                 _tmp300_ = _tmp299_->length;
3518                 _vala_assert (_tmp300_ >= 0, "b.length >= 0");
3519                 _tmp301_ = a;
3520                 _tmp302_ = self->priv->list;
3521                 _tmp303_ = a;
3522                 _tmp304_ = _tmp303_->index;
3523                 _tmp305_ = dest;
3524                 _tmp306_ = a;
3525                 _tmp307_ = _tmp306_->length;
3526                 _tmp308_ = a;
3527                 _tmp309_ = _tmp308_->length;
3528                 gee_tim_sort_slice_merge_in_reversed (_tmp301_, _tmp302_, _tmp304_, _tmp305_ - _tmp307_, _tmp309_);
3529                 _tmp310_ = b;
3530                 _tmp311_ = self->priv->list;
3531                 _tmp312_ = b;
3532                 _tmp313_ = _tmp312_->index;
3533                 _tmp314_ = dest;
3534                 _tmp315_ = a;
3535                 _tmp316_ = _tmp315_->length;
3536                 _tmp317_ = b;
3537                 _tmp318_ = _tmp317_->length;
3538                 _tmp319_ = b;
3539                 _tmp320_ = _tmp319_->length;
3540                 gee_tim_sort_slice_merge_in_reversed (_tmp310_, _tmp311_, _tmp313_, (_tmp314_ - _tmp316_) - _tmp318_, _tmp320_);
3541         }
3542         _gee_tim_sort_slice_free0 (a);
3543         _gee_tim_sort_slice_free0 (b);
3544         g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
3545         g_clear_error (&_inner_error_);
3546         return;
3547 }
3548
3549
3550 GeeTimSort* gee_tim_sort_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) {
3551         GeeTimSort * self = NULL;
3552         self = (GeeTimSort*) g_object_new (object_type, NULL);
3553         self->priv->g_type = g_type;
3554         self->priv->g_dup_func = g_dup_func;
3555         self->priv->g_destroy_func = g_destroy_func;
3556         return self;
3557 }
3558
3559
3560 GeeTimSort* gee_tim_sort_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) {
3561         return gee_tim_sort_construct (GEE_TYPE_TIM_SORT, g_type, g_dup_func, g_destroy_func);
3562 }
3563
3564
3565 static GeeTimSortSlice* gee_tim_sort_slice_new (void** list, gint index, gint length) {
3566         GeeTimSortSlice* self;
3567         void** _tmp0_;
3568         gint _tmp1_;
3569         gint _tmp2_;
3570         self = g_slice_new0 (GeeTimSortSlice);
3571         gee_tim_sort_slice_instance_init (self);
3572         _tmp0_ = list;
3573         self->list = _tmp0_;
3574         _tmp1_ = index;
3575         self->index = _tmp1_;
3576         _tmp2_ = length;
3577         self->length = _tmp2_;
3578         return self;
3579 }
3580
3581
3582 static void gee_tim_sort_slice_copy (GeeTimSortSlice* self) {
3583         void** _tmp0_;
3584         gint _tmp1_;
3585         gint _tmp2_;
3586         void* _tmp3_ = NULL;
3587         void** _tmp4_;
3588         g_return_if_fail (self != NULL);
3589         _tmp0_ = self->list;
3590         _tmp1_ = self->index;
3591         _tmp2_ = self->length;
3592         _tmp3_ = g_memdup (&_tmp0_[_tmp1_], ((guint) sizeof (gpointer)) * _tmp2_);
3593         self->new_list = _tmp3_;
3594         _tmp4_ = self->new_list;
3595         self->list = _tmp4_;
3596         self->index = 0;
3597 }
3598
3599
3600 static inline void gee_tim_sort_slice_merge_in (GeeTimSortSlice* self, void** dest_array, gint index, gint dest_index, gint count) {
3601         void** _tmp0_;
3602         gint _tmp1_;
3603         void** _tmp2_;
3604         gint _tmp3_;
3605         gint _tmp4_;
3606         g_return_if_fail (self != NULL);
3607         _tmp0_ = dest_array;
3608         _tmp1_ = dest_index;
3609         _tmp2_ = self->list;
3610         _tmp3_ = index;
3611         _tmp4_ = count;
3612         g_memmove (&_tmp0_[_tmp1_], &_tmp2_[_tmp3_], (gsize) (sizeof (gpointer) * _tmp4_));
3613 }
3614
3615
3616 static inline void gee_tim_sort_slice_merge_in_reversed (GeeTimSortSlice* self, void** dest_array, gint index, gint dest_index, gint count) {
3617         void** _tmp0_;
3618         gint _tmp1_;
3619         void** _tmp2_;
3620         gint _tmp3_;
3621         gint _tmp4_;
3622         g_return_if_fail (self != NULL);
3623         _tmp0_ = dest_array;
3624         _tmp1_ = dest_index;
3625         _tmp2_ = self->list;
3626         _tmp3_ = index;
3627         _tmp4_ = count;
3628         g_memmove (&_tmp0_[_tmp1_], &_tmp2_[_tmp3_], (gsize) (sizeof (gpointer) * _tmp4_));
3629 }
3630
3631
3632 static inline void gee_tim_sort_slice_shorten_start (GeeTimSortSlice* self, gint n) {
3633         gint _tmp0_;
3634         gint _tmp1_;
3635         gint _tmp2_;
3636         gint _tmp3_;
3637         g_return_if_fail (self != NULL);
3638         _tmp0_ = self->index;
3639         _tmp1_ = n;
3640         self->index = _tmp0_ + _tmp1_;
3641         _tmp2_ = self->length;
3642         _tmp3_ = n;
3643         self->length = _tmp2_ - _tmp3_;
3644 }
3645
3646
3647 static inline void gee_tim_sort_slice_shorten_end (GeeTimSortSlice* self, gint n) {
3648         gint _tmp0_;
3649         gint _tmp1_;
3650         g_return_if_fail (self != NULL);
3651         _tmp0_ = self->length;
3652         _tmp1_ = n;
3653         self->length = _tmp0_ - _tmp1_;
3654 }
3655
3656
3657 static inline void* gee_tim_sort_slice_pop_first (GeeTimSortSlice* self) {
3658         void* result = NULL;
3659         gint _tmp0_;
3660         void** _tmp1_;
3661         gint _tmp2_;
3662         void* _tmp3_;
3663         g_return_val_if_fail (self != NULL, NULL);
3664         _tmp0_ = self->length;
3665         self->length = _tmp0_ - 1;
3666         _tmp1_ = self->list;
3667         _tmp2_ = self->index;
3668         self->index = _tmp2_ + 1;
3669         _tmp3_ = _tmp1_[_tmp2_];
3670         result = _tmp3_;
3671         return result;
3672 }
3673
3674
3675 static inline void* gee_tim_sort_slice_pop_last (GeeTimSortSlice* self) {
3676         void* result = NULL;
3677         gint _tmp0_;
3678         void** _tmp1_;
3679         gint _tmp2_;
3680         gint _tmp3_;
3681         void* _tmp4_;
3682         g_return_val_if_fail (self != NULL, NULL);
3683         _tmp0_ = self->length;
3684         self->length = _tmp0_ - 1;
3685         _tmp1_ = self->list;
3686         _tmp2_ = self->index;
3687         _tmp3_ = self->length;
3688         _tmp4_ = _tmp1_[_tmp2_ + _tmp3_];
3689         result = _tmp4_;
3690         return result;
3691 }
3692
3693
3694 static inline void* gee_tim_sort_slice_peek_first (GeeTimSortSlice* self) {
3695         void* result = NULL;
3696         void** _tmp0_;
3697         gint _tmp1_;
3698         void* _tmp2_;
3699         g_return_val_if_fail (self != NULL, NULL);
3700         _tmp0_ = self->list;
3701         _tmp1_ = self->index;
3702         _tmp2_ = _tmp0_[_tmp1_];
3703         result = _tmp2_;
3704         return result;
3705 }
3706
3707
3708 static inline void* gee_tim_sort_slice_peek_last (GeeTimSortSlice* self) {
3709         void* result = NULL;
3710         void** _tmp0_;
3711         gint _tmp1_;
3712         gint _tmp2_;
3713         void* _tmp3_;
3714         g_return_val_if_fail (self != NULL, NULL);
3715         _tmp0_ = self->list;
3716         _tmp1_ = self->index;
3717         _tmp2_ = self->length;
3718         _tmp3_ = _tmp0_[(_tmp1_ + _tmp2_) - 1];
3719         result = _tmp3_;
3720         return result;
3721 }
3722
3723
3724 static void gee_tim_sort_slice_reverse (GeeTimSortSlice* self) {
3725         gint _tmp0_;
3726         gint low;
3727         gint _tmp1_;
3728         gint _tmp2_;
3729         gint high;
3730         g_return_if_fail (self != NULL);
3731         _tmp0_ = self->index;
3732         low = _tmp0_;
3733         _tmp1_ = self->index;
3734         _tmp2_ = self->length;
3735         high = (_tmp1_ + _tmp2_) - 1;
3736         while (TRUE) {
3737                 gint _tmp3_;
3738                 gint _tmp4_;
3739                 gint _tmp5_;
3740                 gint _tmp6_;
3741                 _tmp3_ = low;
3742                 _tmp4_ = high;
3743                 if (!(_tmp3_ < _tmp4_)) {
3744                         break;
3745                 }
3746                 _tmp5_ = low;
3747                 low = _tmp5_ + 1;
3748                 _tmp6_ = high;
3749                 high = _tmp6_ - 1;
3750                 gee_tim_sort_slice_swap (self, _tmp5_, _tmp6_);
3751         }
3752 }
3753
3754
3755 static inline void gee_tim_sort_slice_swap (GeeTimSortSlice* self, gint i, gint j) {
3756         void** _tmp0_;
3757         gint _tmp1_;
3758         void* _tmp2_;
3759         void* temp;
3760         void** _tmp3_;
3761         gint _tmp4_;
3762         void** _tmp5_;
3763         gint _tmp6_;
3764         void* _tmp7_;
3765         void* _tmp8_;
3766         void** _tmp9_;
3767         gint _tmp10_;
3768         void* _tmp11_;
3769         g_return_if_fail (self != NULL);
3770         _tmp0_ = self->list;
3771         _tmp1_ = i;
3772         _tmp2_ = _tmp0_[_tmp1_];
3773         temp = _tmp2_;
3774         _tmp3_ = self->list;
3775         _tmp4_ = i;
3776         _tmp5_ = self->list;
3777         _tmp6_ = j;
3778         _tmp7_ = _tmp5_[_tmp6_];
3779         _tmp3_[_tmp4_] = _tmp7_;
3780         _tmp8_ = _tmp3_[_tmp4_];
3781         _tmp9_ = self->list;
3782         _tmp10_ = j;
3783         _tmp9_[_tmp10_] = temp;
3784         _tmp11_ = _tmp9_[_tmp10_];
3785 }
3786
3787
3788 static void gee_tim_sort_slice_instance_init (GeeTimSortSlice * self) {
3789 }
3790
3791
3792 static void gee_tim_sort_slice_free (GeeTimSortSlice* self) {
3793         void** _tmp0_;
3794         _tmp0_ = self->new_list;
3795         if (_tmp0_ != NULL) {
3796                 void** _tmp1_;
3797                 _tmp1_ = self->new_list;
3798                 g_free (_tmp1_);
3799         }
3800         g_slice_free (GeeTimSortSlice, self);
3801 }
3802
3803
3804 static void gee_tim_sort_class_init (GeeTimSortClass * klass) {
3805         gee_tim_sort_parent_class = g_type_class_peek_parent (klass);
3806         g_type_class_add_private (klass, sizeof (GeeTimSortPrivate));
3807         G_OBJECT_CLASS (klass)->get_property = _vala_gee_tim_sort_get_property;
3808         G_OBJECT_CLASS (klass)->set_property = _vala_gee_tim_sort_set_property;
3809         G_OBJECT_CLASS (klass)->finalize = gee_tim_sort_finalize;
3810         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_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));
3811         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_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));
3812         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_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));
3813 }
3814
3815
3816 static void gee_tim_sort_instance_init (GeeTimSort * self) {
3817         self->priv = GEE_TIM_SORT_GET_PRIVATE (self);
3818 }
3819
3820
3821 static void gee_tim_sort_finalize (GObject* obj) {
3822         GeeTimSort * self;
3823         self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_TIM_SORT, GeeTimSort);
3824         _g_object_unref0 (self->priv->list_collection);
3825         self->priv->array = (_vala_array_free (self->priv->array, self->priv->array_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL);
3826         self->priv->pending = (_vala_array_free (self->priv->pending, self->priv->pending_length1, (GDestroyNotify) gee_tim_sort_slice_free), NULL);
3827         (self->priv->compare_target_destroy_notify == NULL) ? NULL : (self->priv->compare_target_destroy_notify (self->priv->compare_target), NULL);
3828         self->priv->compare = NULL;
3829         self->priv->compare_target = NULL;
3830         self->priv->compare_target_destroy_notify = NULL;
3831         G_OBJECT_CLASS (gee_tim_sort_parent_class)->finalize (obj);
3832 }
3833
3834
3835 /**
3836  * A stable, adaptive, iterative mergesort that requires far fewer than n*lg(n)
3837  * comparisons when running on partially sorted arrays, while offering
3838  * performance comparable to a traditional mergesort when run on random arrays.
3839  * Like all proper mergesorts, this sort is stable and runs O(n*log(n)) time
3840  * (worst case). In the worst case, this sort requires temporary storage space
3841  * for n/2 object references; in the best case, it requires only a small
3842  * constant amount of space.
3843  *
3844  * This implementation was adapted from Tim Peters's list sort for Python,
3845  * which is described in detail here:
3846  *   [[http://svn.python.org/projects/python/trunk/Objects/listsort.txt]]
3847  *
3848  * Tim's C code may be found here:
3849  *   [[http://svn.python.org/projects/python/trunk/Objects/listobject.c]]
3850  *
3851  * The underlying techniques are described in this paper (and may have even
3852  * earlier origins):
3853  *
3854  *   "Optimistic Sorting and Information Theoretic Complexity"
3855  *   Peter McIlroy
3856  *   SODA (Fourth Annual ACM-SIAM Symposium on Discrete Algorithms), pp
3857  *   467-474, Austin, Texas, 25-27 January 1993.
3858  */
3859 GType gee_tim_sort_get_type (void) {
3860         static volatile gsize gee_tim_sort_type_id__volatile = 0;
3861         if (g_once_init_enter (&gee_tim_sort_type_id__volatile)) {
3862                 static const GTypeInfo g_define_type_info = { sizeof (GeeTimSortClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tim_sort_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTimSort), 0, (GInstanceInitFunc) gee_tim_sort_instance_init, NULL };
3863                 GType gee_tim_sort_type_id;
3864                 gee_tim_sort_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeTimSort", &g_define_type_info, 0);
3865                 g_once_init_leave (&gee_tim_sort_type_id__volatile, gee_tim_sort_type_id);
3866         }
3867         return gee_tim_sort_type_id__volatile;
3868 }
3869
3870
3871 static void _vala_gee_tim_sort_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
3872         GeeTimSort * self;
3873         self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_TIM_SORT, GeeTimSort);
3874         switch (property_id) {
3875                 default:
3876                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
3877                 break;
3878         }
3879 }
3880
3881
3882 static void _vala_gee_tim_sort_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
3883         GeeTimSort * self;
3884         self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_TIM_SORT, GeeTimSort);
3885         switch (property_id) {
3886                 case GEE_TIM_SORT_G_TYPE:
3887                 self->priv->g_type = g_value_get_gtype (value);
3888                 break;
3889                 case GEE_TIM_SORT_G_DUP_FUNC:
3890                 self->priv->g_dup_func = g_value_get_pointer (value);
3891                 break;
3892                 case GEE_TIM_SORT_G_DESTROY_FUNC:
3893                 self->priv->g_destroy_func = g_value_get_pointer (value);
3894                 break;
3895                 default:
3896                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
3897                 break;
3898         }
3899 }
3900
3901
3902 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
3903         if ((array != NULL) && (destroy_func != NULL)) {
3904                 int i;
3905                 for (i = 0; i < array_length; i = i + 1) {
3906                         if (((gpointer*) array)[i] != NULL) {
3907                                 destroy_func (((gpointer*) array)[i]);
3908                         }
3909                 }
3910         }
3911 }
3912
3913
3914 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
3915         _vala_array_destroy (array, array_length, destroy_func);
3916         g_free (array);
3917 }
3918
3919
3920 static void _vala_array_move (gpointer array, gsize element_size, gint src, gint dest, gint length) {
3921         g_memmove (((char*) array) + (dest * element_size), ((char*) array) + (src * element_size), length * element_size);
3922         if ((src < dest) && ((src + length) > dest)) {
3923                 memset (((char*) array) + (src * element_size), 0, (dest - src) * element_size);
3924         } else if ((src > dest) && (src < (dest + length))) {
3925                 memset (((char*) array) + ((dest + length) * element_size), 0, (src - dest) * element_size);
3926         } else if (src != dest) {
3927                 memset (((char*) array) + (src * element_size), 0, length * element_size);
3928         }
3929 }
3930
3931
3932